本文整理汇总了C#中WowPacketParser.Store.Objects.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于WowPacketParser.Store.Objects命名空间,在下文中一共展示了Player类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdatePlayerInfo
// Used when inserting data from SMSG_CHAR_ENUM into the Objects container
public static WoWObject UpdatePlayerInfo(Player oldPlayer, Player newPlayer)
{
oldPlayer.Race = newPlayer.Race;
oldPlayer.Class = newPlayer.Class;
oldPlayer.Name = newPlayer.Name;
oldPlayer.FirstLogin = newPlayer.FirstLogin;
oldPlayer.Level = newPlayer.Level;
return oldPlayer;
}
示例2: ReadCreateObjectBlock
private static void ReadCreateObjectBlock(Packet packet, WowGuid guid, uint map, object index)
{
var objType = packet.ReadByteE<ObjectType>("Object Type", index);
var moves = ReadMovementUpdateBlock(packet, guid, index);
var updates = CoreParsers.UpdateHandler.ReadValuesUpdateBlock(packet, objType, index, true);
WoWObject obj;
switch (objType)
{
case ObjectType.Unit:
obj = new Unit();
break;
case ObjectType.GameObject:
obj = new GameObject();
break;
case ObjectType.Item:
obj = new Item();
break;
case ObjectType.Player:
obj = new Player();
break;
default:
obj = new WoWObject();
break;
}
obj.Type = objType;
obj.Movement = moves;
obj.UpdateFields = updates;
obj.Map = map;
obj.Area = CoreParsers.WorldStateHandler.CurrentAreaId;
obj.PhaseMask = (uint)CoreParsers.MovementHandler.CurrentPhaseMask;
obj.Phases = new HashSet<ushort>(CoreParsers.MovementHandler.ActivePhases);
// If this is the second time we see the same object (same guid,
// same position) update its phasemask
if (Storage.Objects.ContainsKey(guid))
{
var existObj = Storage.Objects[guid].Item1;
CoreParsers.UpdateHandler.ProcessExistingObject(ref existObj, obj, guid); // can't do "ref Storage.Objects[guid].Item1 directly
}
else
Storage.Objects.Add(guid, obj, packet.TimeSpan);
if (guid.HasEntry() && (objType == ObjectType.Unit || objType == ObjectType.GameObject))
packet.AddSniffData(Utilities.ObjectTypeToStore(objType), (int)guid.GetEntry(), "SPAWN");
}
示例3: HandleCharEnum
public static void HandleCharEnum(Packet packet)
{
var count = packet.ReadByte("Count");
for (var i = 0; i < count; i++)
{
var guid = packet.ReadGuid("GUID");
var name = packet.ReadCString("Name");
StoreGetters.AddName(guid, name);
var race = packet.ReadEnum<Race>("Race", TypeCode.Byte);
var clss = packet.ReadEnum<Class>("Class", TypeCode.Byte);
packet.ReadEnum<Gender>("Gender", TypeCode.Byte);
packet.ReadByte("Skin");
packet.ReadByte("Face");
packet.ReadByte("Hair Style");
packet.ReadByte("Hair Color");
packet.ReadByte("Facial Hair");
var level = packet.ReadByte("Level");
var zone = packet.ReadEntryWithName<UInt32>(StoreNameType.Zone, "Zone Id");
var mapId = packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map Id");
var pos = packet.ReadVector3("Position");
if (ClientVersion.AddedInVersion(ClientVersionBuild.V4_0_3_13329))
packet.ReadGuid("Guild GUID");
else
packet.ReadInt32("Guild Id");
packet.ReadEnum<CharacterFlag>("Character Flags", TypeCode.Int32);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
packet.ReadEnum<CustomizationFlag>("Customization Flags", TypeCode.Int32);
var firstLogin = packet.ReadBoolean("First Login");
packet.ReadInt32("Pet Display Id");
packet.ReadInt32("Pet Level");
packet.ReadEnum<CreatureFamily>("Pet Family", TypeCode.Int32);
for (var j = 0; j < 19; j++)
{
packet.ReadInt32("Equip Display Id");
packet.ReadEnum<InventoryType>("Equip Inventory Type", TypeCode.Byte);
packet.ReadInt32("Equip Aura Id");
}
int bagCount = ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685) ? 4 : 1;
for (var j = 0; j < bagCount; j++)
{
packet.ReadInt32("Bag Display Id");
packet.ReadEnum<InventoryType>("Bag Inventory Type", TypeCode.Byte);
packet.ReadInt32("Bag Aura Id");
}
if (firstLogin)
{
var startPos = new StartPosition {Map = mapId, Position = pos, Zone = zone};
Storage.StartPositions.Add(new Tuple<Race, Class>(race, clss), startPos, packet.TimeSpan);
}
var playerInfo = new Player {Race = race, Class = clss, Name = name, FirstLogin = firstLogin, Level = level};
if (Storage.Objects.ContainsKey(guid))
Storage.Objects[guid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(guid, playerInfo, packet.TimeSpan);
}
}
示例4: HandleCharEnum422
//.........这里部分代码省略.........
if (bits[c, 10])
guild[4] = (byte)(packet.ReadByte() ^ 1);
if (bits[c, 15])
guild[0] = (byte)(packet.ReadByte() ^ 1);
var pos = packet.ReadVector3("Position", c);
if (bits[c, 11])
low[0] = (byte)(packet.ReadByte() ^ 1);
var zone = packet.ReadEntryWithName<Int32>(StoreNameType.Zone, "Zone Id", c);
packet.ReadInt32("Pet Level", c);
if (bits[c, 8])
low[3] = (byte)(packet.ReadByte() ^ 1);
if (bits[c, 14])
low[7] = (byte)(packet.ReadByte() ^ 1);
packet.ReadByte("Facial Hair", c);
packet.ReadByte("Skin", c);
var clss = packet.ReadEnum<Class>("Class", TypeCode.Byte, c);
packet.ReadInt32("Pet Family", c);
packet.ReadEnum<CharacterFlag>("CharacterFlag", TypeCode.Int32, c);
if (bits[c, 9])
low[2] = (byte)(packet.ReadByte() ^ 1);
packet.ReadInt32("Pet Display ID", c);
if (bits[c, 3])
guild[7] = (byte)(packet.ReadByte() ^ 1);
var level = packet.ReadByte("Level", c);
if (bits[c, 7])
low[6] = (byte)(packet.ReadByte() ^ 1);
packet.ReadByte("Hair Style", c);
if (bits[c, 13])
guild[2] = (byte)(packet.ReadByte() ^ 1);
var race = packet.ReadEnum<Race>("Race", TypeCode.Byte, c);
packet.ReadByte("Hair Color", c);
if (bits[c, 5])
guild[6] = (byte)(packet.ReadByte() ^ 1);
packet.ReadEnum<Gender>("Gender", TypeCode.Byte, c);
if (bits[c, 6])
low[5] = (byte)(packet.ReadByte() ^ 1);
if (bits[c, 2])
guild[3] = (byte)(packet.ReadByte() ^ 1);
packet.ReadByte("List Order", c);
for (int itm = 0; itm < 19; itm++)
{
packet.ReadInt32("Item EnchantID", c, itm);
packet.ReadEnum<InventoryType>("Item InventoryType", TypeCode.Byte, c, itm);
packet.ReadInt32("Item DisplayID", c, itm);
}
for (int itm = 0; itm < 4; itm++)
{
packet.ReadInt32("Bag EnchantID", c, itm);
packet.ReadEnum<InventoryType>("Bag InventoryType", TypeCode.Byte, c, itm);
packet.ReadInt32("Bag DisplayID", c, itm);
}
packet.ReadEnum<CustomizationFlag>("CustomizationFlag", TypeCode.UInt32, c);
if (bits[c, 4])
guild[1] = (byte)(packet.ReadByte() ^ 1);
var playerGuid = new Guid(BitConverter.ToUInt64(low, 0));
packet.WriteLine("[{0}] Character GUID: {1}", c, playerGuid);
packet.WriteLine("[{0}] Guild GUID: {1}", c, new Guid(BitConverter.ToUInt64(guild, 0)));
var firstLogin = bits[c, 16];
if (firstLogin)
{
var startPos = new StartPosition {Map = mapId, Position = pos, Zone = zone};
Storage.StartPositions.Add(new Tuple<Race, Class>(race, clss), startPos, packet.TimeSpan);
}
var playerInfo = new Player { Race = race, Class = clss, Name = name, FirstLogin = firstLogin, Level = level };
if (Storage.Objects.ContainsKey(playerGuid))
Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan);
}
}
示例5: HandleCharEnum
public static void HandleCharEnum(Packet packet)
{
Characters.Clear();
var count = packet.ReadByte("Count");
for (var i = 0; i < count; i++)
{
var guid = packet.ReadGuid("GUID");
var name = packet.ReadCString("Name");
var race = packet.ReadEnum<Race>("Race", TypeCode.Byte);
var clss = packet.ReadEnum<Class>("Class", TypeCode.Byte);
packet.ReadEnum<Gender>("Gender", TypeCode.Byte);
packet.ReadByte("Skin");
packet.ReadByte("Face");
packet.ReadByte("Hair Style");
packet.ReadByte("Hair Color");
packet.ReadByte("Facial Hair");
var level = packet.ReadByte("Level");
var zone = packet.ReadEntryWithName<UInt32>(StoreNameType.Zone, "Zone Id");
var mapId = packet.ReadEntryWithName<Int32>(StoreNameType.Map, "Map Id");
var pos = packet.ReadVector3("Position");
packet.ReadInt32("Guild Id");
packet.ReadEnum<CharacterFlag>("Character Flags", TypeCode.Int32);
if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_2_9056))
packet.ReadEnum<CustomizationFlag>("Customization Flags", TypeCode.Int32);
var firstLogin = packet.ReadBoolean("First Login");
packet.ReadInt32("Pet Display Id");
packet.ReadInt32("Pet Level");
packet.ReadEnum<CreatureFamily>("Pet Family", TypeCode.Int32);
for (var j = 0; j < 19; j++)
{
packet.ReadInt32("Equip Display Id");
packet.ReadEnum<InventoryType>("Equip Inventory Type", TypeCode.Byte);
packet.ReadInt32("Equip Aura Id");
}
int bagCount = ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3_11685) ? 4 : 1;
for (var j = 0; j < bagCount; j++)
{
packet.ReadInt32("Bag Display Id");
packet.ReadEnum<InventoryType>("Bag Inventory Type", TypeCode.Byte);
packet.ReadInt32("Bag Aura Id");
}
if (firstLogin)
{
var startPos = new StartPosition {Map = mapId, Position = pos, Zone = zone};
packet.SniffFileInfo.Stuffing.StartPositions.TryAdd(new Tuple<Race, Class>(race, clss), startPos);
}
var chInfo = new Player {Race = race, Class = clss, Name = name, FirstLogin = firstLogin, Level = level};
Characters.Add(guid, chInfo); // TODO Remove when its usage is converted to Stuffing.Objects
packet.SniffFileInfo.Stuffing.Objects.TryAdd(guid, chInfo);
}
}
示例6: HandleCharEnum430
//.........这里部分代码省略.........
for (var itm = 0; itm < 4; ++itm)
{
packet.ReadEnum<InventoryType>("Bag InventoryType", TypeCode.Byte, c, itm);
packet.ReadInt32("Bag DisplayID", c, itm);
packet.ReadInt32("Bag EnchantID", c, itm);
}
if (guildGuids[c][0] != 0)
guildGuids[c][0] ^= packet.ReadByte();
if (guildGuids[c][1] != 0)
guildGuids[c][1] ^= packet.ReadByte();
packet.ReadByte("Face", c);
packet.ReadInt32("Pet Display ID", c);
if (guildGuids[c][7] != 0)
guildGuids[c][7] ^= packet.ReadByte();
packet.ReadEnum<Gender>("Gender", TypeCode.Byte, c);
var level = packet.ReadByte("Level", c);
packet.ReadInt32("Pet Level", c);
var zone = packet.ReadEntryWithName<UInt32>(StoreNameType.Zone, "Zone Id", c);
var y = packet.ReadSingle("Position Y", c);
packet.ReadInt32("Pet Family", c);
packet.ReadByte("Hair Style", c);
if (charGuids[c][1] != 0)
charGuids[c][1] ^= packet.ReadByte();
var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c);
if (charGuids[c][0] != 0)
charGuids[c][0] ^= packet.ReadByte();
var race = packet.ReadEnum<Race>("Race", TypeCode.Byte, c);
packet.ReadByte("List Order", c);
if (charGuids[c][7] != 0)
charGuids[c][7] ^= packet.ReadByte();
var z = packet.ReadSingle("Position Z", c);
var mapId = packet.ReadInt32("Map", c);
if (guildGuids[c][4] != 0)
guildGuids[c][4] ^= packet.ReadByte();
packet.ReadByte("Hair Color", c);
if (charGuids[c][3] != 0)
charGuids[c][3] ^= packet.ReadByte();
packet.ReadEnum<CharacterFlag>("CharacterFlag", TypeCode.Int32, c);
packet.ReadByte("Skin", c);
if (charGuids[c][4] != 0)
charGuids[c][4] ^= packet.ReadByte();
if (charGuids[c][5] != 0)
charGuids[c][5] ^= packet.ReadByte();
if (guildGuids[c][5] != 0)
guildGuids[c][5] ^= packet.ReadByte();
packet.ReadEnum<CustomizationFlag>("CustomizationFlag", TypeCode.UInt32, c);
var x = packet.ReadSingle("Position X", c);
packet.ReadByte("Facial Hair", c);
if (charGuids[c][6] != 0)
charGuids[c][6] ^= packet.ReadByte();
if (guildGuids[c][3] != 0)
guildGuids[c][3] ^= packet.ReadByte();
if (charGuids[c][2] != 0)
charGuids[c][2] ^= packet.ReadByte();
var clss = packet.ReadEnum<Class>("Class", TypeCode.Byte, c);
if (guildGuids[c][6] != 0)
guildGuids[c][6] ^= packet.ReadByte();
if (guildGuids[c][2] != 0)
guildGuids[c][2] ^= packet.ReadByte();
var playerGuid = new Guid(BitConverter.ToUInt64(charGuids[c], 0));
packet.Writer.WriteLine("[{0}] Character GUID: {1}", c, playerGuid);
packet.Writer.WriteLine("[{0}] Guild GUID: {1}", c, new Guid(BitConverter.ToUInt64(guildGuids[c], 0)));
if (firstLogins[c])
{
var startPos = new StartPosition();
startPos.Map = mapId;
startPos.Position = new Vector3(x, y, z);
startPos.Zone = zone;
packet.SniffFileInfo.Stuffing.StartPositions.TryAdd(new Tuple<Race, Class>(race, clss), startPos);
}
var chInfo = new Player();
chInfo.Race = race;
chInfo.Class = clss;
chInfo.Name = name;
chInfo.FirstLogin = firstLogins[c];
chInfo.Level = level;
Characters.Add(playerGuid, chInfo); // TODO Remove when its usage is converted to Stuffing.Objects
packet.SniffFileInfo.Stuffing.Objects.TryAdd(playerGuid, chInfo);
}
for (var c = 0; c < unkCounter; c++)
packet.Writer.WriteLine("Unk Loop: {0}, {1}", packet.ReadUInt32(), packet.ReadByte());
}
示例7: HandleCharEnum
//.........这里部分代码省略.........
charGuids[c][7] = packet.ReadBit();
packet.ReadBit("unk bit 124", c); //124
firstLogins[c] = packet.ReadBit(); //108
charGuids[c][6] = packet.ReadBit();
guildGuids[c][6] = packet.ReadBit();
nameLenghts[c] = packet.ReadBits(6);
charGuids[c][1] = packet.ReadBit();
guildGuids[c][1] = packet.ReadBit();
guildGuids[c][0] = packet.ReadBit();
charGuids[c][4] = packet.ReadBit();
guildGuids[c][7] = packet.ReadBit();
charGuids[c][2] = packet.ReadBit();
charGuids[c][5] = packet.ReadBit();
guildGuids[c][2] = packet.ReadBit();
guildGuids[c][5] = packet.ReadBit();
}//+=416
//packet.ResetBitReader();
packet.ReadBit("UnkB16");
for (int c = 0; c < count; ++c)
{
packet.ReadInt32("DW132", c);
packet.ReadXORByte(charGuids[c], 1);//1
packet.ReadByte("Slot", c); //57
packet.ReadByte("Hair Style", c); //63
packet.ReadXORByte(guildGuids[c], 2);//90
packet.ReadXORByte(guildGuids[c], 0);//88
packet.ReadXORByte(guildGuids[c], 6);//94
var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c);
packet.ReadXORByte(guildGuids[c], 3);//91
var x = packet.ReadSingle("Position X", c); //4Ch
packet.ReadInt32("DW104", c);
packet.ReadByte("Face", c); //62
var Class = packet.ReadEnum<Class>("Class", TypeCode.Byte, c); //59
packet.ReadXORByte(guildGuids[c], 5); //93
for (var itm = 0; itm < 23; itm++)
{
packet.ReadInt32("Item EnchantID", c, itm); //140 prolly need to replace those 2
packet.ReadEnum<InventoryType>("Item InventoryType", TypeCode.Byte, c, itm); //144
packet.ReadInt32("Item DisplayID", c, itm); //136
}
packet.ReadEnum<CustomizationFlag>("CustomizationFlag", TypeCode.UInt32, c); //100
packet.ReadXORByte(charGuids[c], 3); //3
packet.ReadXORByte(charGuids[c], 5); //5
packet.ReadInt32("PetFamily", c); //120
packet.ReadXORByte(guildGuids[c], 4); //92
var mapId = packet.ReadInt32("Map", c); //72
var race = packet.ReadEnum<Race>("Race", TypeCode.Byte, c); //58
packet.ReadByte("Skin", c); //61
packet.ReadXORByte(guildGuids[c], 1); //89
var level = packet.ReadByte("Level", c); //66
packet.ReadXORByte(charGuids[c], 0); //0
packet.ReadXORByte(charGuids[c], 2); //2
packet.ReadByte("Hair Color", c); //64
packet.ReadEnum<Gender>("Gender", TypeCode.Byte, c); //60
packet.ReadByte("Facial Hair", c); //65
packet.ReadInt32("Pet Level", c); //116
packet.ReadXORByte(charGuids[c], 4); //4
packet.ReadXORByte(charGuids[c], 7); //7
var y = packet.ReadSingle("Position Y", c); //50h
packet.ReadInt32("Pet DisplayID", c); //112
packet.ReadInt32("DW128", c);
packet.ReadXORByte(charGuids[c], 6); //6
packet.ReadEnum<CharacterFlag>("CharacterFlag", TypeCode.Int32, c); //96
var zone = packet.ReadEntry<UInt32>(StoreNameType.Zone, "Zone Id", c); //68
packet.ReadXORByte(guildGuids[c], 7); //95
var z = packet.ReadSingle("Position Z", c); //54h
var playerGuid = new Guid(BitConverter.ToUInt64(charGuids[c], 0));
packet.WriteGuid("Character GUID", charGuids[c], c);
packet.WriteGuid("Guild GUID", guildGuids[c], c);
if (firstLogins[c])
{
var startPos = new StartPosition();
startPos.Map = mapId;
startPos.Position = new Vector3(x, y, z);
startPos.Zone = (int)zone;
Storage.StartPositions.Add(new Tuple<Race, Class>(race, Class), startPos, packet.TimeSpan);
}
var playerInfo = new Player { Race = race, Class = Class, Name = name, FirstLogin = firstLogins[c], Level = level };
if (Storage.Objects.ContainsKey(playerGuid))
Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan);
StoreGetters.AddName(playerGuid, name);
}
for (var i = 0; i < unkCounter; i++)
{
packet.ReadByte("Unk byte", i); // char_table+28+i*8
packet.ReadUInt32("Unk int", i); // char_table+24+i*8
}
}
示例8: AddOrUpdate
// Adds to or update an entry in Objects dictionary for SMSG_CHAR_ENUM player data
public static void AddOrUpdate(this ConcurrentDictionary<Guid, WoWObject> dict, Guid guid, Player playerInfo)
{
dict.AddOrUpdate(guid, playerInfo, (guid1, wowObject) => Player.UpdatePlayerInfo((Player)wowObject, playerInfo));
}
示例9: HandleCharEnum433
//.........这里部分代码省略.........
packet.ReadByteE<InventoryType>("Bag InventoryType", c, itm);
}
var zone = packet.ReadUInt32<ZoneId>("Zone Id", c);
packet.ReadInt32("Pet Level", c);
packet.ReadInt32E<CharacterFlag>("CharacterFlag", c);
packet.ReadByte("Facial Hair", c);
packet.ReadXORByte(guildGuids[c], 0);
packet.ReadXORByte(charGuids[c], 0);
packet.ReadXORByte(charGuids[c], 2);
if (guildGuids[c][2] != 0)
// guildGuids[c][2] ^= packet.ReadByte();
if (charGuids[c][7] != 0)
charGuids[c][7] ^= packet.ReadByte();
if (guildGuids[c][7] != 0)
// guildGuids[c][7] ^= packet.ReadByte();
packet.ReadByte("List Order", c);
packet.ReadInt32("Pet Display ID", c);
// no ideal //////////////////////////////
if (charGuids[c][4] != 0)
charGuids[c][4] ^= packet.ReadByte();
if (guildGuids[c][4] != 0)
// guildGuids[c][4] ^= packet.ReadByte();
if (charGuids[c][5] != 0)
// charGuids[c][5] ^= packet.ReadByte();
if (guildGuids[c][5] != 0)
// guildGuids[c][5] ^= packet.ReadByte();
if (guildGuids[c][1] != 0)
// guildGuids[c][1] ^= packet.ReadByte();
if (guildGuids[c][3] != 0)
// guildGuids[c][3] ^= packet.ReadByte();
if (guildGuids[c][6] != 0)
// guildGuids[c][6] ^= packet.ReadByte();
//////////////////////////////////////////
if (charGuids[c][3] != 0)
charGuids[c][3] ^= packet.ReadByte();
var klass = packet.ReadByteE<Class>("Class", c);
if (charGuids[c][6] != 0)
charGuids[c][6] ^= packet.ReadByte();
pos.X = packet.ReadSingle("Position X", c);
if (charGuids[c][1] != 0)
charGuids[c][1] ^= packet.ReadByte();
var race = packet.ReadByteE<Race>("Race", c);
packet.ReadInt32("Pet Family", c);
pos.Y = packet.ReadSingle("Position Y", c);
packet.ReadByteE<Gender>("Gender", c);
packet.ReadByte("Hair Style", c);
var level = packet.ReadByte("Level", c);
pos.Z = packet.ReadSingle("Position Z", c);
packet.ReadUInt32E<CustomizationFlag>("CustomizationFlag", c);
packet.ReadByte("Skin", c);
packet.ReadByte("Hair Color", c);
packet.ReadByte("Face", c);
var mapId = packet.ReadInt32("Map", c);
var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c);
var playerGuid = new WowGuid64(BitConverter.ToUInt64(charGuids[c], 0));
packet.WriteGuid("Character GUID", charGuids[c], c);
packet.WriteGuid("Guild GUID", guildGuids[c], c);
if (firstLogins[c])
{
PlayerCreateInfo startPos = new PlayerCreateInfo { Race = race, Class = klass, Map = (uint)mapId, Zone = zone, Position = pos, Orientation = 0 };
Storage.StartPositions.Add(startPos, packet.TimeSpan);
}
var playerInfo = new Player { Race = race, Class = klass, Name = name, FirstLogin = firstLogins[c], Level = level };
if (Storage.Objects.ContainsKey(playerGuid))
Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan);
StoreGetters.AddName(playerGuid, name);
}
for (var c = 0; c < unkCounter; c++)
{
packet.ReadUInt32("Unk1", c);
packet.ReadByte("Unk2", c);
}
}
示例10: HandleCharEnum422
//.........这里部分代码省略.........
playerGuid[c][7] = packet.ReadBit();//14
guildGuid[c][0] = packet.ReadBit();//15
firstLogin[c] = packet.ReadBit();//16
}
for (int c = 0; c < count; c++)
{
var name = packet.ReadCString("Name", c);
packet.ReadXORByte(guildGuid[c], 5);
packet.ReadByte("Face", c);
var mapId = packet.ReadInt32("Map", c);
packet.ReadXORByte(playerGuid[c], 1);
packet.ReadXORByte(playerGuid[c], 4);
packet.ReadXORByte(guildGuid[c], 4);
packet.ReadXORByte(guildGuid[c], 0);
var pos = packet.ReadVector3("Position", c);
packet.ReadXORByte(playerGuid[c], 0);
var zone = packet.ReadInt32<ZoneId>("Zone Id", c);
packet.ReadInt32("Pet Level", c);
packet.ReadXORByte(playerGuid[c], 3);
packet.ReadXORByte(playerGuid[c], 7);
packet.ReadByte("Facial Hair", c);
packet.ReadByte("Skin", c);
var klass = packet.ReadByteE<Class>("Class", c);
packet.ReadInt32("Pet Family", c);
packet.ReadInt32E<CharacterFlag>("CharacterFlag", c);
packet.ReadXORByte(playerGuid[c], 2);
packet.ReadInt32("Pet Display ID", c);
packet.ReadXORByte(guildGuid[c], 7);
var level = packet.ReadByte("Level", c);
packet.ReadXORByte(playerGuid[c], 6);
packet.ReadByte("Hair Style", c);
packet.ReadXORByte(guildGuid[c], 2);
var race = packet.ReadByteE<Race>("Race", c);
packet.ReadByte("Hair Color", c);
packet.ReadXORByte(guildGuid[c], 6);
packet.ReadByteE<Gender>("Gender", c);
packet.ReadXORByte(playerGuid[c], 5);
packet.ReadXORByte(guildGuid[c], 3);
packet.ReadByte("List Order", c);
for (int itm = 0; itm < 19; itm++)
{
packet.ReadInt32("Item EnchantID", c, itm);
packet.ReadByteE<InventoryType>("Item InventoryType", c, itm);
packet.ReadInt32("Item DisplayID", c, itm);
}
for (int itm = 0; itm < 4; itm++)
{
packet.ReadInt32("Bag EnchantID", c, itm);
packet.ReadByteE<InventoryType>("Bag InventoryType", c, itm);
packet.ReadInt32("Bag DisplayID", c, itm);
}
packet.ReadUInt32E<CustomizationFlag>("CustomizationFlag", c);
packet.ReadXORByte(guildGuid[c], 1);
var guidPlayer = new WowGuid64(BitConverter.ToUInt64(playerGuid[c], 0));
packet.WriteGuid("Character Guid", playerGuid[c],c);
packet.WriteGuid("Guild Guid", guildGuid[c],c);
if (firstLogin[c])
{
PlayerCreateInfo startPos = new PlayerCreateInfo { Race = race, Class = klass, Map = (uint)mapId, Zone = (uint)zone, Position = pos, Orientation = 0 };
Storage.StartPositions.Add(startPos, packet.TimeSpan);
}
var playerInfo = new Player { Race = race, Class = klass, Name = name, FirstLogin = firstLogin[c], Level = level };
if (Storage.Objects.ContainsKey(guidPlayer))
Storage.Objects[guidPlayer] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(guidPlayer, playerInfo, packet.TimeSpan);
StoreGetters.AddName(guidPlayer, name);
}
}
示例11: HandleCharEnum430
//.........这里部分代码省略.........
charGuids[c][1] = packet.ReadBit();
firstLogins[c] = packet.ReadBit();
guildGuids[c][5] = packet.ReadBit();
charGuids[c][7] = packet.ReadBit();
guildGuids[c][6] = packet.ReadBit();
guildGuids[c][1] = packet.ReadBit();
}
var unkCounter = packet.ReadBits("Unk Counter", 23);
packet.ReadBit(); // no idea, not used in client
for (int c = 0; c < count; ++c)
{
for (var itm = 0; itm < 19; ++itm)
{
packet.ReadByteE<InventoryType>("Item InventoryType", c, itm);
packet.ReadInt32("Item DisplayID", c, itm);
packet.ReadInt32("Item EnchantID", c, itm);
}
for (var itm = 0; itm < 4; ++itm)
{
packet.ReadByteE<InventoryType>("Bag InventoryType", c, itm);
packet.ReadInt32("Bag DisplayID", c, itm);
packet.ReadInt32("Bag EnchantID", c, itm);
}
packet.ReadXORByte(guildGuids[c], 0);
packet.ReadXORByte(guildGuids[c], 1);
packet.ReadByte("Face", c);
packet.ReadInt32("Pet Display ID", c);
packet.ReadXORByte(guildGuids[c], 7);
packet.ReadByteE<Gender>("Gender", c);
var level = packet.ReadByte("Level", c);
packet.ReadInt32("Pet Level", c);
var zone = packet.ReadUInt32<ZoneId>("Zone Id", c);
var y = packet.ReadSingle("Position Y", c);
packet.ReadInt32("Pet Family", c);
packet.ReadByte("Hair Style", c);
packet.ReadXORByte(charGuids[c], 1);
var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c);
packet.ReadXORByte(charGuids[c], 0);
var race = packet.ReadByteE<Race>("Race", c);
packet.ReadByte("List Order", c);
packet.ReadXORByte(charGuids[c], 7);
var z = packet.ReadSingle("Position Z", c);
var mapId = packet.ReadInt32("Map", c);
packet.ReadXORByte(guildGuids[c], 4);
packet.ReadByte("Hair Color", c);
packet.ReadXORByte(charGuids[c], 3);
packet.ReadInt32E<CharacterFlag>("CharacterFlag", c);
packet.ReadByte("Skin", c);
packet.ReadXORByte(charGuids[c], 4);
packet.ReadXORByte(charGuids[c], 5);
packet.ReadXORByte(guildGuids[c], 5);
packet.ReadUInt32E<CustomizationFlag>("CustomizationFlag", c);
var x = packet.ReadSingle("Position X", c);
packet.ReadByte("Facial Hair", c);
packet.ReadXORByte(charGuids[c], 6);
packet.ReadXORByte(guildGuids[c], 3);
packet.ReadXORByte(charGuids[c], 2);
var clss = packet.ReadByteE<Class>("Class", c);
packet.ReadXORByte(guildGuids[c], 6);
packet.ReadXORByte(guildGuids[c], 2);
var playerGuid = new WowGuid64(BitConverter.ToUInt64(charGuids[c], 0));
packet.WriteGuid("Character GUID", charGuids[c], c);
packet.WriteGuid("Guild GUID", guildGuids[c], c);
if (firstLogins[c])
{
var startPos = new StartPosition { Map = (uint) mapId, Position = new Vector3(x, y, z), Zone = zone };
Storage.StartPositions.Add(new Tuple<Race, Class>(race, clss), startPos, packet.TimeSpan);
}
var playerInfo = new Player{Race = race, Class = clss, Name = name, FirstLogin = firstLogins[c], Level = level};
if (Storage.Objects.ContainsKey(playerGuid))
Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan);
StoreGetters.AddName(playerGuid, name);
}
for (var c = 0; c < unkCounter; c++)
{
packet.ReadUInt32("Unk1", c);
packet.ReadByte("Unk2", c);
}
}
示例12: HandleCharEnum
//.........这里部分代码省略.........
charGuids[c] = new byte[8];
guildGuids[c] = new byte[8];
charGuids[c][3] = packet.ReadBit();
guildGuids[c][6] = packet.ReadBit();
guildGuids[c][3] = packet.ReadBit();
firstLogins[c] = packet.ReadBit();
guildGuids[c][7] = packet.ReadBit();
nameLenghts[c] = packet.ReadBits(6);
guildGuids[c][1] = packet.ReadBit();
charGuids[c][6] = packet.ReadBit();
charGuids[c][1] = packet.ReadBit();
guildGuids[c][4] = packet.ReadBit();
charGuids[c][5] = packet.ReadBit();
guildGuids[c][0] = packet.ReadBit();
charGuids[c][7] = packet.ReadBit();
charGuids[c][2] = packet.ReadBit();
charGuids[c][0] = packet.ReadBit();
guildGuids[c][2] = packet.ReadBit();
guildGuids[c][5] = packet.ReadBit();
charGuids[c][4] = packet.ReadBit();
}
packet.ResetBitReader();
for (int c = 0; c < count; ++c)
{
packet.ReadInt32E<CharacterFlag>("CharacterFlag", c);
var zone = packet.ReadUInt32<ZoneId>("Zone Id", c);
packet.ReadXORByte(charGuids[c], 0);
packet.ReadXORByte(guildGuids[c], 5);
packet.ReadXORByte(charGuids[c], 1);
packet.ReadXORByte(guildGuids[c], 1);
packet.ReadXORByte(charGuids[c], 3);
packet.ReadInt32("Pet Family", c); // v4+116
packet.ReadXORByte(guildGuids[c], 2);
packet.ReadByte("Hair Style", c); // v4+63
packet.ReadXORByte(guildGuids[c], 0);
packet.ReadXORByte(guildGuids[c], 7);
var y = packet.ReadSingle("Position Y", c); // v4+80
packet.ReadXORByte(charGuids[c], 6);
packet.ReadInt32("Pet Level", c); // v4+112
packet.ReadXORByte(charGuids[c], 7);
var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c); // v4 + 8
var level = packet.ReadByte("Level", c); // v4+66
var x = packet.ReadSingle("Position X", c); //v4+76
var clss = packet.ReadByteE<Class>("Class", c); // v4+59
packet.ReadInt32("Pet Display ID", c); //v4+108
packet.ReadByte("List Order", c); //v4+57
packet.ReadByte("Facial Hair", c); // v4+65
var z = packet.ReadSingle("Position Z", c); //v4+84
packet.ReadXORByte(guildGuids[c], 3);
var race = packet.ReadByteE<Race>("Race", c); //v4+58
packet.ReadXORByte(charGuids[c], 4);
for (int j = 0; j < 23; ++j)
{
packet.ReadByteE<InventoryType>("Item InventoryType", c, j);
packet.ReadInt32("Item DisplayID", c, j);
packet.ReadInt32("Item EnchantID", c, j);
}
packet.ReadXORByte(guildGuids[c], 6);
packet.ReadXORByte(charGuids[c], 2);
packet.ReadXORByte(charGuids[c], 5);
packet.ReadByte("Skin", c); //v4+61
packet.ReadByte("Hair Color", c); // v4+64
packet.ReadByte("Face", c); // v4+62
packet.ReadXORByte(guildGuids[c], 4);
packet.ReadUInt32E<CustomizationFlag>("CustomizationFlag", c); //v4+100
packet.ReadByteE<Gender>("Gender", c); //v4+60
var mapId = packet.ReadInt32<MapId>("Map Id", c); //v4+72
for (var i = 0; i < count2; ++i)
{
packet.ReadUInt32("unk1", i);
packet.ReadByte("unk2", i);
}
var playerGuid = new WowGuid64(BitConverter.ToUInt64(charGuids[c], 0));
packet.WriteGuid("Character GUID", charGuids[c], c);
packet.WriteGuid("Guild GUID", guildGuids[c], c);
if (firstLogins[c])
{
var startPos = new StartPosition {Map = (uint) mapId, Position = new Vector3(x, y, z), Zone = zone};
Storage.StartPositions.Add(new Tuple<Race, Class>(race, clss), startPos, packet.TimeSpan);
}
var playerInfo = new Player { Race = race, Class = clss, Name = name, FirstLogin = firstLogins[c], Level = level };
if (Storage.Objects.ContainsKey(playerGuid))
Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan);
StoreGetters.AddName(playerGuid, name);
}
}
示例13: HandleCharEnum434
//.........这里部分代码省略.........
{
packet.ReadEnum<InventoryType>("Bag InventoryType", TypeCode.Byte, c, itm);
packet.ReadInt32("Bag DisplayID", c, itm);
packet.ReadInt32("Bag EnchantID", c, itm);
}
packet.ReadInt32("Pet Family", c);
packet.ReadByte("List Order", c);
packet.ReadByte("Hair Style", c);
packet.ReadInt32("Pet Display ID", c);
packet.ReadEnum<CharacterFlag>("CharacterFlag", TypeCode.Int32, c);
packet.ReadByte("Hair Color", c);
var mapId = packet.ReadInt32("Map", c);
var z = packet.ReadSingle("Position Z", c);
packet.ReadInt32("Pet Level", c);
if (charGuids[c][3] != 0)
charGuids[c][3] ^= packet.ReadByte();
var y = packet.ReadSingle("Position Y", c);
packet.ReadEnum<CustomizationFlag>("CustomizationFlag", TypeCode.UInt32, c);
packet.ReadByte("Facial Hair", c);
if (charGuids[c][7] != 0)
charGuids[c][7] ^= packet.ReadByte();
packet.ReadEnum<Gender>("Gender", TypeCode.Byte, c);
var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c);
packet.ReadByte("Face", c);
if (charGuids[c][0] != 0)
charGuids[c][0] ^= packet.ReadByte();
if (charGuids[c][2] != 0)
charGuids[c][2] ^= packet.ReadByte();
var x = packet.ReadSingle("Position X", c);
packet.ReadByte("Skin", c);
var race = packet.ReadEnum<Race>("Race", TypeCode.Byte, c);
var level = packet.ReadByte("Level", c);
if (charGuids[c][1] != 0)
charGuids[c][1] ^= packet.ReadByte();
var zone = packet.ReadEntryWithName<UInt32>(StoreNameType.Zone, "Zone Id", c);
// Not ideal
if (guildGuids[c][0] != 0)
guildGuids[c][0] ^= packet.ReadByte();
if (guildGuids[c][1] != 0)
guildGuids[c][1] ^= packet.ReadByte();
if (guildGuids[c][7] != 0)
guildGuids[c][7] ^= packet.ReadByte();
if (guildGuids[c][4] != 0)
guildGuids[c][4] ^= packet.ReadByte();
if (charGuids[c][4] != 0)
charGuids[c][4] ^= packet.ReadByte();
if (charGuids[c][5] != 0)
charGuids[c][5] ^= packet.ReadByte();
if (guildGuids[c][5] != 0)
guildGuids[c][5] ^= packet.ReadByte();
if (charGuids[c][6] != 0)
charGuids[c][6] ^= packet.ReadByte();
if (guildGuids[c][3] != 0)
guildGuids[c][3] ^= packet.ReadByte();
if (guildGuids[c][6] != 0)
guildGuids[c][6] ^= packet.ReadByte();
if (guildGuids[c][2] != 0)
guildGuids[c][2] ^= packet.ReadByte();
var playerGuid = new Guid(BitConverter.ToUInt64(charGuids[c], 0));
packet.WriteLine("[{0}] Character GUID: {1}", c, playerGuid);
packet.WriteLine("[{0}] Guild GUID: {1}", c, new Guid(BitConverter.ToUInt64(guildGuids[c], 0)));
if (firstLogins[c])
{
var startPos = new StartPosition();
startPos.Map = mapId;
startPos.Position = new Vector3(x, y, z);
startPos.Zone = zone;
Storage.StartPositions.Add(new Tuple<Race, Class>(race, clss), startPos, packet.TimeSpan);
}
var playerInfo = new Player { Race = race, Class = clss, Name = name, FirstLogin = firstLogins[c], Level = level };
if (Storage.Objects.ContainsKey(playerGuid))
Storage.Objects[playerGuid] = new Tuple<WoWObject, TimeSpan?>(playerInfo, packet.TimeSpan);
else
Storage.Objects.Add(playerGuid, playerInfo, packet.TimeSpan);
}
for (var c = 0; c < unkCounter; c++)
packet.WriteLine("Unk Loop: {0}, {1}", packet.ReadUInt32(), packet.ReadByte());
}
}
示例14: HandleCharEnum510
public static void HandleCharEnum510(Packet packet)
{
var unkCounter = packet.ReadBits("Unk Counter", 23);
var count = packet.ReadBits("Char count", 17);
var charGuids = new byte[count][];
var guildGuids = new byte[count][];
var firstLogins = new bool[count];
var nameLenghts = new uint[count];
for (int c = 0; c < count; ++c)
{
charGuids[c] = new byte[8];
guildGuids[c] = new byte[8];
charGuids[c][7] = packet.ReadBit();
charGuids[c][0] = packet.ReadBit();
charGuids[c][4] = packet.ReadBit();
guildGuids[c][2] = packet.ReadBit();
charGuids[c][5] = packet.ReadBit();
charGuids[c][3] = packet.ReadBit();
nameLenghts[c] = packet.ReadBits(7);
guildGuids[c][0] = packet.ReadBit();
guildGuids[c][5] = packet.ReadBit();
guildGuids[c][3] = packet.ReadBit();
firstLogins[c] = packet.ReadBit();
guildGuids[c][6] = packet.ReadBit();
guildGuids[c][7] = packet.ReadBit();
charGuids[c][1] = packet.ReadBit();
guildGuids[c][4] = packet.ReadBit();
guildGuids[c][1] = packet.ReadBit();
charGuids[c][2] = packet.ReadBit();
charGuids[c][6] = packet.ReadBit();
}
packet.ReadBit("Unk bit");
packet.ResetBitReader();
for (int c = 0; c < count; ++c)
{
Vector3 pos = new Vector3();
packet.ReadInt32E<CharacterFlag>("CharacterFlag", c);
packet.ReadInt32("Pet Family", c);
pos.Z = packet.ReadSingle("Position Z", c);
packet.ReadXORByte(charGuids[c], 7);
packet.ReadXORByte(guildGuids[c], 6);
for (var itm = 0; itm < 23; ++itm)
{
packet.ReadInt32("Item EnchantID", c, itm);
packet.ReadByteE<InventoryType>("Item InventoryType", c, itm);
packet.ReadInt32("Item DisplayID", c, itm);
}
pos.X = packet.ReadSingle("Position X", c);
var klass = packet.ReadByteE<Class>("Class", c);
packet.ReadXORByte(charGuids[c], 5);
pos.Y = packet.ReadSingle("Position Y", c);
packet.ReadXORByte(guildGuids[c], 3);
packet.ReadXORByte(charGuids[c], 6);
packet.ReadInt32("Pet Level", c);
packet.ReadInt32("Pet Display ID", c);
packet.ReadXORByte(charGuids[c], 2);
packet.ReadXORByte(charGuids[c], 1);
packet.ReadByte("Hair Color", c);
packet.ReadByte("Facial Hair", c);
packet.ReadXORByte(guildGuids[c], 2);
var zone = packet.ReadUInt32<ZoneId>("Zone Id", c);
packet.ReadByte("List Order", c);
packet.ReadXORByte(charGuids[c], 0);
packet.ReadXORByte(guildGuids[c], 1);
packet.ReadByte("Skin", c);
packet.ReadXORByte(charGuids[c], 4);
packet.ReadXORByte(guildGuids[c], 5);
var name = packet.ReadWoWString("Name", (int)nameLenghts[c], c);
packet.ReadXORByte(guildGuids[c], 0);
var level = packet.ReadByte("Level", c);
packet.ReadXORByte(charGuids[c], 3);
packet.ReadXORByte(guildGuids[c], 7);
packet.ReadByte("Hair Style", c);
packet.ReadXORByte(guildGuids[c], 4);
packet.ReadByteE<Gender>("Gender", c);
var mapId = packet.ReadInt32<MapId>("Map Id", c);
packet.ReadUInt32E<CustomizationFlag>("CustomizationFlag", c);
var race = packet.ReadByteE<Race>("Race", c);
packet.ReadByte("Face", c);
var playerGuid = new WowGuid64(BitConverter.ToUInt64(charGuids[c], 0));
packet.WriteGuid("Character GUID", charGuids[c], c);
packet.WriteGuid("Guild GUID", guildGuids[c], c);
if (firstLogins[c])
{
PlayerCreateInfo startPos = new PlayerCreateInfo { Race = race, Class = klass, Map = (uint)mapId, Zone = zone, Position = pos, Orientation = 0 };
Storage.StartPositions.Add(startPos, packet.TimeSpan);
}
var playerInfo = new Player { Race = race, Class = klass, Name = name, FirstLogin = firstLogins[c], Level = level };
//.........这里部分代码省略.........
示例15: ReadCreateObjectBlock
private static void ReadCreateObjectBlock(ref Packet packet, Guid guid, uint map, int index)
{
var objType = packet.ReadEnum<ObjectType>("Object Type", TypeCode.Byte, index);
var moves = ReadMovementUpdateBlock(ref packet, guid, index);
var updates = ReadValuesUpdateBlock(ref packet, objType, index);
WoWObject obj;
switch (objType)
{
case ObjectType.Unit: obj = new Unit(); break;
case ObjectType.GameObject: obj = new GameObject(); break;
case ObjectType.Item: obj = new Item(); break;
case ObjectType.Player: obj = new Player(); break;
default: obj = new WoWObject(); break;
}
obj.Type = objType;
obj.Movement = moves;
obj.UpdateFields = updates;
obj.Map = map;
obj.Area = WorldStateHandler.CurrentAreaId;
obj.PhaseMask = (uint) MovementHandler.CurrentPhaseMask;
Storage.Objects.TryAdd(guid, obj);
if (guid.HasEntry() && (objType == ObjectType.Unit || objType == ObjectType.GameObject))
packet.AddSniffData(Utilities.ObjectTypeToStore(objType), (int)guid.GetEntry(), "SPAWN");
}