This commit is contained in:
parent
b3996f7bf3
commit
ceea55b67a
|
@ -439,10 +439,12 @@ namespace BITKit.Net
|
||||||
|
|
||||||
public void Tick()
|
public void Tick()
|
||||||
{
|
{
|
||||||
while (commandQueue.TryDequeue(out var bytes))
|
try
|
||||||
{
|
{
|
||||||
client.Send(bytes, KcpChannel.Reliable);
|
while (commandQueue.TryDequeue(out var bytes))
|
||||||
}
|
{
|
||||||
|
client.Send(bytes, KcpChannel.Reliable);
|
||||||
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (_pingInterval.AllowUpdate)
|
if (_pingInterval.AllowUpdate)
|
||||||
|
@ -452,7 +454,12 @@ namespace BITKit.Net
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
client.Tick();
|
client.Tick();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
BIT4Log.LogException(e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,15 @@ namespace BITKit.Net
|
||||||
|
|
||||||
private void Tick(object sender, ElapsedEventArgs e)
|
private void Tick(object sender, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
if (server.IsActive() is false || ManualTick) return;
|
try
|
||||||
|
{
|
||||||
|
if (server.IsActive() is false || ManualTick) return;
|
||||||
server.Tick();
|
server.Tick();
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
BIT4Log.LogException(exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartServer(ushort port = 27014)
|
public void StartServer(ushort port = 27014)
|
||||||
|
|
Loading…
Reference in New Issue