6 major server modules (PdkFriendServer/GlobalSever/ServerCore/GameModule/GameNetModule) + game logic (GameFix/GameDAL/ServerData) + network layer (NetWorkMessage) + data layer (ObjectModel) + utilities (MrWu/Core/Config/CloudAPI/dll) + adapters (zyxAdapter/base) .NET 8.0 C# solution, 16 projects, 958 source files
20 lines
564 B
C#
20 lines
564 B
C#
using System.Threading;
|
||
using MrWu.Debug;
|
||
|
||
namespace Server.Net
|
||
{
|
||
public static class NetServices
|
||
{
|
||
//private static long idGenerator;
|
||
|
||
// 防止与内网进程号的ChannelId冲突,所以设置为一个大的随机数
|
||
private static long acceptIdGenerator = long.MinValue;
|
||
|
||
public static long CreateAcceptChannelId()
|
||
{
|
||
long value = Interlocked.Increment(ref acceptIdGenerator);
|
||
//Debug.Info($"得到Value:{value}");
|
||
return value;
|
||
}
|
||
}
|
||
} |