fix: Stops creating blocked packets entirely (#944)

Optimizes larger servers where users are logging in and packets are being created for no reason.
This commit is contained in:
Kamron Batman 2022-02-27 00:13:49 -08:00 • committed by GitHub
parent 5db8b1354c
commit 941452de4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 5510 additions and 5537 deletions

View file

@ -135,7 +135,7 @@ namespace Server.Items
public static void SendBookContent(this NetState ns, BaseBook book)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -183,7 +183,7 @@ namespace Server.Items
public static void SendBookCover(this NetState ns, Mobile from, BaseBook book)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}

View file

@ -168,7 +168,7 @@ namespace Server.Network
public static void SendBBDisplayBoard(this NetState ns, BaseBulletinBoard board)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -203,7 +203,7 @@ namespace Server.Network
public static void SendBBMessage(this NetState ns, BaseBulletinBoard board, BulletinMessage msg, bool content = false)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}

View file

@ -287,7 +287,7 @@ namespace Server.Engines.Mahjong
public static void SendMahjongJoinGame(this NetState ns, Serial game)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -303,7 +303,7 @@ namespace Server.Engines.Mahjong
public static void SendMahjongPlayersInfo(this NetState ns, MahjongGame game, Mobile to)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -361,7 +361,7 @@ namespace Server.Engines.Mahjong
public static void SendMahjongTileInfo(this NetState ns, MahjongTile tile, Mobile to)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -407,7 +407,7 @@ namespace Server.Engines.Mahjong
public static void SendMahjongTilesInfo(this NetState ns, MahjongGame game, Mobile to)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -460,7 +460,7 @@ namespace Server.Engines.Mahjong
public static void SendMahjongGeneralInfo(this NetState ns, MahjongGame game)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -503,7 +503,7 @@ namespace Server.Engines.Mahjong
public static void SendMahjongRelieve(this NetState ns, Serial game)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}

View file

@ -65,7 +65,7 @@ namespace Server.Network
public static void SendMapDetails(this NetState ns, MapItem map)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -93,7 +93,7 @@ namespace Server.Network
public static void SendMapCommand(this NetState ns, MapItem map, int command, int x = 0, int y = 0, bool editable = false)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}

View file

@ -23,7 +23,7 @@ namespace Server.Network
{
public static void SendCorpseEquip(this NetState ns, Mobile beholder, Corpse beheld)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}
@ -67,7 +67,7 @@ namespace Server.Network
public static void SendCorpseContent(this NetState ns, Mobile beholder, Corpse beheld)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}

View file

@ -671,7 +671,7 @@ namespace Server.Items
// The client must know about the spellbook or it will crash!
var ns = to.NetState;
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}

View file

@ -32,7 +32,7 @@ namespace Server.Items
public static void SendToggleSpecialAbility(this NetState ns, int abilityId, bool active)
{
if (ns == null)
if (ns.CannotSendPackets())
{
return;
}