From 2d21e4fa20f8c2f86c432dcb29f82cffbad5f2e4 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Fri, 6 Jun 2025 20:43:55 -0700 Subject: [PATCH] kick existing client when duplicate persistent id is found (#1077) ## Description: Kick the existing client instead of the new client because this was causing issues with replays. Players were unable to replay a game if they were a player. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors --- src/server/GameServer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/GameServer.ts b/src/server/GameServer.ts index c74b0d8e4..88db909dd 100644 --- a/src/server/GameServer.ts +++ b/src/server/GameServer.ts @@ -147,7 +147,9 @@ export class GameServer { existingIP: ipAnonymize(conflicting.ip), existingPersistentID: conflicting.persistentID, }); - return; + // Kick the existing client instead of the new one, because this was causing issues when + // a client wanted to replay the game afterwards. + this.kickClient(conflicting.clientID); } }