mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkClient.Ready: easier syntax
This commit is contained in:
parent
f38af96202
commit
4a47b1c7d2
@ -772,20 +772,21 @@ public static bool Ready()
|
||||
}
|
||||
|
||||
// need a valid connection to become ready
|
||||
if (connection != null)
|
||||
if (connection == null)
|
||||
{
|
||||
// Set these before sending the ReadyMessage, otherwise host client
|
||||
// will fail in InternalAddPlayer with null readyConnection.
|
||||
// TODO this is redundant. have one source of truth for .ready
|
||||
ready = true;
|
||||
connection.isReady = true;
|
||||
|
||||
// Tell server we're ready to have a player object spawned
|
||||
connection.Send(new ReadyMessage());
|
||||
return true;
|
||||
Debug.LogError("Ready() called with invalid connection object: conn=null");
|
||||
return false;
|
||||
}
|
||||
Debug.LogError("Ready() called with invalid connection object: conn=null");
|
||||
return false;
|
||||
|
||||
// Set these before sending the ReadyMessage, otherwise host client
|
||||
// will fail in InternalAddPlayer with null readyConnection.
|
||||
// TODO this is redundant. have one source of truth for .ready
|
||||
ready = true;
|
||||
connection.isReady = true;
|
||||
|
||||
// Tell server we're ready to have a player object spawned
|
||||
connection.Send(new ReadyMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
[Obsolete("NetworkClient.Ready doesn't need a NetworkConnection parameter anymore. It always uses NetworkClient.connection anyway.")]
|
||||
|
Loading…
Reference in New Issue
Block a user