public void DoDisconnect(INetChannel channel, string reason) { Timer.Spawn(TimeSpan.FromMilliseconds(100), () => { if (!channel.IsConnected) { return; } // We do this so the client can set net.fakeloss 1 before getting ghosted. // This avoids it spamming messages at the server that cause warnings due to unconnected client. channel.SendMessage(new MsgGhostKick()); Timer.Spawn(TimeSpan.FromMilliseconds(100), () => { if (!channel.IsConnected) { return; } // Actually just remove the client entirely. channel.Disconnect(reason, false); }); }); }
/// <inheritdoc /> public void DisconnectChannel(INetChannel channel, string reason) { channel.Disconnect(reason); }