fix test on older unity

This commit is contained in:
Robin Rolf 2024-01-30 02:52:46 +01:00
parent bf49b6c923
commit ae9ecf3483

View File

@ -25,10 +25,7 @@ protected NetworkIdentity CreatePlayerNI(int connectionId, Action<NetworkIdentit
NetworkConnectionToClient connection = new NetworkConnectionToClient(connectionId);
connection.isAuthenticated = true;
connection.identity = identity;
if (!NetworkServer.connections.TryAdd(connectionId, connection))
{
throw new Exception("Duplicate connection id");
}
NetworkServer.connections.Add(connectionId, connection);
NetworkServer.Spawn(gameObject, connection);
NetworkServer.SetClientReady(connection); // AddPlayerForConnection also calls this!