Added scoreboarstate
@@ -9,7 +9,7 @@ Class representing the GameLib Room inside the ModuleServerAPI.
|
|||||||
Create a new game.
|
Create a new game.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
room.newGame(gameDetails);
|
Room.newGame(gameDetails);
|
||||||
```
|
```
|
||||||
|
|
||||||
| Argument | Type | Description |
|
| Argument | Type | Description |
|
||||||
@@ -23,19 +23,79 @@ room.newGame(gameDetails);
|
|||||||
Clear the queue.
|
Clear the queue.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
room.clearQueue();
|
Room.clearQueue();
|
||||||
```
|
```
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
||||||
### on: endScreen
|
### on: playerJoinQueue
|
||||||
|
|
||||||
Triggers when the endscreen should be shown.
|
Triggers when a player join the queue.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
Controller.on('endScreen', (endScreen) => {});
|
Room.on('playerJoinQueue', (player) => {});
|
||||||
```
|
```
|
||||||
|
|
||||||
| Argument | Type | Description |
|
| Argument | Type | Description |
|
||||||
| --------- | ------------------------------------------- | ------------------- |
|
| -------- | ------------------------------------------------ | --------------------------------- |
|
||||||
| endScreen | [EndScreen](./ModuleAPIGameLibEndScreen.md) | The endscreen data. |
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player that joined the queue. |
|
||||||
|
|
||||||
|
### on: playerLeaveQueue
|
||||||
|
|
||||||
|
Triggers when a player leaves the queue.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Room.on('playerLeaveQueue', (player) => {});
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | ------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player that left the queue. |
|
||||||
|
|
||||||
|
### on: queueUpdate
|
||||||
|
|
||||||
|
Triggers when the queue updates.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Room.on('queueUpdate', (players) => {});
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | -------------------------------------------------- | ------------------------- |
|
||||||
|
| players | [GamePlayer](./ModuleServerAPIGameLibGamePlayer)[] | The players in the queue. |
|
||||||
|
|
||||||
|
### on: activeGameChanged
|
||||||
|
|
||||||
|
Triggers when the active game changes.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Room.on('activeGameChanged', (gameDetails) => {});
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| ----------- | -------------------------------------------- | ----------------------------------- |
|
||||||
|
| gameDetails | [GameDetails](./ModuleApiGameLibGameDetails) | The details of the new active game. |
|
||||||
|
|
||||||
|
### on: mainScoreboardUpdate
|
||||||
|
|
||||||
|
Triggers when the queue updates.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Room.on('mainScoreboardUpdate', (player) => {});
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | --------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player that joined the queue. |
|
||||||
|
|
||||||
|
### on: anyScoreboardUpdate
|
||||||
|
|
||||||
|
Triggers when the queue updates.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Room.on('anyScoreboardUpdate', (player) => {});
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------------------------------------------------ | --------------------------------- |
|
||||||
|
| player | [GamePlayer](./ModuleServerAPIGameLibGamePlayer) | The player that joined the queue. |
|
||||||
|
|||||||
35
ModuleServerAPIGameLibScoreboardState.md
Normal file
35
ModuleServerAPIGameLibScoreboardState.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# ModuleServerApi - GameLib Scoreboard State
|
||||||
|
|
||||||
|
Simple object containing the state of a scoreboard.
|
||||||
|
|
||||||
|
## Structure
|
||||||
|
|
||||||
|
```JSON
|
||||||
|
{
|
||||||
|
"name": "Scoreboard Name",
|
||||||
|
"gameId": "gameId",
|
||||||
|
"scoreboardId": "scoreboardId",
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"uuid": "123",
|
||||||
|
"name": "Player 1",
|
||||||
|
"displayValue": "1m 2s",
|
||||||
|
"value": 62
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"uuid": "456",
|
||||||
|
"name": "Player 2",
|
||||||
|
"displayValue": "59s",
|
||||||
|
"value": 59
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
| Attribute | Type | Description |
|
||||||
|
| ------------ | ---------------------------------------------------------------- | -------------------------------- |
|
||||||
|
| name | string | The name of the scoreboard. |
|
||||||
|
| gameId | string | The id of the active game. |
|
||||||
|
| scoreboardId | string | The id of the active scoreboard. |
|
||||||
|
| entries | { uuid:string, name:string, displayValue:string, value:number}[] | The entries in the scoreboard. |
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
- [Game](./ModuleServerAPIGameLibGame)
|
- [Game](./ModuleServerAPIGameLibGame)
|
||||||
- [GamePlayer](./ModuleServerAPIGameLibGamePlayer)
|
- [GamePlayer](./ModuleServerAPIGameLibGamePlayer)
|
||||||
- [Scoreboard](./ModuleServerAPIGameLibScoreboard)
|
- [Scoreboard](./ModuleServerAPIGameLibScoreboard)
|
||||||
|
- [Scoreboard State](./ModuleServerAPIGameLibScoreboardState)
|
||||||
- [GameLib CollisionSpace](./ModuleServerAPIGameLibCollisionSpace)
|
- [GameLib CollisionSpace](./ModuleServerAPIGameLibCollisionSpace)
|
||||||
- [Libs](./ModuleServerAPILibs)
|
- [Libs](./ModuleServerAPILibs)
|
||||||
- [LibWebSocket](./ModuleServerAPILibsWebSocketLib)
|
- [LibWebSocket](./ModuleServerAPILibsWebSocketLib)
|
||||||
|
|||||||
Reference in New Issue
Block a user