frostbite.serverstructs – Frostbite Server Information Structures

class frostbite.serverstructs.Ban
class frostbite.serverstructs.Map
class frostbite.serverstructs.OpenStruct
dict()
class frostbite.serverstructs.PlayerCollection(names, players)

Represents a collection of players and information about them. Due to the way the frostbite protocol currently sends this info, it also provides a list of field names that are sent alongside the player list.

Parameters:
  • names – Array containing the field names
  • players – Array of arrays of players’ info blocks.
static from_dict(dict)

Transforms a python dictionary of the form {“fields”: [field_names], “players”: [[player_info_block1, player_info_block2]]} into a player collection.

Parameters:dict – Dictionary
Returns:PlayerCollection
static from_packet_array(a)

Alternative constructor to return a PlayerCollection from a list of words from a packet.

Parameters:a – Array of words from a packet returning a player info block.
Returns:PlayerCollection
get_field_names()

Return the list of field names.

Returns:Array of field names.
players()

Return the list of players’ info blocks.

Returns:Array of arrays containing players’ info blocks
to_dict()

Returns a python dictionary of the form {“fields”: [field_names], “players”: [[player_info_block1, player_info_block2]]}

Returns:dictionary
to_packet_array()

Helper method to return an array of words suitable for encoding this PlayerCollection into a packet.

Returns:list of words.
class frostbite.serverstructs.ServerState(server_name, player_count, max_players, game_mode, map_name, current_round, total_rounds, num_teams, team_scores, target_scores, online_state, is_ranked, has_punkbuster, has_password, server_uptime, round_time, join_address, punkbuster_version, join_queue_enabled, region, ping_site, country)

Structure representing the basic state of a BF3 server.

static from_dict(d)

Alternative constructor that returns a ServerState structure from a python dictionary.

static from_packet_array(a)

Alternative constructor that returns a ServerState structure from a list of words from a Frostbite packet.

to_dict()

Helper method that returns a python dictionary containing the information in this structure.

to_packet_array()

Helper method that returns an array of words suitable for encoding in a Frostbite packet.

Previous topic

frostbite.commands – Frostbite Server Command Structures

Next topic

frostbite.crypt – Frostbite Authentication Helpers

This Page