Skip to content

Commit d267efe

Browse files
committed
feat(NetWork): 添加网络操作错误码枚举类
添加 OperationErrorCode 类,包含17种常见的网络操作错误码,用于统一管理网络操作中的错误状态码。每个错误码都包含中文描述信息,便于开发调试和错误处理。
1 parent ab6680e commit d267efe

File tree

1 file changed

+146
-0
lines changed

1 file changed

+146
-0
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
// ==========================================================================================
2+
// GameFrameX 组织及其衍生项目的版权、商标、专利及其他相关权利
3+
// GameFrameX organization and its derivative projects' copyrights, trademarks, patents, and related rights
4+
// 均受中华人民共和国及相关国际法律法规保护。
5+
// are protected by the laws of the People's Republic of China and relevant international regulations.
6+
//
7+
// 使用本项目须严格遵守相应法律法规及开源许可证之规定。
8+
// Usage of this project must strictly comply with applicable laws, regulations, and open-source licenses.
9+
//
10+
// 本项目采用 MIT 许可证与 Apache License 2.0 双许可证分发,
11+
// This project is dual-licensed under the MIT License and Apache License 2.0,
12+
// 完整许可证文本请参见源代码根目录下的 LICENSE 文件。
13+
// please refer to the LICENSE file in the root directory of the source code for the full license text.
14+
//
15+
// 禁止利用本项目实施任何危害国家安全、破坏社会秩序、
16+
// It is prohibited to use this project to engage in any activities that endanger national security, disrupt social order,
17+
// 侵犯他人合法权益等法律法规所禁止的行为!
18+
// or infringe upon the legitimate rights and interests of others, as prohibited by laws and regulations!
19+
// 因基于本项目二次开发所产生的一切法律纠纷与责任,
20+
// Any legal disputes and liabilities arising from secondary development based on this project
21+
// 本项目组织与贡献者概不承担。
22+
// shall be borne solely by the developer; the project organization and contributors assume no responsibility.
23+
//
24+
// GitHub 仓库:https://github.com/GameFrameX
25+
// GitHub Repository: https://github.com/GameFrameX
26+
// Gitee 仓库:https://gitee.com/GameFrameX
27+
// Gitee Repository: https://gitee.com/GameFrameX
28+
// 官方文档:https://gameframex.doc.alianblank.com/
29+
// Official Documentation: https://gameframex.doc.alianblank.com/
30+
// ==========================================================================================
31+
32+
namespace GameFrameX.NetWork;
33+
34+
/// <summary>
35+
/// 操作错误码
36+
/// </summary>
37+
public static class OperationErrorCode
38+
{
39+
/// <summary>
40+
/// 成功
41+
/// </summary>
42+
[System.ComponentModel.Description("成功")]
43+
public const int Success = 0;
44+
45+
/// <summary>
46+
/// 配置表错误
47+
/// </summary>
48+
[System.ComponentModel.Description("配置表错误")]
49+
public const int ConfigErr = 1;
50+
51+
/// <summary>
52+
/// 参数错误
53+
/// </summary>
54+
[System.ComponentModel.Description("客户端传递参数错误")]
55+
public const int ParamErr = 2;
56+
57+
/// <summary>
58+
/// 消耗不足
59+
/// </summary>
60+
[System.ComponentModel.Description("消耗不足")]
61+
public const int CostNotEnough = 3;
62+
63+
/// <summary>
64+
/// 未开通服务
65+
/// </summary>
66+
[System.ComponentModel.Description("未开通服务")]
67+
public const int Forbidden = 4;
68+
69+
/// <summary>
70+
/// 不存在
71+
/// </summary>
72+
[System.ComponentModel.Description("不存在")]
73+
public const int NotFound = 5;
74+
75+
/// <summary>
76+
/// 已经存在
77+
/// </summary>
78+
[System.ComponentModel.Description("已经存在")]
79+
public const int HasExist = 6;
80+
81+
/// <summary>
82+
/// 账号不存在或为空
83+
/// </summary>
84+
[System.ComponentModel.Description("账号不存在或为空")]
85+
public const int AccountCannotBeNull = 7;
86+
87+
/// <summary>
88+
/// 无法执行数据库修改
89+
/// </summary>
90+
[System.ComponentModel.Description("无法执行数据库修改")]
91+
public const int Unprocessable = 8;
92+
93+
/// <summary>
94+
/// 未知平台
95+
/// </summary>
96+
[System.ComponentModel.Description("未知平台")]
97+
public const int UnknownPlatform = 9;
98+
99+
/// <summary>
100+
/// 正常通知
101+
/// </summary>
102+
[System.ComponentModel.Description("正常通知")]
103+
public const int Notice = 10;
104+
105+
/// <summary>
106+
/// 功能未开启,主消息屏蔽
107+
/// </summary>
108+
[System.ComponentModel.Description("功能未开启,主消息屏蔽")]
109+
public const int FuncNotOpen = 11;
110+
111+
/// <summary>
112+
/// 其他
113+
/// </summary>
114+
[System.ComponentModel.Description("其他")]
115+
public const int Other = 12;
116+
117+
/// <summary>
118+
/// 内部服务错误
119+
/// </summary>
120+
[System.ComponentModel.Description("内部服务错误")]
121+
public const int InternalServerError = 13;
122+
123+
/// <summary>
124+
/// 通知客户端服务器人数已达上限
125+
/// </summary>
126+
[System.ComponentModel.Description("通知客户端服务器人数已达上限")]
127+
public const int ServerFullyLoaded = 14;
128+
129+
/// <summary>
130+
/// 已经过期
131+
/// </summary>
132+
[System.ComponentModel.Description("已经过期")]
133+
public const int HasExpiration = 15;
134+
135+
/// <summary>
136+
/// 角色未授权;直接踢下线
137+
/// </summary>
138+
[System.ComponentModel.Description("角色未授权;直接踢下线")]
139+
public const int PlayerUnauthorized = 16;
140+
141+
/// <summary>
142+
/// 没有权限
143+
/// </summary>
144+
[System.ComponentModel.Description("没有权限")]
145+
public const int NoPermission = 17;
146+
}

0 commit comments

Comments
 (0)