Пример #1
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfMsgCode config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_MsgCode", fieldName, fieldValue);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        config = null;
                        return(false);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("MsgCode 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
Пример #2
0
        private void OnSCExceptionResponse(object responseMsg)
        {
            if (responseMsg is ExceptionRemoteLoginResponse)
            {
                ExceptionRemoteLoginResponse rsp = responseMsg as ExceptionRemoteLoginResponse;
                ConfMsgCode error_code           = ConfMsgCode.Get(rsp.Status.Code);
                string      error_str            = "loading_FB_X";

                if (null != error_code)
                {
                    if (!string.IsNullOrEmpty(error_code.popStr) && !string.IsNullOrWhiteSpace(error_code.popStr))
                    {
                        error_str = error_code.popStr;
                    }
                }

                BackToLogin("Timeout", error_str);
            }
            else if (responseMsg is ExceptionResponse)
            {
                ExceptionResponse rsp        = responseMsg as ExceptionResponse;
                ConfMsgCode       error_code = ConfMsgCode.Get(rsp.Status.Code);
                string            error_str  = "server_unusual";

                if (null != error_code)
                {
                    if (!string.IsNullOrEmpty(error_code.popStr) && !string.IsNullOrWhiteSpace(error_code.popStr))
                    {
                        error_str = error_code.popStr;
                    }
                }

                BackToLogin("Timeout", error_str);
            }
        }
Пример #3
0
        private static ConfMsgCode GetConfByDic(DataTable reader)
        {
            long   id       = reader.GetInt64(0);
            string errorStr = reader.GetString(1);
            string popStr   = reader.GetString(2);

            ConfMsgCode new_obj_ConfMsgCode = new ConfMsgCode(id,
                                                              errorStr,
                                                              popStr
                                                              );

            return(new_obj_ConfMsgCode);
        }
Пример #4
0
        public const int BUILDING_HAS_GOT       = 602;   //,"建筑已经解锁过了"),



        public static bool OnError(int code_, string customContent = "")
        {
            string error_str = string.Empty;
            string pop_str   = string.Empty;

            ConfMsgCode MC = ConfMsgCode.Get(code_);

            if (null == MC)
            {
                return(false);
            }

            if (!string.IsNullOrEmpty(MC.errorStr) && !string.IsNullOrWhiteSpace(MC.errorStr))
            {
                error_str = MC.errorStr;
            }

            if (!string.IsNullOrEmpty(MC.popStr) && !string.IsNullOrWhiteSpace(MC.popStr))
            {
                pop_str = MC.popStr;
            }

            if (!string.IsNullOrEmpty(error_str))
            {
                Debug.LogError(error_str);
            }

            StringBuilder errorContent = new StringBuilder();

            errorContent.Append(customContent);

            if (VIT_OUT == code_)
            {
                if (!PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_VIT))
                {
                    //PopUpManager.OpenGoToVitShop();
                    FrameMgr.OpenUIParams ui_param = new FrameMgr.OpenUIParams(UIDefine.UI_SHOPENERGY);
                    ui_param.Param = true;

                    EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(ui_param);
                }
            }
            else if (!string.IsNullOrEmpty(pop_str))
            {
                errorContent = errorContent.Append(pop_str);
                PopupInfo(errorContent.ToString());
            }

            return(!string.IsNullOrEmpty(error_str));
        }
Пример #5
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_MsgCode");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfMsgCode _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
Пример #6
0
        public static bool GetConfig(long id, out ConfMsgCode config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_MsgCode", id);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        dic[id] = null;
                        config  = null;
                        return(false);
                    }
                    dic[id] = config;
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("MsgCode 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
Пример #7
0
 public static void Register()
 {
     ConfAchievement.Init();
     ConfActiveDrop.Init();
     ConfActivityBase.Init();
     ConfAssetManifest.Init();
     Confbranchtask.Init();
     ConfBuilding.Init();
     ConfCartoonScene.Init();
     ConfChapter.Init();
     ConfCharge.Init();
     ConfChat.Init();
     ConfChatItem.Init();
     ConfCheckIn.Init();
     ConfCombineFormula.Init();
     ConfDemoScene.Init();
     ConfDropOut.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfDropOut2.Init();
     Confetl.Init();
     ConfEvent.Init();
     ConfEventAttribute.Init();
     ConfEventPhase.Init();
     Confexhibit.Init();
     ConfExpToLevel.Init();
     Conffailtips.Init();
     ConfFeedback.Init();
     ConfFind.Init();
     ConfFindClue.Init();
     ConfFindTypeIcon.Init();
     ConfGMCMD.Init();
     ConfGuid.Init();
     ConfGuidArt.Init();
     ConfGuidNew.Init();
     ConfGuidNewFunction.Init();
     Confinapppurchase.Init();
     ConfJigsawScene.Init();
     ConfKeyWords.Init();
     ConfLanguage.Init();
     ConfMsgCode.Init();
     ConfNode.Init();
     ConfNpc.Init();
     ConfOfficer.Init();
     ConfPath.Init();
     ConfPoliceRankIcon.Init();
     ConfProp.Init();
     ConfPropGift.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfPush.Init();
     ConfReasoning.Init();
     ConfScene.Init();
     ConfSceneDifficulty.Init();
     ConfSceneSpecial.Init();
     ConfServiceConfig.Init();
     ConfSkill.Init();
     ConfSkyEye.Init();
     ConfSound.Init();
     ConfTask.Init();
     ConfTitle.Init();
 }