47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace PSO2SERVER.Models
|
|
{
|
|
public struct PacketHeader
|
|
{
|
|
public UInt32 Size;
|
|
public byte Type;
|
|
public byte Subtype;
|
|
public byte Flags1;
|
|
public byte Flags2;
|
|
|
|
public PacketHeader(int size, byte type, byte subtype, byte flags1, byte flags2)
|
|
{
|
|
this.Size = (uint)size;
|
|
this.Type = type;
|
|
this.Subtype = subtype;
|
|
this.Flags1 = flags1;
|
|
this.Flags2 = flags2;
|
|
}
|
|
|
|
public PacketHeader(byte type, byte subtype) : this(type, subtype, (byte)0)
|
|
{
|
|
}
|
|
|
|
public PacketHeader(byte type, byte subtype, byte flags1) : this(0, type, subtype, flags1, 0)
|
|
{
|
|
}
|
|
|
|
public PacketHeader(byte type, byte subtype, PacketFlags packetFlags) : this(type, subtype, (byte)packetFlags)
|
|
{
|
|
}
|
|
}
|
|
|
|
[Flags]
|
|
public enum PacketFlags : byte
|
|
{
|
|
None,
|
|
PACKED = 0x4,
|
|
FLAG_10 = 0x10,
|
|
FULL_MOVEMENT = 0x20,
|
|
OBJECT_RELATED = 0x40
|
|
}
|
|
}
|
|
|