Class: GameMachine::Commands::MiscCommands

Inherits:
Object
  • Object
show all
Defined in:
server/lib/game_machine/commands/misc_commands.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMiscCommands

Returns a new instance of MiscCommands


6
7
8
# File 'server/lib/game_machine/commands/misc_commands.rb', line 6

def initialize
  @player_manager = Application.config.player_manager
end

Instance Attribute Details

#player_managerObject (readonly)

Returns the value of attribute player_manager


5
6
7
# File 'server/lib/game_machine/commands/misc_commands.rb', line 5

def player_manager
  @player_manager
end

Instance Method Details

#client_manager_register(name, events = []) ⇒ Object


11
12
13
14
15
16
17
# File 'server/lib/game_machine/commands/misc_commands.rb', line 11

def client_manager_register(name,events=[])
  register = MessageLib::ClientManagerRegister.new.
    set_register_type('actor').set_name(name).set_events(events.join('|'))
  entity = MessageLib::Entity.new.set_id(name).
    set_client_manager_register(register)
  ClientManager.find.tell(entity)
end