This commit is contained in:
CortexCore
2024-06-14 17:50:29 +08:00
parent dfa249677f
commit b368e8258b
3 changed files with 11 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ namespace BITKit.Net
{
public class KCPNetServer:INetServer,INetProvider
{
public int TickRate { get; set; }
public bool ManualTick { get; set; }
public event Action<int> OnClientConnected;
public event Action<int> OnClientDisconnected;
@@ -80,6 +81,10 @@ namespace BITKit.Net
{
if (IsRunningServer is false)
{
if (TickRate > 0)
{
_timer.Interval = 1000f / TickRate;
}
OnStartServer?.Invoke();
server.Start(port);
_timer.Start();