engines.server module

Provides access to the base Server interfaces.

class engines.server.ConnectionlessPacketHandler

Bases: Boost.Python.instance

__init__()

Raises an exception This class cannot be instantiated from Python

class engines.server.MapLoadType

Bases: Boost.Python.enum

Background = _globals.MapLoadType.Background
LoadGame = _globals.MapLoadType.LoadGame
NewGame = _globals.MapLoadType.NewGame
Transition = _globals.MapLoadType.Transition
names = {'NewGame': _globals.MapLoadType.NewGame, 'LoadGame': _globals.MapLoadType.LoadGame, 'Transition': _globals.MapLoadType.Transition, 'Background': _globals.MapLoadType.Background}
values = {0: _globals.MapLoadType.NewGame, 1: _globals.MapLoadType.LoadGame, 2: _globals.MapLoadType.Transition, 3: _globals.MapLoadType.Background}
class engines.server.QueryCvarStatus

Bases: Boost.Python.enum

INVALID = _engines._server.QueryCvarStatus.INVALID
NOT_FOUND = _engines._server.QueryCvarStatus.NOT_FOUND
PROTECTED = _engines._server.QueryCvarStatus.PROTECTED
SUCCESS = _engines._server.QueryCvarStatus.SUCCESS
names = {'SUCCESS': _engines._server.QueryCvarStatus.SUCCESS, 'NOT_FOUND': _engines._server.QueryCvarStatus.NOT_FOUND, 'INVALID': _engines._server.QueryCvarStatus.INVALID, 'PROTECTED': _engines._server.QueryCvarStatus.PROTECTED}
values = {0: _engines._server.QueryCvarStatus.SUCCESS, 1: _engines._server.QueryCvarStatus.NOT_FOUND, 2: _engines._server.QueryCvarStatus.INVALID, 3: _engines._server.QueryCvarStatus.PROTECTED}
class engines.server.Server

Bases: _engines._server.ConnectionlessPacketHandler

__init__()

Raises an exception This class cannot be instantiated from Python

broadcast_message((Server)arg1, (NetMessage)arg2, (bool)arg3, (bool)arg4) → None

broadcast_message( (Server)arg1, (NetMessage)arg2, (BaseRecipientFilter)arg3) -> None

disconnect_client((Server)arg1, (Client)arg2, (str)arg3) → None
get_client((Server)arg1, (Channel)arg2) → Client :

Return the interface to a client.

Return type:Client
get_player_info((Server)arg1, (Channel)arg2, (object)arg3) → bool :
Return type:bool
is_active((Server)arg1) → bool :
Return type:bool
is_dedicated((Server)arg1) → bool :
Return type:bool
is_hltv((Server)arg1) → bool :
Return type:bool
is_loading((Server)arg1) → bool :
Return type:bool
is_multiplayer((Server)arg1) → bool :
Return type:bool
is_pausable((Server)arg1) → bool :
Return type:bool
class_bits
Return type:int
client_count

Return the number of client slots (used and unused).

Return type:int
map_name

Return the current map name.

Return type:str
max_clients

Return the current client limit.

Return type:int
name

Return the public server name.

Return type:str
net_stats

Return a tuple containing the total net in/out in bytes/sec.

Return type:tuple
num_classes
Return type:int
num_clients

Return the current number of clients.

Return type:int
num_fake_clients

Return the number of fake clients.

Return type:int
num_players
Return type:int
num_proxies

Return the number of attached HLTV proxies.

Return type:int
password

Return the server password.

Return type:str
paused
Return type:bool
spawn_count

Return the spawn count.

Return type:int
tick

Return the game world tick.

Return type:int
tick_interval

Return the tick interval in seconds.

Return type:float
time

Return the game world time.

Return type:float
udp_port

Return the currently used UDP port.

Return type:int
engines.server.execute_server_command()

Execute a server command immediately.

Additional arguments can be passed.

Parameters:
  • command (str) – Command to execute.
  • *args

    Additional arguments that should be passed to the command.

Raises:
  • TypeError – Raised if keyword arguments have been passed.
  • ValueError – Raised if the server command was not found or if the command couldn’t be tokenized.
engines.server.queue_command_string((str)arg1) → None :

Adds a string to the end of the server command queue. It’s the same like typing something into the server console.

engines.server.queue_server_command()

Same as execute_server_command(), but does not execute the server command immediately. Instead it is added to the server command queue. Thus, it can be executed with a little delay.

Raises:ValueError – Raised if the server command was not found.
engines.server.insert_command_string((str)arg1) → None :

Same like queue_command_string(), but inserts the command at the beginning of the server command queue.

engines.server.insert_server_command()

Same as queue_server_command(), but inserts the command at the beginning of the server command queue.

Raises:ValueError – Raised if the server command was not found.