mirror of
https://github.com/modernuo/ModernUO
synced 2026-08-11 22:23:06 -04:00
13 lines
575 B
C#
13 lines
575 B
C#
using System.Runtime.CompilerServices;
|
|
|
|
namespace Server.Network;
|
|
|
|
public static class OutgoingPackets
|
|
{
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static bool CannotSendPackets(this NetState ns) =>
|
|
// Do not check for NetState.Running. Packets are sent to a "disconnected" socket as part of the OnDisconnect events
|
|
// up until the Connection is nulled. Closing the connection is done synchronously, therefore packets will not be sent
|
|
// once the Mobile.NetState is null.
|
|
ns?.Connection == null || ns.BlockAllPackets;
|
|
}
|