Class: RconCs::Packets::PlayersPacket
- Inherits:
-
Object
- Object
- RconCs::Packets::PlayersPacket
- Defined in:
- lib/rcon_cs/packets/players_packet.rb
Overview
Players packet class, provides methods to create and parse Source Query protocol player packets.
Instance Method Summary collapse
-
#initialize ⇒ InfoPacket
constructor
Creates a new info packet.
-
#to_s ⇒ String
Returns the players packet as a string.
- #with_challenge(challenge) ⇒ Object
Constructor Details
#initialize ⇒ InfoPacket
Creates a new info packet.
11 12 13 |
# File 'lib/rcon_cs/packets/players_packet.rb', line 11 def initialize @packet = "\xFF\xFF\xFF\xFF\x55" end |
Instance Method Details
#to_s ⇒ String
Returns the players packet as a string.
18 19 20 |
# File 'lib/rcon_cs/packets/players_packet.rb', line 18 def to_s "#{@packet}\xFF\xFF\xFF\xFF" end |
#with_challenge(challenge) ⇒ Object
22 23 24 25 |
# File 'lib/rcon_cs/packets/players_packet.rb', line 22 def with_challenge(challenge) @packet = "#{@packet}#{challenge.force_encoding("UTF-8")}" self end |