|
@@ -11,46 +11,69 @@ namespace GFGGame
|
|
|
{
|
|
|
public static bool Handler(int errorCode)
|
|
|
{
|
|
|
- if (errorCode == ET.ErrorCode.ERR_Success)
|
|
|
+ switch(errorCode)
|
|
|
{
|
|
|
- return false;
|
|
|
- }
|
|
|
- else if (errorCode == ET.ErrorCode.ERR_NetWorkError)
|
|
|
- {
|
|
|
- Alert.Show("连接服务器失败:\n请检查网络和服务器状态")
|
|
|
- .SetRightButton(true, "知道啦", (object data) =>
|
|
|
- {
|
|
|
- Application.Quit();
|
|
|
- });
|
|
|
- }
|
|
|
- else if (errorCode == ET.ErrorCode.ERR_ClientVersionError)
|
|
|
- {
|
|
|
- Alert.Show("版本已更新,请联系研发获取最新版本")
|
|
|
- .SetLeftButton(true, "知道了", (data) =>
|
|
|
+ case ET.ErrorCode.ERR_Success:
|
|
|
{
|
|
|
- Application.Quit();
|
|
|
- });
|
|
|
- }
|
|
|
- else if (errorCode == ET.ErrorCode.ERR_AntiAddiction)
|
|
|
- {
|
|
|
- string promptStr = "您属于未成年人,已被纳入防沉迷系统。每日22时至次日8时,本游戏将无法为未成年人用户提供游戏服务。";
|
|
|
- Alert.Show(promptStr)
|
|
|
- .SetRightButton(true, "知道啦", (object data) =>
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ case ET.ErrorCode.ERR_NetWorkError:
|
|
|
+ {
|
|
|
+ Alert.Show("网络异常")
|
|
|
+ .SetRightButton(true, "知道了", (object data) =>
|
|
|
+ {
|
|
|
+ Application.Quit();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ET.ErrorCode.ERR_ClientVersionError:
|
|
|
+ {
|
|
|
+ Alert.Show("客户端版本错误,请联系研发获取最新版本!")
|
|
|
+ .SetLeftButton(true, "知道了", (data) =>
|
|
|
+ {
|
|
|
+ Application.Quit();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ET.ErrorCode.Err_LoginCountFull:
|
|
|
+ {
|
|
|
+ Alert.Show("游戏已爆满,请稍后再试!")
|
|
|
+ .SetLeftButton(true, "知道了");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ET.ErrorCode.Err_ServerMaintain:
|
|
|
{
|
|
|
+ Alert.Show("服务器维护中,请稍后再试!")
|
|
|
+ .SetLeftButton(true, "知道了", (data) =>
|
|
|
+ {
|
|
|
+ Application.Quit();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ET.ErrorCode.ERR_AntiAddiction:
|
|
|
+ {
|
|
|
+ string promptStr = "您属于未成年人,已被纳入防沉迷系统。每日22时至次日8时,本游戏将无法为未成年人用户提供游戏服务。";
|
|
|
+ Alert.Show(promptStr)
|
|
|
+ .SetRightButton(true, "知道啦", (object data) =>
|
|
|
+ {
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ if (ErrorCodeCfgArray.Instance.GetCfg(errorCode) != null)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt(ErrorCodeCfgArray.Instance.GetCfg(errorCode).tips);
|
|
|
+ ET.Log.Error("errorCode" + errorCode.ToString());
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("errorCode " + errorCode.ToString());
|
|
|
+ ET.Log.Error("errorCode" + errorCode.ToString());
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
- });
|
|
|
- }
|
|
|
- else if (ErrorCodeCfgArray.Instance.GetCfg(errorCode) != null)
|
|
|
- {
|
|
|
- PromptController.Instance.ShowFloatTextPrompt(ErrorCodeCfgArray.Instance.GetCfg(errorCode).tips);
|
|
|
- ET.Log.Error("errorCode" + errorCode.ToString());
|
|
|
- return true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- PromptController.Instance.ShowFloatTextPrompt("errorCode " + errorCode.ToString());
|
|
|
- ET.Log.Error("errorCode" + errorCode.ToString());
|
|
|
- return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|