本文整理汇总了C#中UltimaXNA.Core.Network.PacketReader.ReadInt16方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadInt16方法的具体用法?C# PacketReader.ReadInt16怎么用?C# PacketReader.ReadInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UltimaXNA.Core.Network.PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadInt16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateHealthPacket
public UpdateHealthPacket(PacketReader reader)
: base(0xA1, "Update Health")
{
m_serial = reader.ReadInt32();
m_max = reader.ReadInt16();
m_current = reader.ReadInt16();
}
示例2: ObjectPropertyListPacket
public ObjectPropertyListPacket(PacketReader reader)
: base(0xD6, "Object Property List")
{
reader.ReadInt16(); // Always 0x0001
m_serial = reader.ReadInt32();
reader.ReadInt16(); // Always 0x0000
m_hash = reader.ReadInt32();
m_clilocs = new List<int>();
m_arguments = new List<string>();
// Loop of all the item/creature's properties to display in the order to display them. The name is always the first entry.
int clilocId = reader.ReadInt32();
while (clilocId != 0)
{
m_clilocs.Add(clilocId);
int textLength = reader.ReadUInt16();
string args = string.Empty;
if (textLength > 0)
{
args = reader.ReadUnicodeStringReverse(textLength / 2);
}
m_arguments.Add(args);
clilocId = reader.ReadInt32();
}
}
示例3: ObjectInfoPacket
public ObjectInfoPacket(PacketReader reader)
: base(0x1A, "ObjectInfoPacket")
{
Serial = reader.ReadInt32();
ItemID = reader.ReadUInt16();
Amount = (ushort)(((Serial & 0x80000000) == 0x80000000) ? reader.ReadUInt16() : 0);
X = reader.ReadInt16();
Y = reader.ReadInt16();
Direction = (byte)(((X & 0x8000) == 0x8000) ? reader.ReadByte() : 0);
Z = reader.ReadSByte();
Hue = (ushort)(((Y & 0x8000) == 0x8000) ? reader.ReadUInt16() : 0);
Flags = (byte)(((Y & 0x4000) == 0x4000) ? reader.ReadByte() : 0);
// sanitize values
Serial = (int)(Serial & 0x7FFFFFFF);
ItemID = (ushort)(ItemID & 0x7FFF);
X = (short)(X & 0x7FFF);
Y = (short)(Y & 0x3FFF);
}
示例4: UpdateStaminaPacket
public UpdateStaminaPacket(PacketReader reader)
: base(0xA3, "Update Stamina")
{
m_serial = reader.ReadInt32();
m_max = reader.ReadInt16();
m_current = reader.ReadInt16();
}
示例5: ContainerContentPacket
public ContainerContentPacket(PacketReader reader)
: base(0x3C, "Container ContentPacket")
{
int itemCount = reader.ReadUInt16();
List<ItemInContainer> items = new List<ItemInContainer>(itemCount);
bool PacketIsPre6017 = (reader.Buffer.Length == 5 + (19 * itemCount));
for (int i = 0; i < itemCount; i++)
{
Serial serial = reader.ReadInt32();
int iItemID = reader.ReadUInt16();
int iUnknown = reader.ReadByte(); // signed, itemID offset. always 0 in RunUO.
int iAmount = reader.ReadUInt16();
int iX = reader.ReadInt16();
int iY = reader.ReadInt16();
int iGridLocation = 0;
if (!PacketIsPre6017)
iGridLocation = reader.ReadByte(); // always 0 in RunUO.
int iContainerSerial = reader.ReadInt32();
int iHue = reader.ReadUInt16();
items.Add(new ItemInContainer(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue));
}
m_items = items.ToArray();
}
示例6: ContainerContentPacket
public ContainerContentPacket(PacketReader reader)
: base(0x3C, "Container ContentPacket")
{
int itemCount = reader.ReadUInt16();
List<ContentItem> items = new List<ContentItem>(itemCount);
for (int i = 0; i < itemCount; i++)
{
Serial serial = reader.ReadInt32();
int iItemID = reader.ReadUInt16();
int iUnknown = reader.ReadByte(); // signed, itemID offset. always 0 in RunUO.
int iAmount = reader.ReadUInt16();
int iX = reader.ReadInt16();
int iY = reader.ReadInt16();
int iGridLocation = 0;
if (!NextContainerContentsIsPre6017)
iGridLocation = reader.ReadByte(); // always 0 in RunUO.
int iContainerSerial = reader.ReadInt32();
int iHue = reader.ReadUInt16();
items.Add(new ContentItem(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue));
}
m_items = items.ToArray();
if (NextContainerContentsIsPre6017)
NextContainerContentsIsPre6017 = false;
}
示例7: CustomHousePacket
public CustomHousePacket(PacketReader reader)
: base(0xD8, "Custom House Packet")
{
byte CompressionType = reader.ReadByte();
if (CompressionType != 3)
{
m_houseSerial = Serial.Null;
return;
}
reader.ReadByte(); // unknown, always 0?
m_houseSerial = reader.ReadInt32();
m_revisionHash = reader.ReadInt32();
// this is for compression type 3 only
int bufferLength = reader.ReadInt16();
int trueBufferLength = reader.ReadInt16();
m_numPlanes = reader.ReadByte();
// end compression type 3
m_planes = new CustomHousePlane[m_numPlanes];
for (int i = 0; i < m_numPlanes; i++)
{
m_planes[i] = new CustomHousePlane(reader);
}
}
示例8: MovementRejectPacket
public MovementRejectPacket(PacketReader reader)
: base(0x21, "Move Request Rejected")
{
m_sequence = reader.ReadByte(); // (matches sent sequence)
m_x = reader.ReadInt16();
m_y = reader.ReadInt16();
m_direction = reader.ReadByte();
m_z = reader.ReadSByte();
}
示例9: PlaySoundEffectPacket
public PlaySoundEffectPacket(PacketReader reader)
: base(0x54, "Play Sound Effect")
{
Mode = reader.ReadByte();
SoundModel = reader.ReadInt16();
Unknown = reader.ReadInt16();
X = reader.ReadInt16();
Y = reader.ReadInt16();
Z = reader.ReadInt16();
}
示例10: WornItemPacket
public WornItemPacket(PacketReader reader)
: base(0x2E, "Worn Item")
{
m_serial = reader.ReadInt32();
m_itemId = reader.ReadInt16();
reader.ReadByte();
m_layer = reader.ReadByte();
m_parentSerial = reader.ReadInt32();
m_hue = reader.ReadInt16();
}
示例11: AsciiMessagePacket
public AsciiMessagePacket(PacketReader reader)
: base(0x1C, "Ascii Message")
{
m_serial = reader.ReadInt32();
m_graphic = reader.ReadInt16();
m_type = (MessageTypes)reader.ReadByte();
m_hue = reader.ReadInt16();
m_font = reader.ReadInt16();
m_name = reader.ReadString(30);
m_text = reader.ReadString();
}
示例12: AsciiMessagePacket
public AsciiMessagePacket(PacketReader reader)
: base(0x1C, "Ascii Message")
{
Serial = reader.ReadInt32();
Model = reader.ReadInt16();
MsgType = (MessageTypes)reader.ReadByte();
Hue = reader.ReadUInt16();
Font = reader.ReadInt16();
SpeakerName = reader.ReadString(30).Trim();
Text = reader.ReadString();
}
示例13: MobileAnimationPacket
public MobileAnimationPacket(PacketReader reader)
: base(0x6E, "Mobile Animation")
{
m_serial = reader.ReadInt32();
m_action = reader.ReadInt16();
m_framecount = reader.ReadInt16();
m_repeatcount = reader.ReadInt16();
m_reverse = reader.ReadByte(); // 0x00=forward, 0x01=backwards
m_repeat = reader.ReadByte(); // 0 - Don't repeat / 1 repeat
m_delay = reader.ReadByte();
}
示例14: UnicodeMessagePacket
public UnicodeMessagePacket(PacketReader reader)
: base(0xAE, "Unicode Message")
{
m_serial = reader.ReadInt32();
m_model = reader.ReadInt16();
m_msgType = (MessageTypes)reader.ReadByte();
m_hue = reader.ReadInt16();
m_font = reader.ReadInt16();
m_language = reader.ReadInt32();
m_speakerName = reader.ReadString(30);
m_spokenText = reader.ReadUnicodeString((reader.Buffer.Length - 48) / 2);
}
示例15: TargetCursorMultiPacket
// This is called when the packet is received.
public TargetCursorMultiPacket(PacketReader reader)
: base(0x99, "Target Cursor For Multi")
{
reader.ReadByte(); // (0x01 from server, 0x00 from client)
m_deedSerial = reader.ReadInt32();
reader.ReadByte(); // flag byte. Harmful = 1, Beneficial = 2. Unused.
reader.ReadBytes(11); // unknown (all 0)
m_multiModel = reader.ReadInt16();
m_offsetX = reader.ReadInt16();
m_offsetY = reader.ReadInt16();
m_offsetZ = reader.ReadInt16();
}