Exemple #1
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);
    }
Exemple #2
0
    public bool OnReceiveQuestRewardAck(ERandomwarsQuestErrorCode errorCode, QuestData[] arrayQuestData, ItemBaseInfo[] arrayRewardInfo)
    {
        UI_Main.Get().obj_IndicatorPopup.SetActive(false);

        if (errorCode == ERandomwarsQuestErrorCode.Success)
        {
            UI_Main.Get().AddReward(arrayRewardInfo, btn_Reward.transform.position);

            UI_Popup_Quest.QuestUpdate(arrayQuestData);
            UI_Main.Get().questPopup.InfoCallback();
        }

        return(true);
    }
Exemple #3
0
    private bool ADRewardCallback(ERandomwarsUserErrorCode errorCode, ItemBaseInfo[] arrayRewardInfo,
                                  QuestData[] arrayQuestData)
    {
        //UI_InGamePopup.Get().obj_Indicator.SetActive(false);
        if (errorCode == ERandomwarsUserErrorCode.Success)
        {
            foreach (var reward in arrayRewardInfo)
            {
                UI_Main.listADReward.Add(reward);
            }

            UI_Popup_Quest.QuestUpdate(arrayQuestData);
            InGameManager.Get().MoveToMainScene();
            return(true);
        }

        InGameManager.Get().MoveToMainScene();
        return(false);
    }
Exemple #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);
    }
Exemple #5
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);
    }
Exemple #6
0
        public bool OnReceiveDiceUpgradeAck(ERandomwarsDiceErrorCode errorCode, MsgDiceInfo diceInfo, QuestData[] arrayQuestData, int updateGold)
        {
            UI_Main.Get().obj_IndicatorPopup.SetActive(false);

            if (errorCode == ERandomwarsDiceErrorCode.Success)
            {
                var info = UserInfoManager.Get().GetUserInfo();
                if (info.dicGettedDice.ContainsKey(data.id))
                {
                    info.gold -= needGold;
                    diceLevel++;
                    info.dicGettedDice[data.id][0]++;
                    info.dicGettedDice[data.id][1] -= needDiceCount;

                    obj_Result.SetActive(true);
                    StartCoroutine(SetDiceLevelUpResultCoroutine());
                }

                // Quest
                UI_Popup_Quest.QuestUpdate(arrayQuestData);
            }

            return(true);
        }
Exemple #7
0
        public bool ShowBuyResult(GameBaseShopErrorCode errorCode, int shopId, ShopProductInfo shopProductInfo, ShopProductInfo changeProductInfo, ItemBaseInfo payItemInfo, ItemBaseInfo[] arrayRewardItemInfo, QuestData[] arrayQuestData)
        {
            UI_Main.Get().obj_IndicatorPopup.SetActive(false);

            if (errorCode == GameBaseShopErrorCode.Success)
            {
                if (changeProductInfo != null)
                {
                    UpdateContent(shopInfo, changeProductInfo);
                }

                //구매한 상품에 대한 정보
                //shopProductInfo
                switch (shopId)
                {
                case 1:
                case 2:
                case 5:
                case 6:
                    ShopManager.Get().RefreshShop();
                    break;

                case 3:
                    buttonShopItem.interactable = false;
                    break;
                }
                SetColor();

                if (payItemInfo != null)
                {
                    //소모한 재화에 대한 연출 처리
                    //payItemInfo
                    ITEM_TYPE type;
                    switch (payItemInfo.ItemId)
                    {
                    case 1:
                        type = ITEM_TYPE.GOLD;
                        UserInfoManager.Get().GetUserInfo().gold += payItemInfo.Value;
                        break;

                    case 2:
                        type = ITEM_TYPE.DIAMOND;
                        UserInfoManager.Get().GetUserInfo().diamond += payItemInfo.Value;
                        break;

                    case 11:
                        type = ITEM_TYPE.KEY;
                        UserInfoManager.Get().GetUserInfo().key += payItemInfo.Value;
                        break;

                    default:
                        type = ITEM_TYPE.NONE;
                        break;
                    }
                    UI_GetProduction.Get().RefreshProduct(type);
                }

                //구매한 상품에 대한 결과 값
                //arrayRewardItemInfo
                ItemBaseInfo[] arr = new ItemBaseInfo[arrayRewardItemInfo.Length];
                for (int i = 0; i < arrayRewardItemInfo.Length; i++)
                {
                    Debug.Log($"GET == ID:{arrayRewardItemInfo[i].ItemId}, Value:{arrayRewardItemInfo[i].Value}");
                    arr[i]        = new ItemBaseInfo();
                    arr[i].ItemId = arrayRewardItemInfo[i].ItemId;
                    arr[i].Value  = arrayRewardItemInfo[i].Value;
                }
                UI_Main.Get().AddReward(arr, ShopItem.pos);

                // 퀘스트 업데이트
                UI_Popup_Quest.QuestUpdate(arrayQuestData);

                return(true);
            }
            else
            {
                Debug.Log($"에러 발생 : {errorCode}");
                UI_ErrorMessage.Get().ShowMessage($"Error : {errorCode}");
                return(false);
            }
        }
Exemple #8
0
    public bool OnReceiveBoxOpenAck(ERandomwarsItemErrorCode errorCode, ItemBaseInfo[] arrayDeleteItemInfo, ItemBaseInfo[] arrayRewardInfo, QuestData[] arrayQuestData)
    {
        UI_Main.Get().obj_IndicatorPopup.SetActive(false);
        SoundManager.instance.Play(Global.E_SOUND.SFX_UI_BOX_COMMON_FALLDOWN);

        // 재화 감소
        switch (costType)
        {
        case COST_TYPE.KEY:
            UserInfoManager.Get().GetUserInfo().key -= cost;
            break;

        case COST_TYPE.GOLD:
            UserInfoManager.Get().GetUserInfo().gold -= cost;
            break;

        case COST_TYPE.DIAMOND:
            UserInfoManager.Get().GetUserInfo().diamond -= cost;
            break;
        }

        UserInfoManager.Get().GetUserInfo().dicBox[boxID]--;
        if (UserInfoManager.Get().GetUserInfo().dicBox[boxID] == 0)
        {
            UserInfoManager.Get().GetUserInfo().dicBox.Remove(boxID);
        }

        /////////////////////////////////////////////////////////////////
        ///
        ///
        ///
        ///
        ///

        UI_Main.Get().gerResult.Initialize(arrayRewardInfo, true, true);

        UI_Popup_Quest.QuestUpdate(arrayQuestData);

        return(true);

        // for (int i = 0; i < msg.BoxReward.Length; i++)
        // {
        //     Debug.Log($"Reward   ID:{msg.BoxReward[i].ItemId} , Count:{msg.BoxReward[i].Value}");
        //
        //     var level = 0;
        //     var count = 0;
        //     if (UserInfoManager.Get().GetUserInfo().dicGettedDice.ContainsKey(msg.BoxReward[i].ItemId))
        //     {
        //         level = UserInfoManager.Get().GetUserInfo().dicGettedDice[msg.BoxReward[i].ItemId][0];
        //         count = UserInfoManager.Get().GetUserInfo().dicGettedDice[msg.BoxReward[i].ItemId][1];
        //     }
        //
        //     RandomWarsResource.Data.TDataItemList tDataItemList;
        //     if (TableManager.Get().ItemList.GetData(msg.BoxReward[i].ItemId, out tDataItemList) == false)
        //     {
        //         Debug.LogErrorFormat($"Failed to get table data. ID:{msg.BoxReward[i].ItemId}");
        //         return;
        //     }
        //
        //
        //     switch ((ITEM_TYPE)tDataItemList.itemType)
        //     {
        //         case ITEM_TYPE.TROPHY:
        //             UserInfoManager.Get().GetUserInfo().trophy += msg.BoxReward[i].Value;
        //             break;
        //         case ITEM_TYPE.GOLD:
        //             UserInfoManager.Get().GetUserInfo().gold += msg.BoxReward[i].Value;
        //             break;
        //         case ITEM_TYPE.DIAMOND:
        //             UserInfoManager.Get().GetUserInfo().diamond += msg.BoxReward[i].Value;
        //             break;
        //         case ITEM_TYPE.KEY:
        //             UserInfoManager.Get().GetUserInfo().key += msg.BoxReward[i].Value;
        //             break;
        //         case ITEM_TYPE.BOX:
        //             if (UserInfoManager.Get().GetUserInfo().dicBox.ContainsKey(msg.BoxReward[i].ItemId))
        //             {
        //                 UserInfoManager.Get().GetUserInfo().dicBox[msg.BoxReward[i].ItemId] += msg.BoxReward[i].Value;
        //             }
        //             else
        //             {
        //                 UserInfoManager.Get().GetUserInfo().dicBox.Add(msg.BoxReward[i].ItemId, msg.BoxReward[i].Value);
        //             }
        //             break;
        //         case ITEM_TYPE.DICE:
        //         {
        //             if (level == 0)
        //             {
        //                 RandomWarsResource.Data.TDataDiceInfo tDataDiceInfo;
        //                 if (TableManager.Get().DiceInfo.GetData(tDataItemList.id, out tDataDiceInfo) == false)
        //                 {
        //                     Debug.LogErrorFormat($"Failed to get table data from DiceInfo. ID:{tDataItemList.id}");
        //                     return;
        //                 }
        //
        //                 RandomWarsResource.Data.TDataDiceLevelInfo dataDiceLevelInfo;
        //                 if (TableManager.Get().DiceLevelInfo.GetData(tDataDiceInfo.grade, out dataDiceLevelInfo) == false)
        //                 {
        //                     return;
        //                 }
        //
        //                 count = msg.BoxReward[i].Value;
        //                 UserInfoManager.Get().GetUserInfo().dicGettedDice.Add(msg.BoxReward[i].ItemId, new int[] { dataDiceLevelInfo.baseLevel, count });
        //             }
        //             else
        //             {
        //                 count += msg.BoxReward[i].Value;
        //                 UserInfoManager.Get().GetUserInfo().dicGettedDice[msg.BoxReward[i].ItemId][1] = count;
        //             }
        //         }
        //         break;
        //     }
        // }
        //
        // UI_Main.Get().boxPopup.RefreshBox();
        // UI_Main.Get().RefreshUserInfoUI();
        // UI_Main.Get().panel_Dice.RefreshGettedDice();
        //
        // SetShowItems();
    }