Skip to content

Commit

Permalink
Fix storing peerId mapping of -1 on connect
Browse files Browse the repository at this point in the history
  • Loading branch information
craethke committed Sep 8, 2024
1 parent 043a6fb commit 1149bd4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions SteamMultiplayerPeer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ private void _OnNetworkConnectionStatusChanged(long connectHandle, Dictionary co
}
}

private int GetPeerIdFromSteam64(ulong steam64)
public int GetPeerIdFromSteam64(ulong steam64)
{
if (connectionsBySteamId64.ContainsKey(steam64))
{
Expand Down Expand Up @@ -467,15 +467,9 @@ private void AddConnection(ulong steamId, uint connectionHandle)
ConnectionHandle = connectionHandle,
};
connectionsBySteamId64.Add(steamId, connection);
peerIdToSteamId.Add(connection.PeerId, connection);
}
}

private int AssignPeerId()
{
return peerIdToSteamId.Count() + 2;
}

private void CloseListenSocket()
{
if (listenSocket != 0)
Expand Down

0 comments on commit 1149bd4

Please sign in to comment.