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

@ -0,0 +1,60 @@
/*************************************************************************
* ModernUO *
* Copyright (C) 2019-2021 - ModernUO Development Team *
* Email: hi@modernuo.com *
* File: CharacterStatuePackets.cs *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*************************************************************************/
using System;
using System.Buffers;
using Server.Network;
namespace Server.Engines.VeteranRewards
{
public static class CharacterStatuePackets
{
public const int StatueAnimationPacketLength = 17;
public static void CreateStatueAnimation(Span<byte> buffer, Serial serial, int status, int anim, int frame)
{
if (buffer[0] != 0)
{
return;
}
var writer = new SpanWriter(buffer);
writer.Write((byte)0xBF); // Packet ID
writer.Write((ushort)17);
writer.Write((short)0x19);
writer.Write((byte)0x5);
writer.Write(serial);
writer.Write((byte)0);
writer.Write((byte)0xFF);
writer.Write((byte)status);
writer.Write((byte)0);
writer.Write((byte)anim);
writer.Write((byte)0);
writer.Write((byte)frame);
}
public static void SendStatueAnimation(this NetState ns, Serial serial, int status, int anim, int frame)
{
if (ns == null)
{
return;
}
Span<byte> buffer = stackalloc byte[StatueAnimationPacketLength].InitializePacket();
CreateStatueAnimation(buffer, serial, status, anim, frame);
ns.Send(buffer);
}
}
}