示例#1
0
        public void Stop()
        {
            m_GameState = FSPGameState.None;

            if (m_Client != null)
            {
                m_Client.Close();
                m_Client = null;
            }

            if (m_FrameCtrl != null)
            {
                m_FrameCtrl.Close();
                m_FrameCtrl = null;
            }

            m_FrameListener = null;
            m_FrameBuffer.Clear();
            m_IsRunning = false;

            onGameBegin    = null;
            onRoundBegin   = null;
            onControlStart = null;
            onGameEnd      = null;
            onRoundEnd     = null;
        }
示例#2
0
        public void Start(FSPParam param, uint playerId)
        {
            m_Param        = param;
            m_MinePlayerId = playerId;
            LOG_TAG        = "FSPManager[" + playerId + "]";

            if (!m_Param.UseLocal)
            {
                m_ClientLockedFrame = m_Param.ClientFrameRateMultiple - 1;

                m_Client = new FSPClient();
                m_Client.SetSessionId(param.Sid);
                m_Client.SetFSPAuthInfo(param.AuthId);
                m_Client.Connect();
                m_Client.SetFSPListener(OnFSPListener);
                m_Client.VerifyAuth();
            }
            else
            {
                m_ClientLockedFrame = param.MaxFrameId;
            }

            m_FrameCtrl = new FSPFrameController();
            m_FrameCtrl.Start(param);

            m_FrameBuffer = new Dictionary <int, FSPFrame>();

            m_IsRunning         = true;
            m_GameState         = FSPGameState.Create;
            m_CurrentFrameIndex = 0;
        }