opengsq.protocols package
Submodules
opengsq.protocols.aoe1 module
- class opengsq.protocols.aoe1.AoE1(host: str, port: int = 47624, timeout: float = 5.0)
Bases:
DirectPlayAge of Empires 1 DirectPlay Protocol
Erweitert das DirectPlay Basis-Protokoll um spezifische Age of Empires 1 Implementierungsdetails.
- full_name = 'Age of Empires 1 DirectPlay Protocol'
- AOE1_UDP_PAYLOAD = b'4\x00\xb0\xfa\x02\x00\x08\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00play\x02\x00\x0e\x00\x82\xe9"4\x89\x1a\xd1\x11\xb0\x93\x00\xa0$\xc7Gv\x00\x00\x00\x00\x01\x00\x00\x00'
- AOE1_GAME_GUID = '82e92234-891a-d111-b093-00a024c74776'
opengsq.protocols.aoe2 module
- class opengsq.protocols.aoe2.AoE2(host: str, port: int = 47624, timeout: float = 5.0)
Bases:
DirectPlayAge of Empires 2 DirectPlay Protocol
Erweitert das DirectPlay Basis-Protokoll um spezifische Age of Empires 2 Implementierungsdetails.
- full_name = 'Age of Empires 2 DirectPlay Protocol'
- AOE2_UDP_PAYLOAD = b'4\x00\xb0\xfa\x02\x00\x08\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00play\x02\x00\x0e\x00`\xa2i\xfb1P\xd3\x11\xa2\xd4\x00`\x97\xbaeP\x00\x00\x00\x00\x11\x00\x00\x00'
- AOE2_GAME_GUID = '60a269fb-3150-d311-a2d4-006097ba6550'
- CIVILIZATIONS = {0: 'Unknown', 1: 'Britons', 2: 'Franks', 3: 'Goths', 4: 'Teutons', 5: 'Japanese', 6: 'Chinese', 7: 'Byzantines', 8: 'Persians', 9: 'Saracens', 10: 'Turks', 11: 'Vikings', 12: 'Mongols', 13: 'Celts', 14: 'Spanish', 15: 'Aztecs', 16: 'Mayans', 17: 'Huns', 18: 'Koreans'}
- GAME_MODES = {0: 'Random Map', 1: 'Regicide', 2: 'Death Match', 3: 'Scenario', 4: 'Campaign', 5: 'King of the Hill', 6: 'Wonder Race', 7: 'Defend the Wonder'}
opengsq.protocols.ase module
- class opengsq.protocols.ase.ASE(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the All-Seeing Eye Protocol. It provides methods to interact with the All-Seeing Eye API.
- full_name = 'All-Seeing Eye Protocol'
opengsq.protocols.avp2 module
opengsq.protocols.battlefield module
- class opengsq.protocols.battlefield.Battlefield(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Battlefield Protocol. It provides methods to interact with the Battlefield API.
- full_name = 'Battlefield Protocol'
- async get_info() Info
Asynchronously retrieves the information of the game server.
- Returns:
An Info object containing the information of the game server.
- async get_version() VersionInfo
Asynchronously retrieves the version information of the game server.
- Returns:
A VersionInfo object containing the version information of the game server.
- async get_players() list[dict[str, str]]
Asynchronously retrieves the list of players on the game server.
- Returns:
A list of dictionaries containing the player information.
opengsq.protocols.battlefield2 module
- class opengsq.protocols.battlefield2.Battlefield2(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Battlefield 2 Protocol. It provides methods to interact with Battlefield 2 game servers. Battlefield 2 uses the GameSpy Protocol version 3 for server queries.
- full_name = 'Battlefield 2'
- challenge_required = False
opengsq.protocols.cod1 module
- class opengsq.protocols.cod1.CoD1(host: str, port: int = 28960, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Call of Duty 1 Protocol. It provides methods to interact with CoD1 servers.
- full_name = 'Call of Duty 1 Protocol'
- async get_info(challenge: str = 'xxx') Info
Asynchronously retrieves the server information.
- Parameters:
challenge – The challenge string to send (default: “xxx”).
- Returns:
An Info object containing the server information.
- async get_status() Status
Asynchronously retrieves the server status.
- Returns:
A Status object containing the server status.
- async get_full_status(challenge: str = 'xxx') Cod1Status
Asynchronously retrieves both server info and status.
- Parameters:
challenge – The challenge string to send (default: “xxx”).
- Returns:
A Cod1Status object containing both info and status.
opengsq.protocols.cod4 module
- class opengsq.protocols.cod4.CoD4(host: str, port: int = 28960, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Call of Duty 4 Protocol. It provides methods to interact with CoD4 servers.
- full_name = 'Call of Duty 4 Protocol'
- async get_info(challenge: str = 'xxx') Info
Asynchronously retrieves the server information.
- Parameters:
challenge – The challenge string to send (default: “xxx”).
- Returns:
An Info object containing the server information.
- async get_status() Status
Asynchronously retrieves the server status.
- Returns:
A Status object containing the server status.
- async get_full_status(challenge: str = 'xxx') Cod4Status
Asynchronously retrieves both server info and status.
- Parameters:
challenge – The challenge string to send (default: “xxx”).
- Returns:
A Cod4Status object containing both info and status.
opengsq.protocols.cod5 module
- class opengsq.protocols.cod5.CoD5(host: str, port: int = 28960, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Call of Duty 5: World at War Protocol. It provides methods to interact with CoD5 servers.
- full_name = 'Call of Duty 5: World at War Protocol'
- async get_info(challenge: str = 'xxx') Info
Asynchronously retrieves the server information.
- Parameters:
challenge – The challenge string to send (default: “xxx”).
- Returns:
An Info object containing the server information.
- async get_status() Status
Asynchronously retrieves the server status.
- Returns:
A Status object containing the server status.
- async get_full_status(challenge: str = 'xxx') Cod5Status
Asynchronously retrieves both server info and status.
- Parameters:
challenge – The challenge string to send (default: “xxx”).
- Returns:
A Cod5Status object containing both info and status.
opengsq.protocols.directplay module
- class opengsq.protocols.directplay.DirectPlay(host: str, port: int = 47624, timeout: float = 5.0)
Bases:
ProtocolBaseDirectPlay Protocol Base Class
DirectPlay ist ein Netzwerkprotokoll, das von verschiedenen Spielen verwendet wird, insbesondere von älteren Microsoft-Spielen wie Age of Empires 1 und 2.
Das Protokoll funktioniert folgendermaßen: 1. Ein lokaler TCP Socket wird auf Port 2300 geöffnet 2. Eine UDP-Anfrage wird an Port 47624 des Spieleservers gesendet 3. Der Spieleserver antwortet über TCP an unseren lokalen Port 2300
DirectPlay UDP-Payload Struktur (52 Bytes): - Bytes 0-3: Header (34 00 b0 fa) - Bytes 4-7: Protokoll Info (02 00 08 fc) - Bytes 8-19: Padding/Reserved (alle 00) - Bytes 20-23: “play” - DirectPlay Identifikation - Bytes 24-27: Weitere Header-Info (02 00 0e 00) - Bytes 28-43: Spiel-spezifische GUID (16 Bytes, unterscheidet Spiele) - Bytes 44-47: Padding/Reserved (00 00 00 00) - Bytes 48-51: Version/Type ID (unterscheidet Spielversionen)
- full_name = 'DirectPlay Protocol'
- DIRECTPLAY_UDP_PORT = 47624
- DIRECTPLAY_TCP_PORT = 2300
opengsq.protocols.doom3 module
- class opengsq.protocols.doom3.Doom3(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Doom3 Protocol. It provides methods to interact with the Doom3 API.
- full_name = 'Doom3 Protocol'
- async get_status(strip_color=True) Status
Asynchronously retrieves the status of the game server.
- Parameters:
strip_color – A boolean indicating whether to strip color codes from the player names.
- Returns:
A Status object containing the server information and player list.
This function sends a request to the game server and processes the response to extract server information and player details. If the ‘strip_color’ parameter is set to True, color codes in player names are removed. The function returns a Status object which includes a dictionary of server information and a list of players.
- static strip_colors(text: str) str
Strips color codes from the given text.
- Parameters:
text – The text to strip color codes from.
- Returns:
The text with color codes stripped.
opengsq.protocols.eldewrito module
- class opengsq.protocols.eldewrito.ElDewrito(host: str, port: int = 11774, timeout: float = 5.0)
Bases:
ProtocolBaseElDewrito Protocol Implementation
- ELDEWRITO_BROADCAST_PORT = 11774
- ELDEWRITO_HTTP_PORT = 11775
- BROADCAST_QUERY = b'\x01blam\x00\x00\x00\t\x81\x00\x02\x00\x01-\xc3\x04\x93\xdc\x05\xd9\x95@'
- property full_name: str
- async get_status() Status
Get server status using ElDewrito’s two-step discovery process: 1. Send broadcast query to port 11774 2. Get HTTP response from port 11775
- async discover_servers(broadcast_address: str = '255.255.255.255') list
Discover ElDewrito servers using broadcast query. This method can be used for network discovery.
opengsq.protocols.eos module
- class opengsq.protocols.eos.EOS(host: str, port: int, deployment_id: str, access_token: str, timeout: float = 5)
Bases:
ProtocolBaseThis class represents the Epic Online Services (EOS) Protocol. It provides methods to interact with the EOS API.
- full_name = 'Epic Online Services (EOS) Protocol'
- async static get_access_token(*, client_id: str, client_secret: str, deployment_id: str, grant_type: str, external_auth_type: str, external_auth_token: str) str
Retrieves the access token from the EOS service.
- Parameters:
client_id – The client ID for the EOS service.
client_secret – The client secret for the EOS service.
deployment_id – The deployment ID for the EOS service.
grant_type – The grant type for the OAuth token.
external_auth_type – The external authentication type.
external_auth_token – The external authentication token.
- Returns:
The access token.
- async static get_external_auth_token(*, client_id: str, client_secret: str, external_auth_type: str) str
Retrieves the external authentication token from the EOS service.
- Parameters:
client_id – The client ID for the EOS service.
client_secret – The client secret for the EOS service.
external_auth_type – The external authentication type.
- Returns:
The external authentication token.
- async static get_matchmaking(deployment_id: str, access_token: str, filter: dict = {}) Matchmaking
Retrieves the matchmaking data from the EOS service.
- Parameters:
deployment_id – The deployment ID for the EOS service.
access_token – The access token for the EOS service.
filter – The filter for the matchmaking data.
- Returns:
The matchmaking data.
- async get_info() dict[str, Any]
Retrieves the matchmaking information for the current server.
This method first resolves the host to an IP address, then queries the matchmaking service with the IP address and port. If no matching sessions are found, it raises a ServerNotFoundException.
- Returns:
The first matching session if any are found.
opengsq.protocols.fivem module
- class opengsq.protocols.fivem.FiveM(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the FiveM Protocol (https://docs.fivem.net/docs/server-manual/proxy-setup/). It provides methods to interact with the FiveM API.
- full_name = 'FiveM Protocol'
- async get_info() dict[str, Any]
Asynchronously retrieves the information of the game server.
- Returns:
A dictionary containing the information of the game server.
- async get_players() list[dict[str, Any]]
Asynchronously retrieves the list of players on the game server.
- Returns:
A list of players on the game server.
- async get_dynamic() dict[str, Any]
Asynchronously retrieves the dynamic data of the game server.
- Returns:
A dictionary containing the dynamic data of the game server.
opengsq.protocols.flatout2 module
- class opengsq.protocols.flatout2.Flatout2(host: str, port: int = 23757, timeout: float = 5.0)
Bases:
ProtocolBase✅ KORRIGIERT: This class represents the Flatout 2 Protocol with complete game option decoding. Based on comprehensive analysis of 2074 systematically varied payloads.
Supports decoding of all 5 target game options: - Car Type (Byte -8, Bits 7-4) + Upgrade Setting (Byte -8, Bits 3-2) - Game Mode (Byte -7, Bits 7-1) + Nitro Multi Bit 0 (Byte -7, Bit 0) - Race Damage (Byte -6, Bits 6-4) - Derby Damage (Byte -6, Bits 3-2) - Nitro Multi (2-byte system: Byte -6 Bit 7 + Byte -7 Bit 0)
The protocol uses broadcast packets to discover and query servers.
- full_name = 'Flatout 2 Protocol'
- FLATOUT2_PORT = 23757
- REQUEST_HEADER = b'"\x00'
- RESPONSE_HEADERS = [b'_\x00', b'U\x00', b'Y\x00']
- GAME_IDENTIFIER = b'FO14'
- SESSION_ID = b'\x99r\xcc\x8f'
- COMMAND_QUERY = b'\x18\x0c'
- PACKET_END = b'.U\x19\xb4\xe1O\x81J'
- CAR_TYPE_BASE_MAPPINGS = {0: 'Jeder', 1: 'Derby', 2: 'Rennen', 3: 'Strasse', 5: 'Wie Host'}
- UPGRADE_SETTING_MAPPINGS = {0: '0%', 1: '50%', 2: '100%', 3: 'Wählbar'}
- GAME_MODE_BASE_MAPPINGS = {96: 'Rennen', 98: 'Derby', 100: 'Stunt'}
- RACE_DAMAGE_MAPPINGS = {0: 0, 1: 0.5, 2: 1, 3: 1.5, 4: 2}
- DERBY_DAMAGE_MAPPINGS = {0: 0.5, 1: 1, 2: 1.5, 3: 2}
- NITRO_MULTI_MAPPINGS = {0: 0, 1: 1, 2: 0.5, 3: 2}
- TRACK_TYPE_NAMES = {16: 'Wald', 17: 'Feld', 18: 'Rennen', 19: 'Arena', 20: 'Arena', 21: 'Stunt'}
- PRECISE_TRACK_MAPPING = {(16, 20): 'Timberlands 1', (16, 36): 'Timberlands 2', (16, 52): 'Timberlands 3', (16, 68): 'Pinegrove 1', (16, 84): 'Pinegrove 2', (16, 100): 'Pinegrove 3', (16, 164): 'City Central 1', (16, 180): 'City Central 2', (16, 196): 'City Central 3', (16, 212): 'Downtown 1', (16, 228): 'Downtown 2', (16, 244): 'Downtown 3', (17, 4): 'Water Canal 1', (17, 20): 'Water Canal 2', (17, 36): 'Water Canal 3', (17, 100): 'Desert Oil Field', (17, 116): 'Desert Scrap Yard', (17, 132): 'Desert Town', (17, 196): 'Midwest Ranch 1', (17, 212): 'Midwest Ranch 2', (17, 228): 'Midwest Ranch 3', (17, 244): 'Farmlands 1', (18, 4): 'Farmlands 2', (18, 20): 'Farmlands 3', (18, 132): 'Riverbay Circuit 1', (18, 148): 'Riverbay Circuit 2', (18, 164): 'Riverbay Circuit 3', (18, 180): 'Motor Raceway 1', (18, 196): 'Motor Raceway 2', (18, 212): 'Motor Raceway 3', (19, 70): 'Gas Station Derby', (19, 86): 'Parking Lot Derby', (19, 102): 'Skyscraper Derby', (19, 118): 'Derby Bowl 1', (19, 134): 'Derby Bowl 2', (19, 150): 'Derby Bowl 3', (19, 180): 'Figure of Eight 1', (19, 182): 'Figure of Eight 1', (19, 196): 'Triloop Special', (19, 198): 'Triloop Special', (19, 212): 'Speedbowl', (19, 214): 'Speedbowl', (19, 228): 'Sand Speedway', (19, 230): 'Sand Speedway', (19, 244): 'Figure of Eight 2', (19, 246): 'Figure of Eight 2', (20, 4): 'Crash Alley', (20, 6): 'Crash Alley', (20, 20): 'Speedway Left', (20, 22): 'Speedway Left', (20, 36): 'Speedway Right', (20, 38): 'Speedway Right', (20, 52): 'Speedway Special', (20, 54): 'Speedway Special', (20, 98): 'High Jump', (20, 114): 'Bowling', (20, 130): 'Ski Jump', (20, 146): 'Curling', (20, 162): 'Stone Skipping', (20, 178): 'Ring of Fire', (21, 2): 'Field Goal', (21, 18): 'Royal Flush', (21, 34): 'Basketball', (21, 50): 'Darts', (21, 66): 'Baseball', (21, 82): 'Soccer'}
opengsq.protocols.gamespy1 module
- class opengsq.protocols.gamespy1.GameSpy1(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseGameSpy Protocol version 1
- full_name = 'GameSpy Protocol version 1'
- async get_basic() dict[str, str]
Asynchronously retrieves the basic information of the game server.
- Returns:
A dictionary containing the basic information of the game server.
- async get_info(xserverquery: bool = True) dict[str, str]
Asynchronously retrieves the information of the current game running on the server.
- Parameters:
xserverquery – A boolean indicating whether to use XServerQuery.
- Returns:
A dictionary containing the information of the current game.
- async get_rules(xserverquery: bool = True) dict[str, str]
Asynchronously retrieves the rules of the current game running on the server.
- Parameters:
xserverquery – A boolean indicating whether to use XServerQuery.
- Returns:
A dictionary containing the rules of the current game.
- async get_players(xserverquery: bool = True) list[dict[str, str]]
Asynchronously retrieves the information of each player on the server.
- Parameters:
xserverquery – A boolean indicating whether to use XServerQuery.
- Returns:
A list containing the information of each player.
- async get_status(xserverquery: bool = True) Status
Asynchronously retrieves the status of the game server.
XServerQuery: infoxserverqueryrulesxserverqueryplayersxserverquery Old response: basicinforulesplayers
If the server uses XServerQuery, he sends you the new information, otherwise he’ll give you back the old information.
- Parameters:
xserverquery – A boolean indicating whether to use XServerQuery.
- Returns:
A Status object containing the status of the game server.
- async get_teams() list[dict[str, str]]
Asynchronously retrieves the information of each team on the server.
- Returns:
A list containing the information of each team.
opengsq.protocols.gamespy2 module
- class opengsq.protocols.gamespy2.GameSpy2(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the GameSpy Protocol version 2. It provides methods to interact with the GameSpy API.
- full_name = 'GameSpy Protocol version 2'
- async get_status(request: ~opengsq.protocols.gamespy2.GameSpy2.Request = <Request.INFO|PLAYERS|TEAMS: 7>) Status
Asynchronously retrieves the status of the game server.
- Parameters:
request – A Request object indicating the type of information to retrieve.
- Returns:
A Status object containing the status of the game server.
opengsq.protocols.gamespy3 module
- class opengsq.protocols.gamespy3.GameSpy3(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the GameSpy Protocol version 3. It provides methods to interact with the GameSpy API.
- full_name = 'GameSpy Protocol version 3'
- challenge_required = False
opengsq.protocols.gamespy4 module
opengsq.protocols.halo1 module
opengsq.protocols.kaillera module
- class opengsq.protocols.kaillera.Kaillera(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseA class used to represent the Kaillera Network Protocol.
- full_name = 'Kaillera Network Protocol'
- async get_status() bool
Checks the status of the server by sending a PING message and expecting a PONG response.
- Returns:
bool: True if the server responds with PONG, False otherwise.
opengsq.protocols.killingfloor module
opengsq.protocols.minecraft module
- class opengsq.protocols.minecraft.Minecraft(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Minecraft Protocol. It provides methods to interact with the Minecraft API. (https://wiki.vg/Server_List_Ping)
- full_name = 'Minecraft Protocol'
- async get_status(version=47, strip_color=True) dict[str, Any]
Asynchronously retrieves the status of the game server.
- Parameters:
version – The protocol version number. Defaults to 47.
strip_color – Whether to strip color from the response. Defaults to True.
- Returns:
A dictionary containing the status of the game server.
- async get_status_pre17(strip_color=True) StatusPre17
Asynchronously retrieves the status of a game server that uses a version older than Minecraft 1.7.
- Parameters:
strip_color – Whether to strip color from the response. Defaults to True.
- Returns:
A StatusPre17 object containing the status of the game server.
- static strip_colors(text: str) get_status_pre17
Strips color codes from the given text.
- Parameters:
text – The text to strip color codes from.
- Returns:
The text with color codes stripped.
opengsq.protocols.nadeo module
- class opengsq.protocols.nadeo.Nadeo(host: str, port: int = 5000, timeout: float = 5.0)
Bases:
ProtocolBase- full_name = 'Nadeo GBXRemote Protocol'
- INITIAL_HANDLER = 2147483648
- MAXIMUM_HANDLER = 4294967295
- async connect() None
- async close() None
- async authenticate(username: str, password: str) bool
opengsq.protocols.palworld module
- class opengsq.protocols.palworld.Palworld(host: str, port: int, api_username: str, api_password: str, timeout: float = 5)
Bases:
ProtocolBaseThis class represents the Palworld Protocol. It provides methods to interact with the Palworld REST API.
- full_name = 'Palworld Protocol'
- async api_request(url)
Asynchronously retrieves data from the game server through the REST API.
opengsq.protocols.quake1 module
- class opengsq.protocols.quake1.Quake1(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Quake1 Protocol. It provides methods to interact with the Quake1 API.
- full_name = 'Quake1 Protocol'
opengsq.protocols.quake2 module
opengsq.protocols.quake3 module
- class opengsq.protocols.quake3.Quake3(host: str, port: int, timeout: float = 5.0)
Bases:
Quake2This class represents the Quake3 Protocol. It provides methods to interact with the Quake3 API.
- full_name = 'Quake3 Protocol'
- async get_info(strip_color=True) dict[str, str]
Asynchronously retrieves the information of the game server.
- Parameters:
strip_color – A boolean indicating whether to strip color codes from the information.
- Returns:
A dictionary containing the information of the game server.
- async get_status(strip_color=True) Status
Asynchronously retrieves the status of the game server.
- Returns:
A Status object containing the status of the game server.
- static strip_colors(text: str) str
Strips color codes from the given text.
- Parameters:
text – The text to strip color codes from.
- Returns:
The text with color codes stripped.
opengsq.protocols.raknet module
- class opengsq.protocols.raknet.RakNet(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the RakNet Protocol. It provides methods to interact with the RakNet API. (https://wiki.vg/Raknet_Protocol)
- full_name = 'RakNet Protocol'
opengsq.protocols.renegadex module
opengsq.protocols.samp module
- class opengsq.protocols.samp.Samp(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the San Andreas Multiplayer Protocol. It provides methods to interact with the San Andreas Multiplayer API.
- full_name = 'San Andreas Multiplayer Protocol'
- async get_status() Status
Asynchronously retrieves the status of the game server.
- Returns:
A Status object containing the status of the game server.
- async get_players() list[Player]
Asynchronously retrieves the players of the game server. The server may not respond when the number of players is greater than 100.
- Returns:
A list containing the players of the game server.
- async get_rules() dict[str, str]
Asynchronously retrieves the rules of the game server.
- Returns:
A dictionary containing the rules of the game server.
opengsq.protocols.satisfactory module
- class opengsq.protocols.satisfactory.Satisfactory(host: str, port: int, app_token: str, timeout: float = 5)
Bases:
ProtocolBaseThis class represents the Satisfactory Protocol. It provides methods to interact with the Satisfactory Lightweight Query API.
- full_name = 'Satisfactory Protocol'
- async get_status() Status
Asynchronously retrieves the status of the game server. The status includes the server state, name, player count and max player count. The server state can be one of the following: 0 - Offline (The server is offline. Servers will never send this as a response) 1 - Idle (The server is running, but no save is currently loaded) 2 - Loading (The server is currently loading a map. In this state, HTTPS API is unavailable) 3 - Playing (The server is running, and a save is loaded. Server is joinable by players)
- Returns:
A Status object containing the status of the game server.
opengsq.protocols.scum module
- class opengsq.protocols.scum.Scum(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Scum Protocol. It provides methods to interact with the Scum API.
- full_name = 'Scum Protocol'
- async get_status(master_servers: list[Status] = None) Status
Asynchronously retrieves the status of the game server. If the master_servers parameter is not passed, this method calls the Scum.query_master_servers() function every time it is invoked. You may need to cache the master servers if you have a lot of servers to query.
- Parameters:
master_servers – A list of master servers. Defaults to None.
- Returns:
A Status object containing the status of the game server.
opengsq.protocols.source module
- class opengsq.protocols.source.Source(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Source Engine Protocol. It provides methods to interact with the Source Engine API.
- full_name = 'Source Engine Protocol'
- async get_info() PartialInfo
Asynchronously retrieves information about the server including, but not limited to: its name, the map currently being played, and the number of players.
- Returns:
A PartialInfo object containing the information about the server.
- async get_players() list[Player]
Asynchronously retrieves information about the players currently on the server.
- Returns:
A list of Player objects containing the information about the players.
- async get_rules() dict[str, str]
Asynchronously retrieves the rules of the game server, or configuration variables in name/value pairs.
- Returns:
A dictionary containing the rules of the game server.
opengsq.protocols.ssc module
- class opengsq.protocols.ssc.SSC(host: str, port: int = 25601, timeout: float = 5.0)
Bases:
GameSpy1Serious Sam Classic: The First Encounter Protocol
- full_name = 'Serious Sam Classic: The First Encounter'
- async get_basic() dict[str, str]
Asynchronously retrieves comprehensive information about the game server.
For Serious Sam Classic, we return the full status information as the basic query.
- Returns:
A dictionary containing comprehensive server information.
- async get_status(xserverquery: bool = False)
Asynchronously retrieves the status of the game server.
Serious Sam Classic doesn’t support XServerQuery, so we always use the legacy format.
- Parameters:
xserverquery – Ignored for Serious Sam Classic (always uses legacy format).
- Returns:
A Status object containing the status of the game server.
- async get_info(xserverquery: bool = False) dict[str, str]
Asynchronously retrieves the information of the current game running on the server.
- Parameters:
xserverquery – Ignored for Serious Sam Classic (always uses legacy format).
- Returns:
A dictionary containing the information of the current game.
- async get_rules(xserverquery: bool = False) dict[str, str]
Asynchronously retrieves the rules of the current game running on the server.
- Parameters:
xserverquery – Ignored for Serious Sam Classic (always uses legacy format).
- Returns:
A dictionary containing the rules of the current game.
- async get_players(xserverquery: bool = False) list[dict[str, str]]
Asynchronously retrieves the information of each player on the server.
- Parameters:
xserverquery – Ignored for Serious Sam Classic (always uses legacy format).
- Returns:
A list containing the information of each player.
opengsq.protocols.stronghold_ce module
- class opengsq.protocols.stronghold_ce.StrongholdCE(host: str, port: int = 47624, timeout: float = 5.0)
Bases:
DirectPlayStronghold Crusader Extreme DirectPlay Protocol
Erweitert das DirectPlay Basis-Protokoll um spezifische Stronghold Crusader Extreme Implementierungsdetails.
- full_name = 'Stronghold Crusader Extreme DirectPlay Protocol'
- STRONGHOLD_CE_UDP_PAYLOAD = b'4\x00\xb0\xfa\x02\x00\x08\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00play\x02\x00\x0e\x00\xf0M\x0cI\xc7\x9bLL\xb9Y\xd4\x1f\x1c\xceF\x0e\x00\x00\x00\x00\x91\x00\x00\x00'
- STRONGHOLD_CE_GAME_GUID = 'f04d0c49-c79b-4c4c-b959-d41f1cce460e'
opengsq.protocols.stronghold_crusader module
- class opengsq.protocols.stronghold_crusader.StrongholdCrusader(host: str, port: int = 47624, timeout: float = 5.0)
Bases:
DirectPlayStronghold Crusader DirectPlay Protocol
Erweitert das DirectPlay Basis-Protokoll um spezifische Stronghold Crusader Implementierungsdetails.
Wichtig: Stronghold Crusader verwendet TCP Port 2301 statt 2300!
- full_name = 'Stronghold Crusader DirectPlay Protocol'
- STRONGHOLD_CRUSADER_UDP_PAYLOAD = b'4\x00\xb0\xfa\x02\x00\x08\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00play\x02\x00\x0e\x00H/^\x1d\xc0\xe8\xe5I\xae\xd8\xb1$\xda\x9e0Y\x00\x00\x00\x00\x91\x00\x00\x00'
- STRONGHOLD_CRUSADER_GAME_GUID = '482f5e1d-c0e8-e549-aed8-b124da9e3059'
- STRONGHOLD_CRUSADER_TCP_PORT = 2301
opengsq.protocols.teamspeak3 module
- class opengsq.protocols.teamspeak3.TeamSpeak3(host: str, port: int, voice_port: int, timeout: float = 5)
Bases:
ProtocolBaseThis class represents the TeamSpeak 3 Protocol. It provides methods to interact with the TeamSpeak 3 API.
- full_name = 'TeamSpeak 3 Protocol'
- async get_info() dict[str, str]
Asynchronously retrieves the information of the game server.
- Returns:
A dictionary containing the information of the game server.
- async get_clients() list[dict[str, str]]
Asynchronously retrieves the list of clients on the game server.
- Returns:
A list of clients on the game server.
- async get_channels() list[dict[str, str]]
Asynchronously retrieves the list of channels on the game server.
- Returns:
A list of channels on the game server.
opengsq.protocols.toxikk module
- class opengsq.protocols.toxikk.Toxikk(host: str, port: int = 14001, timeout: float = 5.0)
Bases:
UDK- GAMEMODE_NAMES = {'cruzade.CRZArchRivals': 'Arch Rivals', 'cruzade.CRZAreaDomination': 'Area Domination', 'cruzade.CRZBloodLust': 'BloodLust', 'cruzade.CRZCellCapture': 'Cell Capture', 'cruzade.CRZSquadSurvival': 'Squad Survival', 'cruzade.CRZTeamGame': 'Squad Assault'}
- BOT_SKILL_NAMES = {0: 'Novice', 1: 'Average', 2: 'Experienced', 3: 'Skilled', 4: 'Adept', 5: 'Masterful', 6: 'Inhuman', 7: 'Godlike'}
- VS_BOTS_NAMES = {0: 'None', 1: '1:1', 2: '3:2', 3: '2:1'}
- full_name = 'Toxikk Protocol'
opengsq.protocols.trackmania_nations module
- class opengsq.protocols.trackmania_nations.TrackmaniaPayloadData(server_name: str | None = None, srv_type: str | None = None, environment: str | None = None, maps: List[str] = None, players: int | None = None, max_players: int | None = None, game_mode: str | None = None, comment: str | None = None, raw_strings: List[str] = None)
Bases:
objectStrukturierte Daten aus dem Trackmania Payload
- server_name: str | None = None
- srv_type: str | None = None
- environment: str | None = None
- maps: List[str] = None
- players: int | None = None
- max_players: int | None = None
- game_mode: str | None = None
- comment: str | None = None
- raw_strings: List[str] = None
- class opengsq.protocols.trackmania_nations.TrackmaniaNations(host: str, port: int = 2350, timeout: float = 5.0)
Bases:
ProtocolBaseTrackmania Nations Protocol Implementation Basiert auf MCP/Ghidra Reverse-Engineering
MCP-Erkenntnisse: - Servername bei Position 0x27 mit 4-Byte Längen-Präfix (Little Endian) - #SRV# Marker mit 5-Byte Länge und Typ-Indikator - Drei Haupt-Typen: SRV#f (Float), SRV#s (String), SRV#p (Packet) - Strings verwenden 4-Byte Längen-Präfixe
- property full_name: str
- DEFAULT_PORT = 2350
- async get_info() ServerInfo
Retrieves server information by sending the two TCP packets in sequence.
- Returns:
A ServerInfo object containing server information
- Raises:
InvalidPacketException – If the response doesn’t contain #SRV# marker
- parse_server_payload(data: bytes) TrackmaniaPayloadData
Parst einen Server-Payload basierend auf MCP-Erkenntnissen.
- Args:
data: Die Rohdaten des Payloads
- Returns:
TrackmaniaPayloadData mit extrahierten Informationen
- debug_payload(data: bytes) Dict[str, Any]
Debug-Funktion zur Analyse eines Payloads.
- Args:
data: Die Rohdaten
- Returns:
Dictionary mit Debug-Informationen
opengsq.protocols.udk module
opengsq.protocols.unreal2 module
- class opengsq.protocols.unreal2.Unreal2(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThe Unreal2 class inherits from the ProtocolBase class and represents the Unreal 2 Protocol. It provides methods to get details, rules, and players from a server using the Unreal 2 Protocol.
- full_name = 'Unreal 2 Protocol'
- async get_details(strip_color=True) Status
Asynchronously gets the details of a server.
- Args:
strip_color (bool, optional): If True, strips color codes from the server name. Defaults to True.
- Returns:
Status: A Status object containing the details of the server.
- async get_rules(strip_color=True) dict[str, Any]
Asynchronously gets the rules of a server.
- Args:
strip_color (bool, optional): If True, strips color codes. Defaults to True.
- Returns:
dict: A dictionary containing the rules of the server.
- async get_players(strip_color=True) list[Player]
Asynchronously gets the players of a server.
- Args:
strip_color (bool, optional): If True, strips color codes. Defaults to True.
- Returns:
list: A list of Player objects representing the players of the server.
- static strip_color(text: bytes) bytes
Strips color codes from a string.
- Args:
text (str): The string to strip color codes from.
- Returns:
str: The string with color codes stripped.
opengsq.protocols.ut3 module
- class opengsq.protocols.ut3.UT3(host: str, port: int = 14001, timeout: float = 5.0)
Bases:
UDK- GAMEMODE_NAMES = {0: 'Deathmatch', 1: 'Team Deathmatch', 2: 'Capture The Flag', 3: 'Vehicle CTF', 4: 'Warfare', 5: 'Duel', 6: 'Campaign', 7: 'Greed', 8: 'Betrayal', 9: 'Custom'}
- MUTATOR_NAMES = {1: 'SlowTimeKills', 2: 'BigHead', 4: 'NoOrbs', 8: 'FriendlyFire', 16: 'Handicap', 32: 'Instagib', 64: 'LowGrav', 128: 'NoPowerups', 256: 'NoTranslocator', 512: 'Slomo', 1024: 'SpeedFreak', 2048: 'SuperBerserk', 4096: 'WeaponReplacement', 8192: 'WeaponsRespawn', 16384: 'Survival', 32768: 'Hero', 65536: 'Arena'}
- BOT_SKILL_NAMES = {0: 'Novice', 1: 'Average', 2: 'Experienced', 3: 'Skilled', 4: 'Adept', 5: 'Masterful', 6: 'Inhuman', 7: 'Godlike'}
- VS_BOTS_NAMES = {0: 'None', 1: '1:1', 2: '3:2', 3: '2:1'}
- full_name = 'Unreal Tournament 3 Protocol'
opengsq.protocols.vcmp module
- class opengsq.protocols.vcmp.Vcmp(host: str, port: int, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Vice City Multiplayer Protocol. It provides methods to interact with the Vice City Multiplayer API.
- full_name = 'Vice City Multiplayer Protocol'
opengsq.protocols.w40kdow module
- class opengsq.protocols.w40kdow.W40kDow(host: str, port: int = 6112, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Warhammer 40K Dawn of War Protocol. It provides methods to listen for broadcast announcements from DoW servers.
- full_name = 'Warhammer 40K Dawn of War Protocol'
- async get_status() Status
Asynchronously retrieves the server status by listening for broadcast announcements.
Dawn of War servers continuously broadcast their status on the network. This method listens for these broadcasts and returns the first matching broadcast from the specified host.
- Returns:
A Status object containing the server status.
- Raises:
InvalidPacketException – If the received packet is invalid.
asyncio.TimeoutError – If no broadcast is received within the timeout period.
opengsq.protocols.warcraft3 module
- class opengsq.protocols.warcraft3.GameFlags(value)
Bases:
IntFlagGame flags based on the Go implementation
- CUSTOM_GAME = 1
- SINGLE_PLAYER = 5
- LADDER_1V1 = 16
- LADDER_2V2 = 32
- LADDER_3V3 = 64
- LADDER_4V4 = 128
- TEAM_LADDER = 32
- SAVED_GAME = 512
- TYPE_MASK = 757
- SIGNED_MAP = 8
- PRIVATE_GAME = 2048
- CREATOR_USER = 8192
- CREATOR_BLIZZARD = 16384
- CREATOR_MASK = 24576
- MAP_TYPE_MELEE = 32768
- MAP_TYPE_SCENARIO = 65536
- MAP_TYPE_MASK = 98304
- SIZE_SMALL = 131072
- SIZE_MEDIUM = 262144
- SIZE_LARGE = 524288
- SIZE_MASK = 917504
- OBS_FULL = 1048576
- OBS_ON_DEFEAT = 2097152
- OBS_NONE = 4194304
- OBS_MASK = 7340032
- FILTER_MASK = 8380416
- class opengsq.protocols.warcraft3.GameSettingFlags(value)
Bases:
IntFlagGame setting flags based on the Go implementation
- SPEED_SLOW = 0
- SPEED_NORMAL = 1
- SPEED_FAST = 2
- SPEED_MASK = 15
- TERRAIN_HIDDEN = 256
- TERRAIN_EXPLORED = 512
- TERRAIN_VISIBLE = 1024
- TERRAIN_DEFAULT = 2048
- TERRAIN_MASK = 3840
- OBS_NONE = 0
- OBS_ENABLED = 4096
- OBS_ON_DEFEAT = 8192
- OBS_FULL = 12288
- OBS_REFEREES = 1073741824
- OBS_MASK = 1073754112
- TEAMS_TOGETHER = 16384
- TEAMS_FIXED = 393216
- SHARED_CONTROL = 16777216
- RANDOM_HERO = 33554432
- RANDOM_RACE = 67108864
- class opengsq.protocols.warcraft3.SlotStatus(value)
Bases:
IntEnumSlot status based on the Go implementation
- OPEN = 0
- CLOSED = 1
- OCCUPIED = 2
- class opengsq.protocols.warcraft3.Warcraft3(host: str, port: int = 6112, timeout: float = 5.0)
Bases:
ProtocolBaseThis class represents the Warcraft 3 Protocol. It provides methods to interact with Warcraft 3 game servers. Based on the gowarcraft3 implementation.
- full_name = 'Warcraft 3 Protocol'
- WARCRAFT3_PORT = 6112
- PROTOCOL_SIG = 247
- CURRENT_GAME_VERSION = 26
- PID_SEARCH_GAME = 47
- PID_GAME_INFO = 48