Skip to content

Commit 4ce6534

Browse files
committed
Removed code handling duplicate connections in debug builds
1 parent 97c2ee1 commit 4ce6534

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

Packages/com.unity.multiplayer.samples.coop/Utilities/Net/SessionManager.cs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,7 @@ public bool SetupConnectingPlayerSessionData(ulong clientId, string playerId, T
135135
// If another client is connected with the same playerId
136136
if (m_ClientData[playerId].IsConnected)
137137
{
138-
if (Debug.isDebugBuild)
139-
{
140-
Debug.Log($"Client PlayerId {playerId} already exists. Because this is a debug build, we will still accept the connection");
141-
142-
// If debug build, accept connection and manually update playerId until we get one that either is not connected or that does not already exist
143-
while (m_ClientData.ContainsKey(playerId) && m_ClientData[playerId].IsConnected) playerId += "_Secondary";
144-
145-
if (m_ClientData.ContainsKey(playerId) && !m_ClientData[playerId].IsConnected)
146-
{
147-
// In this specific case, if the clients with the same PlayerId reconnect in a different order than when they originally connected,
148-
// they will swap characters, since their PlayerIds are manually modified here at runtime.
149-
isReconnecting = true;
150-
}
151-
}
152-
else
153-
{
154-
success = false;
155-
}
138+
success = false;
156139
}
157140
else
158141
{

0 commit comments

Comments
 (0)