From 1a030411c4ec06f2e80fe3bcd2aff4d070aeabaf Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 23 Oct 2020 23:41:58 -0600 Subject: [PATCH] Add function to update the player's socket ID. --- src/utils/Game.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/Game.ts b/src/utils/Game.ts index c605833..5176665 100644 --- a/src/utils/Game.ts +++ b/src/utils/Game.ts @@ -56,6 +56,10 @@ export class Game { this.player_len++; }; + public update_socket(player: string, socket: string): void { + this._players[player].socket = socket; + }; + public remove_player(player: string, ban: boolean): void { delete this._players[player]; if (ban) {