Пример #1
0
 private void TryStartOberving()
 {
     if (Singleton <PvpManager> .Instance.IsObserver)
     {
         PvpStateBase.LogState("observing is starting");
         PvpStateManager.Instance.ChangeState(new PvpStateStart(PvpStateCode.PvpStart));
     }
 }
Пример #2
0
        private void P2C_QueryInFightInfo(MobaMessage msg)
        {
            OperationResponse operationResponse = msg.Param as OperationResponse;

            byte[] array = (byte[])operationResponse.Parameters[0];
            InBattleRuntimeInfo inBattleRuntimeInfo = SerializeHelper.Deserialize <InBattleRuntimeInfo>(array);

            if (array.Length == 0)
            {
                inBattleRuntimeInfo = null;
            }
            PvpStateBase.LogState("receive P2C_QueryInFightInfo " + StringUtils.DumpObject(inBattleRuntimeInfo));
            this.SyncFightInfo(inBattleRuntimeInfo);
        }
Пример #3
0
 private void SyncFightInfo(InBattleRuntimeInfo fightInfo)
 {
     if (fightInfo == null)
     {
         PvpStateBase.LogState("no fight info");
         this.TryStartOberving();
         return;
     }
     if (fightInfo.roomState == 3)
     {
         Singleton <PvpManager> .Instance.AbandonGame(PvpErrorCode.StateError);
     }
     else
     {
         PvpProtocolTools.SyncFightInfo(fightInfo);
         this.TryStartOberving();
     }
 }