예제 #1
0
 public void StartJudge(COMDT_TGWINFO inTGW)
 {
     if (this.IsWatching || Singleton <BattleLogic> .get_instance().isRuning)
     {
         return;
     }
     this._workMode = WatchController.WorkMode.Judge;
     this.IsRunning = true;
     this._tgw      = inTGW;
     if (this._tgw != null)
     {
         NetworkModule.InitRelayConnnecting(this._tgw);
     }
 }
예제 #2
0
 public void Stop()
 {
     if (this._workMode == WatchController.WorkMode.Replay)
     {
         Singleton <GameReplayModule> .GetInstance().StopReplay();
     }
     this.SpeedRate  = 1;
     this._isRunning = false;
     this._recvBuff  = null;
     this._pkgQueue  = null;
     this._overTime  = 0f;
     this.TargetUID  = 0uL;
     this._workMode  = WatchController.WorkMode.None;
     this.CloseConnect();
 }
예제 #3
0
 public void StartReplay(string replayPath)
 {
     if (this.IsWatching || Singleton <BattleLogic> .get_instance().isRuning)
     {
         return;
     }
     if (Singleton <GameReplayModule> .GetInstance().BeginReplay(replayPath, false))
     {
         this._workMode = WatchController.WorkMode.Replay;
         this._overTime = 0f;
         this.IsRunning = true;
         this.SpeedRate = 1;
     }
     else
     {
         Singleton <CUIManager> .GetInstance().OpenTips("Can not play file: " + replayPath, false, 2f, null, new object[0]);
     }
     this._tgw = null;
 }
        public void StartReplay(string replayPath)
        {
            if (this.IsWatching || Singleton <BattleLogic> .instance.isRuning)
            {
                Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("Last_match_isnot_clean"), false, 1.5f, null, new object[0]);

                return;
            }
            if (Singleton <GameReplayModule> .GetInstance().BeginReplay(replayPath))
            {
                this._workMode     = WatchController.WorkMode.Replay;
                this._overTime     = 0f;
                this.FightOverJust = false;
                this.IsRunning     = true;
                this.SpeedRate     = 1;
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips("Can not play file: " + replayPath, false, 2f, null, new object[0]);
            }
            this._tgw = null;
        }
        public bool StartObserve(COMDT_TGWINFO inTGW)
        {
            if (this.IsWatching || Singleton <BattleLogic> .instance.isRuning)
            {
                return(false);
            }
            this._workMode        = WatchController.WorkMode.Observe;
            this._overTime        = 0f;
            this.FightOverJust    = false;
            this.IsRunning        = true;
            this.SpeedRate        = 1;
            this._recvBuff        = new byte[409600];
            this._buffRecvSize    = 0u;
            this._totalRecvSize   = 0u;
            this._pkgQueue        = new Queue <object>(1000);
            this._maxFrameNo      = 0u;
            this._isStreamEnd     = false;
            this._thisTick        = 0u;
            this._lastRequestTick = 0u;
            ResGlobalInfo resGlobalInfo = new ResGlobalInfo();

            if (GameDataMgr.svr2CltCfgDict.TryGetValue(215u, out resGlobalInfo))
            {
                this._observeDelayFrames = (uint)Mathf.Clamp((int)(resGlobalInfo.dwConfValue * 1000u / Singleton <FrameSynchr> .GetInstance().SvrFrameDelta), 0, 4500);
            }
            else
            {
                this._observeDelayFrames = 900u;
            }
            this._tgw = inTGW;
            if (this._tgw != null)
            {
                NetworkModule.InitRelayConnnecting(this._tgw);
            }
            this.RequestVideoPiece(true);
            return(true);
        }