private void MobileClientChangeFollowerActiveResultHandler(MobileClientChangeFollowerActiveResult msg) { GARRISON_RESULT result = (GARRISON_RESULT)msg.Result; if (result == GARRISON_RESULT.SUCCESS) { PersistentFollowerData.AddOrUpdateFollower(msg.Follower); FollowerStatus followerStatus = GeneralHelpers.GetFollowerStatus(msg.Follower); if (followerStatus == FollowerStatus.inactive) { Debug.Log("Follower is now inactive. " + msg.ActivationsRemaining + " activations remain for the day."); } else { Debug.Log("Follower is now active. " + msg.ActivationsRemaining + " activations remain for the day."); } if (this.FollowerDataChangedAction != null) { this.FollowerDataChangedAction.Invoke(); } MobilePlayerFollowerActivationDataRequest mobilePlayerFollowerActivationDataRequest = new MobilePlayerFollowerActivationDataRequest(); mobilePlayerFollowerActivationDataRequest.GarrTypeID = 3; Login.instance.SendToMobileServer(mobilePlayerFollowerActivationDataRequest); } else { Debug.Log("Follower activation/deactivation failed for reason " + result.ToString()); } }
private void MobileClientFollowerChangedQualityHandler(MobileClientFollowerChangedQuality msg) { PersistentFollowerData.AddOrUpdateFollower(msg.Follower); if (this.UseEquipmentResultAction != null) { this.UseEquipmentResultAction.Invoke(msg.OldFollower, msg.Follower); } MobilePlayerFollowerEquipmentRequest mobilePlayerFollowerEquipmentRequest = new MobilePlayerFollowerEquipmentRequest(); mobilePlayerFollowerEquipmentRequest.GarrFollowerTypeID = 4; Login.instance.SendToMobileServer(mobilePlayerFollowerEquipmentRequest); }
private void MobileClientGarrisonDataRequestResultHandler(MobileClientGarrisonDataRequestResult msg) { PersistentFollowerData.ClearData(); PersistentMissionData.ClearData(); PersistentTalentData.ClearData(); if (this.GarrisonDataResetStartedAction != null) { this.GarrisonDataResetStartedAction.Invoke(); } GarrisonStatus.SetFaction(msg.PvpFaction); GarrisonStatus.SetGarrisonServerConnectTime(msg.ServerTime); GarrisonStatus.SetCurrencies(msg.GoldCurrency, msg.OilCurrency, msg.OrderhallResourcesCurrency); GarrisonStatus.SetCharacterName(msg.CharacterName); GarrisonStatus.SetCharacterLevel(msg.CharacterLevel); GarrisonStatus.SetCharacterClass(msg.CharacterClassID); uint num = 0u; while ((ulong)num < (ulong)((long)msg.Follower.GetLength(0))) { JamGarrisonFollower jamGarrisonFollower = msg.Follower[(int)((UIntPtr)num)]; PersistentFollowerData.AddOrUpdateFollower(jamGarrisonFollower); bool flag = (jamGarrisonFollower.Flags & 8) != 0; if (flag && jamGarrisonFollower.Durability <= 0) { Debug.Log("Follower " + jamGarrisonFollower.GarrFollowerID + " has expired."); if (this.TroopExpiredAction != null) { this.TroopExpiredAction.Invoke(jamGarrisonFollower); } } num += 1u; } uint num2 = 0u; while ((ulong)num2 < (ulong)((long)msg.Mission.GetLength(0))) { PersistentMissionData.AddMission(msg.Mission[(int)((UIntPtr)num2)]); num2 += 1u; } for (int i = 0; i < msg.Talent.GetLength(0); i++) { PersistentTalentData.AddOrUpdateTalent(msg.Talent[i]); } if (this.GarrisonDataResetFinishedAction != null) { this.GarrisonDataResetFinishedAction.Invoke(); } if (this.FollowerDataChangedAction != null) { this.FollowerDataChangedAction.Invoke(); } }
private void MobileClientUseFollowerArmamentResultHandler(MobileClientUseFollowerArmamentResult msg) { GARRISON_RESULT result = (GARRISON_RESULT)msg.Result; if (result == GARRISON_RESULT.SUCCESS) { PersistentFollowerData.AddOrUpdateFollower(msg.Follower); MobilePlayerFollowerArmamentsRequest mobilePlayerFollowerArmamentsRequest = new MobilePlayerFollowerArmamentsRequest(); mobilePlayerFollowerArmamentsRequest.GarrFollowerTypeID = 4; Login.instance.SendToMobileServer(mobilePlayerFollowerArmamentsRequest); } else { AllPopups.instance.ShowGenericPopup(StaticDB.GetString("USE_ARMAMENT_FAILED", null), result.ToString()); } if (this.UseArmamentResultAction != null) { this.UseArmamentResultAction.Invoke(msg.Result, msg.OldFollower, msg.Follower); } }