PSO2SERVER/Server/Protocol/Packets/04-ObjectRelatedPacket/04-80-MovementActionServerPacket.cs

62 lines
1.9 KiB
C#
Raw Normal View History

2024-09-18 01:50:29 +08:00
using Mysqlx.Crud;
using Mysqlx.Session;
using Org.BouncyCastle.Utilities;
using PSO2SERVER.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.Remoting.Contexts;
using System.Text;
namespace PSO2SERVER.Protocol.Packets
2024-09-18 01:50:29 +08:00
{
public class MovementActionServerPacket : Packet
{
private readonly int _user_playerid;
private readonly ObjectHeader _preformer;
private readonly byte[] _preData;
private readonly string _command;
private readonly byte[] _rest;
private readonly uint _thingCount;
private readonly byte[] _things;
private readonly byte[] _final;
public MovementActionServerPacket(int user_playerid, ObjectHeader preformer, byte[] preData
, string command, byte[] rest, uint thingCount, byte[] things, byte[] final
)
{
_user_playerid = user_playerid;
_preformer = preformer;
_preData = preData;
_command = command;
_rest = rest;
_thingCount = thingCount;
_things = things;
_final = things;
}
#region implemented abstract members of Packet
public override byte[] Build()
{
2024-12-06 03:42:25 +08:00
PacketWriter pkt = new PacketWriter();
pkt.WriteStruct(new ObjectHeader((uint)_user_playerid, ObjectType.Player));
pkt.WriteStruct(_preformer);
pkt.Write(_preData);
pkt.WriteAscii(_command, 0x4315, 0x7A);
pkt.Write(_rest);
pkt.WriteMagic(_thingCount, 0x4315, 0x7A);
pkt.Write(_things);
pkt.Write(_final);
2024-09-18 01:50:29 +08:00
2024-12-06 03:42:25 +08:00
return pkt.ToArray();
2024-09-18 01:50:29 +08:00
}
public override PacketHeader GetHeader()
{
2024-12-06 00:31:51 +08:00
return new PacketHeader(0x04, 0x80, PacketFlags.PACKED_OBJECT_RELATED);
2024-09-18 01:50:29 +08:00
}
#endregion
}
}