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
 private void MissionAddedHandler(LegionCompanionWrapper.MissionAddedEvent eventArgs)
 {
     if (eventArgs.Result == 0 && eventArgs.Mission.MissionRecID != 0)
     {
         PersistentMissionData.AddMission(eventArgs.Mission);
     }
     else
     {
         Debug.Log(string.Concat(new object[]
         {
             "Error adding mission: ",
             ((GARRISON_RESULT)eventArgs.Result).ToString(),
             " Mission ID:",
             eventArgs.Mission.MissionRecID
         }));
     }
     if (this.MissionAddedAction != null)
     {
         this.MissionAddedAction(eventArgs.Mission.MissionRecID, eventArgs.Result);
     }
 }
Exemplo n.º 3
0
 public static void UpdateMission(WrapperGarrisonMission mission)
 {
     PersistentMissionData.instance.m_missionDictionary.Remove(mission.MissionRecID);
     PersistentMissionData.AddMission(mission);
 }