fix(core): Removes 6017 handler (#411)

- [X] Removes 6017 handler since it is only used in one place
- [X] Exposes a ref int to modify the packet length. This is acceptable since we technically have access to the entire reader/buffer.
This commit is contained in:
Kamron Batman 2021-01-16 13:43:16 -08:00 committed by GitHub
parent dc44142d29
commit 97f311d7be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 126 additions and 129 deletions

View file

@ -25,7 +25,7 @@ namespace Server.Network
public static PacketHandler GetHandler(int packetID) =>
packetID >= 0 && packetID < _handlers.Length ? _handlers[packetID] : null;
public static void DecodeBundledPacket(NetState state, CircularBufferReader reader)
public static void DecodeBundledPacket(NetState state, CircularBufferReader reader, ref int packetLength)
{
int packetID = reader.ReadByte();
@ -47,25 +47,25 @@ namespace Server.Network
}
else
{
ph.OnReceive(state, reader);
ph.OnReceive(state, reader, ref packetLength);
}
}
public static void QueryGuildMemberLocations(NetState ns, CircularBufferReader reader)
public static void QueryGuildMemberLocations(NetState state, CircularBufferReader reader, ref int packetLength)
{
Mobile from = ns.Mobile;
Mobile from = state.Mobile;
ns.SendGuildMemberLocations(from, from.Guild as Guild, reader.ReadBoolean());
state.SendGuildMemberLocations(from, from.Guild as Guild, reader.ReadBoolean());
}
public static void QueryPartyMemberLocations(NetState ns, CircularBufferReader reader)
public static void QueryPartyMemberLocations(NetState state, CircularBufferReader reader, ref int packetLength)
{
Mobile from = ns.Mobile;
Mobile from = state.Mobile;
var party = Party.Get(from);
if (party != null)
{
ns.SendPartyMemberLocations(from, party);
state.SendPartyMemberLocations(from, party);
}
}