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:
parent
dc44142d29
commit
97f311d7be
24 changed files with 126 additions and 129 deletions
|
|
@ -23,7 +23,7 @@ namespace Server.Engines.Chat
|
|||
to?.Send(new ChatMessagePacket(null, (int)type + 20, param1, param2));
|
||||
}
|
||||
|
||||
public static void OpenChatWindowRequest(NetState state, CircularBufferReader reader)
|
||||
public static void OpenChatWindowRequest(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ namespace Server.Engines.Chat
|
|||
return user;
|
||||
}
|
||||
|
||||
public static void ChatAction(NetState state, CircularBufferReader reader)
|
||||
public static void ChatAction(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
if (!Enabled)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
return false;
|
||||
}
|
||||
|
||||
private static void RaceChangeReply(NetState state, CircularBufferReader reader)
|
||||
private static void RaceChangeReply(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
if (!m_Pending.TryGetValue(state, out var raceChangeState))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ namespace Server.Items
|
|||
IncomingPackets.Register(0x93, 99, true, OldHeaderChange);
|
||||
}
|
||||
|
||||
public static void OldHeaderChange(NetState state, CircularBufferReader reader)
|
||||
public static void OldHeaderChange(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ namespace Server.Items
|
|||
book.Author = Utility.FixHtml(author);
|
||||
}
|
||||
|
||||
public static void HeaderChange(NetState state, CircularBufferReader reader)
|
||||
public static void HeaderChange(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ namespace Server.Items
|
|||
book.Author = Utility.FixHtml(author);
|
||||
}
|
||||
|
||||
public static void ContentChange(NetState state, CircularBufferReader reader)
|
||||
public static void ContentChange(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ namespace Server.Items
|
|||
IncomingPackets.Register(0x71, 0, true, BBClientRequest);
|
||||
}
|
||||
|
||||
public static void BBClientRequest(NetState state, CircularBufferReader reader)
|
||||
public static void BBClientRequest(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Server.Engines.Mahjong
|
|||
RegisterSubCommand(0x18, MoveDealerIndicator);
|
||||
}
|
||||
|
||||
public static void OnPacket(NetState state,CircularBufferReader reader)
|
||||
public static void OnPacket(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var game = World.FindItem(reader.ReadUInt32()) as MahjongGame;
|
||||
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ namespace Server.Items
|
|||
IncomingPackets.Register(0x56, 11, true, OnMapCommand);
|
||||
}
|
||||
|
||||
private static void OnMapCommand(NetState state, CircularBufferReader reader)
|
||||
private static void OnMapCommand(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public static void OnReceive(NetState state, CircularBufferReader reader)
|
||||
public static void OnReceive(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
reader.ReadByte(); // 1: <4.0.1a, 2>=4.0.1a
|
||||
|
||||
|
|
|
|||
|
|
@ -1768,7 +1768,7 @@ namespace Server.Multis
|
|||
context.Foundation.SendInfoTo(state);
|
||||
}
|
||||
|
||||
public static void QueryDesignDetails(NetState state, CircularBufferReader reader)
|
||||
public static void QueryDesignDetails(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.SkillHandlers
|
|||
SkillInfo.Table[(int)SkillName.Tracking].Callback = OnUse;
|
||||
}
|
||||
|
||||
public static void QuestArrow(NetState state, CircularBufferReader reader)
|
||||
public static void QuestArrow(NetState state, CircularBufferReader reader, ref int packetLength)
|
||||
{
|
||||
if (state.Mobile is PlayerMobile from)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue