Class: GameMachine::GameSystems::RemoteEcho

Inherits:
Actor::Base
  • Object
show all
Includes:
Commands
Defined in:
lib/game_machine/game_systems/remote_echo.rb

Constant Summary

Constants inherited from Actor::Base

Actor::Base::ON_RECEIVE_HOOKS

Instance Method Summary collapse

Methods included from Commands

#commands

Methods inherited from Actor::Base

aspect, aspects, find, find_by_address, find_distributed, find_distributed_local, find_remote, hashring, local_path, model_filter, #onReceive, player_controller, #receive_message, #schedule_message, #sender, set_player_controller

Instance Method Details

#on_receive(message) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/game_machine/game_systems/remote_echo.rb', line 14

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

#post_init(*args) ⇒ Object



7
8
9
10
11
12
# File 'lib/game_machine/game_systems/remote_echo.rb', line 7

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