private void TryStartOberving() { if (Singleton <PvpManager> .Instance.IsObserver) { PvpStateBase.LogState("observing is starting"); PvpStateManager.Instance.ChangeState(new PvpStateStart(PvpStateCode.PvpStart)); } }
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); }
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(); } }