aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Server')
-rw-r--r--src/server/game/Server/Packets/CharacterPackets.cpp29
-rw-r--r--src/server/game/Server/Packets/CharacterPackets.h47
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp2
-rw-r--r--src/server/game/Server/WorldSession.h2
4 files changed, 68 insertions, 12 deletions
diff --git a/src/server/game/Server/Packets/CharacterPackets.cpp b/src/server/game/Server/Packets/CharacterPackets.cpp
index 2adbd3666b0..d6f3736d9bb 100644
--- a/src/server/game/Server/Packets/CharacterPackets.cpp
+++ b/src/server/game/Server/Packets/CharacterPackets.cpp
@@ -317,3 +317,32 @@ void WorldPackets::Character::QueryPlayerName::Read()
if (Hint.NativeRealmAddress.HasValue)
_worldPacket >> Hint.NativeRealmAddress;
}
+
+WorldPacket const* WorldPackets::Character::PlayerNameResponse::Write()
+{
+ _worldPacket << Result;
+ _worldPacket << Player;
+
+ if (Result == 0)
+ {
+ _worldPacket.WriteBits(Data.Name.length(), 7);
+
+ for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
+ _worldPacket.WriteBits(Data.DeclinedNames.name[i].length(), 7);
+
+ for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
+ _worldPacket.WriteString(Data.DeclinedNames.name[i]);
+
+ _worldPacket << Data.AccountID;
+ _worldPacket << Data.BnetAccountID;
+ _worldPacket << Data.GuidActual;
+ _worldPacket << Data.VirtualRealmAddress;
+ _worldPacket << Data.Race;
+ _worldPacket << Data.Sex;
+ _worldPacket << Data.ClassID;
+ _worldPacket << Data.Level;
+ _worldPacket.WriteString(Data.Name);
+ }
+
+ return &_worldPacket;
+}
diff --git a/src/server/game/Server/Packets/CharacterPackets.h b/src/server/game/Server/Packets/CharacterPackets.h
index e85a8aaccb9..5fbe1426292 100644
--- a/src/server/game/Server/Packets/CharacterPackets.h
+++ b/src/server/game/Server/Packets/CharacterPackets.h
@@ -25,18 +25,12 @@ namespace WorldPackets
{
namespace Character
{
- struct PlayerGuidLookupHint
- {
- public Optional<uint32> VirtualRealmAddress; ///< current realm (?) (identifier made from the Index, BattleGroup and Region)
- public Optional<uint32> NativeRealmAddress; ///< original realm (?) (identifier made from the Index, BattleGroup and Region)
- };
-
struct CharacterCreateInfo
{
/// User specified variables
- uint8 Race = 0;
- uint8 Class = 0;
- uint8 Sex = GENDER_NONE;
+ uint8 Race = RACE_NONE;
+ uint8 Class = CLASS_NONE;
+ uint8 Sex = GENDER_NONE;
uint8 Skin = 0;
uint8 Face = 0;
uint8 HairStyle = 0;
@@ -68,7 +62,7 @@ namespace WorldPackets
struct CharacterFactionChangeInfo : public CharacterCustomizeInfo
{
- uint8 Race = 0;
+ uint8 Race = RACE_NONE;
};
struct CharacterUndeleteInfo
@@ -367,6 +361,27 @@ namespace WorldPackets
bool Showing = false;
};
+ struct PlayerGuidLookupHint
+ {
+ Optional<uint32> VirtualRealmAddress; ///< current realm (?) (identifier made from the Index, BattleGroup and Region)
+ Optional<uint32> NativeRealmAddress; ///< original realm (?) (identifier made from the Index, BattleGroup and Region)
+ };
+
+ struct PlayerGuidLookupData
+ {
+ bool IsDeleted = false;
+ ObjectGuid AccountID;
+ ObjectGuid BnetAccountID;
+ ObjectGuid GuidActual;
+ std::string Name;
+ uint32 VirtualRealmAddress = 0;
+ uint8 Race = RACE_NONE;
+ uint8 Sex = GENDER_NONE;
+ uint8 ClassID = CLASS_NONE;
+ uint8 Level = 0;
+ DeclinedName DeclinedNames;
+ };
+
class QueryPlayerName final : public ClientPacket
{
public:
@@ -377,6 +392,18 @@ namespace WorldPackets
ObjectGuid Player;
PlayerGuidLookupHint Hint;
};
+
+ class PlayerNameResponse final : public ServerPacket
+ {
+ public:
+ PlayerNameResponse() : ServerPacket(SMSG_NAME_QUERY_RESPONSE, 60) { }
+
+ WorldPacket const* Write() override;
+
+ ObjectGuid Player;
+ uint8 Result = -1; // 0 - full packet, != 0 - only guid
+ PlayerGuidLookupData Data;
+ };
}
}
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index 504e17788fd..9695598a097 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -1112,7 +1112,7 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_UNHANDLED);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_UNHANDLED);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_UNHANDLED);
- DEFINE_SERVER_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_UNHANDLED);
+ DEFINE_SERVER_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_UNHANDLED);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_UNHANDLED);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_UNHANDLED);
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index c09511eb259..ec791a52ca6 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -569,7 +569,7 @@ class WorldSession
void HandleMeetingStoneInfo(WorldPacket& recPacket);
void HandleGameobjectReportUse(WorldPacket& recvPacket);
- void HandleNameQueryOpcode(WorldPackets::Character::QueryPlayerName& queryPlayerName);
+ void HandleNameQueryOpcode(WorldPackets::Character::QueryPlayerName& packet);
void HandleQueryTimeOpcode(WorldPacket& recvPacket);