use connectingPlayer instead of request

This commit is contained in:
Marco 2023-12-30 12:57:56 +01:00
parent e478bf46fc
commit 8aa5cd88ef
1 changed files with 1 additions and 3 deletions

View File

@ -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))