public override void Start() { if (this.parent.MissionVO.Grind) { MissionIdRequest request = new MissionIdRequest(this.parent.MissionVO.Uid); GetMissionMapCommand getMissionMapCommand = new GetMissionMapCommand(request); getMissionMapCommand.AddSuccessCallback(new AbstractCommand <MissionIdRequest, GetMissionMapResponse> .OnSuccessCallback(this.OnServerGrindSelectionCompleteOnSuccess)); Service.Get <ServerAPI>().Sync(getMissionMapCommand); return; } this.data = BattleInitializationData.CreateFromCampaignMissionVO(this.parent.MissionVO.Uid); this.LoadBattle(); }
public void CollectMission(CampaignMissionVO missionType) { if (!this.progress.IsMissionCollected(missionType)) { Service.Get <EventManager>().SendEvent(EventId.MissionCollecting, missionType); this.rm.TryAndGrantReward(missionType.Rewards, new RewardManager.SuccessCallback(this.OnMissionCollectSuccess), missionType); MissionIdRequest request = new MissionIdRequest(missionType.Uid); if (this.IsPveMission(missionType.MissionType)) { this.server.Enqueue(new PveMissionCollectCommand(request)); return; } this.server.Enqueue(new ClaimMissionCommand(request)); } }
public void StartMission(CampaignMissionVO vo) { if (!string.IsNullOrEmpty(vo.Uid) && this.missions.ContainsKey(vo.Uid)) { Mission mission = this.missions[vo.Uid]; if (vo.Grind) { mission.GrindMissionRetries++; } if (!mission.Activated) { MissionIdRequest request = new MissionIdRequest(vo.Uid); Service.Get <ServerAPI>().Sync(new ActivateMissionCommand(request)); mission.Activated = true; } } }