Example #1
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);
            }
        }
Example #2
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));
        }