本文整理汇总了C#中GenericReader.ReadCoords3方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadCoords3方法的具体用法?C# GenericReader.ReadCoords3怎么用?C# GenericReader.ReadCoords3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadCoords3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseMovementUpdateBlock
//.........这里部分代码省略.........
}
/*
// still used, but can't figure out when...
if ((flags2 & 0x8000000) == 0 && objectTypeId == ObjectTypes.TYPEID_UNIT)
{
if ((flags3 & 0x40000) != 0)
{
uint f3_3 = br.ReadUInt32();
sb.AppendLine("flags3_unk_value3 " + f3_3);
}
if ((flags3 & 0x20000) != 0)
{
ulong g3 = br.ReadUInt64();
sb.AppendLine("flags3_guid " + g3); // ????
}
}
*/
if ((UpdateFlags.UPDATEFLAG_HIGHGUID & flags) != 0) // 0x08
{
uint guid_high = gr.ReadUInt32(); // 2.0.10 - it's not high guid anymore
sb.AppendLine("guid_high " + guid_high);
}
if ((UpdateFlags.UPDATEFLAG_FULLGUID & flags) != 0) // 0x04
//if ((UpdateFlags.UPDATEFLAG_FULLGUID & flags) != 0 && (flags3 & 0x20000) == 0) // 0x04
//if ((UpdateFlags.UPDATEFLAG_FULLGUID & flags) != 0 && (flags3 & 0x40000) == 0) // 0x04
{
//long pos = br.BaseStream.Position;
//swe.WriteLine("flags & 0x4 at position " + pos.ToString("X2"));
ulong guid2 = gr.ReadPackedGuid(); // looks like guid, but what guid?
sb.AppendLine("unk guid " + guid2);
}
if ((UpdateFlags.UPDATEFLAG_TRANSPORT & flags) != 0) // 0x02
{
uint time = gr.ReadUInt32();
sb.AppendLine("t_time " + time);
}
if ((flags2 & 0x8000000) != 0) // splines
{
uint t1 = gr.ReadUInt32();
sb.AppendLine("t1 " + t1);
uint t2 = gr.ReadUInt32();
sb.AppendLine("t2 " + t2);
//outdated 2.0.10
//uint t3 = br.ReadUInt32();
//sb.AppendLine("t3 " + t3);
uint coords_count = gr.ReadUInt32();
sb.AppendLine("coords_count " + coords_count);
//if (coords_count > 1000)
//{
// coords_count = br.ReadUInt32();
// sb.AppendLine("second attempt to get correct coords count, now " + coords_count);
//}
//if (coords_count > 1000)
//{
// coords_count = br.ReadUInt32();
// sb.AppendLine("third attempt to get correct coords count, now " + coords_count);
//}
if (coords_count > 1000) // prevent overflow in case wrong packet parsing :)
{
long pos = gr.BaseStream.Position;
swe.WriteLine("error position " + pos.ToString("X2"));
swe.WriteLine("error while parsing movement update block, flags: " + flags.ToString("X") + ", flags2: " + flags2.ToString("X") + ", flags3: " + flags3.ToString("X") + ", objecttype " + objectTypeId);
return false;
}
if (coords_count > 0)
{
for (uint i = 0; i < coords_count; i++)
{
Coords3 v = gr.ReadCoords3();
sb.AppendLine("coord" + i + ": " + v.GetCoords());
}
}
Coords3 end = gr.ReadCoords3();
sb.AppendLine("end: " + end.GetCoords());
uint t8 = gr.ReadUInt32();
sb.AppendLine("t8 " + t8);
// added in 2.0.10 (really?)
uint t9 = gr.ReadUInt32();
sb.AppendLine("t9 " + t9);
}
sb.AppendLine("=== movement_update_block_end ===");
return true;
}