예제 #1
0
    public static void Load()
    {
        string strData = C_Save.LoadString(Name, C_LocalPath.StreamingAssetsConfigPath);

        if (!string.IsNullOrEmpty(strData))
        {
            WordBallConfigItemList.Clear();

            JsonData WordBallConfigItemListJD = C_Json.GetJsonKeyJsonData(strData, "WordBallConfigItemList");
            if (WordBallConfigItemListJD != null)
            {
                for (int i = 0; i < WordBallConfigItemListJD.Count; i++)
                {
                    if (WordBallConfigItemListJD[i] != null)
                    {
                        FieldGuideConfigItem item = new FieldGuideConfigItem();

                        item.ID       = C_Json.GetJsonKeyInt(WordBallConfigItemListJD[i], "ID");
                        item.Name     = C_Json.GetJsonKeyString(WordBallConfigItemListJD[i], "Name");
                        item.Type     = C_Json.GetJsonKeyInt(WordBallConfigItemListJD[i], "Type");
                        item.BallType = C_Json.GetJsonKeyInt(WordBallConfigItemListJD[i], "BallType");

                        WordBallConfigItemList.Add(item);
                    }
                }
            }
        }
    }
예제 #2
0
    public static string GetStageConfigName(string stageName)
    {
        string serverStageName    = stageName.ToLower() + "@" + GameHotUpdateMgr.CommonChannel;
        string serverStageVersion = C_Json.GetJsonKeyString(GameHotUpdateMgr.ServerHotUpdateConfig, serverStageName);

        return(serverStageName + "@" + serverStageVersion);
    }
예제 #3
0
파일: GameConfig.cs 프로젝트: jonntd/Xbl
    public static void Load()
    {
        string strData = C_MonoSingleton <C_DataMgr> .GetInstance().LoadData(Name);

        if (!string.IsNullOrEmpty(strData))
        {
            AppVersion     = C_Json.GetJsonKeyString(strData, "AppVersion");
            ResVersion     = C_Json.GetJsonKeyString(strData, "ResVersion");
            LogState       = C_Json.GetJsonKeyInt(strData, "LogState");
            LocalResources = C_Json.GetJsonKeyInt(strData, "LocalResources");
            AutoTest       = C_Json.GetJsonKeyInt(strData, "AutoTest");
            HYJJ_Test      = C_Json.GetJsonKeyInt(strData, "HYJJ_Test");
        }
    }
예제 #4
0
    public static void Load()
    {
        string strData = C_Save.LoadString(Name, C_LocalPath.StreamingAssetsConfigPath);

        if (!string.IsNullOrEmpty(strData))
        {
            FormalHotUpdate = C_Json.GetJsonKeyString(strData, "FormalHotUpdate");
            TestHotUpdate   = C_Json.GetJsonKeyString(strData, "TestHotUpdate");

            FormalHost = C_Json.GetJsonKeyString(strData, "FormalHost");
            TestHost   = C_Json.GetJsonKeyString(strData, "TestHost");

            FormalPinYinHost = C_Json.GetJsonKeyString(strData, "FormalPinYinHost");
            TestPinYinHost   = C_Json.GetJsonKeyString(strData, "TestPinYinHost");

            FormalPayHost = C_Json.GetJsonKeyString(strData, "FormalPayHost");
            TestPayHost   = C_Json.GetJsonKeyString(strData, "TestPayHost");

            FormalCommonHost = C_Json.GetJsonKeyString(strData, "FormalCommonHost");
            TestCommonHost   = C_Json.GetJsonKeyString(strData, "TestCommonHost");


            BabyNameMP3Url = C_Json.GetJsonKeyString(strData, "BabyNameMP3Url");


            SMSLoginCode = C_Json.GetJsonKeyString(strData, "SMSLoginCode");
            LoginPhoneVerificationCode = C_Json.GetJsonKeyString(strData, "LoginPhoneVerificationCode");
            LoginWeChat       = C_Json.GetJsonKeyString(strData, "LoginWeChat");
            LoginWeChatQRCode = C_Json.GetJsonKeyString(strData, "LoginWeChatQRCode");
            LoginUID          = C_Json.GetJsonKeyString(strData, "LoginUID");
            LoginVisitor      = C_Json.GetJsonKeyString(strData, "LoginVisitor");
            LogoutVisitor     = C_Json.GetJsonKeyString(strData, "LogoutVisitor");
            BindingPhone      = C_Json.GetJsonKeyString(strData, "BindingPhone");
            BindingWeChat     = C_Json.GetJsonKeyString(strData, "BindingWeChat");


            SetHeadImg = C_Json.GetJsonKeyString(strData, "SetHeadImg");

            SetBabyInfo = C_Json.GetJsonKeyString(strData, "SetBabyInfo");

            GetNameVideo = C_Json.GetJsonKeyString(strData, "GetNameVideo");

            GetVIPInfo = C_Json.GetJsonKeyString(strData, "GetVIPInfo");


            GetChannelConfig = C_Json.GetJsonKeyString(strData, "GetChannelConfig");
            GetStoreConfig   = C_Json.GetJsonKeyString(strData, "GetStoreConfig");
        }
    }
예제 #5
0
    void Awake()
    {
        string actionConfig = C_Singleton <GameResMgr> .GetInstance().LoadString("action_config", "entity", "character", "c_framework/entity/character/" + Name + "/config/");

        if (!string.IsNullOrEmpty(actionConfig))
        {
            JsonData actionJD = C_Json.GetJsonKeyJsonData(actionConfig, "Acton");
            if (actionJD != null)
            {
                for (int i = 0; i < actionJD.Count; i++)
                {
                    CharacterAction action = new CharacterAction();
                    action.Name         = C_Json.GetJsonKeyString(actionJD[i], "Name");
                    action.Type         = C_Json.GetJsonKeyInt(actionJD[i], "Type");
                    action.EndType      = C_Json.GetJsonKeyInt(actionJD[i], "EndType");
                    action.DurationTime = C_Json.GetJsonKeyFloat(actionJD[i], "DurationTime");

                    JsonData animatorControllerJD = C_Json.GetJsonKeyJsonData(actionJD[i], "AnimatorController");
                    if (animatorControllerJD != null)
                    {
                        for (int j = 0; j < animatorControllerJD.Count; j++)
                        {
                            CharacterActionItem item = new CharacterActionItem();
                            item.Name         = C_Json.GetJsonKeyString(animatorControllerJD[j], "Name");
                            item.Type         = C_Json.GetJsonKeyInt(animatorControllerJD[j], "Type");
                            item.DurationTime = C_Json.GetJsonKeyFloat(animatorControllerJD[j], "DurationTime");
                            action.AnimatorController.Add(item);
                        }
                    }

                    JsonData audioJD = C_Json.GetJsonKeyJsonData(actionJD[i], "Audio");
                    if (audioJD != null)
                    {
                        for (int j = 0; j < audioJD.Count; j++)
                        {
                            CharacterActionItem item = new CharacterActionItem();
                            item.Name         = C_Json.GetJsonKeyString(audioJD[j], "Name");
                            item.Type         = C_Json.GetJsonKeyInt(audioJD[j], "Type");
                            item.DurationTime = C_Json.GetJsonKeyFloat(audioJD[j], "DurationTime");
                            action.Audio.Add(item);
                        }
                    }

                    m_CharacterAction.Add(action);
                }
            }
        }
    }
예제 #6
0
    public static GameObject CreateCharacter(string entityID)
    {
        string characterConfigName = C_Json.GetJsonKeyString(EntityConfig, entityID);

        if (!string.IsNullOrEmpty(characterConfigName))
        {
            string prefabConfig = C_Singleton <GameResMgr> .GetInstance().LoadString("prefab_config.json", "entity", "character", "c_framework/entity/character/" + characterConfigName + "/config/");

            if (!string.IsNullOrEmpty(prefabConfig))
            {
                string prefabName = C_Json.GetJsonKeyString(prefabConfig, "main_prefab");
                if (!string.IsNullOrEmpty(prefabName))
                {
                    return(C_Singleton <GameResMgr> .GetInstance().LoadResource_GameObject(prefabName, "PackagingResources/c_framework/entity/character/" + characterConfigName + "/prefab/"));
                }
            }
        }

        return(null);
    }
예제 #7
0
    public static void UpdateData(string data)
    {
        JsonData jsonData = C_Json.GetJsonKeyJsonData(data, "_ResList");

        if (jsonData != null)
        {
            _ResList.Clear();
            for (int i = 0; i < jsonData.Count; i++)
            {
                ResItem resItem = new ResItem();
                resItem.name    = C_Json.GetJsonKeyString(jsonData[i], "name");
                resItem.path    = C_Json.GetJsonKeyString(jsonData[i], "path");
                resItem.resType = C_Json.GetJsonKeyString(jsonData[i], "resType");
                // resItem.overriden = C_Json.GetJsonKeyBool(jsonData[i], "overriden");
                if (string.IsNullOrEmpty(resItem.resType))
                {
                    continue;
                }
                else if (resItem.resType.Equals("texture"))
                {
                    resItem.textureType     = C_Json.GetJsonKeyInt(jsonData[i], "textureType");
                    resItem.readEnable      = C_Json.GetJsonKeyInt(jsonData[i], "readEnable");
                    resItem.gengrateMipMaps = C_Json.GetJsonKeyInt(jsonData[i], "gengrateMipMaps");
                    resItem.maxSize         = C_Json.GetJsonKeyString(jsonData[i], "maxSize");
                    resItem.format          = C_Json.GetJsonKeyInt(jsonData[i], "format");
                }
                else if (resItem.resType.Equals("audioclip"))
                {
                    resItem.loadtype          = C_Json.GetJsonKeyInt(jsonData[i], "loadtype");
                    resItem.compressionFormat = C_Json.GetJsonKeyInt(jsonData[i], "compressionFormat");
                    resItem.quality           = C_Json.GetJsonKeyString(jsonData[i], "quality");
                    resItem.sampleRateSet     = C_Json.GetJsonKeyInt(jsonData[i], "sampleRateSet");
                }

                _ResList.Add(resItem);
            }
        }
    }
예제 #8
0
    public static List <HotUpdateItem> ParseHotUpdateConfig(string config)
    {
        List <HotUpdateItem> list = new List <HotUpdateItem>();

        //解析
        if (!string.IsNullOrEmpty(config))
        {
            JsonData configJD = C_Json.GetJsonKeyJsonData(config, "config");
            if (configJD != null)
            {
                foreach (JsonData itemJD in configJD)
                {
                    HotUpdateItem item = new HotUpdateItem();
                    item.Name = C_Json.GetJsonKeyString(itemJD, "name");
                    item.MD5  = C_Json.GetJsonKeyString(itemJD, "md5");

                    list.Add(item);
                }
            }
        }

        return(list);
    }
예제 #9
0
    static void InitData(ModelData result, string json)
    {
        if (result == null)
        {
            C_DebugHelper.LogError("result is null");
            return;
        }
        if (string.IsNullOrEmpty(json))
        {
            C_DebugHelper.LogError("json is null");
            return;
        }
        string artScene = C_Json.GetJsonKeyString(json, "ArtScene");

        if (string.IsNullOrEmpty(artScene))
        {
            C_DebugHelper.LogError("ArtScene is null ");
            return;
        }
        result.ArtSceneName = artScene;
        string pathArtName = C_Json.GetJsonKeyString(json, "PathArtName");

        if (string.IsNullOrEmpty(pathArtName))
        {
            C_DebugHelper.LogError("ArtName is null ");
            return;
        }
        result.PathArtRootNodeName = pathArtName;
        string pathDesName = C_Json.GetJsonKeyString(json, "PathDesName");

        if (string.IsNullOrEmpty(pathDesName))
        {
            C_DebugHelper.LogError("DesName is null ");
            return;
        }
        result.PathDesRootNodeName = pathDesName;

        string desScene = C_Json.GetJsonKeyString(json, "DesScene");

        if (string.IsNullOrEmpty(desScene))
        {
            C_DebugHelper.LogError("DesScene is null ");
            return;
        }
        result.DesSceneName = desScene;

        string cutsceneArtName = C_Json.GetJsonKeyString(json, "CutsceneArtName");

        if (string.IsNullOrEmpty(cutsceneArtName))
        {
            C_DebugHelper.LogError("cutsceneArtName is null ");
            return;
        }
        result.CutsceneArtRootNodeName = cutsceneArtName;
        string cutsceneDesName = C_Json.GetJsonKeyString(json, "CutsceneDesName");

        if (string.IsNullOrEmpty(cutsceneDesName))
        {
            C_DebugHelper.LogError("cutsceneDesName is null ");
            return;
        }
        result.CutsceneDesRootNodeName = cutsceneDesName;

        JsonData pathReplacItemNameList = C_Json.GetJsonKeyJsonData(json, "PathReplaceItemName");

        if (pathReplacItemNameList == null)
        {
            C_DebugHelper.LogError("ReplaceItemName is null");
            return;
        }
        foreach (JsonData item in pathReplacItemNameList)
        {
            result.PathReplaceList.Add(item.ToString());
        }

        JsonData cutsceneReplacItemNameList = C_Json.GetJsonKeyJsonData(json, "CutsceneReplaceItemName");

        if (cutsceneReplacItemNameList == null)
        {
            C_DebugHelper.LogError("cutsceneReplacItemNameList is null");
            return;
        }
        foreach (JsonData item in cutsceneReplacItemNameList)
        {
            result.CutsceneReplaceList.Add(item.ToString());
        }
    }
예제 #10
0
파일: LevelConfig.cs 프로젝트: jonntd/Xbl
    public static void Load()
    {
        string strData = C_Save.LoadString(Name, C_LocalPath.StreamingAssetsConfigPath);

        if (!string.IsNullOrEmpty(strData))
        {
            JsonData levelMaxStarJD = C_Json.GetJsonKeyJsonData(strData, "LevelMaxStar");
            if (levelMaxStarJD != null)
            {
                LevelMaxStar = new int[levelMaxStarJD.Count];

                for (int i = 0; i < levelMaxStarJD.Count; i++)
                {
                    LevelMaxStar[i] = (int)levelMaxStarJD[i];
                }
            }

            JsonData levelNameJD = C_Json.GetJsonKeyJsonData(strData, "LevelName");
            if (levelNameJD != null)
            {
                LevelName = new string[levelNameJD.Count];

                for (int i = 0; i < levelNameJD.Count; i++)
                {
                    LevelName[i] = (string)levelNameJD[i];
                }
            }

            JsonData levelUnlockStageJD = C_Json.GetJsonKeyJsonData(strData, "LevelUnlockStage");
            if (levelUnlockStageJD != null)
            {
                LevelUnlockStage = new string[levelUnlockStageJD.Count];

                for (int i = 0; i < levelUnlockStageJD.Count; i++)
                {
                    LevelUnlockStage[i] = (string)levelUnlockStageJD[i];
                }
            }

            JsonData gradeMaxStarJD = C_Json.GetJsonKeyJsonData(strData, "GradeMaxStar");
            if (gradeMaxStarJD != null)
            {
                GradeMaxStar = new int[gradeMaxStarJD.Count];

                for (int i = 0; i < gradeMaxStarJD.Count; i++)
                {
                    GradeMaxStar[i] = (int)gradeMaxStarJD[i];
                }
            }

            JsonData gradeNameJD = C_Json.GetJsonKeyJsonData(strData, "GradeName");
            if (gradeNameJD != null)
            {
                GradeName = new string[gradeNameJD.Count];

                for (int i = 0; i < gradeNameJD.Count; i++)
                {
                    GradeName[i] = (string)gradeNameJD[i];
                }
            }

            JsonData gradeUnlockStageJD = C_Json.GetJsonKeyJsonData(strData, "GradeUnlockStage");
            if (gradeUnlockStageJD != null)
            {
                GradeUnlockStage = new string[gradeUnlockStageJD.Count];

                for (int i = 0; i < gradeUnlockStageJD.Count; i++)
                {
                    GradeUnlockStage[i] = (string)gradeUnlockStageJD[i];
                }
            }
        }
    }
예제 #11
0
    void GetTecentReslut(string result)
    {
        float score = 0;

        try
        {
            string resultWord = "0";
            if (!string.IsNullOrEmpty(result))
            {
                //  WordRespone itemDate = JsonUtility.FromJson<WordRespone>(result);//特殊处理的jason,一般jason类继续使用框架jason
                C_DebugHelper.Log("class:RecognizeAudio function:GetTecentReslut  line 59..  result =" + result);

                string word = C_Json.GetJsonKeyString(result, "inputWords");
#if !UNITY_IOS
                int pronCompletion = C_Json.GetJsonKeyInt(result, "pronCompletion");
#else
#endif
                int   resultCode   = C_Json.GetJsonKeyInt(result, "resultCode");
                float pronAccuracy = C_Json.GetJsonKeyFloat(result, "pronAccuracy");
                float pronFluency  = C_Json.GetJsonKeyFloat(result, "pronFluency");
                if (resultCode == 1)
                {
                    if (_ResultType == ResultType.PickWord)
                    {
                        //解析所有的文字,找到分数最高的文字
                        float    wordMaxScore = 0f;
                        JsonData wordList     = C_Json.GetJsonKeyJsonData(result, "words");
                        if (wordList != null)
                        {
                            for (int i = 0; i < wordList.Count; i++)
                            {
                                if (wordList[i] != null)
                                {
                                    string wordName          = C_Json.GetJsonKeyString(wordList[i], "word");
                                    float  pronAccuracy_word = C_Json.GetJsonKeyFloat(wordList[i], "pronAccuracy");
                                    float  pronFluency_word  = C_Json.GetJsonKeyFloat(wordList[i], "pronFluency");
#if !UNITY_IOS
                                    float tmpScore = pronAccuracy_word * 0.6f + pronFluency_word * 100f * 0.4f;
#else
                                    float tmpScore = pronAccuracy_word;
                                    //C_DebugHelper.Log("class:RecognizeAudio function:GetTecentReslut  line 153..  pronFluency_word =" + pronFluency_word);
#endif
                                    if (tmpScore >= wordMaxScore || (i == 0))
                                    {
                                        wordMaxScore = tmpScore;
                                        resultWord   = wordName;
                                    }
                                }
                            }
                        }
                        DoScoreCallBack(resultWord);
                        return;
                    }
                    else if (_ResultType == ResultType.PickScore)
                    {
                        //直接计算分数

#if !UNITY_IOS
                        score = (pronAccuracy * 0.6f + pronFluency * 100f * 0.4f) * pronCompletion;
#else
                        score = (pronAccuracy * 0.6f + pronFluency * 100f * 0.4f);
#endif
                    }
                }
                if (_ResultCallback != null)
                {
                    C_DebugHelper.Log("_ResultCallback ..GetTecentReslut  result =" + result);
                    _ResultCallback(score.ToString());
                    _ResultCallback = null;
                }
            }
            else
            {
                C_DebugHelper.Log("class:RecognizeAudio function:GetTecentReslut  line 169..  result =" + result);

                DoScoreCallBack(score.ToString());
            }
        }
        catch (Exception e)
        {
            DoScoreCallBack(score.ToString());
        }
    }
예제 #12
0
 /// <summary>
 /// 转化为Json字符串
 /// </summary>
 /// <returns></returns>
 public string toJson()
 {
     return(C_Json.toJson(this));
 }
예제 #13
0
 /// <summary>
 /// 分页获取法官评价列表
 /// </summary>
 /// <param name="ID"></param>
 /// <returns></returns>
 public ActionResult AppraiseList(PageInfo info, int iUserId)
 {
     return(Content(C_Json.toJson(manage.AppraiseList(info, iUserId))));
 }
        private int _iMaxSize = 2 * 1024;//文件最大不超过2M

        public void ProcessRequest(HttpContext context)
        {
            try
            {
                context.Response.ContentType = "text/plain";
                HttpFileCollection ImgList = context.Request.Files;
                for (int i = 0; i < ImgList.Count; i++)
                {
                    HttpPostedFile image = ImgList[i];
                    if (image != null && image.ContentLength > 0)
                    {
                        string[] sExtension = { ".gif", ".jpg", ".jpeg", ".png", ".bmp" };
                        string   dDate      = DateTime.Now.ToString("yyyy-MM");

                        /*图片保存路径*/
                        string sPath = System.AppDomain.CurrentDomain.BaseDirectory + "Images\\" + dDate + "\\";
                        if (!Directory.Exists(sPath))
                        {
                            Directory.CreateDirectory(sPath);
                        }

                        string format = System.IO.Path.GetExtension(image.FileName);//后缀名
                        /*组装文件名*/
                        string sFileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + format;

                        /*文件大小超出限制*/
                        if (image.ContentLength > (_iMaxSize * 1024))
                        {
                            context.Response.Write(C_Json.toJson(new result()
                            {
                                error   = 1,
                                message = "文件超出大小限制2M!"
                            }));
                            return;
                        }
                        /*上传的文件后缀名格式错误*/
                        if (!sExtension.Contains(format))
                        {
                            context.Response.Write(C_Json.toJson(new result()
                            {
                                error   = 1,
                                message = "上传的图片文件格式错误!"
                            }));
                            return;
                        }
                        /*保存图片到本地*/
                        image.SaveAs(sPath + sFileName);
                        context.Response.Write(C_Json.toJson(new result()
                        {
                            error = 0,
                            url   = "/Images/" + dDate + "/" + sFileName
                        }));
                    }
                }
            }
            catch (Exception e)
            {
                Logs.LogHelper.ErrorLog(e);
                context.Response.Write(C_Json.toJson(new result()
                {
                    error   = 1,
                    message = "上传失败!"
                }));
            }
        }
예제 #15
0
    public static void Load()
    {
        string strData = C_Save.LoadString(Name, C_LocalPath.StreamingAssetsConfigPath);

        if (!string.IsNullOrEmpty(strData))
        {
            JsonData learningRhythmNameJD = C_Json.GetJsonKeyJsonData(strData, "LearningRhythmName");
            if (learningRhythmNameJD != null)
            {
                LearningRhythmName = new string[learningRhythmNameJD.Count];

                for (int i = 0; i < learningRhythmNameJD.Count; i++)
                {
                    LearningRhythmName[i] = (string)learningRhythmNameJD[i];
                }
            }

            JsonData learningRhythmCourseJD = C_Json.GetJsonKeyJsonData(strData, "LearningRhythmCourse");
            if (learningRhythmCourseJD != null)
            {
                LearningRhythmCourse = new int[learningRhythmCourseJD.Count];

                for (int i = 0; i < learningRhythmCourseJD.Count; i++)
                {
                    LearningRhythmCourse[i] = (int)learningRhythmCourseJD[i];
                }
            }

            JsonData learningTimeNameJD = C_Json.GetJsonKeyJsonData(strData, "LearningTimeName");
            if (learningTimeNameJD != null)
            {
                LearningTimeName = new string[learningTimeNameJD.Count];

                for (int i = 0; i < learningTimeNameJD.Count; i++)
                {
                    LearningTimeName[i] = (string)learningTimeNameJD[i];
                }
            }

            JsonData learningTimeJD = C_Json.GetJsonKeyJsonData(strData, "LearningTime");
            if (learningTimeJD != null)
            {
                LearningTime = new int[learningTimeJD.Count];

                for (int i = 0; i < learningTimeJD.Count; i++)
                {
                    LearningTime[i] = (int)learningTimeJD[i];
                }
            }

            JsonData restTimeNameJD = C_Json.GetJsonKeyJsonData(strData, "RestTimeName");
            if (restTimeNameJD != null)
            {
                RestTimeName = new string[restTimeNameJD.Count];

                for (int i = 0; i < restTimeNameJD.Count; i++)
                {
                    RestTimeName[i] = (string)restTimeNameJD[i];
                }
            }

            JsonData restTimeJD = C_Json.GetJsonKeyJsonData(strData, "RestTime");
            if (restTimeJD != null)
            {
                RestTime = new int[restTimeJD.Count];

                for (int i = 0; i < restTimeJD.Count; i++)
                {
                    RestTime[i] = (int)restTimeJD[i];
                }
            }
        }
    }
예제 #16
0
 /// <summary>
 /// 获取调解室的数据列表
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public ActionResult List(PageInfo info, string searchText)
 {
     return(Content(C_Json.toJson(manage.List(info, searchText))));
 }
예제 #17
0
        /// 获取律师的数据列表
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public ActionResult List(PageInfo info, string searchText)
        {
            LawyerManage manage = new LawyerManage();

            return(Content(C_Json.toJson(manage.List(info, searchText))));
        }