engines.server module

Provides access to the base Server interfaces.

class engines.server.ConnectionlessPacketHandler

Bases: instance

__init__()

Raises an exception This class cannot be instantiated from Python

class engines.server.MapLoadType

Bases: enum

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

Bases: enum

INVALID = _engines._server.QueryCvarStatus.INVALID
NOT_FOUND = _engines._server.QueryCvarStatus.NOT_FOUND
PROTECTED = _engines._server.QueryCvarStatus.PROTECTED
SUCCESS = _engines._server.QueryCvarStatus.SUCCESS
names = {'INVALID': _engines._server.QueryCvarStatus.INVALID, 'NOT_FOUND': _engines._server.QueryCvarStatus.NOT_FOUND, 'PROTECTED': _engines._server.QueryCvarStatus.PROTECTED, 'SUCCESS': _engines._server.QueryCvarStatus.SUCCESS}
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: ConnectionlessPacketHandler

__init__()

Raises an exception This class cannot be instantiated from Python

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

broadcast_message( (Server)arg1, (_net_channel.NetMessage)arg2, (_filters._recipients.BaseRecipientFilter)arg3) -> None

disconnect_client((Server)arg1, (_players.Client)arg2, (str)arg3) None
get_client((Server)arg1, (_engines._sound.Channel)arg2) _players.Client :

Return the interface to a client.

Return type:

Client

get_player_info((Server)arg1, (_engines._sound.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

property class_bits
Return type:

int

property client_count

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

Return type:

int

property map_name

Return the current map name.

Return type:

str

property max_clients

Return the current client limit.

Return type:

int

property name

Return the public server name.

Return type:

str

property net_stats

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

Return type:

tuple

property num_classes
Return type:

int

property num_clients

Return the current number of clients.

Return type:

int

property num_fake_clients

Return the number of fake clients.

Return type:

int

property num_players
Return type:

int

property num_proxies

Return the number of attached HLTV proxies.

Return type:

int

property password

Return the server password.

Return type:

str

property paused
Return type:

bool

property spawn_count

Return the spawn count.

Return type:

int

property tick

Return the game world tick.

Return type:

int

property tick_interval

Return the tick interval in seconds.

Return type:

float

property time

Return the game world time.

Return type:

float

property 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.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.

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.