本文整理汇总了C#中UltimaXNA.Core.Network.PacketReader.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadByte方法的具体用法?C# PacketReader.ReadByte怎么用?C# PacketReader.ReadByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UltimaXNA.Core.Network.PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: SwingPacket
public SwingPacket(PacketReader reader)
: base(0x2F, "Swing")
{
m_flag = reader.ReadByte();
m_attacker = reader.ReadInt32();
m_defender = reader.ReadInt32();
}
示例3: WeatherPacket
public WeatherPacket(PacketReader reader)
: base(0x65, "Set Weather")
{
m_weatherType = reader.ReadByte();
m_effectId = reader.ReadByte();
m_temperature = reader.ReadByte();
}
示例4: TimePacket
public TimePacket(PacketReader reader)
: base(0x5B, "Time")
{
m_hour = reader.ReadByte();
m_minute = reader.ReadByte();
m_second = reader.ReadByte();
}
示例5: TargetCursorPacket
public TargetCursorPacket(PacketReader reader)
: base(0x6C, "Target Cursor")
{
m_commandtype = reader.ReadByte(); // 0x00 = Select Object; 0x01 = Select X, Y, Z
m_cursorid = reader.ReadInt32();
m_cursortype = reader.ReadByte(); // 0 - 2 = unknown; 3 = Cancel current targetting RunUO seems to always send 0.
}
示例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: 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();
}
示例9: ExtendedStatsInfo
public ExtendedStatsInfo(PacketReader reader)
{
int clientFlag = reader.ReadByte(); // (0x2 for 2D client, 0x5 for KR client)
Serial = reader.ReadInt32();
byte unknown0 = reader.ReadByte(); // (always 0)
byte lockFlags = reader.ReadByte();
// Lock flags = bitflags 00SSDDII
// 00 = up
// 01 = down
// 10 = locked
// FF = update mobile status animation ( KR only )
if (lockFlags != 0xFF) {
int strengthLock = (lockFlags >> 4) & 0x03;
int dexterityLock = (lockFlags >> 2) & 0x03;
int inteligenceLock = (lockFlags) & 0x03;
Locks = new StatLocks(strengthLock, dexterityLock, inteligenceLock);
}
if (clientFlag == 5) {
Tracer.Warn("ClientFlags == 5 in GeneralInfoPacket ExtendedStats 0x19. This is not a KR client.");
// If(Lock flags = 0xFF) //Update mobile status animation
// BYTE[1] Status // Unveryfied if lock flags == FF the locks will be handled here
// BYTE[1] unknown (0x00)
// BYTE[1] Animation
// BYTE[1] unknown (0x00)
// BYTE[1] Frame
// else
// BYTE[1] unknown (0x00)
// BYTE[4] unknown (0x00000000)
// endif
}
}
示例10: ServerListEntry
public ServerListEntry(PacketReader reader)
{
Index = (ushort)reader.ReadInt16();
Name = reader.ReadString(32);
PercentFull = reader.ReadByte();
Timezone = reader.ReadByte();
Address = (uint)reader.ReadInt32();
}
示例11: ServerListEntry
public ServerListEntry(PacketReader reader)
{
index = (ushort)reader.ReadInt16();
name = reader.ReadString(30);
percentFull = reader.ReadByte();
timezone = reader.ReadByte();
address = (uint)reader.ReadInt32();
}
示例12: WarModePacket
public WarModePacket(PacketReader reader)
: base(0x72, "Request War Mode")
{
m_warmode = reader.ReadByte();
reader.ReadByte(); // always 0x00
reader.ReadByte(); // always 0x32
reader.ReadByte(); // always 0x00
}
示例13: 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();
}
示例14: 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();
}
示例15: 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();
}