private void Handle_CreatureQuery(WoWReader wr) { Entry entry = new Entry(); entry.entry = wr.ReadUInt32(); entry.name = wr.ReadString(); entry.blarg = wr.ReadBytes(3); entry.subname = wr.ReadString(); entry.flags = wr.ReadUInt32(); entry.subtype = wr.ReadUInt32(); entry.family = wr.ReadUInt32(); entry.rank = wr.ReadUInt32(); BoogieCore.Log(LogType.NeworkComms, "Got CreatureQuery Response - Entry: {0} - Name: {1} - SubName {2}", entry.entry, entry.name, entry.subname); if (EntryList.ContainsKey(entry.entry) == false) EntryList.Add(entry.entry, entry); if (EntryQueue.ContainsKey(entry.entry)) EntryQueue.Remove(entry.entry); foreach (Object obj in BoogieCore.world.getObjectList()) { if (obj.Fields != null) { if (obj.Fields[(int)UpdateFields.OBJECT_FIELD_ENTRY] == entry.entry) { if (entry.name.Contains("Auctioneer") && SentHello == false) { WoWWriter ww = new WoWWriter(OpCode.MSG_AUCTION_HELLO); ww.Write(obj.GUID.GetOldGuid()); Send(ww.ToArray()); BoogieCore.Log(LogType.SystemDebug, "Sent AH Hello!"); SentHello = true; } obj.Name = entry.name; obj.SubName = entry.subname; obj.SubType = entry.subtype; obj.Family = entry.family; obj.Rank = entry.rank; } } } }
private void Handle_GameObjectQuery(WoWReader wr) { Entry entry = new Entry(); entry.entry = wr.ReadUInt32(); if (entry.entry < 1 || wr.Remaining < 4) { BoogieCore.Log(LogType.System, "Got {1} in GameObject query response for entryid or remaining in packet too small {0}", wr.Remaining, entry.entry); return; } entry.Type = wr.ReadUInt32(); entry.DisplayID = wr.ReadUInt32(); entry.name = wr.ReadString(); BoogieCore.Log(LogType.NeworkComms, "Got GameObject Query Response - Entry: {0} - Name: {1} - Type {2}", entry.entry, entry.name, entry.Type); if (EntryList.ContainsKey(entry.entry) == false) EntryList.Add(entry.entry, entry); if (EntryQueue.ContainsKey(entry.entry)) EntryQueue.Remove(entry.entry); foreach (Object obj in BoogieCore.world.getObjectList()) { if (obj.Fields != null) { if (obj.Fields[(int)UpdateFields.OBJECT_FIELD_ENTRY] == entry.entry) { obj.Type = (byte)entry.Type; obj.Name = entry.name; } } } }