本文整理汇总了C#中StreamHandler.ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler.ReadInt32方法的具体用法?C# StreamHandler.ReadInt32怎么用?C# StreamHandler.ReadInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamHandler
的用法示例。
在下文中一共展示了StreamHandler.ReadInt32方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ElementRead
protected override void ElementRead(StreamHandler reader, int index)
{
if (index == -5)
this.Unk = reader.ReadUInt32();
else
this.Data[-index - 1] = reader.ReadBytes(reader.ReadInt32());
}
示例2: Read
public override void Read(StreamHandler reader)
{
this.Unit = reader.ReadPackedGuid();
var count = reader.ReadInt32();
this.ThreatList = new ThreatUpdatePair[count];
for (int i = 0; i < count; ++i)
this.ThreatList[i] = new ThreatUpdatePair { Unit = reader.ReadPackedGuid(), Threat = reader.ReadUInt32() };
}
示例3: Read
public override void Read(StreamHandler reader)
{
Caster = reader.ReadPackedGuid();
SpellId = reader.ReadUInt32();
Duration = reader.ReadInt32();
HaveFlags = reader.ReadBoolean();
if (HaveFlags)
{
TargetFlags1 = reader.ReadUInt32();
TargetFlags2 = reader.ReadUInt32();
}
Unk_HaveData2 = reader.ReadBoolean();
if (Unk_HaveData2)
{
Unk_Guid1 = reader.ReadPackedGuid();
Unk_UInt3 = reader.ReadUInt32();
Unk_Byte = reader.ReadByte();
if (Unk_Byte == 2)
Unk_Guid2 = reader.ReadPackedGuid();
}
}
示例4: InternalParse
protected override void InternalParse()
{
int row;
int size;
DB2Ids type;
Output.AppendLine("Data Size: " + (size = Reader.ReadInt32()));
byte[] data = Reader.ReadBytes(size);
Output.AppendLine("Type: " + (type = (DB2Ids)Reader.ReadUInt32()));
Output.AppendLine("Row: " + (row = Reader.ReadInt32()));
Output.AppendLine("Time(?): " + Reader.ReadUInt32().AsUnixTime());
Output.AppendLine();
if (row < 0)
return;
using (var dataReader = new StreamHandler(data))
{
if (type == DB2Ids.Item)
{
Output.AppendLine("Item Id: " + dataReader.ReadUInt32());
Output.AppendLine("Class: " + (ItemClass)dataReader.ReadUInt32());
Output.AppendLine("SubClass: " + (ItemSubClass)dataReader.ReadUInt32());
Output.AppendLine("Unk -1: " + dataReader.ReadInt32());
Output.AppendLine("Material: " + (Material)dataReader.ReadUInt32());
Output.AppendLine("Display Id: " + dataReader.ReadUInt32());
Output.AppendLine("Inventory Type: " + (InventorySlot)dataReader.ReadUInt32());
Output.AppendLine("Sheath: " + dataReader.ReadUInt32());
}
else if (type == DB2Ids.ItemSparse)
{
Output.AppendLine("id: " + dataReader.ReadInt32());
Output.AppendLine("quality: " + (ItemQuality)dataReader.ReadInt32());
Output.AppendLine("flags: " + dataReader.ReadUInt32());
Output.AppendLine("flags2: " + dataReader.ReadUInt32());
Output.AppendLine("4.3.2 float1: " + dataReader.ReadSingle()); // 0.95-1.05
Output.AppendLine("4.3.2 float2: " + dataReader.ReadSingle()); // 0, 1, 4, huge
Output.AppendLine("4.3.2 int: " + dataReader.ReadUInt32()); // stack count
Output.AppendLine("buyprice: " + dataReader.ReadInt32());
Output.AppendLine("sellprice: " + dataReader.ReadInt32());
Output.AppendLine("inventorytype: " + dataReader.ReadInt32());
Output.AppendLine("allowableclass: " + dataReader.ReadInt32());
Output.AppendLine("allowablerace: " + dataReader.ReadInt32());
Output.AppendLine("itemlevel: " + dataReader.ReadInt32());
Output.AppendLine("requiredlevel: " + dataReader.ReadInt32());
Output.AppendLine("requiredskill: " + dataReader.ReadInt32());
Output.AppendLine("requiredskillrank: " + dataReader.ReadInt32());
Output.AppendLine("requiredspell: " + dataReader.ReadInt32());
Output.AppendLine("requiredhonorrank: " + dataReader.ReadInt32());
Output.AppendLine("requiredcityrank: " + dataReader.ReadInt32());
Output.AppendLine("requiredreputationfaction: " + dataReader.ReadInt32());
Output.AppendLine("requiredreputationrank: " + dataReader.ReadInt32());
Output.AppendLine("maxcount: " + dataReader.ReadInt32());
Output.AppendLine("stackable: " + dataReader.ReadInt32());
Output.AppendLine("containerslots: " + dataReader.ReadInt32());
Output.AppendLine("stat_type1: " + dataReader.ReadInt32());
Output.AppendLine("stat_type2: " + dataReader.ReadInt32());
Output.AppendLine("stat_type3: " + dataReader.ReadInt32());
Output.AppendLine("stat_type4: " + dataReader.ReadInt32());
Output.AppendLine("stat_type5: " + dataReader.ReadInt32());
Output.AppendLine("stat_type6: " + dataReader.ReadInt32());
Output.AppendLine("stat_type7: " + dataReader.ReadInt32());
Output.AppendLine("stat_type8: " + dataReader.ReadInt32());
Output.AppendLine("stat_type9: " + dataReader.ReadInt32());
Output.AppendLine("stat_type10: " + dataReader.ReadInt32());
Output.AppendLine("stat_value1: " + dataReader.ReadInt32());
Output.AppendLine("stat_value2: " + dataReader.ReadInt32());
Output.AppendLine("stat_value3: " + dataReader.ReadInt32());
Output.AppendLine("stat_value4: " + dataReader.ReadInt32());
Output.AppendLine("stat_value5: " + dataReader.ReadInt32());
Output.AppendLine("stat_value6: " + dataReader.ReadInt32());
Output.AppendLine("stat_value7: " + dataReader.ReadInt32());
Output.AppendLine("stat_value8: " + dataReader.ReadInt32());
Output.AppendLine("stat_value9: " + dataReader.ReadInt32());
Output.AppendLine("stat_value10: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_1: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_2: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_3: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_4: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_5: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_6: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_7: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_8: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_9: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk1_10: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_1: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_2: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_3: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_4: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_5: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_6: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_7: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_8: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_9: " + dataReader.ReadInt32());
Output.AppendLine("stat_unk2_10: " + dataReader.ReadInt32());
Output.AppendLine("scalingstatdistribution: " + dataReader.ReadInt32());
Output.AppendLine("damagetype: " + dataReader.ReadInt32());
Output.AppendLine("delay: " + dataReader.ReadInt32());
Output.AppendLine("rangedmodrange: " + dataReader.ReadSingle());
//.........这里部分代码省略.........
示例5: InternalOpenForReading
protected unsafe override void InternalOpenForReading(Stream stream, bool closeStream)
{
m_isLoaded = true;
var mainHeaderBytes = new byte[MainHeader.Size];
stream.Read(mainHeaderBytes, 0, MainHeader.Size);
MainHeader* mainHeader;
fixed (byte* mainHeaderBytesPtr = mainHeaderBytes)
{
mainHeader = (MainHeader*)mainHeaderBytesPtr;
m_nPackets = mainHeader->PacketCount;
this.StartTime = mainHeader->StartedOnUnix.AsUnixTime();
this.StartTicks = mainHeader->StartedOnTicks;
this.InternalSetCapacity(m_nPackets);
}
int extraLen = mainHeader->ExtraDataLength;
if (extraLen > 0)
{
byte[] extraData = new byte[extraLen];
stream.Read(extraData, 0, extraLen);
using (var reader = new StreamHandler(extraData))
{
ExtraDataFlags flags = mainHeader->ExtraInfoFlags;
if (flags.HasFlag(ExtraDataFlags.HasClientIPv4))
this.ClientAddress = new IPAddress(reader.ReadBytes(4));
if (flags.HasFlag(ExtraDataFlags.HasServerIPv4))
this.ServerAddress = new IPAddress(reader.ReadBytes(4));
if (flags.HasFlag(ExtraDataFlags.HasClientIPv6))
this.ClientAddress = new IPAddress(reader.ReadBytes(16));
if (flags.HasFlag(ExtraDataFlags.HasServerIPv6))
this.ServerAddress = new IPAddress(reader.ReadBytes(16));
if (flags.HasFlag(ExtraDataFlags.HasClientPort))
this.ClientPort = reader.ReadInt32();
if (flags.HasFlag(ExtraDataFlags.HasServerPort))
this.ServerPort = reader.ReadInt32();
if (flags.HasFlag(ExtraDataFlags.HasSnifferIdString))
{
int origLen = reader.ReadInt32();
int cmprLen = reader.ReadInt32();
var arr = new byte[origLen];
using (var iStream = new MemoryStream(reader.ReadBytes(cmprLen)))
using (var ds = new DeflateStream(iStream, CompressionMode.Decompress, true))
ds.Read(arr, 0, arr.Length);
this.SnifferDesc = Encoding.UTF8.GetString(arr);
}
}
}
m_stream = new StreamHandler(stream, closeStream);
}
示例6: ReadValues
private UpdateFields ReadValues(StreamHandler Reader)
{
var values = new UpdateFields();
byte blocksCount = Reader.ReadByte();
int[] updatemask = new int[blocksCount];
for (int i = 0; i < updatemask.Length; ++i)
updatemask[i] = Reader.ReadInt32();
var mask = new BitArray(updatemask);
for (uint i = 0; i < mask.Count; ++i)
if (mask[(int)i])
values[i] = Reader.ReadUInt32();
return values;
}
示例7: Read
public void Read(StreamHandler Reader)
{
Slot = Reader.ReadByte();
Spell = Reader.ReadUInt32();
Caster = Unit;
if (Spell != 0)
{
Flags = (AuraFlags)Reader.ReadUInt16();
Level = Reader.ReadByte();
Charges = Reader.ReadByte();
if ((Flags & AuraFlags.NotCaster) == 0)
Caster = Reader.ReadPackedGuid();
if ((Flags & AuraFlags.Duration) != 0)
{
MaxDuration = Reader.ReadUInt32();
var currentDurationMs = Reader.ReadUInt32();
this.AppliedTime = (uint)Environment.TickCount - currentDurationMs;
}
if ((Flags & AuraFlags.BasePoints) != 0)
{
for (int i = 0; i < MaxEffects; ++i)
{
if ((Flags & (AuraFlags)(1 << i)) != 0)
BasePoints[i] = Reader.ReadInt32();
else
BasePoints[i] = 0;
}
}
else
Array.Clear(BasePoints, 0, MaxEffects);
}
}