override public IdentificationStatus Identify(int OpCode, int Size, PacketDirection Direction) { if ((OpCode == OpManager.OpCodeNameToNumber("OP_ZoneEntry")) && (Direction == PacketDirection.ClientToServer)) { return(IdentificationStatus.Yes); } return(IdentificationStatus.No); }
override public IdentificationStatus Identify(int opCode, int size, PacketDirection direction) { if ((opCode == OpManager.OpCodeNameToNumber("OP_ZoneEntry")) && (direction == PacketDirection.ClientToServer)) { return(IdentificationStatus.Tentative); } if ((opCode == OpManager.OpCodeNameToNumber("OP_PlayerProfile")) && (direction == PacketDirection.ServerToClient) && (size == ExpectedPPLength)) { return(IdentificationStatus.Yes); } return(IdentificationStatus.No); }
public int PacketTypeCountByName(string OPCodeName) { UInt32 OpCodeNumber = OpManager.OpCodeNameToNumber(OPCodeName); int Count = 0; foreach (EQApplicationPacket app in Packets.PacketList) { if (app.OpCode == OpCodeNumber) { ++Count; } } return(Count); }
public override IdentificationStatus Identify(int opCode, int size, PacketDirection direction) { var opZoneEntry = OpManager.OpCodeNameToNumber("OP_ZoneEntry"); var opPlayerProfile = OpManager.OpCodeNameToNumber("OP_PlayerProfile"); if (opCode == opZoneEntry && direction == PacketDirection.ClientToServer) { return(IdentificationStatus.Tentative); } if (opCode == opPlayerProfile && direction == PacketDirection.ServerToClient) // &&(Size == ExpectedPPLength)) { return(IdentificationStatus.Yes); } return(IdentificationStatus.No); }
public List <byte[]> GetPacketsOfType(string OpCodeName, PacketDirection Direction) { List <byte[]> ReturnList = new List <byte[]>(); if (OpManager == null) { return(ReturnList); } UInt32 OpCodeNumber = OpManager.OpCodeNameToNumber(OpCodeName); foreach (EQApplicationPacket app in Packets.PacketList) { if ((app.OpCode == OpCodeNumber) && (app.Direction == Direction) && (app.Locked)) { ReturnList.Add(app.Buffer); } } return(ReturnList); }
override public MerchantManager GetMerchantData(NPCSpawnList npcsl) { List <EQApplicationPacket> PacketList = Packets.PacketList; UInt32 OP_ShopRequest = OpManager.OpCodeNameToNumber("OP_ShopRequest"); UInt32 OP_ShopEnd = OpManager.OpCodeNameToNumber("OP_ShopEnd"); UInt32 OP_ItemPacket = OpManager.OpCodeNameToNumber("OP_ItemPacket"); MerchantManager mm = new MerchantManager(); for (int i = 0; i < PacketList.Count; ++i) { EQApplicationPacket p = PacketList[i]; if ((p.Direction == PacketDirection.ServerToClient) && (p.OpCode == OP_ShopRequest)) { ByteStream Buffer = new ByteStream(p.Buffer); UInt32 MerchantSpawnID = Buffer.ReadUInt32(); NPCSpawn npc = npcsl.GetNPC(MerchantSpawnID); UInt32 NPCTypeID; if (npc != null) { NPCTypeID = npc.NPCTypeID; } else { NPCTypeID = 0; } mm.AddMerchant(MerchantSpawnID); for (int j = i + 1; j < PacketList.Count; ++j) { p = PacketList[j]; if (p.OpCode == OP_ShopEnd) { break; } if (p.OpCode == OP_ItemPacket) { Buffer = new ByteStream(p.Buffer); UInt32 StackSize = Buffer.ReadUInt32(); Buffer.SkipBytes(4); UInt32 Slot = Buffer.ReadUInt32(); UInt32 MerchantSlot = Buffer.ReadUInt32(); UInt32 Price = Buffer.ReadUInt32(); Int32 Quantity = Buffer.ReadInt32(); Buffer.SetPosition(68); // Point to item name string ItemName = Buffer.ReadString(true); string Lore = Buffer.ReadString(true); string IDFile = Buffer.ReadString(true); UInt32 ItemID = Buffer.ReadUInt32(); //if (Quantity == -1) mm.AddMerchantItem(MerchantSpawnID, ItemID, ItemName, MerchantSlot, Quantity); } } } } return(mm); }