优化服务器端指令头分类操作

This commit is contained in:
dathlin
2017-06-17 10:44:34 +08:00
parent ed8dc29129
commit a8aad0b3dc
2 changed files with 38 additions and 4 deletions

View File

@@ -335,11 +335,11 @@ namespace 软件系统服务端模版
private void Net_simplify_server_ReceiveStringEvent(AsyncStateOne state, int customer, string data)
{
//必须返回结果调用SendMessage(object1,[实际数据]);
if (customer < 11000)
if (CommonHeadCode.SimplifyHeadCode.IsCustomerGroupSystem(customer))
{
DataProcessingWithStartA(state, customer, data);
}
else if (customer < 12000)
else if (CommonHeadCode.SimplifyHeadCode.IsCustomerGroupLogging(customer))
{
DataProcessingWithStartB(state, customer, data);
}
@@ -604,7 +604,7 @@ namespace 软件系统服务端模版
private void Net_socket_server_AcceptString(AsyncStateOne object1, int customer, string data)
{
//如果此处充斥大量if语句影响观感则考虑进行指令头分类操作客户端异步发送的字符串都会到此处处理
if (50000 <= customer && customer < 51000)
if (CommonHeadCode.MultiNetHeadCode.IsCustomerGroupSystem(customer))
{
//H类系统指令
DataProcessingWithStartH(object1, customer, data);