예제 #1
0
파일: FSPManager.cs 프로젝트: zj831007/SGF
        public void Start(FSPParam param, uint playerId)
        {
            m_Param        = param;
            m_MinePlayerId = playerId;
            LOG_TAG        = "FSPManager[" + playerId + "]";

            Debuger.Log();

            if (m_Param.useLocal)
            {
                m_LockedFrameIndex = param.maxFrameId;
            }
            else
            {
                m_Client = new FSPClient();
                m_Client.Init(m_Param.sid);
                m_Client.SetFSPAuthInfo(param.authId);
                m_Client.SetFSPListener(OnFSPListener);

                m_Client.Connect(param.host, param.port);
                m_Client.VerifyAuth();

                m_LockedFrameIndex = m_Param.clientFrameRateMultiple - 1;
            }

            m_IsRunning = true;
            m_GameState = FSPGameState.Create;

            m_FrameBuffer       = new DictionarySafe <int, FSPFrame>();
            m_CurrentFrameIndex = 0;

            m_FrameCtrl = new FSPFrameController();
            m_FrameCtrl.Start(param);
        }
예제 #2
0
        public void Start(FSPParam param, uint playerId)
        {
            mParam        = param;
            mMinePlayerId = playerId;
            LOG_TAG       = "FSPManager[" + playerId + "]";

            if (!mParam.useLocal)
            {
                mClientLockedFrame = mParam.clientFrameRateMultiple - 1;

                mClient = new FSPClient();
                mClient.SetSessionId((ushort)param.sid);
                mClient.SetFSPAuthInfo(param.authId);
                mClient.Connect(param.host, param.port);
                mClient.SetFSPListener(OnFSPListener);
                mClient.VerifyAuth();
            }
            else
            {
                mClientLockedFrame = param.maxFrameId;
            }

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

            mFrameBuffer = new DictionaryExt <int, FSPFrame>();

            mIsRunning         = true;
            mGameState         = FSPGameState.Create;
            mCurrentFrameIndex = 0;
        }