forked from powerfun/udpservice
减少通信字段;通信添加比赛字段;
This commit is contained in:
1 parent
3e28d52154
commit
70abe45eb0
2 files changed
+16
-3
No files matched your search
@@ -199,7 +199,19 @@ namespace OnlineUserPool.ViewModels
|
||||
|
||||
private static void SendMessage(Collection<HostModel> clients, List<MsgModel> msgModels)
|
||||
{
|
||||
string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(msgModels);
|
||||
string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(msgModels.Select(m=> new {
|
||||
m.RouteId,
|
||||
m.MemberId,
|
||||
m.Point,
|
||||
m.IsCompleted,
|
||||
m.exit,
|
||||
m.Speed,
|
||||
m.PreDistance,
|
||||
m.EndDistance,
|
||||
m.IsVirtual,//后面要把这个字段过滤掉
|
||||
m.WeightKg,
|
||||
m.Competitionid
|
||||
}));
|
||||
var data = Encoding.ASCII.GetBytes(jsonString);
|
||||
foreach (var item in clients)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user