public void OnExceptionSocket(short errorCode, string errorMessage) { global::Debug.Log("OnExceptionSocket"); RestrictionInput.EndLoad(); if (this.syncData != null) { this.syncData.StopSync(); this.syncData = null; } if (this.httpRequestRoutine != null) { base.StopCoroutine(this.httpRequestRoutine); this.httpRequestRoutine = null; } if (this.animeRoutine != null) { base.StopCoroutine(this.animeRoutine); this.animeRoutine = null; } if (errorCode != 741) { this.uiRoot.SetErrorData("MultiRecruit-13", "ColosseumNetworkError"); this.uiRoot.ClosePanel(true); } }
public void OnSyncMatchingFinish() { global::Debug.Log("OnSyncMatchingFinish"); Singleton <TCPUtil> .Instance.ResetAllCallBackMethod(); if (this.syncData != null) { this.syncData.StopSync(); this.syncData = null; } ClassSingleton <MultiBattleData> .Instance.MaxAttackTime = ConstValue.PVP_MAX_ATTACK_TIME; ClassSingleton <MultiBattleData> .Instance.HurryUpAttackTime = ConstValue.PVP_HURRYUP_ATTACK_TIME; ClassSingleton <MultiBattleData> .Instance.MaxRoundNum = ConstValue.PVP_MAX_ROUND_NUM; ClassSingleton <MultiBattleData> .Instance.MyPlayerUserId = DataMng.Instance().UserId; ClassSingleton <MultiBattleData> .Instance.PvPUserDatas = new MultiBattleData.PvPUserData[] { this.matchingResult.myData, this.matchingResult.opponentData }; ClassSingleton <MultiBattleData> .Instance.PvPField = new MultiBattleData.PvPFieldData { worldDungeonId = this.matchingResult.dungeonId }; ClassSingleton <MultiBattleData> .Instance.RandomSeed = this.matchingResult.randomSeed; this.uiRoot.ChangeBattleScene(); }
public ColosseumMatchingNetworkSynchronize GetOpponentReadyStateSync(Func <RequestBase, Coroutine> requestRoutine) { GameWebAPI.ColosseumPrepareStatusLogic opponentReadyCheckRequest = this.matchingInfo.GetOpponentReadyCheckRequest(); ColosseumMatchingNetworkSynchronize colosseumMatchingNetworkSynchronize = new ColosseumMatchingNetworkSynchronize(); colosseumMatchingNetworkSynchronize.SetIntervalAndTrialTime(5f, 15f); colosseumMatchingNetworkSynchronize.SetFailedAction(new Action(this.eventListener.OnFailedSyncMatchingFinish)); colosseumMatchingNetworkSynchronize.SetRequestHTTP(opponentReadyCheckRequest, requestRoutine); return(colosseumMatchingNetworkSynchronize); }
public void OnMonsterSelectTimeOver() { global::Debug.Log("OnMonsterSelectTimeOver"); if (this.syncData == null) { this.syncData = new ColosseumMatchingNetworkSynchronize(); this.syncData.SetFailedAction(new Action(this.OnFailedSelectMonsterSend)); this.syncData.SetWaitReceive(8f); this.syncData.SynchronizeRoutine = base.StartCoroutine(this.syncData.Synchronize()); } }
public void OnExceptionStartBattleResponse(string errorCode) { global::Debug.Log("OnExceptionStartBattleResponse"); if (this.syncData != null) { this.syncData.StopSync(); this.syncData = null; } this.uiRoot.SetAlertData(errorCode); this.network.CloseSocketNetwork(); }
public void OnCancelMatching() { global::Debug.Log("OnCancelMatching"); RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_OFF); if (this.syncData != null) { this.syncData.StopSync(); this.syncData = null; } this.network.StopMatching(); }
public ColosseumMatchingNetworkSynchronize CreateSelectMonsterMessage(List <int> toAddress, int[] selectMonsterIndexList) { PvPEnemyData value = new PvPEnemyData { hashValue = Singleton <TCPUtil> .Instance.CreateHash(TCPMessageType.PvPEnemyData, DataMng.Instance().UserId, TCPMessageType.None), playerUserId = DataMng.Instance().UserId, indexId = selectMonsterIndexList }; this.messageBuffer.Clear(); this.messageBuffer.Add(TCPMessageType.PvPEnemyData.ToString(), value); ColosseumMatchingNetworkSynchronize colosseumMatchingNetworkSynchronize = new ColosseumMatchingNetworkSynchronize(); colosseumMatchingNetworkSynchronize.SetIntervalAndTrialTime(5f, 15f); colosseumMatchingNetworkSynchronize.SetFailedAction(new Action(this.eventListener.OnFailedSelectMonsterSend)); colosseumMatchingNetworkSynchronize.SetMessage(toAddress, this.messageBuffer, "enemyData"); return(colosseumMatchingNetworkSynchronize); }
public void OnSelectedMonster(int[] indexList) { global::Debug.Log("OnSelectedMonster"); List <MonsterData> colosseumDeckUserMonsterList = ClassSingleton <MonsterUserDataMng> .Instance.GetColosseumDeckUserMonsterList(); ColosseumData.LastUseMonsterList = new MonsterData[indexList.Length]; GameWebAPI.Common_MonsterData[] array = new GameWebAPI.Common_MonsterData[indexList.Length]; for (int i = 0; i < indexList.Length; i++) { MonsterData monsterData = colosseumDeckUserMonsterList[indexList[i]]; ColosseumData.LastUseMonsterList[i] = monsterData; array[i] = new GameWebAPI.Common_MonsterData(monsterData); } this.matchingResult.myData.monsterData = array; this.matchingResult.mySelectMonsterIndexList = indexList; RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_OFF); this.syncData = this.network.GetSelectMonsterSync(this.matchingResult.OpponentUserId, indexList); this.syncData.SynchronizeRoutine = base.StartCoroutine(this.syncData.Synchronize()); }
public void OnDeleteMathing() { global::Debug.Log("OnDeleteMathing"); RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_OFF); if (this.syncData != null) { this.syncData.StopSync(); this.syncData = null; } if (this.httpRequestRoutine != null) { base.StopCoroutine(this.httpRequestRoutine); this.httpRequestRoutine = null; } if (this.animeRoutine != null) { base.StopCoroutine(this.animeRoutine); this.animeRoutine = null; } base.StartCoroutine(this.network.SendLoseBattle()); }
public void OnReadyBattleCompleted() { global::Debug.Log("OnReadyBattleCompleted"); if (this.syncData != null) { this.syncData.StopSync(); this.syncData = null; } if (!this.matchingResult.isOpponentLeaveRoom) { this.syncData = this.network.GetOpponentReadyStateSync(delegate(RequestBase request) { this.httpRequestRoutine = base.StartCoroutine(this.network.RequestOpponentReadyCheck(request)); return(this.httpRequestRoutine); }); this.syncData.SynchronizeRoutine = base.StartCoroutine(this.syncData.Synchronize()); } else { this.OnSyncMatchingFinish(); } }
public void OnAckReceivedSelectMonster(int randomSeed) { global::Debug.Log("OnAckReceivedSelectMonster"); if (this.matchingResult.opponentData == null) { return; } this.syncData.StopSync(); this.syncData = null; if (!this.matchingResult.isMySelectedMonster) { this.matchingResult.isMySelectedMonster = true; if (!this.matchingResult.myData.isOwner) { this.matchingResult.randomSeed = randomSeed; } if (this.matchingResult.isOpponentSelectedMonster) { this.network.SaveMatchingFinish(this.matchingResult.mySelectMonsterIndexList, this.matchingResult.opponentSelectMonsterIndexList); } } }