Skip to content

Commit

Permalink
fix key already added bug (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
stilnat authored May 31, 2023
1 parent 3b4edca commit e52bafb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Assets/Scripts/SS3D/Systems/PlayerControl/PlayerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ private void ProcessAuthorizePlayer(NetworkConnection conn, UserAuthorizationMes
}

player.GiveOwnership(conn);
_onlinePlayers.Add(ckey, player);

bool hasOnlinePlayer = _onlinePlayers.TryGetValue(ckey, out Player onlinePlayer);
if (!hasOnlinePlayer)
{
_onlinePlayers.Add(ckey, player);
}

}

[Server]
Expand Down

0 comments on commit e52bafb

Please sign in to comment.