awkisopen/australium

View on GitHub
lib/australium/events/player_connect.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Australium
  class PlayerConnect < Event

    LOG_REGEX = /"(?<player>.+)" connected, address "(?<address>.+)"/

    # @!attribute player
    #   @return [Player] the {Player} who connected to the server.
    # @!attribute address
    #   @return [String] the IP address of the connecting player.

    def initialize(data)
      super(data)
      player.address = address
      player[:connected?, timestamp] = true
    end

  end
end