Skip to content

Commit

Permalink
add master server node
Browse files Browse the repository at this point in the history
add master server node
  • Loading branch information
Ughuuu committed Dec 14, 2024
1 parent 86a7277 commit ca1299f
Show file tree
Hide file tree
Showing 11 changed files with 511 additions and 2 deletions.
6 changes: 6 additions & 0 deletions modules/blazium_sdk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ def get_doc_classes():
"POGRClient",
"POGRResult",
"POGRResponse",
"MasterServerClient",
"MasterServerResult",
"MasterServerResponse",
"MasterServerListResult",
"MasterServerListResponse",
"GameServerInfo",
]


Expand Down
37 changes: 37 additions & 0 deletions modules/blazium_sdk/doc_classes/GameServerInfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GameServerInfo" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Game server info used by the [MasterServerClient].
</brief_description>
<description>
Game server info used by the [MasterServerClient]. Used to create or update a game server.
</description>
<tutorials>
</tutorials>
<members>
<member name="description" type="String" setter="set_description" getter="get_description" default="&quot;&quot;">
Description of the game server.
</member>
<member name="game_name" type="String" setter="set_game_name" getter="get_game_name" default="&quot;&quot;">
Name of the game server.
</member>
<member name="id" type="String" setter="set_id" getter="get_id" default="&quot;&quot;">
Id of the game server. Generated after call to create game server.
</member>
<member name="ip_address" type="String" setter="set_ip_address" getter="get_ip_address" default="&quot;&quot;">
Ip address of the game server.
</member>
<member name="max_players" type="int" setter="set_max_players" getter="get_max_players" default="0">
Max players of the game server.
</member>
<member name="players" type="int" setter="set_players" getter="get_players" default="0">
Players of the game server.
</member>
<member name="port" type="int" setter="set_port" getter="get_port" default="0">
Port of the game server.
</member>
<member name="version" type="String" setter="set_version" getter="get_version" default="&quot;&quot;">
Version of the game server.
</member>
</members>
</class>
41 changes: 41 additions & 0 deletions modules/blazium_sdk/doc_classes/MasterServerClient.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MasterServerClient" inherits="BlaziumClient" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A node used to connect to a master server.
</brief_description>
<description>
A node used to connect to a master server.
</description>
<tutorials>
</tutorials>
<methods>
<method name="create_game">
<return type="MasterServerResponse" />
<param index="0" name="game_server_info" type="GameServerInfo" />
<description>
Create a game server.
</description>
</method>
<method name="recent_games">
<return type="MasterServerListResponse" />
<description>
Get a list of recent games.
</description>
</method>
<method name="update_game">
<return type="MasterServerResponse" />
<param index="0" name="game_server_info" type="GameServerInfo" />
<description>
Update a game server.
</description>
</method>
</methods>
<members>
<member name="game_id" type="String" setter="set_game_id" getter="get_game_id" default="&quot;&quot;">
Game id of the game server.
</member>
<member name="server_url" type="String" setter="set_server_url" getter="get_server_url" default="&quot;https://masterserver.blazium.app/api/v1&quot;">
Set to what url this master server should connect to.
</member>
</members>
</class>
19 changes: 19 additions & 0 deletions modules/blazium_sdk/doc_classes/MasterServerListResponse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MasterServerListResponse" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Response from a list games request.
</brief_description>
<description>
Response from a list games request.
</description>
<tutorials>
</tutorials>
<signals>
<signal name="finished">
<param index="0" name="result" type="MasterServerResult" />
<description>
Signal emitted when the request is finished.
</description>
</signal>
</signals>
</class>
27 changes: 27 additions & 0 deletions modules/blazium_sdk/doc_classes/MasterServerListResult.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MasterServerListResult" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A result from a [MasterServerListResponse].
</brief_description>
<description>
A result from a [MasterServerListResponse]. Contains either result or error.
</description>
<tutorials>
</tutorials>
<methods>
<method name="has_error" qualifiers="const">
<return type="bool" />
<description>
Returns true if there is an error.
</description>
</method>
</methods>
<members>
<member name="error" type="String" setter="" getter="get_error" default="&quot;&quot;">
The error message.
</member>
<member name="results" type="GameServerInfo[]" setter="" getter="get_results" default="[]">
The results.
</member>
</members>
</class>
19 changes: 19 additions & 0 deletions modules/blazium_sdk/doc_classes/MasterServerResponse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MasterServerResponse" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Response from a create or update game request.
</brief_description>
<description>
Response from a create or update game request.
</description>
<tutorials>
</tutorials>
<signals>
<signal name="finished">
<param index="0" name="result" type="MasterServerResult" />
<description>
Signal emitted when the request is finished.
</description>
</signal>
</signals>
</class>
27 changes: 27 additions & 0 deletions modules/blazium_sdk/doc_classes/MasterServerResult.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MasterServerResult" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A result from a [MasterServerResponse].
</brief_description>
<description>
A result from a [MasterServerResponse]. Contains either result or error.
</description>
<tutorials>
</tutorials>
<methods>
<method name="has_error" qualifiers="const">
<return type="bool" />
<description>
Returns true if there is an error.
</description>
</method>
</methods>
<members>
<member name="error" type="String" setter="" getter="get_error" default="&quot;&quot;">
Gets the error message.
</member>
<member name="result" type="GameServerInfo" setter="" getter="get_result">
Gets the result.
</member>
</members>
</class>
1 change: 1 addition & 0 deletions modules/blazium_sdk/icons/MasterServerClient.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ca1299f

Please sign in to comment.