1
This commit is contained in:
@@ -101,7 +101,7 @@ namespace BITKit.Net
|
||||
BIT4Log.Log<KCPNetServer>($"{Name}:链接{id}超时,已断开");
|
||||
}
|
||||
|
||||
if (server.IsActive() is false || ManualTick) return;
|
||||
if (server.IsActive() is false) return;
|
||||
|
||||
server.Tick();
|
||||
|
||||
@@ -150,9 +150,11 @@ namespace BITKit.Net
|
||||
_timer.Interval = 1000f / TickRate;
|
||||
_interval = TimeSpan.FromSeconds(1.0 / TickRate);
|
||||
}
|
||||
|
||||
OnStartServer?.Invoke();
|
||||
server.Start(port);
|
||||
_timer.Start();
|
||||
if (ManualTick is false)
|
||||
_timer.Start();
|
||||
_isStarted = true;
|
||||
BIT4Log.Log<KCPNetServer>($"已启动KCP服务器:{port}");
|
||||
}
|
||||
@@ -551,14 +553,14 @@ namespace BITKit.Net
|
||||
{
|
||||
foreach (var methodInfo in rpcHandle.GetType().GetMethods())
|
||||
{
|
||||
var att = methodInfo.GetCustomAttribute<NetRpcAttribute>();
|
||||
var att = methodInfo.GetCustomAttribute<NetRpcAttribute>(true);
|
||||
if(att is null)continue;
|
||||
_rpcMethods.TryAdd(methodInfo.Name, methodInfo);
|
||||
_rpcHandles.TryAdd(methodInfo.Name, rpcHandle);
|
||||
}
|
||||
foreach (var eventInfo in rpcHandle.GetType().GetEvents())
|
||||
{
|
||||
var att = eventInfo.GetCustomAttribute<NetRpcAttribute>();
|
||||
var att = eventInfo.GetCustomAttribute<NetRpcAttribute>(true);
|
||||
if(att is null)continue;
|
||||
|
||||
_rpcEvents.TryAdd(eventInfo.Name, eventInfo);
|
||||
|
Reference in New Issue
Block a user