浏览代码

comment/logging cleanup

/fix-mtt-493
eheimburg 4 年前
当前提交
429bd773
共有 2 个文件被更改,包括 1 次插入43 次删除
  1. 42
      Assets/BossRoom/Scripts/Client/Game/State/ClientCharSelectState.cs
  2. 2
      Assets/BossRoom/Scripts/Server/Game/State/ServerCharSelectState.cs

42
Assets/BossRoom/Scripts/Client/Game/State/ClientCharSelectState.cs


newClass, newIsMale, newState);
}
/*
public override void NetworkStart()
{
base.NetworkStart();
if (!IsClient)
{
this.enabled = false;
}
else
{
// Work around another MLAPI timing bug. (Similar to other reported timing bug, but is *probably* not the same?)
// Because this component is attached to an in-scene NetworkedObject and not a dynamically-created one,
// our NetworkStart() is called before the server has finished initializing the server-side version of us.
// (We are fully initialized here on the client, but not the server.) If we try to call RPC functions too
// quickly, the server will get a null-reference-exception in MLAPI.NetworkedBehaviour.InvokeServerRPCLocal()
// or MLAPI.NetworkedBehaviour.OnRemoteServerRPC (depending on whether we're in host mode or a separate
// client, respectively).
//
// (This is also why the server can't just use its OnClientConnected() to immediately assign us a lobby slot:
// sending client RPCs immediately after learning about a client is too soon, and always fails.)
//
// There doesn't seem to be any way to be notified of when we are REALLY ready to send/receive RPCs.
// In testing, waiting a single physics frame seems to be sufficient... but since its a problem on the SERVER
// and we're delaying in the client, there is no reason to believe a single frame will always be enough time.
//
// To repro this bug, simply comment out the line indicated in CoroRequestLobbyIndex() and then host a game.
StartCoroutine(CoroRequestLobbyIndex());
}
}
private IEnumerator CoroRequestLobbyIndex()
{
// COMMENT OUT THE NEXT LINE TO REPRO BUG
yield return new WaitForFixedUpdate();
NetData.InvokeServerRpc(NetData.RpcRequestLobbyIndex, NetworkingManager.Singleton.LocalClientId);
yield break;
}
*/
Debug.Log("We've been assigned index #" + index);
CharIndex = index;
}
}

2
Assets/BossRoom/Scripts/Server/Game/State/ServerCharSelectState.cs


}
}
// Switch scenes after a short delay
// Delay a few seconds to give the UI time to react, then switch scenes
StartCoroutine(CoroEndLobby());
}

正在加载...
取消
保存