Class: Australium::PlayerDisconnect

Inherits:
Event show all
Defined in:
lib/australium/events/player_disconnect.rb

Constant Summary collapse

LOG_REGEX =
/"(?<player>.+)" disconnected/

Constants inherited from Event

Event::PROPERTY_REGEX, Event::TIMESTAMP_FORMAT, Event::TIMESTAMP_REGEX

Instance Attribute Summary collapse

Attributes inherited from Event

#raw

Instance Method Summary collapse

Methods inherited from Event

inherited, #to_s

Methods inherited from OpenStruct

#initialize_clone

Constructor Details

#initialize(data) ⇒ PlayerDisconnect

Returns a new instance of PlayerDisconnect


9
10
11
12
13
# File 'lib/australium/events/player_disconnect.rb', line 9

def initialize(data)
  super(data)
  player[:connected?, timestamp] = false
  player[:in_game?, timestamp] = false
end

Instance Attribute Details

#playerPlayer

Returns the Australium::Player who disconnected from the server.

Returns:


9
10
11
12
13
# File 'lib/australium/events/player_disconnect.rb', line 9

def initialize(data)
  super(data)
  player[:connected?, timestamp] = false
  player[:in_game?, timestamp] = false
end