This Godot game client consumes the GameServerAPI to provide a multiplayer gaming environment. Designed for seamless integration with the API, it features a user interface that allows players to authenticate, discover game servers, and securely authenticate themselves to them.
A Game Server implementation in Godot can be found here.
- Login/Registration Interface: Players are able to interact with the APIs Auth Controller through a login user interface.
- JWT Authorization: Upon successful sign in, player’s are provided a JWT which is used to authorize future requests.
- Server Retrieval: Communicates with the API’s Server Browser Controller to fetch the list of active game servers.
- Server Browser Interface: Displays available game servers in server browser interface, allowing player to select and join a game.
-
PlayerJoinToken Acquisition: Requests a PlayerJoinToken from the API’s Player Token Controller before attempting to join a game server.
-
Token Handoff: Upon successful connection to a game server, the client provides the PlayerJoinToken, which the server then validates with the API to authenticate the player and fetch relevant player information.
-
Game Server Interaction: This project provides a simple environment where players are labeled with their username and are able to move around using WASD keys.
Installation Guide
-
Download the Source Code
- Visit the GitHub repository at
https://github.com/robert-caulfield/GameServerAPI-ClientGodot
. - Click on
Code
and selectDownload ZIP
, or clone the repository using:git clone https://github.com/robert-caulfield/GameServerAPI-ClientGodot
- Visit the GitHub repository at
-
Open the Project in Godot
- Open the Godot Engine.
- Select
Import Project
from the Godot Project Manager. - Navigate to the downloaded directory and select the
project.godot
file. - Click
Import & Edit
to open the project.
-
Configure the API Endpoint
- Navigate to the
api_helper.gd
script in the Godot Editor. - Locate the
API_URL
variable and set it to the correct endpoint URL for your GameServerAPI:# Base url to api const API_URL = "https://localhost:7242/api/"
- Save the script.
- Navigate to the
-
Run the Project
- Ensure the API is running, and run the project.
- Godot v4.21