コード例 #1
0
    private void MobileClientCompleteMissionResultHandler(MobileClientCompleteMissionResult msg)
    {
        Debug.Log(string.Concat(new object[]
        {
            "CompleteMissionResult: ID=",
            msg.GarrMissionID,
            ", result=",
            msg.Result,
            " success chance was ",
            msg.MissionSuccessChance
        }));
        PersistentMissionData.UpdateMission(msg.Mission);
        if (this.CompleteMissionResultAction != null)
        {
            this.CompleteMissionResultAction.Invoke(msg.GarrMissionID, msg.Result, (int)msg.MissionSuccessChance);
        }
        MobilePlayerGarrisonDataRequest mobilePlayerGarrisonDataRequest = new MobilePlayerGarrisonDataRequest();

        mobilePlayerGarrisonDataRequest.GarrTypeID = 3;
        Login.instance.SendToMobileServer(mobilePlayerGarrisonDataRequest);
        MobilePlayerRequestShipmentTypes obj = new MobilePlayerRequestShipmentTypes();

        Login.instance.SendToMobileServer(obj);
        MobilePlayerRequestShipments obj2 = new MobilePlayerRequestShipments();

        Login.instance.SendToMobileServer(obj2);
        MobilePlayerFollowerEquipmentRequest mobilePlayerFollowerEquipmentRequest = new MobilePlayerFollowerEquipmentRequest();

        mobilePlayerFollowerEquipmentRequest.GarrFollowerTypeID = 4;
        Login.instance.SendToMobileServer(mobilePlayerFollowerEquipmentRequest);
    }
コード例 #2
0
 private void OnEnable()
 {
     this.GetRequestedMissionCollectionDictionary().Clear();
     this.okButton.SetActive(false);
     this.mainCanvas.renderMode = 1;
     if (GarrisonStatus.Faction() == PVP_FACTION.HORDE)
     {
         this.hordeCommander.SetActive(true);
         this.allianceCommander.SetActive(false);
     }
     else
     {
         this.hordeCommander.SetActive(false);
         this.allianceCommander.SetActive(true);
     }
     this.completedMissionsText.text = string.Empty + PersistentMissionData.GetNumCompletedMissions(false) + " Completed Missions";
     MissionListItem[] componentsInChildren = this.completedMissionListContents.GetComponentsInChildren <MissionListItem>(true);
     for (int i = 0; i < componentsInChildren.Length; i++)
     {
         Object.DestroyImmediate(componentsInChildren[i].gameObject);
     }
     MissionRewardDisplay[] componentsInChildren2 = this.missionRewardsIconArea.GetComponentsInChildren <MissionRewardDisplay>(true);
     for (int j = 0; j < componentsInChildren2.Length; j++)
     {
         Object.DestroyImmediate(componentsInChildren2[j].gameObject);
     }
     this.missionReportView.SetActive(true);
     this.missionResultsView.SetActive(false);
 }
コード例 #3
0
 private void MobileClientClaimMissionBonusResultHandler(MobileClientClaimMissionBonusResult msg)
 {
     PersistentMissionData.UpdateMission(msg.Mission);
     if (this.ClaimMissionBonusResultAction != null)
     {
         this.ClaimMissionBonusResultAction.Invoke(msg.GarrMissionID, msg.AwardOvermax, msg.Result);
     }
 }
コード例 #4
0
    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();
        }
    }
コード例 #5
0
 private void MobileClientMissionAddedHandler(MobileClientMissionAdded msg)
 {
     if (msg.Result == 0 && msg.Mission.MissionRecID != 0)
     {
         PersistentMissionData.AddMission(msg.Mission);
     }
     else
     {
         GARRISON_RESULT result = (GARRISON_RESULT)msg.Result;
         Debug.Log(string.Concat(new object[]
         {
             "Error adding mission: ",
             result.ToString(),
             " Mission ID:",
             msg.Mission.MissionRecID
         }));
     }
     if (this.MissionAddedAction != null)
     {
         this.MissionAddedAction.Invoke(msg.Mission.MissionRecID, msg.Result);
     }
 }
コード例 #6
0
 private void Update()
 {
     this.completedMissionsText.text = string.Empty + PersistentMissionData.GetNumCompletedMissions(false) + " Completed Missions";
 }
コード例 #7
0
    private void Update()
    {
        int numCompletedMissions = PersistentMissionData.GetNumCompletedMissions(true);

        if (numCompletedMissions != this.m_numReadyTroops)
        {
            this.m_theActualButton.SetActive(numCompletedMissions > 0);
            if (numCompletedMissions == 0)
            {
                this.ClearEffects();
            }
            if (numCompletedMissions > this.m_numReadyTroops)
            {
                this.ClearEffects();
                this.m_glowHandle     = UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", this.m_theActualButton.get_transform(), Vector3.get_zero(), 3f, 0f);
                this.m_glowLoopHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_theActualButton.get_transform(), Vector3.get_zero(), 3f, 0f);
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobble",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    0.1f,
                    "looptype",
                    iTween.LoopType.none
                }));
                iTween.PunchScale(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitWobbleL",
                    "x",
                    this.amount,
                    "y",
                    this.amount,
                    "time",
                    this.duration,
                    "delay",
                    this.delay,
                    "looptype",
                    iTween.LoopType.loop
                }));
                iTween.PunchRotation(this.m_theActualButton, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitButtonSwing",
                    "z",
                    -30f,
                    "time",
                    2f
                }));
                iTween.PunchRotation(this.m_numReadyTroopsTextBG, iTween.Hash(new object[]
                {
                    "name",
                    "RecruitNumSwing",
                    "z",
                    -50f,
                    "time",
                    3f
                }));
                Main.instance.m_UISound.Play_LootReady();
            }
            this.m_numReadyTroops = numCompletedMissions;
            this.m_numReadyTroopsText.set_text(string.Empty + ((this.m_numReadyTroops <= 0) ? string.Empty : (string.Empty + this.m_numReadyTroops)));
            this.m_numReadyTroopsTextBG.SetActive(this.m_numReadyTroops > 0);
        }
    }
コード例 #8
0
 public static void UpdateMission(JamGarrisonMobileMission mission)
 {
     PersistentMissionData.instance.m_missionDictionary.Remove(mission.MissionRecID);
     PersistentMissionData.AddMission(mission);
 }
 private void Update()
 {
     this.completedMissionsText.set_text(string.Empty + PersistentMissionData.GetNumCompletedMissions() + " Completed Missions");
 }
コード例 #10
0
    private void Update()
    {
        switch (this.m_navButtonType)
        {
        case OrderHallNavButton.NavButtonType.missions:
        {
            int numCompletedMissions = PersistentMissionData.GetNumCompletedMissions(true);
            if (numCompletedMissions == 0 && this.m_notificationBadgeRoot.activeSelf)
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (numCompletedMissions > 0)
            {
                if (!this.m_notificationBadgeRoot.activeSelf)
                {
                    this.m_notificationBadgeRoot.SetActive(true);
                }
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.transform, Vector3.zero, 1f, 0f);
                }
                this.m_notificationBadgeText.text = string.Empty + numCompletedMissions;
            }
            break;
        }

        case OrderHallNavButton.NavButtonType.recruit:
        {
            int num = PersistentShipmentData.GetNumReadyShipments();
            if (ArtifactKnowledgeData.s_artifactKnowledgeInfo != null && ArtifactKnowledgeData.s_artifactKnowledgeInfo.CurrentLevel < ArtifactKnowledgeData.s_artifactKnowledgeInfo.MaxLevel)
            {
                num += ArtifactKnowledgeData.s_artifactKnowledgeInfo.ItemsInBags;
            }
            if (num == 0 && this.m_notificationBadgeRoot.activeSelf)
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (num > 0)
            {
                if (!this.m_notificationBadgeRoot.activeSelf)
                {
                    this.m_notificationBadgeRoot.SetActive(true);
                }
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.transform, Vector3.zero, 1f, 0f);
                }
                this.m_notificationBadgeText.text = string.Empty + num;
            }
            break;
        }

        case OrderHallNavButton.NavButtonType.talents:
        {
            bool flag = AllPanels.instance.m_talentTreePanel.TalentIsReadyToPlayGreenCheckAnim();
            if (!flag && this.m_notificationBadgeRoot.activeSelf)
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (flag && !this.m_notificationBadgeRoot.activeSelf)
            {
                this.m_notificationBadgeRoot.SetActive(true);
                this.m_notificationBadgeText.text = "1";
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.transform, Vector3.zero, 1f, 0f);
                }
            }
            break;
        }
        }
    }
コード例 #11
0
    private void Update()
    {
        switch (this.m_navButtonType)
        {
        case OrderHallNavButton.NavButtonType.missions:
        {
            int numCompletedMissions = PersistentMissionData.GetNumCompletedMissions(true);
            if (numCompletedMissions == 0 && this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (numCompletedMissions > 0)
            {
                if (!this.m_notificationBadgeRoot.get_activeSelf())
                {
                    this.m_notificationBadgeRoot.SetActive(true);
                }
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.get_transform(), Vector3.get_zero(), 1f, 0f);
                }
                this.m_notificationBadgeText.set_text(string.Empty + numCompletedMissions);
            }
            break;
        }

        case OrderHallNavButton.NavButtonType.recruit:
        {
            int numReadyShipments = PersistentShipmentData.GetNumReadyShipments();
            if (numReadyShipments == 0 && this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (numReadyShipments > 0)
            {
                if (!this.m_notificationBadgeRoot.get_activeSelf())
                {
                    this.m_notificationBadgeRoot.SetActive(true);
                }
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.get_transform(), Vector3.get_zero(), 1f, 0f);
                }
                this.m_notificationBadgeText.set_text(string.Empty + numReadyShipments);
            }
            break;
        }

        case OrderHallNavButton.NavButtonType.talents:
        {
            bool flag = AllPanels.instance.m_talentTreePanel.TalentIsReadyToPlayGreenCheckAnim();
            if (!flag && this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(false);
            }
            else if (flag && !this.m_notificationBadgeRoot.get_activeSelf())
            {
                this.m_notificationBadgeRoot.SetActive(true);
                this.m_notificationBadgeText.set_text("1");
                if (this.m_notificationPulseHandle == null)
                {
                    this.m_notificationPulseHandle = UiAnimMgr.instance.PlayAnim("MinimapLoopPulseAnim", this.m_notificationBadgeRoot.get_transform(), Vector3.get_zero(), 1f, 0f);
                }
            }
            break;
        }
        }
    }