From 8aa5cd88ef052d13cd18270a0cb99dd0a5be4759 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 30 Dec 2023 12:57:56 +0100 Subject: [PATCH] use connectingPlayer instead of request --- main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.go b/main.go index cd3f2ac..e216f28 100644 --- a/main.go +++ b/main.go @@ -106,7 +106,7 @@ func joinPrivateGame(c *gin.Context) { req.PlayerID != nil && req.LobbyID != nil { //is reconnect lobby := u.FindExistingPrivateLobbyByID(utils.Passphrase(*req.Passphrase)) - _, found := lobby.GetPlayerByUUID(*req.PlayerID) + _, found := lobby.GetPlayerByUUID(connectingPlayer.Uuid) if found { c.IndentedJSON( http.StatusOK, @@ -121,8 +121,6 @@ func joinPrivateGame(c *gin.Context) { } } - player = chess.NewPlayer(uuid.New()) - mut.Lock() defer mut.Unlock() lobby := u.FindExistingPrivateLobbyByID(utils.Passphrase(*req.Passphrase))