Class: GameMachine::GameSystems::ChatTopic

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

Constant Summary

Constants inherited from Actor::Base

Actor::Base::ON_RECEIVE_HOOKS

Instance Attribute Summary collapse

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, logger, model_filter, #onReceive, player_controller, #receive_message, #schedule_message, #schedule_message_once, #sender, set_player_controller

Instance Attribute Details

#chat_idObject (readonly)

Returns the value of attribute chat_id


6
7
8
# File 'server/lib/game_machine/game_systems/chat_topic.rb', line 6

def chat_id
  @chat_id
end

#registered_asObject (readonly)

Returns the value of attribute registered_as


6
7
8
# File 'server/lib/game_machine/game_systems/chat_topic.rb', line 6

def registered_as
  @registered_as
end

Instance Method Details

#on_receive(message) ⇒ Object


12
13
14
15
16
17
18
19
# File 'server/lib/game_machine/game_systems/chat_topic.rb', line 12

def on_receive(message)
  if message.is_a?(MessageLib::Entity) && message.chat_message
    receive_chat_message(message.chat_message)
  elsif message.is_a?(JavaLib::DistributedPubSubMediator::SubscribeAck)
  else
    unhandled(message)
  end
end

#post_init(*args) ⇒ Object


7
8
9
10
# File 'server/lib/game_machine/game_systems/chat_topic.rb', line 7

def post_init(*args)
  @chat_id = args.first
  @registered_as = args.last
end