<s> from ark . steam . steam_packet_encoding import SteamPacketEncoding <EOL> from ark . cli import * <EOL> class SteamPacket ( SteamPacketEncoding ) : <EOL> _packet_count = <NUM_LIT:0> <EOL> @ staticmethod <EOL> def pack ( body , packet_type = <NUM_LIT:2> ) : <EOL> """<STR_LIT>""" <EOL> obj = SteamPacket ( ) <EOL> SteamPacket . _packet_count += <NUM_LIT:1> <EOL> obj . packet_id = SteamPacket . _packet_count <EOL> obj . outgoing_command = body <EOL> obj . _encode ( body , packet_type ) <EOL> return obj <EOL> @ staticmethod <EOL> def unpack ( binary_string ) : <EOL> """<STR_LIT>""" <EOL> obj = SteamPacket ( ) <EOL> debug_out ( '<STR_LIT>' , binary_string , level = <NUM_LIT:5> ) <EOL> obj . _decode ( binary_string ) <EOL> if obj . decoded [ '<STR_LIT:body>' ] . lower ( ) . strip ( ) == '<STR_LIT>' : <EOL> obj . empty_response = True <EOL> if obj . decoded [ '<STR_LIT:body>' ] . lower ( ) . strip ( ) == '<STR_LIT>' : <EOL> obj . keep_alive_packet = True <EOL> return obj </s>
