コード例 #1
0
    public override eErrorCode LoadJsonTable(JsonData pJson)
    {
        if (null == pJson)
        {
            return(eErrorCode.Table_LoadFailed);
        }

        int iMaxTable = pJson.Count;

        for (int iLoop = 0; iLoop < iMaxTable; ++iLoop)
        {
            var pDataNode = pJson[iLoop];
            SHUtils.ForToEnum <eSceneType>((eType) =>
            {
                if (false == pDataNode.Keys.Contains(eType.ToString()))
                {
                    return;
                }

                for (int iDataIndex = 0; iDataIndex < pDataNode[eType.ToString()].Count; ++iDataIndex)
                {
                    AddData(eType, (string)pDataNode[eType.ToString()][iDataIndex]);
                }
            });
        }

        return(eErrorCode.Succeed);
    }
コード例 #2
0
    public override bool?LoadJsonTable(JSONNode pJson, string strFileName)
    {
        if (null == pJson)
        {
            return(false);
        }

        JSONNode pDataNode = pJson["ServerConfiguration"];

        // 마켓 URL
        m_strAOSMarketURL = GetStrToJson(pDataNode, "AOS_MarketURL");
        m_strIOSMarketURL = GetStrToJson(pDataNode, "IOS_MarketURL");

        // 모드별 정보
        SHUtils.ForToEnum <eServiceMode>((eMode) =>
        {
            if (eServiceMode.None == eMode)
            {
                return;
            }

            var pData = new JsonServerConfigurationData();
            pData.m_strClientVersion = GetStrToJson(pDataNode[eMode.ToString()], "ClientVersion");
            pData.m_strGameServerURL = GetStrToJson(pDataNode[eMode.ToString()], "GameServerURL");
            pData.m_strBundleCDN     = GetStrToJson(pDataNode[eMode.ToString()], "BundleCDN");
            pData.m_strCheckMessage  = GetStrToJson(pDataNode[eMode.ToString()], "CheckMessage");
            pData.m_strServiceState  = GetStrToJson(pDataNode[eMode.ToString()], "ServiceState");
            pData.m_eServiceMode     = eMode;
            m_dicServerInfo[eMode]   = pData;
        });

        return(true);
    }
コード例 #3
0
 void CreateEffectChannel()
 {
     ClearChannel(m_dicEffectChannel);
     m_dicEffectChannel.Clear();
     SHUtils.ForToEnum <eSoundEffectChannel>((eEffectChannel) =>
     {
         var pObject = new GameObject(eEffectChannel.ToString());
         pObject.transform.SetParent(transform);
         m_dicEffectChannel.Add(eEffectChannel, SHGameObject.GetComponent <AudioSource>(pObject));
     });
 }
コード例 #4
0
    void ResetStickInfo()
    {
        m_dicStickInfo.Clear();
        SHUtils.ForToEnum <eStickType>((eType) =>
        {
            if ((eStickType.None == eType) ||
                (eStickType.Max == eType))
            {
                return;
            }

            m_dicStickInfo.Add(eType, GetStickGoodsStateToPlayerPrefs(eType));
        });
    }
コード例 #5
0
    void ResetMonsterInfo()
    {
        m_dicMonsterInfo.Clear();
        SHUtils.ForToEnum <eMonsterType>((eType) =>
        {
            if ((eMonsterType.None == eType) ||
                (eMonsterType.Max_NormalMonster == eType) ||
                (eMonsterType.Max == eType))
            {
                return;
            }

            m_dicMonsterInfo.Add(eType, GetMonsterGoodsStateToPlayerPrefs(eType));
        });
    }
コード例 #6
0
    public List <eMonsterType> GetEnableMonstersToPlayerPrefs()
    {
        var pResult = new List <eMonsterType>();

        SHUtils.ForToEnum <eMonsterType>((eType) =>
        {
            if (false == IsEnableMonsterToPlayerPrefs(eType))
            {
                return;
            }

            pResult.Add(eType);
        });

        return(pResult);
    }
コード例 #7
0
    public override bool?LoadJsonTable(JSONNode pJson, string strFileName)
    {
        if (null == pJson)
        {
            return(false);
        }

        SHUtils.For(0, pJson["PreLoadResourcesList"].Count, (iLoop) =>
        {
            var pDataNode = pJson["PreLoadResourcesList"][iLoop];
            SHUtils.ForToEnum <eSceneType>((eType) =>
            {
                SHUtils.For(0, pDataNode[eType.ToString()].Count, (iDataIndex) =>
                {
                    AddData(eType, pDataNode[eType.ToString()][iDataIndex].Value);
                });
            });
        });

        return(true);
    }
コード例 #8
0
    // 인터페이스 : 데이터 내용 Json파일로 저장하기
    public void SaveJsonFile(string strSavePath)
    {
        string strNewLine = "\r\n";
        string strBuff    = "{" + strNewLine;

        strBuff += string.Format("\t\"{0}\": {1}", "ServerConfiguration", strNewLine);
        strBuff += "\t{" + strNewLine;
        {
            strBuff += string.Format("\t\t\"AOS_MarketURL\": \"{0}\",{1}",
                                     m_strAOSMarketURL,
                                     strNewLine);

            strBuff += string.Format("\t\t\"IOS_MarketURL\": \"{0}\",{1}",
                                     m_strIOSMarketURL,
                                     strNewLine);

            // 모드별 정보
            SHUtils.ForToEnum <eServiceMode>((eMode) =>
            {
                if (eServiceMode.None == eMode)
                {
                    return;
                }

                strBuff += string.Format("\t\t\"{0}\":{1}",
                                         eMode.ToString(),
                                         strNewLine);
                strBuff += "\t\t{" + strNewLine;
                {
                    var pData = m_dicServerInfo[eMode];

                    strBuff += string.Format("\t\t\t\"ClientVersion\": \"{0}\",{1}",
                                             pData.m_strClientVersion,
                                             strNewLine);

                    strBuff += string.Format("\t\t\t\"GameServerURL\": \"{0}\",{1}",
                                             pData.m_strGameServerURL,
                                             strNewLine);

                    strBuff += string.Format("\t\t\t\"BundleCDN\": \"{0}\",{1}",
                                             pData.m_strBundleCDN,
                                             strNewLine);

                    strBuff += string.Format("\t\t\t\"CheckMessage\": \"{0}\",{1}",
                                             pData.m_strCheckMessage,
                                             strNewLine);

                    strBuff += string.Format("\t\t\t\"ServiceState\": \"{0}\"{1}",
                                             pData.m_strServiceState,
                                             strNewLine);
                }
                strBuff += "\t\t}," + strNewLine;
            });

            strBuff = string.Format("{0}{1}", strBuff.Substring(0, strBuff.Length - (strNewLine.Length + 1)), strNewLine);
        }
        strBuff += "\t}";
        strBuff += string.Format("{0}", strNewLine);
        strBuff += "}";

        // 저장
        SHUtils.SaveFile(strBuff, string.Format("{0}/{1}.json", strSavePath, m_strFileName));
    }