本文整理汇总了C#中MyUtils.ByteStream.ReadBytes方法的典型用法代码示例。如果您正苦于以下问题:C# ByteStream.ReadBytes方法的具体用法?C# ByteStream.ReadBytes怎么用?C# ByteStream.ReadBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyUtils.ByteStream
的用法示例。
在下文中一共展示了ByteStream.ReadBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetZoneData
public override NewZoneStruct GetZoneData()
{
NewZoneStruct NewZone = new NewZoneStruct();
List<byte[]> ZonePackets = GetPacketsOfType("OP_NewZone", PacketDirection.ServerToClient);
if (ZonePackets.Count < 1)
return NewZone;
// Assume there is only 1 packet and process the first one.
ByteStream Buffer = new ByteStream(ZonePackets[0]);
string CharName = Buffer.ReadFixedLengthString(64, false);
NewZone.ShortName = Buffer.ReadFixedLengthString(32, false);
Buffer.SkipBytes(96); // Skip Unknown
NewZone.LongName = Buffer.ReadFixedLengthString(278, true);
NewZone.Type = Buffer.ReadByte();
NewZone.FogRed = Buffer.ReadBytes(4);
NewZone.FogGreen = Buffer.ReadBytes(4);
NewZone.FogBlue = Buffer.ReadBytes(4);
Buffer.SkipBytes(1); // Unknown
for (int i = 0; i < 4; ++i)
NewZone.FogMinClip[i] = Buffer.ReadSingle();
for (int i = 0; i < 4; ++i)
NewZone.FogMaxClip[i] = Buffer.ReadSingle();
NewZone.Gravity = Buffer.ReadSingle();
NewZone.TimeType = Buffer.ReadByte();
Buffer.SkipBytes(49); // Unknown
NewZone.Sky = Buffer.ReadByte();
Buffer.SkipBytes(13); // Unknown
NewZone.ZEM = Buffer.ReadSingle();
NewZone.SafeY = Buffer.ReadSingle();
NewZone.SafeX = Buffer.ReadSingle();
NewZone.SafeZ = Buffer.ReadSingle();
NewZone.MinZ = Buffer.ReadSingle();
NewZone.MaxZ = Buffer.ReadSingle();
NewZone.UnderWorld = Buffer.ReadSingle();
NewZone.MinClip = Buffer.ReadSingle();
NewZone.MaxClip = Buffer.ReadSingle();
Buffer.SkipBytes(84); // Unknown
NewZone.ShortName2 = Buffer.ReadFixedLengthString(96, false);
Buffer.SkipBytes(52); // Unknown
NewZone.ZoneID = Buffer.ReadUInt16();
NewZone.InstanceID = Buffer.ReadUInt16();
Buffer.SkipBytes(38); // Unknown
NewZone.FallDamage = Buffer.ReadByte();
Buffer.SkipBytes(21); // Unknown
NewZone.FogDensity = Buffer.ReadSingle();
// Everything else after this point in the packet is unknown.
return NewZone;
}