public override void Show(Action <int> f, float sizeX, float sizeY, float aT)
 {
     SoundMng.Instance().PlayGameBGM("bgm_303");
     if (GooglePlayGamesTool.Instance != null)
     {
         GooglePlayGamesTool.Instance.ClearQuest();
     }
     GameWebAPI.RespDataWD_DungeonStart respDataWD_DungeonStart = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonStart;
     if (respDataWD_DungeonStart != null)
     {
         this.clearDungeonID = respDataWD_DungeonStart.worldDungeonId;
     }
     GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
     if (respData_WorldMultiStartInfo != null)
     {
         this.clearDungeonID = respData_WorldMultiStartInfo.worldDungeonId;
     }
     this.results.Add(CMD_BattleResult.State.DropItem, this.dropItemResult);
     this.results.Add(CMD_BattleResult.State.Experience, this.experienceResult);
     foreach (ResultBase resultBase in this.results.Values)
     {
         resultBase.gameObject.SetActive(true);
         resultBase.Init();
         resultBase.gameObject.SetActive(false);
     }
     this.ChangeState(CMD_BattleResult.State.DropItem);
     base.Show(f, sizeX, sizeY, aT);
 }
示例#2
0
    private void AppendStandardInfo(List <string> jsonObjs)
    {
        GameWebAPI.RespDataWD_DungeonStart respDataWD_DungeonStart = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonStart;
        string             str                = string.Concat(jsonObjs.ToArray());
        string             hashCode           = this.CalculateMD5(str);
        VersatileDataStore versatileDataStore = new VersatileDataStore
        {
            worldDungeonId = respDataWD_DungeonStart.worldDungeonId,
            startId        = respDataWD_DungeonStart.startId,
            hashCode       = hashCode,
            randomState    = JsonUtility.ToJson(UnityEngine.Random.state)
        };

        UnityEngine.Random.state = JsonUtility.FromJson <UnityEngine.Random.State>(versatileDataStore.randomState);
        string item = JsonWriter.Serialize(versatileDataStore);

        jsonObjs.Insert(0, item);
        jsonObjs.Insert(0, VersionManager.version);
    }
    public override void Init()
    {
        base.Init();
        NGUITools.SetActiveSelf(this.winLogo, false);
        NGUITools.SetActiveSelf(this.winLogoForSkip, false);
        NGUITools.SetActiveSelf(this.titleGO, false);
        if (this.lines != null)
        {
            foreach (GameObject gameObject in this.lines)
            {
                gameObject.SetActive(false);
            }
        }
        string worldDungeonId = string.Empty;

        GameWebAPI.RespDataWD_DungeonStart respDataWD_DungeonStart = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonStart;
        if (respDataWD_DungeonStart != null)
        {
            worldDungeonId = respDataWD_DungeonStart.worldDungeonId;
        }
        GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
        if (respData_WorldMultiStartInfo != null)
        {
            worldDungeonId = respData_WorldMultiStartInfo.worldDungeonId;
        }
        GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM[] worldDungeonM = MasterDataMng.Instance().RespDataMA_WorldDungeonM.worldDungeonM;
        GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM   masterDungeon = worldDungeonM.SingleOrDefault((GameWebAPI.RespDataMA_GetWorldDungeonM.WorldDungeonM x) => x.worldDungeonId == worldDungeonId);
        GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM[]     worldStageM   = MasterDataMng.Instance().RespDataMA_WorldStageM.worldStageM;
        GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM       worldStageM2  = worldStageM.SingleOrDefault((GameWebAPI.RespDataMA_GetWorldStageM.WorldStageM x) => x.worldStageId == masterDungeon.worldStageId);
        string name = worldStageM2.name;

        this.areaName.text = name;
        string name2   = masterDungeon.name;
        string @string = StringMaster.GetString("BattleResult-01");

        this.stageName.text = string.Format(@string, name2);
    }
示例#4
0
    private bool ValidateAndCacheJson(string resJson)
    {
        bool flag = true;

        try
        {
            string[] array = JsonReader.Deserialize <string[]>(resJson);
            if (array.Length < 3)
            {
                global::Debug.LogError("jsonObj format error");
                flag = false;
            }
            if (flag && VersionManager.version == array[0])
            {
                GameWebAPI.RespDataWD_DungeonStart respDataWD_DungeonStart = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonStart;
                string b  = string.Empty;
                string b2 = string.Empty;
                if (respDataWD_DungeonStart == null)
                {
                    global::Debug.LogWarning("dungeon data is null");
                    flag = false;
                }
                else
                {
                    b  = respDataWD_DungeonStart.startId;
                    b2 = respDataWD_DungeonStart.worldDungeonId;
                }
                VersatileDataStore versatileDataStore = JsonReader.Deserialize <VersatileDataStore>(array[1]);
                string             startId            = versatileDataStore.startId;
                string             worldDungeonId     = versatileDataStore.worldDungeonId;
                if (flag && startId == b && worldDungeonId == b2)
                {
                    string[] array2 = new string[array.Length - 1];
                    int      num    = 2;
                    Array.Copy(array, num, array2, 0, array.Length - num);
                    string str = string.Concat(array2);
                    string a   = this.CalculateMD5(str);
                    if (a == versatileDataStore.hashCode)
                    {
                        this.cachedJsonArr = array2;
                    }
                    else
                    {
                        global::Debug.LogError("MD5違う.");
                        flag = false;
                    }
                }
                else
                {
                    flag = false;
                }
            }
            else
            {
                flag = false;
            }
        }
        catch (Exception ex)
        {
            global::Debug.LogErrorFormat("Error:{0}", new object[]
            {
                ex.Message
            });
            flag = false;
        }
        return(flag);
    }
示例#5
0
    private IEnumerator CacheJsonBySaveDataForBattle(Action <bool> callback)
    {
        global::Debug.Log("CacheJsonBySaveDataForBattle.");
        bool   res  = true;
        string path = this.GetJsonFilePath(this.isSubTurn);

        if (string.IsNullOrEmpty(VersionManager.version))
        {
            global::Debug.LogError("VersionManager.version is null.");
            callback(false);
            yield break;
        }
        string      tmpJsonStr = string.Empty;
        IEnumerator wait       = this.LoadFromBinaryFile(path, delegate(string resJson)
        {
            global::Debug.Log("resJson.");
            tmpJsonStr = resJson;
        });

        while (wait.MoveNext())
        {
            object obj = wait.Current;
            yield return(obj);
        }
        if (string.IsNullOrEmpty(tmpJsonStr))
        {
            global::Debug.LogError("tmpJsonStr file is bad.");
            callback(false);
            yield break;
        }
        try
        {
            string[] array = JsonReader.Deserialize <string[]>(tmpJsonStr);
            if (array.Length < 3)
            {
                global::Debug.LogError("jsonObj format error");
                res = false;
            }
            if (res && VersionManager.version == array[0])
            {
                GameWebAPI.RespDataWD_DungeonStart respDataWD_DungeonStart = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonStart;
                string b  = string.Empty;
                string b2 = string.Empty;
                if (respDataWD_DungeonStart == null)
                {
                    global::Debug.LogError("dungeon data is null");
                    res = false;
                }
                else
                {
                    b  = respDataWD_DungeonStart.startId;
                    b2 = respDataWD_DungeonStart.worldDungeonId;
                }
                VersatileDataStore versatileDataStore = JsonReader.Deserialize <VersatileDataStore>(array[1]);
                string             startId            = versatileDataStore.startId;
                string             worldDungeonId     = versatileDataStore.worldDungeonId;
                if (versatileDataStore.randomSeed != 0)
                {
                    UnityEngine.Random.InitState(versatileDataStore.randomSeed);
                }
                else
                {
                    UnityEngine.Random.state = JsonUtility.FromJson <UnityEngine.Random.State>(versatileDataStore.randomState);
                }
                if (res && startId == b && worldDungeonId == b2)
                {
                    this.cachedJsonArr = new string[array.Length - 1];
                    int num = 2;
                    Array.Copy(array, num, this.cachedJsonArr, 0, array.Length - num);
                    callback(res);
                    yield break;
                }
                callback(false);
                yield break;
            }
            else
            {
                res = false;
            }
        }
        catch (Exception ex)
        {
            global::Debug.LogErrorFormat("Error:{0}", new object[]
            {
                ex.Message
            });
            res = false;
        }
        global::Debug.LogFormat("最終的なres:{0}", new object[]
        {
            res
        });
        callback(res);
        yield break;
    }
    private void ShowDrops()
    {
        this.skipCount = DropItemResult.SkipCount.Drops;
        GameWebAPI.RespDataWD_DungeonResult.Drop[]            array    = null;
        GameWebAPI.RespDataWD_DungeonStart.LuckDrop           luckDrop = null;
        GameWebAPI.RespDataWD_DungeonResult.OptionDrop[]      array2   = null;
        GameWebAPI.RespDataWD_DungeonResult.EventChipReward[] array3   = null;
        GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] array4 = null;
        GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward[] array5 = null;
        GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.LuckDrop[]   array6 = null;
        GameWebAPI.RespDataWD_DungeonStart respDataWD_DungeonStart = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonStart;
        if (respDataWD_DungeonStart != null)
        {
            luckDrop = respDataWD_DungeonStart.luckDrop;
            if (ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult != null)
            {
                array  = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult.dropReward;
                array2 = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult.optionDrop;
                array3 = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult.eventChipReward;
            }
        }
        GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
        if (respData_WorldMultiStartInfo != null)
        {
            array    = null;
            luckDrop = null;
            GameWebAPI.RespData_WorldMultiResultInfoLogic respData_WorldMultiResultInfoLogic = ClassSingleton <QuestData> .Instance.RespData_WorldMultiResultInfoLogic;
            if (respData_WorldMultiResultInfoLogic.dungeonReward != null)
            {
                array6 = respData_WorldMultiResultInfoLogic.dungeonReward.luckDrop;
                GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo2 = DataMng.Instance().RespData_WorldMultiStartInfo;
                bool flag = respData_WorldMultiStartInfo2.party[0].userId == DataMng.Instance().RespDataCM_Login.playerInfo.userId;
                if (flag)
                {
                    array4 = respData_WorldMultiResultInfoLogic.dungeonReward.ownerDropReward;
                }
                array5 = respData_WorldMultiResultInfoLogic.dungeonReward.multiReward;
            }
            array  = respData_WorldMultiResultInfoLogic.dropReward;
            array2 = respData_WorldMultiResultInfoLogic.optionDrop;
            array3 = respData_WorldMultiResultInfoLogic.eventChipReward;
        }
        List <DropItemTotalParts.Data> list = new List <DropItemTotalParts.Data>();

        if (array != null)
        {
            foreach (GameWebAPI.RespDataWD_DungeonResult.Drop drop in array)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = drop.assetCategoryId,
                    objectId        = drop.assetValue.ToString(),
                    num             = drop.assetNum
                });
            }
        }
        if (luckDrop != null)
        {
            list.Add(new DropItemTotalParts.Data
            {
                assetCategoryId = luckDrop.assetCategoryId,
                objectId        = luckDrop.assetValue.ToString(),
                num             = luckDrop.assetNum
            });
        }
        if (array4 != null)
        {
            foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward dropReward in array4)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = dropReward.assetCategoryId,
                    objectId        = dropReward.assetValue.ToString(),
                    num             = dropReward.assetNum
                });
            }
        }
        if (array5 != null)
        {
            foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward dropReward2 in array5)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = dropReward2.assetCategoryId,
                    objectId        = dropReward2.assetValue.ToString(),
                    num             = dropReward2.assetNum
                });
            }
        }
        if (array6 != null)
        {
            foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.LuckDrop luckDrop2 in array6)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = luckDrop2.assetCategoryId,
                    objectId        = luckDrop2.assetValue.ToString(),
                    num             = luckDrop2.assetNum
                });
            }
        }
        if (array2 != null)
        {
            foreach (GameWebAPI.RespDataWD_DungeonResult.OptionDrop optionDrop in array2)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = optionDrop.assetCategoryId,
                    objectId        = optionDrop.assetValue.ToString(),
                    num             = optionDrop.assetNum.ToInt32()
                });
            }
        }
        if (array3 != null)
        {
            foreach (GameWebAPI.RespDataWD_DungeonResult.EventChipReward eventChipReward in array3)
            {
                list.Add(new DropItemTotalParts.Data
                {
                    assetCategoryId = eventChipReward.assetCategoryId,
                    objectId        = eventChipReward.assetValue.ToString(),
                    num             = eventChipReward.assetNum.ToInt32()
                });
            }
        }
        List <DropItemTotalParts.Data> list2 = new List <DropItemTotalParts.Data>();

        while (list.Count > 0)
        {
            DropItemTotalParts.Data data = list[0];
            int num = 0;
            foreach (DropItemTotalParts.Data data2 in list)
            {
                if (data.assetCategoryId == data2.assetCategoryId && data.objectId == data2.objectId)
                {
                    num += data2.num;
                }
            }
            DropItemTotalParts.Data newData = new DropItemTotalParts.Data();
            newData.assetCategoryId = data.assetCategoryId;
            newData.objectId        = data.objectId;
            newData.num             = num;
            list2.Add(newData);
            list = list.Where((DropItemTotalParts.Data x) => x.assetCategoryId != newData.assetCategoryId || x.objectId != newData.objectId).ToList <DropItemTotalParts.Data>();
        }
        this.dropItemTotalList = new DropItemTotalList(base.gameObject, list2.ToArray());
        this.dropItemTotalList.SetActive(false);
        this.dropItemList = new DropItemList(base.gameObject, 10, new Vector2(890f, 250f), array, luckDrop, array4, array5, array6, array2, array3);
        this.dropItemList.SetScrollBarPosX(550f);
        this.dropItemList.SetPosition(new Vector3(0f, 40f, 100f));
        if (this.clipingTextures != null)
        {
            foreach (UITexture uitexture in this.clipingTextures)
            {
                uitexture.depth = 0;
            }
        }
        IEnumerator routine = this.dropItemList.SetDrops(false, new Action(this.SetDropCallBack));

        this.coroutineDropInfo = AppCoroutine.Start(routine, false);
        if (this.lines != null)
        {
            foreach (GameObject gameObject in this.lines)
            {
                gameObject.SetActive(true);
            }
        }
        this.isUserMonsterRefresh = false;
        this.isChipMonsterRefresh = false;
        foreach (DropItemTotalParts.Data data3 in list2)
        {
            if (data3.assetCategoryId.ToInt32() == 1)
            {
                this.isUserMonsterRefresh = true;
            }
            if (data3.assetCategoryId.ToInt32() == 17)
            {
                this.isChipMonsterRefresh = true;
            }
        }
    }