Skip to content

Commit

Permalink
user-auth: Add possibility for server-induced userData updates
Browse files Browse the repository at this point in the history
In several occassions server-side logic may want to induce an (enforced)
userData update, distributed to all players.

Examples:
- Moderating: Changing offensive usernames and/or characters
- Ownership-based: Loss of ownership of a certain character or
  characterDescription-Item (includes e.g. NFT-Transfers, when items are
represented as NFT)
- Game-Events: A group of Users, e.g. the winning team of a challenge,
  should get awared with a special character or character item.
  • Loading branch information
tbergmueller committed May 16, 2024
1 parent 7d6c9af commit facff8c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export class Networked3dWebExperienceServer {
});
}

public updateUserCharacter(clientId: number, userData: UserData) {
console.log(`Initiate server-side update of client ${clientId}`)
this.userNetworkingServer.updateUserCharacter(clientId, userData);
}

registerExpressRoutes(app: enableWs.Application) {
app.ws(this.config.networkPath, (ws) => {
this.userNetworkingServer.connectClient(ws);
Expand Down

0 comments on commit facff8c

Please sign in to comment.