OnClientConnect: explain clientLoadedScene flag

This commit is contained in:
vis2k 2020-01-05 19:04:46 +01:00
parent 5f655098f1
commit f7500a2a82

View File

@ -1277,6 +1277,9 @@ public virtual void OnServerSceneChanged(string sceneName) { }
/// <param name="conn">Connection to the server.</param>
public virtual void OnClientConnect(NetworkConnection conn)
{
// OnClientConnect by default calls AddPlayer but it should not do
// that when we have online/offline scenes. so we need the
// clientLoadedScene flag to prevent it.
if (!clientLoadedScene)
{
// Ready/AddPlayer is usually triggered by a scene load completing. if no scene was loaded, then Ready/AddPlayer it here instead.