Skip to content

Commit

Permalink
Update docs on blazium nodes (#198)
Browse files Browse the repository at this point in the history
update some docs

Update LoginClient.xml

update master server service

Update LoginClient.xml

Update BlaziumClient.xml

update login client docs

update docs
  • Loading branch information
Ughuuu authored Dec 15, 2024
1 parent 0d496e7 commit 6a27e2c
Show file tree
Hide file tree
Showing 25 changed files with 138 additions and 55 deletions.
17 changes: 15 additions & 2 deletions modules/blazium_sdk/doc_classes/BlaziumClient.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BlaziumClient" inherits="Node" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
An abstract base node used to connect to Blazium services.
Base node for connecting to the Blazium services.
</brief_description>
<description>
An abstract base node used to connect to Blazium services.
The [BlaziumClient] node provides an interface for connecting to the Blazium services. These services are designed to simplify game development with aspects such as multiplayer, authentication, etc.
Developers have the flexibility to either:
- Connect to the free Blazium services hosted on the [url=https://blazium.app]blazium.app[/url] domain.
- Self-deploy the Blazium services on their own infrastructure for full control and customization.
[codeblock lang=text]

+---------------------+ +---------------------+
| Blazium Engine | HTTP and | Blazium Service |
|---------------------| WebSocket |---------------------|
| - Send requests | &lt;---------&gt; | - Handle requests |
| - Receive responses | | - Send responses |
+---------------------+ +---------------------+

[/codeblock]
</description>
<tutorials>
</tutorials>
Expand Down
4 changes: 2 additions & 2 deletions modules/blazium_sdk/doc_classes/GameServerInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.
Game server info used by the [MasterServerClient]. Used to [method MasterServerClient.create_game] or [method MasterServerClient.update_game].
</description>
<tutorials>
</tutorials>
Expand All @@ -16,7 +16,7 @@
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.
Id of the game server. Generated after call to [method MasterServerClient.create_game].
</member>
<member name="ip_address" type="String" setter="set_ip_address" getter="get_ip_address" default="&quot;&quot;">
Ip address of the game server.
Expand Down
4 changes: 2 additions & 2 deletions modules/blazium_sdk/doc_classes/ListLobbyResponse.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ListLobbyResponse" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Response from a list lobby request.
Response from a [method LobbyClient.list_lobbies] call.
</brief_description>
<description>
Response from a list lobby request. Await on finished to get the [ListLobbyResult].
Response from a [method LobbyClient.list_lobbies] call. Await on [signal finished] signal to get the [ListLobbyResult].
</description>
<tutorials>
</tutorials>
Expand Down
4 changes: 2 additions & 2 deletions modules/blazium_sdk/doc_classes/LobbyCallResponse.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LobbyCallResponse" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Response from a lobby call function.
Response from a [method AuthoritativeClient.lobby_call] call.
</brief_description>
<description>
Response from a lobby call function. Await on finished to get the [LobbyCallResult].
Response from a [method AuthoritativeClient.lobby_call] call. Await on [signal finished] signal to get the [LobbyCallResult].
</description>
<tutorials>
</tutorials>
Expand Down
2 changes: 1 addition & 1 deletion modules/blazium_sdk/doc_classes/LobbyCallResult.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
A result from a [LobbyCallResponse].
</brief_description>
<description>
A result from a [LobbyCallResponse].
A result from a [LobbyCallResponse]. Contains either result or error.
</description>
<tutorials>
</tutorials>
Expand Down
41 changes: 37 additions & 4 deletions modules/blazium_sdk/doc_classes/LobbyClient.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LobbyClient" 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 lobby server.
Node for connecting to the Blazium Lobby service. Offers non-authoritative lobby making features.
</brief_description>
<description>
A node used to connect to a lobby server. It can be used to do matchmaking. You can do operations such as create lobby, join lobby, etc. The server is configurable and can either be self deployed or you can use the blazium free matchmaking server.
The [LobbyClient] node provides an interface for connecting to the Blazium Lobby service. There is a free instance hosted on the [url=https://blazium.app]blazium.app[/url] domain that is used by default.
The normal flow is as follows:
1. Listen to all the signals you are interested in.
2. Connect to the server using [method connect_to_lobby] method.
3. Call any other methods to create, view or join lobbies, as well as add data to them.
4. Close the session using [method disconnect_from_lobby] method at the end of the game.
[b]Note:[/b] Some methods are non blocking and can be awaited in order to get the result.
There are also members on this class that are automatically updated as the lobby gets updated, such as:
- [member peer]: The current peer. Reflects changes to the self peer.
- [member peers]: The lobby peers. Reflects changes to all peers.
- [member lobby]: The lobby. Reflects changes to the lobby.
- [member host_data]: The current lobby private data. Only works if you are host.
- [member peer_data]: The current peer private data.
</description>
<tutorials>
</tutorials>
Expand All @@ -15,6 +27,7 @@
<param index="1" name="is_private" type="bool" default="false" />
<description>
Add data to the lobby. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal received_lobby_data].
</description>
</method>
Expand All @@ -23,6 +36,7 @@
<param index="0" name="tags" type="Dictionary" />
<description>
Add tags to the lobby. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_tagged].
</description>
</method>
Expand All @@ -33,6 +47,7 @@
<param index="2" name="is_private" type="bool" default="false" />
<description>
Add data to a peer. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal received_peer_data].
</description>
</method>
Expand All @@ -42,13 +57,15 @@
<param index="1" name="is_private" type="bool" default="false" />
<description>
Add data to all peers. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal received_peer_data].
</description>
</method>
<method name="connect_to_lobby">
<return type="bool" />
<description>
Connect to a Blazium Lobby Server using the [member game_id] and [member server_url].
Generates [signal connected_to_lobby] signal if successful.
</description>
</method>
<method name="create_lobby">
Expand All @@ -60,6 +77,7 @@
<description>
Create a lobby and become host. If you are already in a lobby, you cannot create one. You need to leave first.
The new lobby can have a title, tags, max players and password. 0 max players means unlimited.
Returns a [ViewLobbyResponse] object that has a [signal ViewLobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_created] signal.
</description>
</method>
Expand All @@ -69,6 +87,7 @@
<param index="1" name="is_private" type="bool" default="false" />
<description>
Delete one or more keys from the lobby data. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal received_lobby_data].
</description>
</method>
Expand All @@ -77,6 +96,7 @@
<param index="0" name="keys" type="String[]" />
<description>
Delete one or more keys from the lobby tags. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_tagged].
</description>
</method>
Expand All @@ -86,7 +106,8 @@
<param index="1" name="target_peer" type="String" />
<param index="2" name="is_private" type="bool" default="false" />
<description>
one or more keys from the peer data. Only works if you are host.
Delete one or more keys from the peer data. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal received_peer_data].
</description>
</method>
Expand All @@ -95,14 +116,16 @@
<param index="0" name="keys" type="String[]" />
<param index="1" name="is_private" type="bool" default="false" />
<description>
one or more keys from the peers data. Only works if you are host.
Delete one or more keys from the peers data. Only works if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal received_peer_data].
</description>
</method>
<method name="disconnect_from_lobby">
<return type="void" />
<description>
Disconnect from the lobby server.
Generates [signal disconnected_from_lobby] signal.
</description>
</method>
<method name="is_host">
Expand All @@ -118,6 +141,7 @@
<description>
Join a lobby. If you are already in a lobby, you cannot join another one. You need to leave first.
If the lobby you want to join is password protected, you need to provide the password.
Returns a [ViewLobbyResponse] object that has a [signal ViewLobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_joined].
</description>
</method>
Expand All @@ -126,13 +150,15 @@
<param index="0" name="peer_id" type="String" />
<description>
Kick a peer. You need to be host to do so.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal peer_left] signal with kicked set to true.
</description>
</method>
<method name="leave_lobby">
<return type="LobbyResponse" />
<description>
Leave a lobby. You need to be in a lobby to leave one.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_left].
</description>
</method>
Expand All @@ -150,6 +176,7 @@
<param index="0" name="data" type="Variant" />
<description>
Send a notification either to the host, or if you are host send data to all peers.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_notified] signal.
</description>
</method>
Expand All @@ -159,6 +186,7 @@
<param index="1" name="target_peer" type="String" />
<description>
Send a notification to a peer, works only if you are host.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_notified] signal.
</description>
</method>
Expand All @@ -167,6 +195,7 @@
<param index="0" name="chat_message" type="String" />
<description>
Send a chat message. Only works if you are in a lobby.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal peer_messaged].
</description>
</method>
Expand All @@ -175,6 +204,7 @@
<param index="0" name="ready" type="bool" />
<description>
Ready up in the lobby. You need to be in a lobby and unready to run this.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal peer_ready].
</description>
</method>
Expand All @@ -183,6 +213,7 @@
<param index="0" name="seal" type="bool" />
<description>
Seals the lobby. You need to be the host to do this and the lobby needs to be unsealed.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal lobby_sealed].
</description>
</method>
Expand All @@ -191,6 +222,7 @@
<param index="0" name="peer_name" type="String" />
<description>
Set your peer name.
Returns a [LobbyResponse] object that has a [signal LobbyResponse.finished] signal that is emitted when finished.
Generates [signal peer_named] signal if you are in lobby.
</description>
</method>
Expand All @@ -200,6 +232,7 @@
<param index="1" name="password" type="String" default="&quot;&quot;" />
<description>
View data from a lobby. Returns lobby settings and peers.
Returns a [ViewLobbyResponse] object that has a [signal ViewLobbyResponse.finished] signal that is emitted when finished.
</description>
</method>
</methods>
Expand Down
5 changes: 3 additions & 2 deletions modules/blazium_sdk/doc_classes/LobbyInfo.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LobbyInfo" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Lobby information returned after a view lobby request.
Lobby information returned after a [LobbyClient] request that returns a lobby.
</brief_description>
<description>
Lobby information returned after a view lobby request.
Lobby information returned after a [LobbyClient] request that returns a lobby.
</description>
<tutorials>
</tutorials>
Expand All @@ -28,6 +28,7 @@
The maximum number of players allowed in the lobby. 0 = unlimited
</member>
<member name="password_protected" type="bool" setter="" getter="is_password_protected" default="false">
Whether the lobby is password protected.
</member>
<member name="players" type="int" setter="" getter="get_players" default="0">
The number of players currently in the lobby.
Expand Down
5 changes: 3 additions & 2 deletions modules/blazium_sdk/doc_classes/LobbyPeer.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LobbyPeer" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Lobby peers information returned after a view lobby request.
Lobby information returned after a [LobbyClient] request that returns peers.
</brief_description>
<description>
Lobby peers information returned after a view lobby request.
Lobby information returned after a [LobbyClient] request that returns peers.
</description>
<tutorials>
</tutorials>
<members>
<member name="data" type="Dictionary" setter="" getter="get_data" default="{}">
Public data of the peer.
</member>
<member name="id" type="String" setter="" getter="get_id" default="&quot;&quot;">
Identifier of the peer.
Expand Down
4 changes: 2 additions & 2 deletions modules/blazium_sdk/doc_classes/LobbyResponse.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LobbyResponse" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Generic response from a lobby request.
Generic response from a [LobbyClient] call.
</brief_description>
<description>
Generic response from a lobby request. Await on finished to get the result.
Generic response from a [LobbyClient] call. Await on [signal finished] signal to get the [LobbyResult].
</description>
<tutorials>
</tutorials>
Expand Down
24 changes: 17 additions & 7 deletions modules/blazium_sdk/doc_classes/LoginClient.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LoginClient" 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 login server.
Node for connecting to the Blazium Login service. Offers authentication mechanism.
</brief_description>
<description>
A node used to connect to a login server.
The [LoginClient] node provides an interface for connecting to the Blazium Login service. There is a free instance hosted on the [url=https://blazium.app]blazium.app[/url] domain that is used by default.
The authentication flow is as follows:
1. Listen to all the signals you are interested in.
2. Connect to the server using the [method connect_to_server] method.
3. Then you can request login info using the [method request_login_info] method.
4. Open the resulting login url received after awaiting on the [signal LoginResponse.finished] signal.
5. Obtain the jwt from the [signal received_jwt] signal.
[b]Note:[/b] Some methods are non blocking and can be awaited in order to get the result.
</description>
<tutorials>
</tutorials>
<methods>
<method name="connect_to_server">
<return type="bool" />
<description>
Connect to the server.
Connects to the server specified in [member server_url] using the game id specified in [member game_id]. Must be done before requesting login info.
Generates [signal connected_to_server] when connected.
</description>
</method>
<method name="disconnect_from_server">
Expand All @@ -26,19 +34,21 @@
<return type="LoginResponse" />
<param index="0" name="login_type" type="String" />
<description>
Request login info.
Request login info using the login type specified.
Returns a [LoginResponse] object that has a [signal LoginResponse.finished] signal that is emitted when finished.
</description>
</method>
</methods>
<members>
<member name="connected" type="bool" setter="" getter="get_connected" default="false">
True if the client is connected, else false.
Client connected state.
</member>
<member name="game_id" type="String" setter="set_game_id" getter="get_game_id" default="&quot;&quot;">
The game id.
Set what game id this client should use when connecting to the server. If this is missing connection will error.
Can only contain alphanumeric characters.
</member>
<member name="server_url" type="String" setter="set_server_url" getter="get_server_url" default="&quot;wss://login.blazium.app/connect&quot;">
Set to what url this login should connect to.
Set to what url this client should connect to.
</member>
</members>
<signals>
Expand Down
Loading

0 comments on commit 6a27e2c

Please sign in to comment.