fix(core): Converts some packets & misc fixes/cleanup (#414)

- [X] Adds a stop music packet
- [X] Converts chat packets
- [X] Breaks out chat code a little bit more
- [X] Converts character statue animation packet
- [X] Renames some folders to have spaces
- [X] Organizes and consolidates incoming/outgoing packets for other content
- [X] Fixes virtual checks
This commit is contained in:
Kamron Batman 2021-01-16 21:01:54 -08:00 • committed by GitHub
parent a146955f6c
commit fbafd7210d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 814 additions and 662 deletions

View file

@ -20,6 +20,49 @@ namespace Server.Network
{
public static class MapItemPackets
{
public static void Configure()
{
IncomingPackets.Register(0x56, 11, true, OnMapCommand);
}
private static void OnMapCommand(NetState state, CircularBufferReader reader, ref int packetLength)
{
var from = state.Mobile;
if (!(World.FindItem(reader.ReadUInt32()) is MapItem map))
{
return;
}
int command = reader.ReadByte();
int number = reader.ReadByte();
int x = reader.ReadInt16();
int y = reader.ReadInt16();
switch (command)
{
case 1:
map.OnAddPin(from, x, y);
break;
case 2:
map.OnInsertPin(from, number, x, y);
break;
case 3:
map.OnChangePin(from, number, x, y);
break;
case 4:
map.OnRemovePin(from, number);
break;
case 5:
map.OnClearPins(from);
break;
case 6:
map.OnToggleEditable(from);
break;
}
}
public static void SendMapDetails(this NetState ns, MapItem map)
{
if (ns == null)