OnClientReady() public method

This is a hook that is invoked on clients when a LobbyPlayer switches between ready or not ready.

public OnClientReady ( bool readyState ) : void
readyState bool Whether the player is ready or not.
return void
Example #1
0
 private void OnClientReadyToBegin(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <LobbyReadyToBeginMessage>(NetworkLobbyManager.s_LobbyReadyToBeginMessage);
     if ((int)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId >= this.lobbySlots.Count <NetworkLobbyPlayer>())
     {
         if (LogFilter.logError)
         {
             Debug.LogError("NetworkLobbyManager OnClientReadyToBegin invalid lobby slot " + NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId);
         }
     }
     else
     {
         NetworkLobbyPlayer networkLobbyPlayer = this.lobbySlots[(int)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId];
         if (networkLobbyPlayer == null || networkLobbyPlayer.gameObject == null)
         {
             if (LogFilter.logError)
             {
                 Debug.LogError("NetworkLobbyManager OnClientReadyToBegin no player at lobby slot " + NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId);
             }
         }
         else
         {
             networkLobbyPlayer.readyToBegin = NetworkLobbyManager.s_LobbyReadyToBeginMessage.readyState;
             networkLobbyPlayer.OnClientReady(NetworkLobbyManager.s_LobbyReadyToBeginMessage.readyState);
         }
     }
 }
 private void OnClientReadyToBegin(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <LobbyReadyToBeginMessage>(NetworkLobbyManager.s_LobbyReadyToBeginMessage);
     if ((int)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId >= ((IEnumerable <NetworkLobbyPlayer>) this.lobbySlots).Count <NetworkLobbyPlayer>())
     {
         if (!LogFilter.logError)
         {
             return;
         }
         Debug.LogError((object)("NetworkLobbyManager OnClientReadyToBegin invalid lobby slot " + (object)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId));
     }
     else
     {
         NetworkLobbyPlayer lobbySlot = this.lobbySlots[(int)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId];
         if ((Object)lobbySlot == (Object)null || (Object)lobbySlot.gameObject == (Object)null)
         {
             if (!LogFilter.logError)
             {
                 return;
             }
             Debug.LogError((object)("NetworkLobbyManager OnClientReadyToBegin no player at lobby slot " + (object)NetworkLobbyManager.s_LobbyReadyToBeginMessage.slotId));
         }
         else
         {
             lobbySlot.readyToBegin = NetworkLobbyManager.s_LobbyReadyToBeginMessage.readyState;
             lobbySlot.OnClientReady(NetworkLobbyManager.s_LobbyReadyToBeginMessage.readyState);
         }
     }
 }
Example #3
0
        private void OnClientReadyToBegin(NetworkMessage netMsg)
        {
            netMsg.ReadMessage(s_LobbyReadyToBeginMessage);
            if (s_LobbyReadyToBeginMessage.slotId >= lobbySlots.Count())
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("NetworkLobbyManager OnClientReadyToBegin invalid lobby slot " + s_LobbyReadyToBeginMessage.slotId);
                }
                return;
            }
            NetworkLobbyPlayer networkLobbyPlayer = lobbySlots[s_LobbyReadyToBeginMessage.slotId];

            if (networkLobbyPlayer == null || networkLobbyPlayer.gameObject == null)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("NetworkLobbyManager OnClientReadyToBegin no player at lobby slot " + s_LobbyReadyToBeginMessage.slotId);
                }
            }
            else
            {
                networkLobbyPlayer.readyToBegin = s_LobbyReadyToBeginMessage.readyState;
                networkLobbyPlayer.OnClientReady(s_LobbyReadyToBeginMessage.readyState);
            }
        }