本文整理汇总了C#中MyUtils.ByteStream.ReadUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# ByteStream.ReadUInt16方法的具体用法?C# ByteStream.ReadUInt16怎么用?C# ByteStream.ReadUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyUtils.ByteStream
的用法示例。
在下文中一共展示了ByteStream.ReadUInt16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode_OP_MobUpdate
override public PositionUpdate Decode_OP_MobUpdate(byte[] MobUpdatePacket)
{
PositionUpdate PosUpdate = new PositionUpdate();
ByteStream Buffer = new ByteStream(MobUpdatePacket);
PosUpdate.SpawnID = Buffer.ReadUInt16();
Buffer.SkipBytes(2);
UInt32 Word1 = Buffer.ReadUInt32();
UInt32 Word2 = Buffer.ReadUInt32();
UInt16 Word3 = Buffer.ReadUInt16();
PosUpdate.p.y = Utils.EQ19ToFloat((Int32)(Word1 & 0x7FFFF));
// Z is in the top 13 bits of Word1 and the bottom 6 of Word2
UInt32 ZPart1 = Word1 >> 19; // ZPart1 now has low order bits of Z in bottom 13 bits
UInt32 ZPart2 = Word2 & 0x3F; // ZPart2 now has high order bits of Z in bottom 6 bits
ZPart2 = ZPart2 << 13;
PosUpdate.p.z = Utils.EQ19ToFloat((Int32)(ZPart1 | ZPart2));
PosUpdate.p.x = Utils.EQ19ToFloat((Int32)(Word2 >> 6) & 0x7FFFF);
PosUpdate.p.heading = Utils.EQ19ToFloat((Int32)(Word3 & 0xFFF));
PosUpdate.HighRes = false;
return PosUpdate;
}
示例2: ExploreClientUpdate
public void ExploreClientUpdate(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt16 SpawnID = Buffer.ReadUInt16();
Buffer.SkipBytes(6);
float x = Buffer.ReadSingle();
float y = Buffer.ReadSingle();
Buffer.SkipBytes(12);
float z = Buffer.ReadSingle();
Buffer.SkipBytes(4);
UInt32 Temp = Buffer.ReadUInt32();
Temp = Temp & 0x3FFFFF;
Temp = Temp >> 10;
float heading = Utils.EQ19ToFloat((Int32)(Temp));
OutputStream.WriteLine("Loc: {0}, {1}, {2} Heading: {3}", x, y, z, heading);
OutputStream.WriteLine("");
}
示例3: ExploreHPUpdate
public void ExploreHPUpdate(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt32 CurrentHP = Buffer.ReadUInt32();
Int32 MaxHP = Buffer.ReadInt32();
UInt16 SpawnID = Buffer.ReadUInt16();
string SpawnName = FindExplorerSpawn(SpawnID);
OutputStream.WriteLine("Spawn {0} {1} Current HP: {2} Max HP: {3}", SpawnID, SpawnName, CurrentHP, MaxHP);
OutputStream.WriteLine("");
}
示例4: ExplorePlayerProfile
//.........这里部分代码省略.........
OutputStream.WriteLine("Sl: {0}, UF: {1}, PID: {2}, UByte: {3}, Cnt1: {4}, Dur: {5}, Lvl: {6} SpellID: {7}, SlotID: {8}, Cnt2: {9}",
i, UnkFloat, PlayerID, UnkByte, Counters1, Duration, Level, SpellID, SlotID, Counters2);
Buffer.SkipBytes(44);
}
OutputStream.WriteLine("{0, -5}: Plat = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Gold = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Silver = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Copper = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Plat Cursor = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Gold Cursor = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Silver Cursor = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Copper Cursor = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Unknown = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Toxicity? = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Unknown = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Thirst? = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Hunger? = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
//Buffer.SkipBytes(20);
OutputStream.WriteLine("{0, -5}: AA Spent = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: AA Point Count? = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: AA Assigned = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: AA Spent General = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: AA Spent Archetype = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: AA Spent Class = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: AA Spent Special = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: AA Unspent = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
OutputStream.WriteLine("{0, -5}: Unknown", Buffer.GetPosition(), Buffer.ReadUInt16());
//Buffer.SkipBytes(30);
UInt32 BandolierCount = Buffer.ReadUInt32();
OutputStream.WriteLine("{0, -5}: Bandolier Count = {1}", Buffer.GetPosition() - 4, BandolierCount);
for (int i = 0; i < BandolierCount; ++i)
{
Buffer.ReadString(false);
Buffer.ReadString(false);
Buffer.SkipBytes(8);
Buffer.ReadString(false);
Buffer.SkipBytes(8);
Buffer.ReadString(false);
Buffer.SkipBytes(8);
Buffer.ReadString(false);
Buffer.SkipBytes(8);
}
UInt32 PotionCount = Buffer.ReadUInt32();
OutputStream.WriteLine("{0, -5}: Potion Count = {1}", Buffer.GetPosition() - 4, PotionCount);
for (int i = 0; i < PotionCount; ++i)
{
Buffer.ReadString(false);
示例5: ExploreTaskDescription
public void ExploreTaskDescription(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt32 Seq = Buffer.ReadUInt32();
UInt32 TaskID = Buffer.ReadUInt32();
UInt32 Unk1 = Buffer.ReadUInt32();
UInt32 Unk2 = Buffer.ReadUInt32();
byte Unk3 = Buffer.ReadByte();
OutputStream.WriteLine("Seq: {0}, TaskID: {1}, Unk1: {2:X}, Unk2: {3:X}, Unk3: {4:X}", Seq, TaskID, Unk1, Unk2, Unk3);
String Title = Buffer.ReadString(false);
OutputStream.WriteLine("Title: {0}", Title);
UInt32 Duration = Buffer.ReadUInt32();
UInt32 Unk4 = Buffer.ReadUInt32();
UInt32 StartTime = Buffer.ReadUInt32();
String Desc = Buffer.ReadString(false);
OutputStream.WriteLine("Duration: {0}, Unk4: {1:X}, StartTime: {2:X}", Duration, Unk4, StartTime);
OutputStream.WriteLine("Desc: {0}", Desc);
UInt32 RewardCount = Buffer.ReadUInt32();
UInt32 Unk5 = Buffer.ReadUInt32();
UInt32 Unk6 = Buffer.ReadUInt32();
UInt16 Unk7 = Buffer.ReadUInt16();
OutputStream.WriteLine("RewardCount: {0}, Unk5: {1:X}, Unk6: {2:X}, Unk7: {3:X}", Duration, Unk5, Unk6, Unk7);
string MyString = "";
byte b;
while ((b = Buffer.ReadByte()) != 0)
{
if (b == 0x12)
continue;
MyString += Convert.ToChar(b);
}
OutputStream.WriteLine("RewardString: {0}", MyString);
UInt32 Unk8 = Buffer.ReadUInt32();
byte Unk9 = Buffer.ReadByte();
OutputStream.WriteLine("Unk8: {0:X}, Unk9: {1:X}", Unk8, Unk9);
}
示例6: ExploreOpenNewTasksWindow
public void ExploreOpenNewTasksWindow(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt32 NumTasks = Buffer.ReadUInt32();
UInt32 Unknown = Buffer.ReadUInt32();
UInt32 TaskGiver = Buffer.ReadUInt32();
OutputStream.WriteLine("Number of Tasks: {0}, Given by: {1}", NumTasks, TaskGiver);
for (int i = 0; i < NumTasks; ++i)
{
UInt32 TaskID = Buffer.ReadUInt32();
float Unk1 = Buffer.ReadSingle();
UInt32 TimeLimit = Buffer.ReadUInt32();
UInt32 Unk2 = Buffer.ReadUInt32();
string Title = Buffer.ReadString(false);
string Description = Buffer.ReadString(false);
string UnkString = Buffer.ReadString(false);
OutputStream.WriteLine("TaskID: {0}, Title: {1}", TaskID, Title);
UInt32 ActivityCount = Buffer.ReadUInt32();
OutputStream.WriteLine("Unknown: {0}", ActivityCount);
OutputStream.WriteLine("");
for (int j = 0; j < ActivityCount; ++j)
{
OutputStream.WriteLine("Activity {0}", i);
OutputStream.WriteLine("");
OutputStream.WriteLine(" Unknown: {0}", Buffer.ReadUInt32());
OutputStream.WriteLine(" Unknown: {0}", Buffer.ReadUInt32());
OutputStream.WriteLine(" Unknown: {0}", Buffer.ReadUInt32());
OutputStream.WriteLine(" String: {0}", Buffer.ReadString(false));
UInt32 StringLength = Buffer.ReadUInt32();
OutputStream.WriteLine(" StringLength: {0}", StringLength);
string MyString = "";
for (int k = 0; k < StringLength; ++k)
MyString += Convert.ToChar(Buffer.ReadByte());
OutputStream.WriteLine(" Weird String: {0}", MyString);
OutputStream.WriteLine(" Unknown: {0}", Buffer.ReadUInt32());
OutputStream.WriteLine(" Unknown: {0}", Buffer.ReadUInt32());
OutputStream.WriteLine(" String: {0}", Buffer.ReadString(false));
OutputStream.WriteLine(" Unknown 2 bytes: {0}", Buffer.ReadUInt16());
//if (i == 3)
//{
// OutputStream.WriteLine("Offset is now: {0}", Buffer.GetPosition());
// return;
//}
OutputStream.WriteLine(" String: {0}", Buffer.ReadString(false));
OutputStream.WriteLine(" String: {0}", Buffer.ReadString(false));
OutputStream.WriteLine(" String: {0}", Buffer.ReadString(false));
}
OutputStream.WriteLine("");
//OutputStream.WriteLine("Offset is now: {0}", Buffer.GetPosition());
}
}
示例7: ExploreClientUpdate
public void ExploreClientUpdate(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
if (Direction == PacketDirection.ServerToClient)
{
UInt32 SpawnID = Buffer.ReadUInt16();
UInt32 SpawnID2 = Buffer.ReadUInt16();
OutputStream.WriteLine("ClientUpdate S->C SpawnID: {0}, SpawnID2: {1}", SpawnID, SpawnID2);
UInt32 Word = Buffer.ReadUInt32();
float Y = Utils.EQ19ToFloat((int)(Word >> 12));
OutputStream.WriteLine("Y = {0}", Y);
//Buffer.SkipBytes(6);
//float DeltaY = Buffer.ReadSingle();
//float YPos = Buffer.ReadSingle();
//float XPos = Buffer.ReadSingle();
//float DeltaHeading = Utils.EQ19ToFloat((int)(Word & 0x3FF));
}
}
示例8: DumpAAs
public override bool DumpAAs(string FileName)
{
List<byte[]> AAPackets = GetPacketsOfType("OP_SendAATable", PacketDirection.ServerToClient);
if (AAPackets.Count < 1)
return false;
StreamWriter OutputFile;
try
{
OutputFile = new StreamWriter(FileName);
}
catch
{
return false;
}
OutputFile.WriteLine("-- There are " + AAPackets.Count + " OP_SendAATable packets.");
OutputFile.WriteLine("");
foreach (byte[] Packet in AAPackets)
{
ByteStream Buffer = new ByteStream(Packet);
UInt32 AAID = Buffer.ReadUInt32();
byte Unknown004 = Buffer.ReadByte();
UInt32 HotKeySID = Buffer.ReadUInt32();
UInt32 HotKeySID2 = Buffer.ReadUInt32();
UInt32 TitleSID = Buffer.ReadUInt32();
UInt32 DescSID = Buffer.ReadUInt32();
UInt32 ClassType = Buffer.ReadUInt32();
UInt32 Cost = Buffer.ReadUInt32();
UInt32 Seq = Buffer.ReadUInt32();
UInt32 CurrentLevel = Buffer.ReadUInt32();
UInt32 PreReqSkillCount = Buffer.ReadUInt32();
UInt32 [] PreReqSkills = new UInt32[PreReqSkillCount];
for(int i = 0; i < PreReqSkillCount; ++i)
PreReqSkills[i] = Buffer.ReadUInt32(); // The SEQ value of the AA packet containing the pre-req AA
UInt32 PreReqMinPointCount = Buffer.ReadUInt32();
UInt32[] PreReqMinPoints = new UInt32[PreReqMinPointCount];
for (int i = 0; i < PreReqMinPointCount; ++i)
PreReqMinPoints[i] = Buffer.ReadUInt32();
UInt32 Type = Buffer.ReadUInt32();
UInt32 SpellID = Buffer.ReadUInt32();
UInt32 Unknown057 = Buffer.ReadUInt32();
UInt32 SpellType = Buffer.ReadUInt32();
UInt32 SpellRefresh = Buffer.ReadUInt32();
UInt16 Classes = Buffer.ReadUInt16();
UInt16 Berserker = Buffer.ReadUInt16();
UInt32 MaxLevel = Buffer.ReadUInt32();
UInt32 LastID = Buffer.ReadUInt32();
UInt32 NextID = Buffer.ReadUInt32();
UInt32 Cost2 = Buffer.ReadUInt32();
Buffer.SkipBytes(7);
UInt32 AAExpansion = Buffer.ReadUInt32();
UInt32 SpecialCategory = Buffer.ReadUInt32();
Buffer.SkipBytes(4);
UInt32 TotalAbilities = Buffer.ReadUInt32();
OutputFile.WriteLine(String.Format("AAID: {0}", AAID));
OutputFile.WriteLine(" Unknown004:\t" + Unknown004);
OutputFile.WriteLine(" HotkeySID:\t" + HotKeySID);
OutputFile.WriteLine(" HotkeySID2:\t" + HotKeySID2);
OutputFile.WriteLine(" TitleSID:\t" + TitleSID);
OutputFile.WriteLine(" DescSID:\t" + DescSID);
OutputFile.WriteLine(" ClassType:\t" + ClassType);
OutputFile.WriteLine(" Cost:\t\t" + Cost);
OutputFile.WriteLine(" Seq:\t\t" + Seq);
OutputFile.WriteLine(" CurrentLevel:\t" + CurrentLevel);
OutputFile.Write(" PreReqSkills (SEQs):\t");
for (int i = 0; i < PreReqSkillCount; ++i)
OutputFile.Write("{0} ", PreReqSkills[i]);
OutputFile.WriteLine("");
OutputFile.Write(" PreReqSkills MinPoints:\t");
for (int i = 0; i < PreReqMinPointCount; ++i)
OutputFile.Write("{0} ", PreReqMinPoints[i]);
OutputFile.WriteLine("");
OutputFile.WriteLine(" Type:\t\t" + Type);
OutputFile.WriteLine(" SpellID:\t" + SpellID);
OutputFile.WriteLine(" Unknown057:\t" + Unknown057);
OutputFile.WriteLine(" SpellType:\t" + SpellType);
OutputFile.WriteLine(" SpellRefresh:\t" + SpellRefresh);
OutputFile.WriteLine(" Classes:\t" + Classes);
OutputFile.WriteLine(" Berserker:\t" + Berserker);
OutputFile.WriteLine(" MaxLevel:\t" + MaxLevel);
OutputFile.WriteLine(" LastID:\t" + LastID);
OutputFile.WriteLine(" NextID:\t" + NextID);
OutputFile.WriteLine(" Cost2:\t\t" + Cost2);
OutputFile.WriteLine(" AAExpansion:\t" + AAExpansion);
//.........这里部分代码省略.........
示例9: 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;
}
示例10: ExploreSubItem
void ExploreSubItem(StreamWriter OutputStream, ref ByteStream Buffer)
{
Buffer.SkipBytes(8);
byte Area = Buffer.ReadByte();
UInt16 MainSlot = Buffer.ReadUInt16();
Int16 SubSlot = Buffer.ReadInt16();
Buffer.SkipBytes(54);
string Name = Buffer.ReadString(true);
if (SubSlot >= 0)
OutputStream.Write(" ");
string AreaName = "Unknown";
switch (Area)
{
case 0:
AreaName = "Personal Inventory";
break;
case 1:
AreaName = "Bank";
break;
case 2:
AreaName = "Shared Bank";
break;
case 6:
AreaName = "Personal Tribute";
break;
case 7:
AreaName = "Guild Tribute";
break;
case 8:
AreaName = "Merchant";
break;
}
OutputStream.WriteLine("Area: {0} {1} Main Slot {2,2} Sub Slot {3,3} Name {4}", Area, AreaName.PadRight(20), MainSlot, SubSlot, Name);
Buffer.ReadString(true); // Lore
Buffer.ReadString(true); // IDFile
//Buffer.SkipBytes(236); // Item Body Struct
UInt32 ID = Buffer.ReadUInt32();
byte Weight = Buffer.ReadByte();
byte NoRent = Buffer.ReadByte();
byte NoDrop = Buffer.ReadByte();
byte Attune = Buffer.ReadByte();
byte Size = Buffer.ReadByte();
OutputStream.WriteLine(" ID: {0} Weight: {1} NoRent: {2} NoDrop: {3} Attune {4} Size {5}", ID, Weight, NoRent, NoDrop, Attune, Size);
UInt32 Slots = Buffer.ReadUInt32();
UInt32 Price = Buffer.ReadUInt32();
UInt32 Icon = Buffer.ReadUInt32();
Buffer.SkipBytes(2);
UInt32 BenefitFlags = Buffer.ReadUInt32();
byte Tradeskills = Buffer.ReadByte();
OutputStream.WriteLine(" Slots: {0} Price: {1} Icon: {2} BenefitFlags {3} Tradeskills: {4}", Slots, Price, Icon, BenefitFlags, Tradeskills);
byte CR = Buffer.ReadByte();
byte DR = Buffer.ReadByte();
byte PR = Buffer.ReadByte();
byte MR = Buffer.ReadByte();
byte FR = Buffer.ReadByte();
byte SVC = Buffer.ReadByte();
OutputStream.WriteLine(" CR: {0} DR: {1} PR: {2} MR: {3} FR: {4} SVC: {5}", CR, DR, PR, MR, FR, SVC);
byte AStr = Buffer.ReadByte();
byte ASta = Buffer.ReadByte();
byte AAgi = Buffer.ReadByte();
byte ADex = Buffer.ReadByte();
byte ACha = Buffer.ReadByte();
byte AInt = Buffer.ReadByte();
byte AWis = Buffer.ReadByte();
OutputStream.WriteLine(" AStr: {0} ASta: {1} AAgi: {2} ADex: {3} ACha: {4} AInt: {5} AWis: {6}", AStr, ASta, AAgi, ADex, ACha, AInt, AWis);
Int32 HP = Buffer.ReadInt32();
Int32 Mana = Buffer.ReadInt32();
UInt32 Endurance = Buffer.ReadUInt32();
Int32 AC = Buffer.ReadInt32();
Int32 Regen = Buffer.ReadInt32();
Int32 ManaRegen = Buffer.ReadInt32();
Int32 EndRegen = Buffer.ReadInt32();
UInt32 Classes = Buffer.ReadUInt32();
UInt32 Races = Buffer.ReadUInt32();
UInt32 Deity = Buffer.ReadUInt32();
Int32 SkillModValue = Buffer.ReadInt32();
Buffer.SkipBytes(4);
UInt32 SkillModType = Buffer.ReadUInt32();
UInt32 BaneDamageRace = Buffer.ReadUInt32();
UInt32 BaneDamageBody = Buffer.ReadUInt32();
UInt32 BaneDamageRaceAmount = Buffer.ReadUInt32();
Int32 BaneDamageAmount = Buffer.ReadInt32();
byte Magic = Buffer.ReadByte();
Int32 CastTime = Buffer.ReadInt32();
//.........这里部分代码省略.........
示例11: GetGroundSpawns
public override List<GroundSpawnStruct> GetGroundSpawns()
{
List<GroundSpawnStruct> GroundSpawns = new List<GroundSpawnStruct>();
List<byte[]> GroundSpawnPackets = GetPacketsOfType("OP_GroundSpawn", PacketDirection.ServerToClient);
foreach (byte[] GroundSpawnPacket in GroundSpawnPackets)
{
GroundSpawnStruct GroundSpawn = new GroundSpawnStruct();
ByteStream Buffer = new ByteStream(GroundSpawnPacket);
GroundSpawn.DropID = Buffer.ReadUInt32();
GroundSpawn.Name = Buffer.ReadString(false);
GroundSpawn.ZoneID = Buffer.ReadUInt16();
GroundSpawn.InstanceID = Buffer.ReadUInt16();
Buffer.SkipBytes(8); // Two unknown uint32s
GroundSpawn.Heading = Buffer.ReadSingle();
Buffer.SkipBytes(12); // First float is 255 to make some groundspawns appear, second 4 bytes unknown, last is a float
GroundSpawn.y = Buffer.ReadSingle();
GroundSpawn.x = Buffer.ReadSingle();
GroundSpawn.z = Buffer.ReadSingle();
GroundSpawn.ObjectType = Buffer.ReadUInt32();
GroundSpawns.Add(GroundSpawn);
}
return GroundSpawns;
}
示例12: GetClientMovementUpdates
public override List<PositionUpdate> GetClientMovementUpdates()
{
List<PositionUpdate> Updates = new List<PositionUpdate>();
List<EQApplicationPacket> PacketList = Packets.PacketList;
UInt32 OP_ClientUpdate = OpManager.OpCodeNameToNumber("OP_ClientUpdate");
foreach (EQApplicationPacket UpdatePacket in PacketList)
{
if ((UpdatePacket.OpCode != OP_ClientUpdate) || (UpdatePacket.Direction != PacketDirection.ClientToServer))
continue;
ByteStream Buffer = new ByteStream(UpdatePacket.Buffer);
PositionUpdate PosUpdate = new PositionUpdate();
PosUpdate.SpawnID = Buffer.ReadUInt16();
Buffer.SkipBytes(6);
PosUpdate.p.x = Buffer.ReadSingle();
PosUpdate.p.y = Buffer.ReadSingle();
Buffer.SkipBytes(12);
PosUpdate.p.z = Buffer.ReadSingle();
PosUpdate.p.TimeStamp = UpdatePacket.PacketTime;
Buffer.SkipBytes(4);
UInt32 Temp = Buffer.ReadUInt32();
Temp = Temp & 0x3FFFFF;
Temp = Temp >> 10;
PosUpdate.p.heading = Utils.EQ19ToFloat((Int32)(Temp));
Updates.Add(PosUpdate);
}
return Updates;
}
示例13: ExploreSpawnAppearance
public void ExploreSpawnAppearance(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt16 SpawnID = Buffer.ReadUInt16();
UInt16 Type = Buffer.ReadUInt16();
UInt32 Param = Buffer.ReadUInt32();
string SpawnName = FindExplorerSpawn(SpawnID);
OutputStream.WriteLine("Spawn {0} {1} Appearance Change Type {2} Parameter {3}", SpawnID, SpawnName, Type, Param);
OutputStream.WriteLine("");
}
示例14: ExploreRequestClientZoneChange
public void ExploreRequestClientZoneChange(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt16 ZoneID = Buffer.ReadUInt16();
UInt16 Instance = Buffer.ReadUInt16();
float X = Buffer.ReadSingle();
float Y = Buffer.ReadSingle();
float Z = Buffer.ReadSingle();
float Heading = Buffer.ReadSingle();
UInt32 Type = Buffer.ReadUInt16();
OutputStream.WriteLine("ZoneID: {0} Type: {1}", ZoneID, Type);
OutputStream.WriteLine("");
}
示例15: ExploreAnimation
public void ExploreAnimation(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
{
UInt16 SpawnID = Buffer.ReadUInt16();
byte Action = Buffer.ReadByte();
byte Value = Buffer.ReadByte();
string SpawnName = FindExplorerSpawn(SpawnID);
OutputStream.WriteLine("Spawn {0} {1} Action: {2} Value: {3}", SpawnID, SpawnName, Action, Value);
OutputStream.WriteLine("");
}