Exemplo n.º 1
0
 private void GarrisonDataResultHandler(LegionCompanionWrapper.GarrisonDataRequestResultEvent eventArgs)
 {
     PersistentFollowerData.ClearData();
     PersistentMissionData.ClearData();
     PersistentTalentData.ClearData();
     if (this.GarrisonDataResetStartedAction != null)
     {
         this.GarrisonDataResetStartedAction();
     }
     GarrisonStatus.SetFaction(eventArgs.Data.PvpFaction);
     GarrisonStatus.SetGarrisonServerConnectTime(eventArgs.Data.ServerTime);
     GarrisonStatus.SetCurrencies(eventArgs.Data.GoldCurrency, eventArgs.Data.OrderhallResourcesCurrency, eventArgs.Data.WarResourcesCurrency);
     GarrisonStatus.SetCharacterName(eventArgs.Data.CharacterName);
     GarrisonStatus.SetCharacterLevel(eventArgs.Data.CharacterLevel);
     GarrisonStatus.SetCharacterClass(eventArgs.Data.CharacterClassID);
     for (int i = 0; i < eventArgs.Data.Followers.Count; i++)
     {
         WrapperGarrisonFollower wrapperGarrisonFollower = eventArgs.Data.Followers[i];
         if (StaticDB.garrFollowerDB.GetRecord(wrapperGarrisonFollower.GarrFollowerID) != null)
         {
             PersistentFollowerData.AddOrUpdateFollower(wrapperGarrisonFollower);
             bool flag = (wrapperGarrisonFollower.Flags & 8) != 0;
             if (flag && wrapperGarrisonFollower.Durability <= 0 && this.TroopExpiredAction != null)
             {
                 this.TroopExpiredAction(wrapperGarrisonFollower);
             }
         }
     }
     for (int j = 0; j < eventArgs.Data.Missions.Count; j++)
     {
         PersistentMissionData.AddMission(eventArgs.Data.Missions[j]);
     }
     for (int k = 0; k < eventArgs.Data.Talents.Count; k++)
     {
         PersistentTalentData.AddOrUpdateTalent(eventArgs.Data.Talents[k]);
     }
     if (!GarrisonStatus.Initialized)
     {
         this.GarrisonDataResetFinishedAction += this.HandleEnterWorld;
         GarrisonStatus.Initialized            = true;
     }
     if (this.GarrisonDataResetFinishedAction != null)
     {
         this.GarrisonDataResetFinishedAction();
     }
     if (this.FollowerDataChangedAction != null)
     {
         this.FollowerDataChangedAction();
     }
     Singleton <Login> .Instance.MobileLoginDataRequestComplete();
 }
Exemplo n.º 2
0
 public void MobileLoggedIn()
 {
     PersistentArmamentData.ClearData();
     PersistentBountyData.ClearData();
     PersistentEquipmentData.ClearData();
     PersistentFollowerData.ClearData();
     PersistentFollowerData.ClearPreMissionFollowerData();
     PersistentMissionData.ClearData();
     PersistentShipmentData.ClearData();
     PersistentTalentData.ClearData();
     MissionDataCache.ClearData();
     WorldQuestData.ClearData();
     ItemStatCache.instance.ClearItemStats();
     GarrisonStatus.Initialized = false;
     MobileClient.SetCommunityID(Singleton <CharacterData> .Instance.CommunityID);
     MobileClient.Initialize();
     Singleton <GarrisonWrapper> .Instance.MobileRequestData();
 }