/
a2s_rules_packet.rb
33 lines (27 loc) · 993 Bytes
/
a2s_rules_packet.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# This code is free software; you can redistribute it and/or modify it under
# the terms of the new BSD License.
#
# Copyright (c) 2008-2020, Sebastian Staudt
require 'steam-condenser/servers/packets/query_packet'
module SteamCondenser::Servers::Packets
# This packet class represents a A2S_RULES request send to a game server
#
# The game server will return a list of currently active game rules, e.g.
# `mp_friendlyfire = 1`.
#
# This packet type requires the client to challenge the server in advance,
# which is done automatically if required.
#
# @author Sebastian Staudt
# @see GameServer#update_rules_info
class A2S_RULES_Packet
include QueryPacket
# Creates a new A2S_RULES request object including the challenge number
#
# @param [Numeric] challenge_number The challenge number received from the
# server
def initialize(challenge_number = -1)
super A2S_RULES_HEADER, [challenge_number.to_i].pack('l')
end
end
end