示例#1
0
    public void Update(float deltaTime)
    {
        /*
         * if (mTimeoutShowing && PlatNetwork.Instance.IsEnterPlatTimeout())
         * {
         *      ReconnectPrompt(CommonFunction.GetConstString("NETWORK_UNSTABLE_RETRY_LATER"));
         *      mTimeoutShowing = false;
         * }
         */

        if (autoReconn && (DateTime.Now.Ticks - connFailTime) > 30000000)
        {
            autoReconn = false;
            if (CanAutoReconn())
            {
                Reconnect();
            }
        }

        if (m_loginConn != null)
        {
            m_loginConn.Update(deltaTime);
        }

        if (m_platConn != null)
        {
            m_platConn.Update(deltaTime);
        }

        if (m_gameConn != null)
        {
            m_gameConn.Update(deltaTime);
        }
    }
示例#2
0
    static int Update(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        NetworkConn obj  = (NetworkConn)LuaScriptMgr.GetNetObjectSelf(L, 1, "NetworkConn");
        float       arg0 = (float)LuaScriptMgr.GetNumber(L, 2);

        obj.Update(arg0);
        return(0);
    }
示例#3
0
    //For virtual game server
    public static void SendTurn(PlayFrame turn)
    {
        NetworkConn conn = GameSystem.Instance.mNetworkManager.m_gameConn;

        if (conn == null)
        {
            return;
        }
        conn.SendPack <PlayFrame>(0, turn, MsgID.PlayFrameID);
        //Debug.Log("VirtualGameServer, SendTurn " + turn.frameNum);

        //如果使用的是虚拟连接,保证消息立即传回客户端
        if (conn.m_type == NetworkConn.Type.eVirtualServer)
        {
            conn.Update(0f);
        }
    }
示例#4
0
    public void FixedUpdate(float fDeltaTime)
    {
        if (m_loginConn != null)
        {
            m_loginConn.Update(fDeltaTime);
        }

        if (m_platConn != null)
        {
            m_platConn.Update(fDeltaTime);
        }

        if (m_gameConn != null)
        {
            m_gameConn.Update(fDeltaTime);
        }
    }