Class: GameMachine::DefaultHandlers::ZoneManager

Inherits:
Actor::Base
  • Object
show all
Defined in:
server/lib/game_machine/default_handlers/zone_manager.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


15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'server/lib/game_machine/default_handlers/zone_manager.rb', line 15

def on_receive(message)

  # Region manager pings us every couple of seconds as long as we are alive,
  # it's up to us to determine if we have started the region or not
  if message.is_a?(GameMachine::Models::Region)
    return if @region_up
    @region_up = true

    zone = message.name
    GameMachine.logger.info "#{self.class.name} Starting region #{zone}"
    start_zone(zone)
  end
end

#post_init(*args) ⇒ Object


8
9
10
# File 'server/lib/game_machine/default_handlers/zone_manager.rb', line 8

def post_init(*args)
  @region_up = false
end

#start_zone(zone) ⇒ Object


12
13
# File 'server/lib/game_machine/default_handlers/zone_manager.rb', line 12

def start_zone(zone)
end