Commit dd2729a2 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 WebSocketBehavior自带ID, 示例WSCF.RevCtrl.Test.Server 不需要自己创建GUID

parent fa4a5134
...@@ -64,7 +64,7 @@ namespace WSCF.RevCtrl.Test.Server ...@@ -64,7 +64,7 @@ namespace WSCF.RevCtrl.Test.Server
throw new Exception("有人在私聊,居然之前没有记录"); throw new Exception("有人在私聊,居然之前没有记录");
} }
var customerContext_target = customerContexts.Find(c => c.guid == targetGuid); var customerContext_target = customerContexts.Find(c => c.revCtrl_Proxy.ID == targetGuid);
if (customerContext_target == null) if (customerContext_target == null)
{ {
//没有这个目标 //没有这个目标
...@@ -73,7 +73,7 @@ namespace WSCF.RevCtrl.Test.Server ...@@ -73,7 +73,7 @@ namespace WSCF.RevCtrl.Test.Server
} }
customerContext_target.customer.SendMsgToPrivateChat( customerContext_target.customer.SendMsgToPrivateChat(
customerContext.guid, customerContext.revCtrl_Proxy.ID,
customerContext.customer.Name, customerContext.customer.Name,
DateTime.Now, DateTime.Now,
msg); msg);
...@@ -108,8 +108,7 @@ namespace WSCF.RevCtrl.Test.Server ...@@ -108,8 +108,7 @@ namespace WSCF.RevCtrl.Test.Server
customerContext = new CustomerContext() customerContext = new CustomerContext()
{ {
revCtrl_Proxy = proxy, revCtrl_Proxy = proxy,
customer = customer, customer = customer
guid = Guid.NewGuid().ToString()
}; };
customerContexts.Add(customerContext); customerContexts.Add(customerContext);
...@@ -132,7 +131,7 @@ namespace WSCF.RevCtrl.Test.Server ...@@ -132,7 +131,7 @@ namespace WSCF.RevCtrl.Test.Server
{ {
return new CustomerInfo() return new CustomerInfo()
{ {
Guid = cc.guid, Guid = cc.revCtrl_Proxy.ID,
Name = cc.customer.Name Name = cc.customer.Name
}; };
}).ToArray(); }).ToArray();
...@@ -169,6 +168,5 @@ namespace WSCF.RevCtrl.Test.Server ...@@ -169,6 +168,5 @@ namespace WSCF.RevCtrl.Test.Server
{ {
public RevCtrl_Proxy revCtrl_Proxy; public RevCtrl_Proxy revCtrl_Proxy;
public ICustomerService customer; public ICustomerService customer;
public string guid;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment