mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using DotRecast.Core.Collections;
|
||||
using Google.Protobuf;
|
||||
using JNGame.Network.Entity;
|
||||
using JNGame.Network.Util;
|
||||
@@ -92,10 +91,10 @@ namespace JNGame.Network
|
||||
if (hId == 0)
|
||||
{
|
||||
int size = 0;
|
||||
_byteSize.ForEach(child =>
|
||||
foreach (var child in _byteSize)
|
||||
{
|
||||
size += child.Value;
|
||||
});
|
||||
}
|
||||
return size;
|
||||
}
|
||||
return _byteSize.GetValueOrDefault(hId, 0);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DotRecast.Core.Collections;
|
||||
using JNGame.Runtime.System;
|
||||
using JNGame.Util;
|
||||
|
||||
@@ -61,10 +60,10 @@ namespace JNGame.Network
|
||||
int size = 0;
|
||||
try
|
||||
{
|
||||
_byteSize.ForEach(child =>
|
||||
foreach (var child in _byteSize)
|
||||
{
|
||||
size += child.Value;
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@@ -2,7 +2,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using DotRecast.Core.Collections;
|
||||
using Google.Protobuf;
|
||||
using JNGame.Network.Action;
|
||||
using JNGame.Network.Entity;
|
||||
@@ -142,13 +141,13 @@ namespace JNGame.Network
|
||||
public void AllSend(int hId,IMessage data = null,Func<SocketClient,bool> filter = null)
|
||||
{
|
||||
filter ??= (SocketClient client) => true;
|
||||
service.GetClients().ForEach(client =>
|
||||
foreach (var client in service.GetClients())
|
||||
{
|
||||
if (filter(client))
|
||||
{
|
||||
Send(client, hId, data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user