Beispiel #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);
    }
Beispiel #2
0
    public void Initialize(UserSeasonInfo msg)
    {
        gameObject.SetActive(true);

        DateTime dateTime = DateTime.Now.AddSeconds(msg.SeasonResetRemainTime);

        text_Discription.text += $"\nSeason {msg.SeasonId}\n{dateTime}까지\n상태 {(SEASON_STATE) msg.SeasonState}";

        // setting
        UserInfoManager.Get().GetUserInfo().seasonPassId         = msg.SeasonId;
        UserInfoManager.Get().GetUserInfo().seasonTrophy         = 0;
        UserInfoManager.Get().GetUserInfo().seasonEndTime        = DateTime.Now.AddSeconds(msg.SeasonResetRemainTime);
        UserInfoManager.Get().GetUserInfo().seasonPassRewardIds  = new List <int>(new int[] { 0, 0 });
        UserInfoManager.Get().GetUserInfo().buySeasonPass        = msg.IsFreeSeason && UserInfoManager.Get().GetUserInfo().buySeasonPass;
        UserInfoManager.Get().GetUserInfo().needSeasonReset      = false;
        UserInfoManager.Get().GetUserInfo().seasonPassRewardStep = msg.SeasonPassRewardStep;

        // refresh
        FindObjectOfType <UI_Panel_Reward>().InitializeSeasonPass();
        UI_Main.Get().rankPopup.isInitialized = false;
    }
Beispiel #3
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);
    }
Beispiel #4
0
    /// <summary>
    /// 유저 정보 응답 처리
    /// </summary>
    /// <param name="errorCode"></param>
    /// <param name="userInfo"></param>
    /// <param name="arrayUserDeck"></param>
    /// <param name="arrayUserDice"></param>
    /// <param name="arrayUserBox"></param>
    /// <param name="questInfo"></param>
    /// <param name="seasonInfo"></param>
    /// <returns></returns>
    public bool OnReceiveUserInfoAck(ERandomwarsUserErrorCode errorCode, MsgUserInfo userInfo, UserDeck[] arrayUserDeck, UserDice[] arrayUserDice, UserItemInfo userItemInfo, QuestInfo questInfo, UserSeasonInfo seasonInfo)
    {
        if (errorCode != ERandomwarsUserErrorCode.Success)
        {
            UserInfoManager.Get().ResetUserId();

            return(true);
        }

        UserInfoManager.Get().SetUserInfo(userInfo, seasonInfo);
        UserInfoManager.Get().SetDeck(arrayUserDeck);
        UserInfoManager.Get().SetDice(arrayUserDice);
        UserInfoManager.Get().SetItem(userItemInfo);
        UI_Popup_Quest.QuestUpdate(questInfo);

        GameStateManager.Get().UserAuthOK();
        //UnityUtil.Print("RECV AUTH => msg", Newtonsoft.Json.JsonConvert.SerializeObject(msg), "green");

        return(true);
    }