public static MsgItem Create(int uid, int value, int param, MsgItemType type) { var packet = stackalloc MsgItem[1]; { packet->Size = (ushort)sizeof(MsgItem); packet->Id = 1009; packet->UnqiueId = uid; packet->Param = param; packet->Type = type; packet->Value = value; packet->Timestamp = Environment.TickCount; } var buffer = BufferPool.GetBuffer(); fixed(byte *p = buffer) * (MsgItem *)p = *packet; return(buffer); }
public MessageItem(MsgItemType it, int size) { ItemType = it; Size = size; }
public MessageItem(MsgItemType it) : this(it, 0) { }