Esempio n. 1
0
 public bool HandlePvpMsg(PvpCode msgID, object msgParam)
 {
     if (this.IsReplaying)
     {
         return(true);
     }
     if (this.IsRecording && msgID != PvpCode.C2P_Ping && msgID != PvpCode.P2C_TipMessage)
     {
         OperationResponse operationResponse = msgParam as OperationResponse;
         ReplayMessage     msg;
         if (operationResponse != null)
         {
             msg = new ReplayMessage
             {
                 time  = ReplayController.GetRecordTimeOffset(),
                 code  = msgID,
                 param = operationResponse.Parameters[0] as byte[]
             };
         }
         else
         {
             msg = new ReplayMessage
             {
                 time  = ReplayController.GetRecordTimeOffset(),
                 code  = msgID,
                 param = msgParam as byte[]
             };
         }
         this._replayMessageIO.Push(msg);
     }
     return(false);
 }
Esempio n. 2
0
 public void StartRecord()
 {
     this._state              = ReplayController.State.Recording;
     this._curReplayId        = ReplayController.GetReplayId();
     this._curRecordMetaEntry = new ReplayMetaInfo.ReplayMetaEntry
     {
         ReplayId   = this._curReplayId,
         ReplayFile = this._curReplayId + ".rep"
     };
     this._replayMessageIO = new ReplayMessageIO(ReplayController.ReplayStoreDir + "/" + this._curRecordMetaEntry.ReplayFile);
     if (this.IsSavedReconnectSyncMsgValid())
     {
         this._replayMessageIO.Push(this.GetSavedReconnectSyncMsg());
     }
 }