2017-03-04 17:07:26 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CommonLibrary
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用于网络通信的二级协议头说明
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class CommonHeadCode
|
|
|
|
|
|
{
|
2017-06-17 10:44:34 +08:00
|
|
|
|
|
|
|
|
|
|
/************************************************************************************************
|
|
|
|
|
|
*
|
|
|
|
|
|
* 注意:您在准备二次开发时,应该重新生成一个自己的GUID码
|
|
|
|
|
|
*
|
|
|
|
|
|
**************************************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-05 18:32:55 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 用于同步和异步的网络的身份令牌,提升安全性
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static Guid KeyToken { get; set; } = new Guid("1275BB9A-14B2-4A96-9673-B0AF0463D474");
|
|
|
|
|
|
|
2017-06-16 09:52:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
2017-03-04 17:07:26 +08:00
|
|
|
|
/// <summary>
|
2017-06-16 09:52:58 +08:00
|
|
|
|
/// 同步通信的指令头说明,以10000开头,后面接20000,30000,
|
2017-03-04 17:07:26 +08:00
|
|
|
|
/// </summary>
|
2017-04-25 21:39:15 +08:00
|
|
|
|
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Auto)]
|
2017-03-04 17:07:26 +08:00
|
|
|
|
public class SimplifyHeadCode
|
|
|
|
|
|
{
|
2017-06-17 10:44:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 判断指令否是系统指令
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="customer">指令</param>
|
|
|
|
|
|
/// <returns>是否符合</returns>
|
|
|
|
|
|
public static bool IsCustomerGroupSystem(int customer)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (customer >= 10000 && customer < 11000);
|
|
|
|
|
|
}
|
2017-06-16 09:52:58 +08:00
|
|
|
|
public static int 维护检查 { get; } = 10000;//10000开始的表明是系统相关的
|
|
|
|
|
|
public static int 更新检查 { get; } = 10001;
|
|
|
|
|
|
public static int 账户检查 { get; } = 10002;
|
|
|
|
|
|
public static int 参数下载 { get; } = 10003;
|
|
|
|
|
|
public static int 密码修改 { get; } = 10004;
|
|
|
|
|
|
public static int 更细账户 { get; } = 10005;
|
|
|
|
|
|
public static int 获取账户 { get; } = 10006;
|
|
|
|
|
|
public static int 更新公告 { get; } = 10007;
|
|
|
|
|
|
public static int 注册账号 { get; } = 10008;
|
|
|
|
|
|
public static int 更新版本 { get; } = 10009;
|
|
|
|
|
|
public static int 请求文件 { get; } = 10010;
|
|
|
|
|
|
public static int 意见反馈 { get; } = 10011;
|
2017-06-17 18:36:29 +08:00
|
|
|
|
public static int 群发消息 { get; } = 10012;
|
2017-06-27 15:08:32 +08:00
|
|
|
|
public static int 异常消息 { get; } = 10013;
|
2017-07-02 10:29:48 +08:00
|
|
|
|
public static int 性能计数 { get; } = 10014;
|
2017-07-06 22:04:52 +08:00
|
|
|
|
public static int 请求小头 { get; } = 10015;
|
|
|
|
|
|
public static int 下载小头 { get; } = 10016;
|
|
|
|
|
|
public static int 请求大头 { get; } = 10017;
|
|
|
|
|
|
public static int 下载大头 { get; } = 10018;
|
2017-03-04 17:07:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-17 10:44:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 判断指令否是日志相关指令
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="customer">指令</param>
|
|
|
|
|
|
/// <returns>是否符合</returns>
|
|
|
|
|
|
public static bool IsCustomerGroupLogging(int customer)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (customer >= 11000 && customer < 12000);
|
|
|
|
|
|
}
|
2017-06-16 09:52:58 +08:00
|
|
|
|
public static int 网络日志查看 { get; } = 11000;//11000开头的是日志请求和清空
|
|
|
|
|
|
public static int 网络日志清空 { get; } = 11001;
|
|
|
|
|
|
public static int 同步日志查看 { get; } = 11002;
|
|
|
|
|
|
public static int 同步日志清空 { get; } = 11003;
|
|
|
|
|
|
public static int 更新日志查看 { get; } = 11004;
|
|
|
|
|
|
public static int 更新日志清空 { get; } = 11005;
|
|
|
|
|
|
public static int 运行日志查看 { get; } = 11006;
|
|
|
|
|
|
public static int 运行日志清空 { get; } = 11007;
|
|
|
|
|
|
public static int 文件日志查看 { get; } = 11008;
|
|
|
|
|
|
public static int 文件日志清空 { get; } = 11009;
|
|
|
|
|
|
public static int 反馈日志查看 { get; } = 11010;
|
|
|
|
|
|
public static int 反馈日志清空 { get; } = 11011;
|
|
|
|
|
|
public static int UDP日志查看 { get; } = 11012;
|
|
|
|
|
|
public static int UDP日志清空 { get; } = 11013;
|
2017-06-27 15:08:32 +08:00
|
|
|
|
public static int 客户端日志查看 { get; } = 11014;
|
|
|
|
|
|
public static int 客户端日志清空 { get; } = 11015;
|
2017-07-07 10:42:02 +08:00
|
|
|
|
public static int 头像日志查看 { get; } = 11016;
|
|
|
|
|
|
public static int 头像日志清空 { get; } = 11017;
|
2017-03-04 17:07:26 +08:00
|
|
|
|
|
2017-05-17 22:20:52 +08:00
|
|
|
|
/**************************************************************************************
|
|
|
|
|
|
*
|
2017-06-16 09:52:58 +08:00
|
|
|
|
* 为了保证您的指令头不和系统的冲突,您的指令头应该以20000之后开头
|
2017-05-17 22:20:52 +08:00
|
|
|
|
*
|
|
|
|
|
|
**************************************************************************************/
|
|
|
|
|
|
|
2017-03-04 17:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 异步通信的头说明,以字母H开头,后面跟I,G,K,L,M
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class MultiNetHeadCode
|
|
|
|
|
|
{
|
2017-06-17 10:44:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="customer">指令</param>
|
|
|
|
|
|
/// <returns>是否符合</returns>
|
|
|
|
|
|
public static bool IsCustomerGroupSystem(int customer)
|
|
|
|
|
|
{
|
|
|
|
|
|
return (customer >= 50000 && customer < 51000);
|
|
|
|
|
|
}
|
2017-06-16 09:52:58 +08:00
|
|
|
|
public static int 总在线信息 { get; } = 50000;
|
|
|
|
|
|
public static int 关闭客户端 { get; } = 50001;
|
|
|
|
|
|
public static int 弹窗新消息 { get; } = 50002;
|
|
|
|
|
|
public static int 时间的推送 { get; } = 50003;
|
|
|
|
|
|
public static int 文件总数量 { get; } = 50004;
|
|
|
|
|
|
public static int 初始化数据 { get; } = 50005;
|
|
|
|
|
|
public static int 留言版消息 { get; } = 50006;
|
2017-05-17 22:20:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************************
|
|
|
|
|
|
*
|
|
|
|
|
|
* 为了保证您的指令头不和系统的冲突,您的指令头应该以I,J,K,L开头
|
|
|
|
|
|
*
|
|
|
|
|
|
**************************************************************************************/
|
2017-03-04 17:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-17 22:20:52 +08:00
|
|
|
|
//可以在下面进行扩展,需要保证长度都是统一的,新建您自己的类型
|
2017-03-04 17:07:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|