Esempio n. 1
0
        public static bool Ready(NetworkConnection conn)
        {
            if (s_IsReady)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("A connection has already been set as ready. There can only be one.");
                }
                return(false);
            }

            if (LogFilter.logDebug)
            {
                Debug.Log("ClientScene::Ready() called with connection [" + conn + "]");
            }

            if (conn != null)
            {
                var msg = new ReadyMessage();
                conn.Send((short)MsgType.Ready, msg);
                s_IsReady                 = true;
                s_ReadyConnection         = conn;
                s_ReadyConnection.isReady = true;
                return(true);
            }
            if (LogFilter.logError)
            {
                Debug.LogError("Ready() called with invalid connection object: conn=null");
            }
            return(false);
        }
Esempio n. 2
0
 // default ready handler.
 static void OnClientReadyMessage(NetworkConnection conn, ReadyMessage msg)
 {
     if (LogFilter.Debug)
     {
         Debug.Log("Default handler for ready message from " + conn);
     }
     SetClientReady(conn);
 }
Esempio n. 3
0
 internal void OnServerReadyMessageInternal(NetworkConnection conn, ReadyMessage msg)
 {
     if (LogFilter.Debug)
     {
         Debug.Log("NetworkManager.OnServerReadyMessageInternal");
     }
     OnServerReady(conn);
 }
Esempio n. 4
0
 /// <summary>
 /// default ready handler.
 /// </summary>
 /// <param name="conn"></param>
 /// <param name="msg"></param>
 void OnClientReadyMessage(INetworkConnection conn, ReadyMessage msg)
 {
     if (logger.LogEnabled())
     {
         logger.Log("Default handler for ready message from " + conn);
     }
     SetClientReady(conn);
 }