public static void SendCharacterRenameSuccess(RealmClient client, EntityId guid, string newName) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_CHAR_RENAME, 10 + newName.Length)) { packet.WriteByte((byte)AccountCharacterErrorCodes.ACCNT_MANIP_OK); packet.Write(guid.Full); packet.WriteCString(newName); client.Send(packet); } }
public static void CreatureNameQueryRequest(RealmClient client, RealmPacketIn packet) { uint creatureEntry = packet.ReadUInt32(); EntityId creatureEntityId = packet.ReadEntityId(); var npc = WorldMgr.GetObject(creatureEntityId) as NPC; if (npc != null) { var entry = npc.Entry; var name = entry.Name; var title = entry.Title; var info = entry.Info; using (RealmPacketOut pkt = new RealmPacketOut(RealmServerOpCode.SMSG_CREATURE_QUERY_RESPONSE, 5 + 4 + 1 + 36 + 2 + name.Length + title.Length)) { pkt.WriteUInt(creatureEntry); pkt.Write(name); pkt.WriteByte(0); // Name2 pkt.WriteByte(0); // Name3 pkt.WriteByte(0); // Name4 pkt.WriteCString(title); //pkt.WriteCString(info); pkt.WriteUInt(entry.Flags); pkt.Write((uint)entry.Type); pkt.WriteUInt(entry.Family); pkt.Write((uint)entry.Rank); pkt.WriteUInt(entry.UInt1); pkt.WriteUInt(entry.SpellDataId); pkt.WriteUInt(npc.DisplayId); pkt.Write(entry.Float1); pkt.Write(entry.Float2); pkt.WriteByte(0); pkt.WriteByte(entry.IsLeader); client.Send(pkt); } } }
static void DoPacketAnalyzr() { DebugHelper.Init(); var packet = new RealmPacketOut(RealmServerOpCode.CMSG_MESSAGECHAT, 40); packet.Write((uint)ChatMsgType.Guild); packet.Write((uint)ChatLanguage.DemonTongue); packet.WriteCString("huhu Guild!"); DebugHelper.DumpPacket(packet.GetFinalizedPacket()); }