Class: GameMachine::GameSystems::PrivateChat

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

Constant Summary

Constants inherited from Actor::Base

Actor::Base::ON_RECEIVE_HOOKS

Instance Method Summary collapse

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 Method Details

#on_receive(message) ⇒ Object


10
11
12
13
14
15
16
17
# File 'server/lib/game_machine/game_systems/private_chat.rb', line 10

def on_receive(message)
  if message.is_a?(ChatMessage)
    send_message(message)
  elsif message.is_a?(JavaLib::DistributedPubSubMediator::SubscribeAck)
  else
    unhandled(message)
  end
end

#preStartObject


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

def preStart
  message = Subscribe.new.set_topic('private')
  MessageQueuel.find.tell(message,Actor::Ref.new(get_self))
end