void HandleNameQueryResponse(PacketReader reader) { UInt64 playerGUID = reader.ReadPackedGuid(); bool noData = reader.ReadBoolean(); if (noData) return; string name = reader.ReadCString(); reader.ReadCString(); // Realm Name (Cross Realm) reader.ReadByte(); reader.ReadByte(); reader.ReadByte(); bool declined = reader.ReadBoolean(); // Name declined/not declined if (declined) for (byte i = 0; i < 5; ++i) reader.ReadByte(); PlayerName result = Manager.m_WorldServer.PlayerNameList.Find( delegate(PlayerName playerName) { return playerName.GUID == playerGUID; }); if (result == null) { PlayerName playerName = new PlayerName(); playerName.GUID = playerGUID; playerName.Name = name; QueryChatMessage.Name = name; ReceiveMsg = QueryChatMessage; PlayerNameList.Add(playerName); } }
void HandleChannelList(PacketReader reader) { byte type = reader.ReadByte(); string name = reader.ReadCString(); ChannelFlags flags = (ChannelFlags)reader.ReadByte(); UInt32 size = reader.ReadUInt32(); for (UInt32 i = 0; i < size; i++) { reader.ReadUInt64(); reader.ReadByte(); } }
void HandleServerAuthResponse(PacketReader reader) { byte detail = reader.ReadByte(); uint billingTimeRemaining = reader.ReadUInt32(); byte billingFlags = reader.ReadByte(); uint billingTimeRested = reader.ReadByte(); byte expansion = reader.ReadByte(); if (detail == 0x0C) { PacketWriter writer = new PacketWriter(Opcodes.ClientEnumerateCharacters); Send(writer); } else ErrorMessage = "Could not respond to ServerAuthResponse"; }
public Character(PacketReader reader) { GUID = reader.ReadUInt64(); Name = reader.ReadCString(); Race = reader.ReadByte(); Class = reader.ReadByte(); Gender = (Gender)reader.ReadByte(); Bytes = reader.ReadBytes(5); Level = reader.ReadByte(); ZoneId = reader.ReadUInt32(); MapId = reader.ReadUInt32(); X = reader.ReadSingle(); Y = reader.ReadSingle(); Z = reader.ReadSingle(); GuildId = reader.ReadUInt32(); Flags = reader.ReadUInt32(); reader.ReadUInt32(); reader.ReadByte(); PetInfoId = reader.ReadUInt32(); PetLevel = reader.ReadUInt32(); PetFamilyId = reader.ReadUInt32(); for (int i = 0; i < Items.Length - 1; ++i) Items[i] = new Item(reader); for (int i = 0; i < 4; ++i) { reader.ReadUInt32(); reader.ReadByte(); reader.ReadUInt32(); } }
void HandleChannelNotify(PacketReader reader) { ChatNotify chatNotify = (ChatNotify)reader.ReadByte(); string name = reader.ReadCString(); switch (chatNotify) { case ChatNotify.CHAT_YOU_JOINED_NOTICE: break; } }
public Item(PacketReader reader) { DisplayId = reader.ReadUInt32(); InventoryType = reader.ReadByte(); reader.ReadUInt32(); }
void HandleServerChatMessage(PacketReader reader) { ChatType type = (ChatType)reader.ReadByte(); Language language; UInt64 targetGUID; UInt64 targetGUIDOther; UInt32 messageLength; string channelName = null; string message; if ((type != ChatType.CHAT_TYPE_CHANNEL && type != ChatType.CHAT_TYPE_WHISPER)) language = (Language)reader.ReadUInt32(); else language = (Language)reader.ReadUInt32(); targetGUID = reader.ReadUInt64(); reader.ReadUInt32(); switch (type) { case ChatType.CHAT_TYPE_CHANNEL: channelName = reader.ReadCString(); break; } targetGUIDOther = reader.ReadUInt64(); messageLength = reader.ReadUInt32(); message = reader.ReadCString(); reader.ReadByte(); PlayerName result = PlayerNameList.Find( delegate(PlayerName playerName) { return playerName.GUID == targetGUID; }); if (type == ChatType.CHAT_TYPE_SYSTEM) { foreach (string syntax in message.Split('\n')) if (!CmdList.Contains(syntax)) // Prevent double message CmdList.Add(syntax); } if (result != null) { QueryChatMessage.Type = type; QueryChatMessage.Message = message; QueryChatMessage.Name = result.Name; if (channelName != null) QueryChatMessage.ChannelName = channelName; ReceiveMsg = QueryChatMessage; } else { QueryChatMessage.Type = type; QueryChatMessage.Message = message; if (channelName != null) QueryChatMessage.ChannelName = channelName; } if (targetGUID > 0) { PacketWriter writer = new PacketWriter(Opcodes.CMSG_NAME_QUERY); writer.Write(targetGUID); Send(writer); } }