Sha256: 933a6ff0b1d983643556006f1c1fc6226b6a0d1a49ead402daa52ced241a5c8f

Contents?: true

Size: 646 Bytes

Versions: 2

Compression:

Stored size: 646 Bytes

Contents

module GameMachine
  module GameSystems
    class RemoteEcho < Actor::Base
      include GameMachine::Commands
      aspect %w(EchoTest)

      def post_init(*args)
        chars = [*('a'..'z'),*('0'..'9')].flatten
        str = Array.new(400) {|i| chars.sample}.join
        @test_message = MessageLib::Entity.new.set_id(str)
        #schedule_message('test',10)
      end

      def on_receive(message)
        if message.is_a?(String) && message == 'test'
          return
        end
        #GameMachine.logger.info "#{self.class.name} #{message}"
        commands.player.send_message(message,message.player.id)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
game_machine-1.0.4 lib/game_machine/game_systems/remote_echo.rb
game_machine-1.0.2 lib/game_machine/game_systems/remote_echo.rb