Checking some stuff

2025-08-10 16:09:44 +02:00
parent de8ceeaae8
commit 4ba4363fb7
3 changed files with 86 additions and 1 deletions

@@ -1,3 +1,63 @@
# ModuleClientApi - GameLib Game
Class representing the GameLib Game inside the ModuleServerAPI.
## Methods
### start
Start the game, advertise it to the control and make player requesting possible.
```javascript
Game.start();
```
### stop
Stop the game, remove all players and stop advertising to the control.
```javascript
Game.stop();
```
## Scoreboard
### requestScoreboard
Get a scoreboard for the game.
```javascript
Game.requestScoreboard(details);
```
| Argument | Type | Description |
| -------- | ------------------------------------------------------------ | --------------------------------------------------------------------- |
| details | [ScoreboardDetails](ModuleServerAPIGameLibScoreboardDetails) | Simple object that specifies the style and behaviour of a scoreboard. |
**Return** [Scoreboard](./ModuleServerAPIGameLibScoreboard) _Scoreboard instance._
### setMainScoreboard
Set the main scoreboard for the game.
```javascript
Game.setMainScoreboard(scoreboard);
```
| Argument | Type | Description |
| ---------- | ------------------------------------------------------- | ------------------------------------- |
| scoreboard | [Scoreboard](ModuleServerAPIGameLibScoreboard) / string | Scoreboard instance or scoreboard id. |
## Players
### requestFromQueue
### removePlayer
### getPlayer
### getPlayers
### hasPlayer
## Events

@@ -0,0 +1,24 @@
# ModuleServerApi - GameLib Scoreboard Details
Simple object that specifies the style and behaviour of a scoreboard.
## Structure
```JSON
{
"id": "scoreboardId",
"name": "Scoreboard Name",
"formatting": "duration",
"sorting": "LOW_TO_HIGH",
"showCount": 10
}
```
| Attribute | Type | Description |
| ------------------- | ----------------------------- | ------------------------------------------------ |
| id | string | The id of the scoreboard. |
| name | string | The name of the scoreboard. |
| formatting | "number" / "duration" | The score formatting of the scoreboard. |
| scsortingoreboardId | "LOW_TO_HIGH" / "HIGH_TO_LOW" | The sorting of the scoreboard. |
| showCount | number | The amount of entries to show on the scoreboard. |

@@ -27,7 +27,8 @@
- [Game](./ModuleServerAPIGameLibGame)
- [GamePlayer](./ModuleServerAPIGameLibGamePlayer)
- [Scoreboard](./ModuleServerAPIGameLibScoreboard)
- [Scoreboard State](./ModuleServerAPIGameLibScoreboardState)
- [Details](./ModuleServerAPIGameLibScoreboardDetails)
- [State](./ModuleServerAPIGameLibScoreboardState)
- [GameLib CollisionSpace](./ModuleServerAPIGameLibCollisionSpace)
- [Libs](./ModuleServerAPILibs)
- [LibWebSocket](./ModuleServerAPILibsWebSocketLib)