Inheritance: UnityEngine.Networking.MessageBase
コード例 #1
0
 public void SendReadyToBeginMessage()
 {
     if (LogFilter.logDebug)
     {
         Debug.Log("NetworkLobbyPlayer SendReadyToBeginMessage");
     }
     NetworkLobbyManager singleton = NetworkManager.singleton as NetworkLobbyManager;
     if (singleton != null)
     {
         LobbyReadyToBeginMessage msg = new LobbyReadyToBeginMessage {
             slotId = (byte) base.playerControllerId,
             readyState = true
         };
         singleton.client.Send(0x2b, msg);
     }
 }
コード例 #2
0
 private void OnServerReadyToBeginMessage(NetworkMessage netMsg)
 {
     PlayerController controller;
     if (LogFilter.logDebug)
     {
         Debug.Log("NetworkLobbyManager OnServerReadyToBeginMessage");
     }
     netMsg.ReadMessage<LobbyReadyToBeginMessage>(s_ReadyToBeginMessage);
     if (!netMsg.conn.GetPlayerController(s_ReadyToBeginMessage.slotId, out controller))
     {
         if (LogFilter.logError)
         {
             Debug.LogError("NetworkLobbyManager OnServerReadyToBeginMessage invalid playerControllerId " + s_ReadyToBeginMessage.slotId);
         }
     }
     else
     {
         NetworkLobbyPlayer component = controller.gameObject.GetComponent<NetworkLobbyPlayer>();
         component.readyToBegin = s_ReadyToBeginMessage.readyState;
         LobbyReadyToBeginMessage msg = new LobbyReadyToBeginMessage {
             slotId = component.slot,
             readyState = s_ReadyToBeginMessage.readyState
         };
         NetworkServer.SendToReady(null, 0x2b, msg);
         this.CheckReadyToBegin();
     }
 }