Exemplo n.º 1
0
    public bool OnReceiveSeasonResetAck(ERandomwarsSeasonErrorCode errorCode, UserSeasonInfo seasonInfo, ItemBaseInfo[] arrayRewardInfo)
    {
        this.seasonInfo = seasonInfo;

        UI_Main.Get().obj_IndicatorPopup.SetActive(false);

        if (errorCode == ERandomwarsSeasonErrorCode.Success)
        {
            UserInfoManager.Get().GetUserInfo().seasonTrophy = seasonInfo.SeasonTrophy;
            UserInfoManager.Get().GetUserInfo().rankPoint    = seasonInfo.RankPoint;

            if (arrayRewardInfo != null && arrayRewardInfo.Length > 0)
            {
                rewardSlot.gameObject.SetActive(true);
                text_Unranked.gameObject.SetActive(false);

                text_MyRank.text = seasonInfo.Rank.ToString();

                rewardSlot.Initialize(arrayRewardInfo);
                btn_GetReward.interactable = true;
            }
            else
            {
                rewardSlot.gameObject.SetActive(false);
                text_Unranked.gameObject.SetActive(true);
                btn_GetReward.interactable = false;
            }
        }

        Open();

        return(true);
    }
Exemplo n.º 2
0
    public bool OnReceiveSeasonPassStepAck(ERandomwarsSeasonErrorCode errorCode, int rewardId, ItemBaseInfo useItemInfo, ItemBaseInfo rewardInfo, QuestData[] arrayQuestData)
    {
        UI_Main.Get().obj_IndicatorPopup.SetActive(false);

        UI_Popup.AllClose();

        if (errorCode == ERandomwarsSeasonErrorCode.Success)
        {
            switch (useItemInfo.ItemId)
            {
            case 1:
                UserInfoManager.Get().GetUserInfo().gold += useItemInfo.Value;
                break;

            case 2:
                UserInfoManager.Get().GetUserInfo().diamond += useItemInfo.Value;
                break;
            }

            UserInfoManager.Get().GetUserInfo().seasonPassRewardStep = rewardId;
            UserInfoManager.Get().GetUserInfo().seasonTrophy        += rewardInfo.Value;

            UI_Main.Get().RefreshUserInfoUI();
            UI_Popup_Quest.QuestUpdate(arrayQuestData);
            SendMessageUpwards("RefreshSeasonInfo", SendMessageOptions.DontRequireReceiver);

            transform.parent.BroadcastMessage("SetButton");
        }
        else
        {
            UI_ErrorMessage.Get().ShowMessage("재화가 부족합니다.");
        }

        return(true);
    }
Exemplo n.º 3
0
    public bool OnReceiveSeasonRankAck(ERandomwarsSeasonErrorCode errorCode, int pageNo, MsgRankInfo[] arrayRankInfo)
    {
        Invoke("RankCallingFalse", 1f);

        UI_Main.Get().obj_IndicatorPopup.SetActive(false);
        if (errorCode == ERandomwarsSeasonErrorCode.Success && arrayRankInfo != null)
        {
            Debug.Log($"Msg error code: {errorCode}");
            Debug.Log($"MsgGetRankAck errorCode:{errorCode} count:{arrayRankInfo.Length}");
            AddSlots(arrayRankInfo);
        }

        return(true);
    }
Exemplo n.º 4
0
    public bool OnReceiveSeasonPassRewardAck(ERandomwarsSeasonErrorCode errorCode, int[] arrayRewardId, ItemBaseInfo[] arrayRewardInfo, QuestData[] arrayQuestData)
    {
        UI_Main.Get().obj_IndicatorPopup.SetActive(false);
        if (errorCode == ERandomwarsSeasonErrorCode.Success)
        {
            if (isGetPremium)
            {
                getVipRow++;
            }
            else
            {
                getNormalRow++;
            }

            UI_Main.Get().AddReward(arrayRewardInfo, arrButton[isGetPremium ? 0 : 1].transform.position);
            UI_Popup_Quest.QuestUpdate(arrayQuestData);
        }

        SetButton();
        return(true);
    }
Exemplo n.º 5
0
    public bool OnReceiveSeasonInfoAck(ERandomwarsSeasonErrorCode errorCode, UserSeasonInfo seasonInfo, MsgRankInfo[] arrayRankInfo)
    {
        Invoke("RankCallingFalse", 1f);
        StopAllCoroutines();

        UI_Main.Get().obj_IndicatorPopup.SetActive(false);

        if (seasonInfo.NeedSeasonReset)
        {
            //UI_Main.Get().seasonEndPopup.Initialize();

            UI_Main.Get().ShowMessageBox("시즌 종료", "시즌이 종료되었습니다.", UI_Main.Get().seasonEndPopup.Initialize);

            Close();
        }

        Debug.Log($"UserSeasonInfoAck {seasonInfo.SeasonId} state {(SEASON_STATE)seasonInfo.SeasonState}, remainTime {seasonInfo.SeasonResetRemainTime}, needReset {seasonInfo.NeedSeasonReset}\n" +
                  $"MyRank:{seasonInfo.Rank}, MyTrophy:{seasonInfo.SeasonTrophy}, Time:{seasonInfo.SeasonResetRemainTime}");

        ResetSlots();

        switch ((SEASON_STATE)seasonInfo.SeasonState)
        {
        case SEASON_STATE.NONE:
            text_RankMessage.gameObject.SetActive(true);
            break;

        //case SEASON_STATE.PRE:
        //    text_RankMessage.gameObject.SetActive(true);
        //    break;
        case SEASON_STATE.GOING:
            isInitialized = true;
            text_RankMessage.gameObject.SetActive(false);

            text_Season.text = $"SEASON {seasonInfo.SeasonId}";
            //text_SeasonRemainTime.text = msg.SeasonRemainTime.ToString();
            //StartCoroutine(TimerCoroutine(msg.SeasonRemainTime));
            //time = DateTime.Now.AddSeconds(msg.SeasonRemainTime);
            text_MyRanking.text = seasonInfo.Rank > 0 ? seasonInfo.Rank.ToString() : string.Empty;
            text_MyTrophy.text  = seasonInfo.SeasonTrophy.ToString();

            Debug.Log($"RankInfoCount: {arrayRankInfo.Length}");
            AddSlots(arrayRankInfo);
            // for (int i = 0; i < listSlot.Count && i < msg.TopRankInfo.Length; i++)
            // {
            //     listSlot[i].Initialize(
            //         msg.TopRankInfo[i].Ranking,
            //         msg.TopRankInfo[i].Trophy,
            //         msg.TopRankInfo[i].Name,
            //         msg.TopRankInfo[i].Class,
            //         msg.TopRankInfo[i].DeckInfo
            //     );
            // }
            break;

        case SEASON_STATE.BREAK:
            text_RankMessage.gameObject.SetActive(true);
            break;

        case SEASON_STATE.END:
            text_RankMessage.gameObject.SetActive(true);
            break;
        }

        Open();

        return(true);
    }