コード例 #1
0
 private void MobileClientStartMissionResultHandler(MobileClientStartMissionResult msg)
 {
     Debug.Log(string.Concat(new object[]
     {
         "StartMissionResult: ID=",
         msg.GarrMissionID,
         ", result=",
         msg.Result
     }));
     if (msg.Result != 0)
     {
         GARRISON_RESULT result = (GARRISON_RESULT)msg.Result;
         string          text   = result.ToString();
         if (result == GARRISON_RESULT.FOLLOWER_SOFT_CAP_EXCEEDED)
         {
             text = StaticDB.GetString("TOO_MANY_ACTIVE_CHAMPIONS", null);
             AllPopups.instance.ShowGenericPopup(StaticDB.GetString("MISSION_START_FAILED", null), text);
         }
         else if (result == GARRISON_RESULT.MISSION_MISSING_REQUIRED_FOLLOWER)
         {
             text = StaticDB.GetString("MISSING_REQUIRED_FOLLOWER", null);
             AllPopups.instance.ShowGenericPopup(StaticDB.GetString("MISSION_START_FAILED", null), text);
         }
         else
         {
             AllPopups.instance.ShowGenericPopupFull(StaticDB.GetString("MISSION_START_FAILED", null));
             Debug.Log("Mission start result: " + text);
         }
     }
     this.MobileRequestData();
 }
コード例 #2
0
    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());
        }
    }
コード例 #3
0
    private void MobileClientResearchGarrisonTalentResultHandler(MobileClientResearchGarrisonTalentResult msg)
    {
        GARRISON_RESULT result = (GARRISON_RESULT)msg.Result;

        if (result != GARRISON_RESULT.SUCCESS)
        {
            AllPopups.instance.ShowGenericPopup(StaticDB.GetString("TALENT_RESEARCH_FAILED", null), result.ToString());
        }
        if (this.ResearchGarrisonTalentResultAction != null)
        {
            this.ResearchGarrisonTalentResultAction.Invoke(msg.GarrTalentID, msg.Result);
        }
    }
コード例 #4
0
        private void ResearchGarrisonTalentResultHandler(LegionCompanionWrapper.ResearchGarrisonTalentResultEvent eventArgs)
        {
            GARRISON_RESULT result = (GARRISON_RESULT)eventArgs.Result;

            if (result != GARRISON_RESULT.SUCCESS)
            {
                AllPopups.instance.ShowGenericPopup(StaticDB.GetString("TALENT_RESEARCH_FAILED", null), result.ToString());
            }
            if (this.ResearchGarrisonTalentResultAction != null)
            {
                this.ResearchGarrisonTalentResultAction(eventArgs.GarrTalentID, eventArgs.Result);
            }
        }
コード例 #5
0
 private void MobileClientEvaluateMissionResultHandler(MobileClientEvaluateMissionResult msg)
 {
     if (msg.Result == 0)
     {
         MissionDataCache.AddOrUpdateMissionData(msg.GarrMissionID, msg.SuccessChance);
         if (this.MissionSuccessChanceChangedAction != null)
         {
             this.MissionSuccessChanceChangedAction.Invoke(msg.SuccessChance);
         }
     }
     else
     {
         GARRISON_RESULT result = (GARRISON_RESULT)msg.Result;
         Debug.Log("MobileClientEvaluateMissionResult failed with error " + result.ToString());
     }
 }
コード例 #6
0
    private void MobileClientCreateShipmentResultHandler(MobileClientCreateShipmentResult msg)
    {
        GARRISON_RESULT result = (GARRISON_RESULT)msg.Result;

        if (result != GARRISON_RESULT.SUCCESS)
        {
            AllPopups.instance.ShowGenericPopup(StaticDB.GetString("SHIPMENT_CREATION_FAILED", null), result.ToString());
        }
        if (this.CreateShipmentResultAction != null)
        {
            this.CreateShipmentResultAction.Invoke(msg.Result);
        }
        if (result == GARRISON_RESULT.SUCCESS)
        {
            MobilePlayerGarrisonDataRequest mobilePlayerGarrisonDataRequest = new MobilePlayerGarrisonDataRequest();
            mobilePlayerGarrisonDataRequest.GarrTypeID = 3;
            Login.instance.SendToMobileServer(mobilePlayerGarrisonDataRequest);
        }
    }
コード例 #7
0
    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);
        }
    }
コード例 #8
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);
     }
 }
コード例 #9
0
 private void StartMissionResultHandler(LegionCompanionWrapper.GarrisonStartMissionResultEvent eventArgs)
 {
     if (eventArgs.Result.Result != 0)
     {
         GARRISON_RESULT result = (GARRISON_RESULT)eventArgs.Result.Result;
         string          text   = result.ToString();
         if (result == GARRISON_RESULT.FOLLOWER_SOFT_CAP_EXCEEDED)
         {
             text = StaticDB.GetString("TOO_MANY_ACTIVE_CHAMPIONS", null);
             AllPopups.instance.ShowGenericPopup(StaticDB.GetString("MISSION_START_FAILED", null), text);
         }
         else if (result == GARRISON_RESULT.MISSION_MISSING_REQUIRED_FOLLOWER)
         {
             text = StaticDB.GetString("MISSING_REQUIRED_FOLLOWER", null);
             AllPopups.instance.ShowGenericPopup(StaticDB.GetString("MISSION_START_FAILED", null), text);
         }
         else
         {
             AllPopups.instance.ShowGenericPopupFull(StaticDB.GetString("MISSION_START_FAILED", null));
             Debug.Log("Mission start result: " + text);
         }
     }
     this.MobileRequestData();
 }