123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using UnityEngine;
- namespace GFGGame
- {
- public class ErrorCodeController
- {
- //返回结果为true时,表示可以在错误提示后继续处理后续逻辑
- public static bool Handler(int errorCode)
- {
- switch (errorCode)
- {
- case ET.ErrorCode.ERR_NetWorkError:
- {
- AlertSystem.Show("网络异常,也有可能是服务器异常,请稍后再试!")
- .SetRightButton(true, "好的", (object data) =>
- {
-
- });
- }
- break;
- case ET.ErrorCode.ERR_ClientVersionError:
- {
- AlertSystem.Show("客户端版本错误,请联系研发获取最新版本!")
- .SetLeftButton(true, "知道了", (data) =>
- {
- Application.Quit();
- });
- return false;
- }
- case ET.ErrorCode.Err_LoginCountFull:
- {
- AlertSystem.Show("游戏已爆满,请稍后再试!")
- .SetLeftButton(true, "好的", (data) =>
- {
-
- });
- }
- break;
- case ET.ErrorCode.Err_ServerMaintain:
- {
- AlertSystem.Show("服务器维护中,请稍后再试!")
- .SetLeftButton(true, "好的", (data) =>
- {
-
- });
- }
- break;
- case ET.ErrorCode.ERR_AntiAddiction:
- {
- string promptStr = "您属于未成年人,已被纳入防沉迷系统,当前为非游戏时间,本游戏将无法为未成年人用户提供游戏服务。";
- AlertSystem.Show(promptStr)
- .SetRightButton(true, "休息一下", (object data) =>
- {
- Application.Quit();
- });
- return false;
- }
- default:
- if (ErrorCodeCfgArray.Instance.GetCfg(errorCode) != null)
- {
- PromptController.Instance.ShowFloatTextPrompt(ErrorCodeCfgArray.Instance.GetCfg(errorCode).tips);
- ET.Log.Debug("errorCode" + errorCode.ToString());
- }
- else
- {
- PromptController.Instance.ShowFloatTextPrompt("errorCode " + errorCode.ToString());
- ET.Log.Error("errorCode" + errorCode.ToString());
- }
- break;
- }
- return true;
- }
- }
- }
|