npsharp/src/libnpsharp/RPC/Messages/RPCMessage.cs

16 lines
435 B
C#

using System.Linq;
namespace NPSharp.RPC.Messages
{
public abstract class RPCMessage
{
internal const uint Signature = 0xDEADC0DE; // I wonder if aiw3 changed this since kernal noted it in his source code.
public uint GetTypeId()
{
var packet = (PacketAttribute) GetType().GetCustomAttributes(typeof (PacketAttribute), false).Single();
return packet.Type;
}
}
}