@@ -15,7 +15,7 @@ public abstract class ENetServer : IDisposable
1515 public ConcurrentQueue < ENetCmd > ENetCmds { get ; set ; }
1616 public ushort MaxPlayers { get ; set ; }
1717
18- protected CancellationTokenSource CancelTokenSource { get ; set ; }
18+ protected CancellationTokenSource CTS { get ; set ; }
1919 protected bool QueueRestart { get ; set ; }
2020 protected long SomeoneConnected = 0 ;
2121 protected long Running = 0 ;
@@ -38,11 +38,11 @@ public async Task Start(ushort port, int maxClients)
3838 return ;
3939 }
4040
41- CancelTokenSource = new CancellationTokenSource ( ) ;
41+ CTS = new CancellationTokenSource ( ) ;
4242
4343 try
4444 {
45- await Task . Run ( ( ) => ENetThreadWorker ( port , maxClients ) , CancelTokenSource . Token ) ;
45+ await Task . Run ( ( ) => ENetThreadWorker ( port , maxClients ) , CTS . Token ) ;
4646 }
4747 catch ( Exception e )
4848 {
@@ -147,7 +147,7 @@ private async Task ENetThreadWorker(ushort port, int maxClients)
147147 Log ( $ "Server listening on port { port } ") ;
148148 Running = 1 ;
149149
150- while ( ! CancelTokenSource . IsCancellationRequested )
150+ while ( ! CTS . IsCancellationRequested )
151151 {
152152 bool polled = false ;
153153
@@ -259,7 +259,7 @@ private void Send(ServerPacket gamePacket, Peer peer)
259259 peer . Send ( channelID , ref packet ) ;
260260 }
261261
262- private bool ConcurrentQueuesWorking ( ) => NetworkManager . GodotCmds . Count != 0 || ENetCmds . Count != 0 || Outgoing . Count != 0 ;
262+ private bool ConcurrentQueuesWorking ( ) => ENetCmds . Count != 0 || Outgoing . Count != 0 ;
263263
264264 public virtual void Dispose ( )
265265 { }
0 commit comments