예제 #1
0
    def _unpack(self):
        self.victim_id = Packet.unpack_uint8(self.buffer)
        self.killer_id = Packet.unpack_uint8(self.buffer)
        self.reason = Packet.unpack_uint16(self.buffer)
        self.shot_id = Packet.unpack_uint16(self.buffer)
        self.flag = Packet.unpack_flag(self.buffer)

        if self.reason == code_from_chars('pd'):
            self.physics_driver_id = Packet.unpack_uint32(self.buffer)
예제 #2
0
    def _unpack(self):
        count: int = Packet.unpack_uint8(self.buffer)

        for i in range(0, count):
            Packet.unpack_uint8(self.buffer)

            p_info: PlayerInfo = PlayerInfo()
            p_info.player_index = Packet.unpack_uint8(self.buffer)
            p_info.ip_address = Packet.unpack_ip_address(self.buffer)

            self.players.append(p_info)
예제 #3
0
    def _unpack(self):
        count: int = Packet.unpack_uint8(self.buffer)

        for i in range(0, count):
            data: ScoreData = ScoreData()
            data.player_id = Packet.unpack_uint8(self.buffer)
            data.wins = Packet.unpack_uint16(self.buffer)
            data.losses = Packet.unpack_uint16(self.buffer)
            data.team_kills = Packet.unpack_uint16(self.buffer)

            self.scores.append(data)
예제 #4
0
    def _unpack(self):
        count: int = Packet.unpack_uint16(self.buffer)

        for i in range(0, count):
            setting: BZDBSetting = BZDBSetting()

            name_len: int = Packet.unpack_uint8(self.buffer)
            setting.name = Packet.unpack_string(self.buffer, name_len)

            value_len: int = Packet.unpack_uint8(self.buffer)
            setting.value = Packet.unpack_string(self.buffer, value_len)

            self.settings.append(setting)
예제 #5
0
    def _unpack(self):
        count: int = Packet.unpack_uint8(self.buffer)

        for i in range(0, count):
            player = PlayerData()
            player.player_id = Packet.unpack_uint8(self.buffer)

            properties: int = Packet.unpack_uint8(self.buffer)

            player.is_registered = properties & IsRegistered == IsRegistered
            player.is_verified = properties & IsVerified == IsVerified
            player.is_admin = properties & IsAdmin == IsAdmin

            self.players.append(player)
예제 #6
0
    def _unpack(self):
        # Discard this value; I'm not sure why this value comes out to a weird
        # float. We have the timestamp of the raw packet, so just that instead
        _ = Packet.unpack_float(self.buffer)

        self.player_id = Packet.unpack_uint8(self.buffer)
        self.state = Packet.unpack_player_state(self.buffer, self.packet.code)
예제 #7
0
    def _unpack(self):
        self.player_index = Packet.unpack_uint8(self.buffer)
        self.player_type = Packet.unpack_uint16(self.buffer)
        self.team_value = Packet.unpack_uint16(self.buffer)
        self.score.wins = Packet.unpack_uint16(self.buffer)
        self.score.losses = Packet.unpack_uint16(self.buffer)
        self.score.team_kills = Packet.unpack_uint16(self.buffer)

        self.callsign = Packet.unpack_string(self.buffer, NetworkProtocol.CALLSIGN_LEN)
        self.motto = Packet.unpack_string(self.buffer, NetworkProtocol.MOTTO_LEN)
예제 #8
0
    def _unpack(self):
        count: int = Packet.unpack_uint8(self.buffer)

        for i in range(0, count):
            data: TeamData = TeamData()

            data.team = Packet.unpack_uint16(self.buffer)
            data.size = Packet.unpack_uint16(self.buffer)
            data.wins = Packet.unpack_uint16(self.buffer)
            data.losses = Packet.unpack_uint16(self.buffer)

            self.teams.append(data)
예제 #9
0
 def _unpack(self):
     self.player_id = Packet.unpack_uint8(self.buffer)
     self.paused = Packet.unpack_uint8(self.buffer)
예제 #10
0
 def _unpack(self):
     self.player_id = Packet.unpack_uint8(self.buffer)
     self.flag = Packet.unpack_flag(self.buffer)
예제 #11
0
 def _unpack(self):
     self.player_id = Packet.unpack_uint8(self.buffer)
     self.from_ = Packet.unpack_uint16(self.buffer)
     self.to = Packet.unpack_uint16(self.buffer)
예제 #12
0
 def _unpack(self):
     self.player_id = Packet.unpack_uint8(self.buffer)
     self.position = Packet.unpack_vector(self.buffer)
     self.azimuth = Packet.unpack_float(self.buffer)
예제 #13
0
 def _unpack(self):
     self.player_from_id = Packet.unpack_uint8(self.buffer)
     self.player_to_id = Packet.unpack_uint8(self.buffer)
     self.message = Packet.unpack_string(self.buffer, -1)
예제 #14
0
 def _unpack(self):
     self.player_id = Packet.unpack_uint8(self.buffer)
     self.flag_id = Packet.unpack_uint16(self.buffer)
     self.team = Packet.unpack_uint16(self.buffer)
예제 #15
0
 def _unpack(self):
     self.target = Packet.unpack_uint8(self.buffer)
     self.shot = Packet.unpack_shot(self.buffer)
예제 #16
0
 def _unpack(self):
     self.from_ = Packet.unpack_uint8(self.buffer)
     self.to = Packet.unpack_uint8(self.buffer)
     self.flag = Packet.unpack_flag(self.buffer)