aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/characters/2016_xx_xx_xx_characters_legion_01.sql4
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.cpp20
-rw-r--r--src/server/game/Entities/Player/Player.cpp109
-rw-r--r--src/server/game/Entities/Player/Player.h2
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp48
-rw-r--r--src/server/game/Server/Packets/CharacterPackets.cpp91
-rw-r--r--src/server/game/Server/Packets/CharacterPackets.h26
-rw-r--r--src/server/game/Server/Packets/SystemPackets.cpp12
-rw-r--r--src/server/game/Server/Packets/SystemPackets.h3
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp16
-rw-r--r--src/server/game/World/World.h2
-rw-r--r--src/server/worldserver/worldserver.conf.dist6
12 files changed, 177 insertions, 162 deletions
diff --git a/sql/updates/characters/2016_xx_xx_xx_characters_legion_01.sql b/sql/updates/characters/2016_xx_xx_xx_characters_legion_01.sql
new file mode 100644
index 00000000000..3cc4003e724
--- /dev/null
+++ b/sql/updates/characters/2016_xx_xx_xx_characters_legion_01.sql
@@ -0,0 +1,4 @@
+ALTER TABLE `characters`
+ ADD `customDisplay1` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `facialStyle`,
+ ADD `customDisplay2` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `customDisplay1`,
+ ADD `customDisplay3` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `customDisplay2`;
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp
index a7e7394fc87..6450946aaa4 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp
@@ -44,20 +44,20 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_MAIL_LIST_INFO, "SELECT id, sender, (SELECT name FROM characters WHERE guid = sender) AS sendername, receiver, (SELECT name FROM characters WHERE guid = receiver) AS receivername, "
"subject, deliver_time, expire_time, money, has_items FROM mail WHERE receiver = ? ", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_MAIL_LIST_ITEMS, "SELECT itemEntry,count FROM item_instance WHERE guid = ?", CONNECTION_SYNCH);
- PrepareStatement(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, "
+ PrepareStatement(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.customDisplay1, c.customDisplay2, c.customDisplay3, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, "
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot, c.logout_time "
"FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? AND c.deleteInfos_Name IS NULL", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.level, c.zone, c.map, "
+ PrepareStatement(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.customDisplay1, c.customDisplay2, c.customDisplay3, c.level, c.zone, c.map, "
"c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, "
"cb.guid, c.slot, c.logout_time, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? "
"LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? AND c.deleteInfos_Name IS NULL", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_UNDELETE_ENUM, "SELECT c.guid, c.deleteInfos_Name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, "
+ PrepareStatement(CHAR_SEL_UNDELETE_ENUM, "SELECT c.guid, c.deleteInfos_Name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.customDisplay1, c.customDisplay2, c.customDisplay3, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, "
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot, c.logout_time "
"FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.deleteInfos_Account = ? AND c.deleteInfos_Name IS NOT NULL", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_UNDELETE_ENUM_DECLINED_NAME, "SELECT c.guid, c.deleteInfos_Name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.level, c.zone, c.map, "
+ PrepareStatement(CHAR_SEL_UNDELETE_ENUM_DECLINED_NAME, "SELECT c.guid, c.deleteInfos_Name, c.race, c.class, c.gender, c.skin, c.face, c.hairStyle, c.hairColor, c.facialStyle, c.customDisplay1, c.customDisplay2, c.customDisplay3, c.level, c.zone, c.map, "
"c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, "
"cb.guid, c.slot, c.logout_time, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? "
"LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
@@ -75,7 +75,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_BATTLEGROUND_RANDOM, "DELETE FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_BATTLEGROUND_RANDOM, "INSERT INTO character_battleground_random (guid) VALUES (?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, bankSlots, restState, playerFlags, "
+ PrepareStatement(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, customDisplay1, customDisplay2, customDisplay3, bankSlots, restState, playerFlags, "
"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
"resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeonDifficulty, "
"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
@@ -386,7 +386,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_LFG_DATA, "DELETE FROM lfg_data WHERE guid = ?", CONNECTION_ASYNC);
// Player saving
- PrepareStatement(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, bankSlots, restState, playerFlags, "
+ PrepareStatement(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, customDisplay1, customDisplay2, customDisplay3, bankSlots, restState, playerFlags, "
"map, instance_id, dungeonDifficulty, raidDifficulty, legacyRaidDifficulty, position_x, position_y, position_z, orientation, trans_x, trans_y, trans_z, trans_o, transguid, "
"taximask, cinematic, "
"totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, talentTree, "
@@ -394,8 +394,8 @@ void CharacterDatabaseConnection::DoPrepareStatements()
"death_expire_time, taxi_path, totalKills, "
"todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, health, power1, power2, power3, "
"power4, power5, power6, latency, talentGroupsCount, activeTalentGroup, lootSpecId, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels) VALUES "
- "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,skin=?,face=?,hairStyle=?,hairColor=?,facialStyle=?,bankSlots=?,restState=?,playerFlags=?,"
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,skin=?,face=?,hairStyle=?,hairColor=?,facialStyle=?,customDisplay1=?,customDisplay2=?,customDisplay3=?,bankSlots=?,restState=?,playerFlags=?,"
"map=?,instance_id=?,dungeonDifficulty=?,raidDifficulty=?,legacyRaidDifficulty=?,position_x=?,position_y=?,position_z=?,orientation=?,trans_x=?,trans_y=?,trans_z=?,trans_o=?,transguid=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?,"
"logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,talentTree=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?,"
"totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,"
@@ -443,7 +443,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ?, extendState = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent, extendState) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC);
- PrepareStatement(CHAR_UPD_GENDER_AND_APPEARANCE, "UPDATE characters SET gender = ?, skin = ?, face = ?, hairStyle = ?, hairColor = ?, facialStyle = ? WHERE guid = ?", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_UPD_GENDER_AND_APPEARANCE, "UPDATE characters SET gender = ?, skin = ?, face = ?, hairStyle = ?, hairColor = ?, facialStyle = ?, customDisplay1 = ?, customDisplay2 = ?, customDisplay3 = ? WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_DEL_CHARACTER_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS, "UPDATE character_social SET flags = ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_CHARACTER_SOCIAL, "INSERT INTO character_social (guid, friend, flags) VALUES (?, ?, ?)", CONNECTION_ASYNC);
@@ -466,7 +466,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC, "SELECT guid, name FROM characters WHERE account = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_POOL_QUEST_SAVE, "SELECT quest_id FROM pool_quest_save WHERE pool_id = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHAR_CUSTOMIZE_INFO, "SELECT name, race, class, gender, at_login FROM characters WHERE guid = ?", CONNECTION_ASYNC);
- PrepareStatement(CHAR_SEL_CHAR_RACE_OR_FACTION_CHANGE_INFOS, "SELECT at_login, knownTitles, skin, face, hairStyle, hairColor, facialStyle FROM characters WHERE guid = ?", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_SEL_CHAR_RACE_OR_FACTION_CHANGE_INFOS, "SELECT at_login, knownTitles FROM characters WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_PERM_BIND_BY_INSTANCE, "SELECT guid FROM character_instance WHERE instance = ? and permanent = 1", CONNECTION_SYNCH);
PrepareStatement(CHAR_SEL_CHAR_COD_ITEM_MAIL, "SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver = ? AND has_items <> 0 AND cod <> 0", CONNECTION_SYNCH);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 1efc4988a08..18a853d40b7 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -16242,17 +16242,17 @@ bool Player::IsLoading() const
bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
{
- // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
- //"SELECT guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, bankSlots, restState, playerFlags, "
- // 17 18 19 20 21 22 23 24 25 26 27 28 29
- //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
- // 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
- //"resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeonDifficulty, "
- // 45 46 47 48 49 50
- //"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
- // 51 52 53 54 55 56 57 58 59 60 61 62 63
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+ //"SELECT guid, account, name, race, class, gender, level, xp, money, skin, face, hairStyle, hairColor, facialStyle, customDisplay1, customDisplay2, customDisplay3, "
+ // 17 18 19 20 21 22 23 24 25 26 27 28 29 30
+ //"bankSlots, restState, playerFlags, position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, "
+ // 31 32 33 34 35 36 37 38 39 40 41 42 43 44
+ //"is_logout_resting, resettalents_cost, resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, "
+ // 45 46 47 48 49 50 51 52 53
+ //"death_expire_time, taxi_path, dungeonDifficulty, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
+ // 54 55 56 57 58 59 60 61 62 63 64 65 66
//"health, power1, power2, power3, power4, power5, power6, instance_id, speccount, activespec, lootSpecId, exploredZones, equipmentCache, "
- // 64 65 66 67 68
+ // 67 68 69 70 71
//"knownTitles, actionBars, grantableLevels, raidDifficulty, legacyRaidDifficulty FROM characters WHERE guid = '%u'", guid);
PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_FROM);
if (!result)
@@ -16321,8 +16321,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8());
SetUInt32Value(PLAYER_XP, fields[7].GetUInt32());
- _LoadIntoDataField(fields[62].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
- _LoadIntoDataField(fields[64].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE * 2);
+ _LoadIntoDataField(fields[65].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
+ _LoadIntoDataField(fields[67].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE * 2);
SetObjectScale(1.0f);
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
@@ -16340,12 +16340,12 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID, fields[11].GetUInt8());
SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID, fields[12].GetUInt8());
SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, fields[13].GetUInt8());
- SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS, fields[14].GetUInt8());
- SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, fields[15].GetUInt8());
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS, fields[17].GetUInt8());
+ SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE, fields[18].GetUInt8());
SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER, gender);
- SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_INEBRIATION, fields[50].GetUInt8());
- SetUInt32Value(PLAYER_FLAGS, fields[16].GetUInt32());
- SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[49].GetUInt32());
+ SetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_INEBRIATION, fields[53].GetUInt8());
+ SetUInt32Value(PLAYER_FLAGS, fields[19].GetUInt32());
+ SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[52].GetUInt32());
if (!ValidateAppearance(
fields[3].GetUInt8(), // race
@@ -16362,7 +16362,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
// set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise)
- SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES, fields[65].GetUInt8());
+ SetByteValue(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTES_OFFSET_ACTION_BAR_TOGGLES, fields[68].GetUInt8());
InitDisplayIds();
@@ -16390,18 +16390,18 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
InitPrimaryProfessions(); // to max set before any spell loaded
// init saved position, and fix it later if problematic
- ObjectGuid::LowType transLowGUID = fields[36].GetUInt64();
+ ObjectGuid::LowType transLowGUID = fields[39].GetUInt64();
- Relocate(fields[17].GetFloat(), fields[18].GetFloat(), fields[19].GetFloat(), fields[21].GetFloat());
+ Relocate(fields[20].GetFloat(), fields[24].GetFloat(), fields[22].GetFloat(), fields[24].GetFloat());
- uint32 mapId = fields[20].GetUInt16();
- uint32 instanceId = fields[58].GetUInt32();
+ uint32 mapId = fields[23].GetUInt16();
+ uint32 instanceId = fields[61].GetUInt32();
- SetDungeonDifficultyID(CheckLoadedDungeonDifficultyID(Difficulty(fields[44].GetUInt8())));
- SetRaidDifficultyID(CheckLoadedRaidDifficultyID(Difficulty(fields[67].GetUInt8())));
- SetLegacyRaidDifficultyID(CheckLoadedLegacyRaidDifficultyID(Difficulty(fields[68].GetUInt8())));
+ SetDungeonDifficultyID(CheckLoadedDungeonDifficultyID(Difficulty(fields[47].GetUInt8())));
+ SetRaidDifficultyID(CheckLoadedRaidDifficultyID(Difficulty(fields[70].GetUInt8())));
+ SetLegacyRaidDifficultyID(CheckLoadedLegacyRaidDifficultyID(Difficulty(fields[71].GetUInt8())));
- std::string taxi_nodes = fields[43].GetString();
+ std::string taxi_nodes = fields[46].GetString();
#define RelocateToHomebind(){ mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); }
@@ -16426,9 +16426,9 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
_LoadCurrency(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_CURRENCY));
- SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[45].GetUInt32());
- SetUInt16Value(PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_TODAY_KILLS, fields[46].GetUInt16());
- SetUInt16Value(PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_YESTERDAY_KILLS, fields[47].GetUInt16());
+ SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[48].GetUInt32());
+ SetUInt16Value(PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_TODAY_KILLS, fields[49].GetUInt16());
+ SetUInt16Value(PLAYER_FIELD_KILLS, PLAYER_FIELD_KILLS_OFFSET_YESTERDAY_KILLS, fields[50].GetUInt16());
_LoadBoundInstances(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_BOUND_INSTANCES));
_LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_INSTANCE_LOCK_TIMES));
@@ -16501,7 +16501,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
if (transport)
{
- float x = fields[32].GetFloat(), y = fields[33].GetFloat(), z = fields[34].GetFloat(), o = fields[35].GetFloat();
+ float x = fields[38].GetFloat(), y = fields[36].GetFloat(), z = fields[37].GetFloat(), o = fields[38].GetFloat();
m_movementInfo.transport.pos.Relocate(x, y, z, o);
transport->CalculatePassengerPosition(x, y, z, &o);
@@ -16691,7 +16691,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
SaveRecallPosition();
time_t now = time(nullptr);
- time_t logoutTime = time_t(fields[27].GetUInt32());
+ time_t logoutTime = time_t(fields[30].GetUInt32());
// since last logout (in seconds)
uint32 time_diff = uint32(now - logoutTime); //uint64 is excessive for a time_diff in seconds.. uint32 allows for 136~ year difference.
@@ -16704,18 +16704,18 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
SetDrunkValue(newDrunkValue);
- m_cinematic = fields[23].GetUInt8();
- m_Played_time[PLAYED_TIME_TOTAL] = fields[24].GetUInt32();
- m_Played_time[PLAYED_TIME_LEVEL] = fields[25].GetUInt32();
+ m_cinematic = fields[26].GetUInt8();
+ m_Played_time[PLAYED_TIME_TOTAL] = fields[27].GetUInt32();
+ m_Played_time[PLAYED_TIME_LEVEL] = fields[28].GetUInt32();
- SetTalentResetCost(fields[29].GetUInt32());
- SetTalentResetTime(time_t(fields[30].GetUInt32()));
+ SetTalentResetCost(fields[32].GetUInt32());
+ SetTalentResetTime(time_t(fields[33].GetUInt32()));
- m_taxi.LoadTaxiMask(fields[22].GetString()); // must be before InitTaxiNodesForLevel
+ m_taxi.LoadTaxiMask(fields[25].GetString()); // must be before InitTaxiNodesForLevel
- uint32 extraflags = fields[37].GetUInt16();
+ uint32 extraflags = fields[40].GetUInt16();
- m_stableSlots = fields[38].GetUInt8();
+ m_stableSlots = fields[41].GetUInt8();
if (m_stableSlots > MAX_PET_STABLES)
{
TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) can't have more stable slots than %u, but has %u in DB",
@@ -16723,7 +16723,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
m_stableSlots = MAX_PET_STABLES;
}
- m_atLoginFlags = fields[39].GetUInt16();
+ m_atLoginFlags = fields[42].GetUInt16();
if (HasAtLoginFlag(AT_LOGIN_RENAME))
{
@@ -16736,7 +16736,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
m_lastHonorUpdateTime = logoutTime;
UpdateHonorFields();
- m_deathExpireTime = time_t(fields[42].GetUInt32());
+ m_deathExpireTime = time_t(fields[45].GetUInt32());
if (m_deathExpireTime > now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP)
m_deathExpireTime = now + MAX_DEATH_COUNT * DEATH_EXPIRE_STEP - 1;
@@ -16773,7 +16773,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
InitRunes();
// rest bonus can only be calculated after InitStatsForLevel()
- m_rest_bonus = fields[26].GetFloat();
+ m_rest_bonus = fields[29].GetFloat();
if (time_diff > 0)
{
@@ -16781,7 +16781,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
float bubble0 = 0.031f;
//speed collect rest bonus in offline, in logout, in tavern, city (section/in hour)
float bubble1 = 0.125f;
- float bubble = fields[28].GetUInt8() > 0
+ float bubble = fields[31].GetUInt8() > 0
? bubble1*sWorld->getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY)
: bubble0*sWorld->getRate(RATE_REST_OFFLINE_IN_WILDERNESS);
@@ -16792,10 +16792,10 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
_LoadSkills(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_SKILLS));
UpdateSkillsForLevel(); //update skills after load, to make sure they are correctly update at player load
- SetTalentGroupsCount(fields[59].GetUInt8());
- SetActiveTalentGroup(fields[60].GetUInt8());
+ SetTalentGroupsCount(fields[62].GetUInt8());
+ SetActiveTalentGroup(fields[63].GetUInt8());
- uint32 lootSpecId = fields[61].GetUInt32();
+ uint32 lootSpecId = fields[64].GetUInt32();
if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(lootSpecId))
{
if (chrSpec->ClassID == getClass())
@@ -16811,7 +16811,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
// Only load selected specializations, learning mastery spells requires this
- Tokenizer talentSpecs(fields[31].GetString(), ' ', MAX_TALENT_GROUPS);
+ Tokenizer talentSpecs(fields[34].GetString(), ' ', MAX_TALENT_GROUPS);
for (uint8 i = 0; i < MAX_TALENT_GROUPS; ++i)
{
if (i >= talentSpecs.size())
@@ -16878,7 +16878,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES
// note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded
- uint32 curTitle = fields[48].GetUInt32();
+ uint32 curTitle = fields[51].GetUInt32();
if (curTitle && !HasTitle(curTitle))
curTitle = 0;
@@ -16901,14 +16901,14 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
UpdateAllStats();
// restore remembered power/health values (but not more max values)
- uint32 savedHealth = fields[51].GetUInt32();
+ uint32 savedHealth = fields[54].GetUInt32();
SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth);
uint32 loadedPowers = 0;
for (uint32 i = 0; i < MAX_POWERS; ++i)
{
if (GetPowerIndex(i) != MAX_POWERS)
{
- uint32 savedPower = fields[52 + loadedPowers].GetUInt32();
+ uint32 savedPower = fields[55 + loadedPowers].GetUInt32();
uint32 maxPower = GetUInt32Value(UNIT_FIELD_MAXPOWER + loadedPowers);
SetPower(Powers(i), (savedPower > maxPower) ? maxPower : savedPower);
if (++loadedPowers >= MAX_POWERS_PER_CLASS)
@@ -16973,7 +16973,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
}
// RaF stuff.
- m_grantableLevels = fields[66].GetUInt8();
+ m_grantableLevels = fields[69].GetUInt8();
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
SetFlag(OBJECT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND);
@@ -18552,6 +18552,9 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID));
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID));
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE));
+ stmt->setUInt8(index++, 0);
+ stmt->setUInt8(index++, 0);
+ stmt->setUInt8(index++, 0);
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS));
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS));
@@ -18679,6 +18682,9 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_STYLE_ID));
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_HAIR_COLOR_ID));
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE));
+ stmt->setUInt8(index++, 0);
+ stmt->setUInt8(index++, 0);
+ stmt->setUInt8(index++, 0);
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_BANK_BAG_SLOTS));
stmt->setUInt8(index++, GetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_REST_STATE));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS));
@@ -26224,6 +26230,7 @@ void Player::RemoveSocial()
m_social = nullptr;
}
+// TODO: check demon hunter custom display sections
bool Player::ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create /*=false*/)
{
// Check skin color
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 5ff09881eb3..f6e0bd7c090 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -581,6 +581,8 @@ enum PlayerBytes2Offsets
PLAYER_BYTES_2_OFFSET_REST_STATE = 3
};
+#define PLAYER_CUSTOM_DISPLAY_SIZE 3
+
enum PlayerBytes3Offsets
{
PLAYER_BYTES_3_OFFSET_GENDER = 0,
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index ee75a4ed58c..07507392cef 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -267,6 +267,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
WorldPackets::Character::EnumCharactersResult charEnum;
charEnum.Success = true;
charEnum.IsDeletedCharacters = false;
+ charEnum.DisabledClassesMask = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK);
_legitCharacters.clear();
@@ -333,6 +334,7 @@ void WorldSession::HandleCharUndeleteEnum(PreparedQueryResult result)
WorldPackets::Character::EnumCharactersResult charEnum;
charEnum.Success = true;
charEnum.IsDeletedCharacters = true;
+ charEnum.DisabledClassesMask = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK);
if (result)
{
@@ -1594,7 +1596,10 @@ void WorldSession::HandleCharCustomizeCallback(PreparedQueryResult result, World
stmt->setUInt8(3, customizeInfo->HairStyleID);
stmt->setUInt8(4, customizeInfo->HairColorID);
stmt->setUInt8(5, customizeInfo->FacialHairStyleID);
- stmt->setUInt64(6, lowGuid);
+ stmt->setUInt8(6, customizeInfo->CustomDisplay[0]);
+ stmt->setUInt8(7, customizeInfo->CustomDisplay[1]);
+ stmt->setUInt8(8, customizeInfo->CustomDisplay[2]);
+ stmt->setUInt64(9, lowGuid);
trans->Append(stmt);
}
@@ -1854,29 +1859,17 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(PreparedQueryResult res
// Customize
{
- if (!factionChangeInfo->SkinID)
- factionChangeInfo->SkinID = fields[2].GetUInt8();
-
- if (!factionChangeInfo->FaceID)
- factionChangeInfo->FaceID = fields[3].GetUInt8();
-
- if (!factionChangeInfo->HairStyleID)
- factionChangeInfo->HairStyleID = fields[4].GetUInt8();
-
- if (!factionChangeInfo->HairColorID)
- factionChangeInfo->HairColorID = fields[5].GetUInt8();
-
- if (!factionChangeInfo->FacialHairStyleID)
- factionChangeInfo->FacialHairStyleID = fields[6].GetUInt8();
-
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_AND_APPEARANCE);
stmt->setUInt8(0, factionChangeInfo->SexID);
- stmt->setUInt8(1, *factionChangeInfo->SkinID);
- stmt->setUInt8(2, *factionChangeInfo->FaceID);
- stmt->setUInt8(3, *factionChangeInfo->HairStyleID);
- stmt->setUInt8(4, *factionChangeInfo->HairColorID);
- stmt->setUInt8(5, *factionChangeInfo->FacialHairStyleID);
- stmt->setUInt64(6, lowGuid);
+ stmt->setUInt8(1, factionChangeInfo->SkinID);
+ stmt->setUInt8(2, factionChangeInfo->FaceID);
+ stmt->setUInt8(3, factionChangeInfo->HairStyleID);
+ stmt->setUInt8(4, factionChangeInfo->HairColorID);
+ stmt->setUInt8(5, factionChangeInfo->FacialHairStyleID);
+ stmt->setUInt8(6, factionChangeInfo->CustomDisplay[0]);
+ stmt->setUInt8(7, factionChangeInfo->CustomDisplay[1]);
+ stmt->setUInt8(8, factionChangeInfo->CustomDisplay[2]);
+ stmt->setUInt64(9, lowGuid);
trans->Append(stmt);
}
@@ -2532,12 +2525,13 @@ void WorldSession::SendCharFactionChange(ResponseCodes result, WorldPackets::Cha
packet.Display = boost::in_place();
packet.Display->Name = factionChangeInfo->Name;
packet.Display->SexID = factionChangeInfo->SexID;
- packet.Display->SkinID = *factionChangeInfo->SkinID;
- packet.Display->HairColorID = *factionChangeInfo->HairColorID;
- packet.Display->HairStyleID = *factionChangeInfo->HairStyleID;
- packet.Display->FacialHairStyleID = *factionChangeInfo->FacialHairStyleID;
- packet.Display->FaceID = *factionChangeInfo->FaceID;
+ packet.Display->SkinID = factionChangeInfo->SkinID;
+ packet.Display->HairColorID = factionChangeInfo->HairColorID;
+ packet.Display->HairStyleID = factionChangeInfo->HairStyleID;
+ packet.Display->FacialHairStyleID = factionChangeInfo->FacialHairStyleID;
+ packet.Display->FaceID = factionChangeInfo->FaceID;
packet.Display->RaceID = factionChangeInfo->RaceID;
+ packet.Display->CustomDisplay = factionChangeInfo->CustomDisplay;
}
SendPacket(packet.Write());
diff --git a/src/server/game/Server/Packets/CharacterPackets.cpp b/src/server/game/Server/Packets/CharacterPackets.cpp
index d30779d49c2..dfa4bbb3bfa 100644
--- a/src/server/game/Server/Packets/CharacterPackets.cpp
+++ b/src/server/game/Server/Packets/CharacterPackets.cpp
@@ -24,11 +24,13 @@ WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Fiel
{
// 0 1 2 3 4 5 6 7
// "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.skin, characters.face, characters.hairStyle, "
- // 8 9 10 11 12 13 14 15
- // "characters.hairColor, characters.facialStyle, characters.level, characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, "
- // 16 17 18 19 20 21 22
+ // 8 9 10 11 12 13
+ // "characters.hairColor, characters.facialStyle, characters.customDisplay1, characters.customDisplay2, characters.customDisplay3, characters.level, "
+ // 14 15 16 17 18
+ // "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, "
+ // 19 20 21 22 23 24 25
// "guild_member.guildid, characters.playerFlags, characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, "
- // 23 24 25 26
+ // 26 27 28 29
// "character_banned.guid, characters.slot, characters.logout_time, character_declinedname.genitive"
Guid = ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt64());
@@ -41,18 +43,21 @@ WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Fiel
HairStyle = fields[7].GetUInt8();
HairColor = fields[8].GetUInt8();
FacialHair = fields[9].GetUInt8();
- Level = fields[10].GetUInt8();
- ZoneId = int32(fields[11].GetUInt16());
- MapId = int32(fields[12].GetUInt16());
- PreLoadPosition.x = fields[13].GetFloat();
- PreLoadPosition.y = fields[14].GetFloat();
- PreLoadPosition.z = fields[15].GetFloat();
-
- if (ObjectGuid::LowType guildId = fields[16].GetUInt64())
+ CustomDisplay[0] = fields[10].GetUInt8();
+ CustomDisplay[1] = fields[11].GetUInt8();
+ CustomDisplay[2] = fields[12].GetUInt8();
+ Level = fields[13].GetUInt8();
+ ZoneId = int32(fields[14].GetUInt16());
+ MapId = int32(fields[15].GetUInt16());
+ PreLoadPosition.x = fields[16].GetFloat();
+ PreLoadPosition.y = fields[17].GetFloat();
+ PreLoadPosition.z = fields[18].GetFloat();
+
+ if (ObjectGuid::LowType guildId = fields[19].GetUInt64())
GuildGuid = ObjectGuid::Create<HighGuid::Guild>(guildId);
- uint32 playerFlags = fields[17].GetUInt32();
- uint32 atLoginFlags = fields[18].GetUInt16();
+ uint32 playerFlags = fields[20].GetUInt32();
+ uint32 atLoginFlags = fields[21].GetUInt16();
if (atLoginFlags & AT_LOGIN_RESURRECT)
playerFlags &= ~PLAYER_FLAGS_GHOST;
@@ -69,10 +74,10 @@ WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Fiel
if (atLoginFlags & AT_LOGIN_RENAME)
Flags |= CHARACTER_FLAG_RENAME;
- if (fields[23].GetUInt64())
+ if (fields[26].GetUInt64())
Flags |= CHARACTER_FLAG_LOCKED_BY_BILLING;
- if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) && !fields[26].GetString().empty())
+ if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) && !fields[29].GetString().empty())
Flags |= CHARACTER_FLAG_DECLINED;
if (atLoginFlags & AT_LOGIN_CUSTOMIZE)
@@ -88,10 +93,10 @@ WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Fiel
// show pet at selection character in character list only for non-ghost character
if (!(playerFlags & PLAYER_FLAGS_GHOST) && (Class == CLASS_WARLOCK || Class == CLASS_HUNTER || Class == CLASS_DEATH_KNIGHT))
{
- if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(fields[19].GetUInt32()))
+ if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(fields[22].GetUInt32()))
{
- Pet.CreatureDisplayId = fields[20].GetUInt32();
- Pet.Level = fields[21].GetUInt16();
+ Pet.CreatureDisplayId = fields[23].GetUInt32();
+ Pet.Level = fields[24].GetUInt16();
Pet.CreatureFamily = creatureInfo->family;
}
}
@@ -100,9 +105,9 @@ WorldPackets::Character::EnumCharactersResult::CharacterInfo::CharacterInfo(Fiel
ProfessionIds[0] = 0;
ProfessionIds[1] = 0;
- Tokenizer equipment(fields[22].GetString(), ' ');
- ListPosition = fields[24].GetUInt8();
- LastPlayedTime = fields[25].GetUInt32();
+ Tokenizer equipment(fields[25].GetString(), ' ');
+ ListPosition = fields[27].GetUInt8();
+ LastPlayedTime = fields[28].GetUInt32();
for (uint8 slot = 0; slot < INVENTORY_SLOT_BAG_END; ++slot)
{
@@ -119,9 +124,17 @@ WorldPacket const* WorldPackets::Character::EnumCharactersResult::Write()
_worldPacket.WriteBit(Success);
_worldPacket.WriteBit(IsDeletedCharacters);
+ _worldPacket.WriteBit(IsDemonHunterCreationAllowed);
+ _worldPacket.WriteBit(HasDemonHunterOnRealm);
+ _worldPacket.WriteBit(HasLevel70OnAccount);
+ _worldPacket.WriteBit(Unknown7x);
+ _worldPacket.WriteBit(DisabledClassesMask.is_initialized());
_worldPacket << uint32(Characters.size());
_worldPacket << uint32(FactionChangeRestrictions.size());
+ if (DisabledClassesMask)
+ _worldPacket << uint32(*DisabledClassesMask);
+
for (CharacterInfo const& charInfo : Characters)
{
_worldPacket << charInfo.Guid;
@@ -134,6 +147,7 @@ WorldPacket const* WorldPackets::Character::EnumCharactersResult::Write()
_worldPacket << uint8(charInfo.HairStyle);
_worldPacket << uint8(charInfo.HairColor);
_worldPacket << uint8(charInfo.FacialHair);
+ _worldPacket.append(charInfo.CustomDisplay.data(), charInfo.CustomDisplay.size());
_worldPacket << uint8(charInfo.Level);
_worldPacket << int32(charInfo.ZoneId);
_worldPacket << int32(charInfo.MapId);
@@ -190,6 +204,7 @@ void WorldPackets::Character::CreateCharacter::Read()
_worldPacket >> CreateInfo->HairColor;
_worldPacket >> CreateInfo->FacialHairStyle;
_worldPacket >> CreateInfo->OutfitId;
+ _worldPacket.read(CreateInfo->CustomDisplay.data(), CreateInfo->CustomDisplay.size());
CreateInfo->Name = _worldPacket.ReadString(nameLength);
if (hasTemplateSet)
CreateInfo->TemplateSet = _worldPacket.read<int32>();
@@ -244,6 +259,7 @@ void WorldPackets::Character::CharCustomize::Read()
_worldPacket >> CustomizeInfo->HairStyleID;
_worldPacket >> CustomizeInfo->FacialHairStyleID;
_worldPacket >> CustomizeInfo->FaceID;
+ _worldPacket.read(CustomizeInfo->CustomDisplay.data(), CustomizeInfo->CustomDisplay.size());
CustomizeInfo->CharName = _worldPacket.ReadString(_worldPacket.ReadBits(6));
}
@@ -255,32 +271,16 @@ void WorldPackets::Character::CharRaceOrFactionChange::Read()
uint32 nameLength = _worldPacket.ReadBits(6);
- bool const hasSkinID = _worldPacket.ReadBit();
- bool const hasHairColorID = _worldPacket.ReadBit();
- bool const hasHairStyleID = _worldPacket.ReadBit();
- bool const hasFacialHairStyleID = _worldPacket.ReadBit();
- bool const hasFaceID = _worldPacket.ReadBit();
-
_worldPacket >> RaceOrFactionChangeInfo->Guid;
_worldPacket >> RaceOrFactionChangeInfo->SexID;
_worldPacket >> RaceOrFactionChangeInfo->RaceID;
-
+ _worldPacket >> RaceOrFactionChangeInfo->SkinID;
+ _worldPacket >> RaceOrFactionChangeInfo->HairColorID;
+ _worldPacket >> RaceOrFactionChangeInfo->HairStyleID;
+ _worldPacket >> RaceOrFactionChangeInfo->FacialHairStyleID;
+ _worldPacket >> RaceOrFactionChangeInfo->FaceID;
+ _worldPacket.read(RaceOrFactionChangeInfo->CustomDisplay.data(), RaceOrFactionChangeInfo->CustomDisplay.size());
RaceOrFactionChangeInfo->Name = _worldPacket.ReadString(nameLength);
-
- if (hasSkinID)
- RaceOrFactionChangeInfo->SkinID = _worldPacket.read<uint8>();
-
- if (hasHairColorID)
- RaceOrFactionChangeInfo->HairColorID = _worldPacket.read<uint8>();
-
- if (hasHairStyleID)
- RaceOrFactionChangeInfo->HairStyleID = _worldPacket.read<uint8>();
-
- if (hasFacialHairStyleID)
- RaceOrFactionChangeInfo->FacialHairStyleID = _worldPacket.read<uint8>();
-
- if (hasFaceID)
- RaceOrFactionChangeInfo->FaceID = _worldPacket.read<uint8>();
}
WorldPacket const* WorldPackets::Character::CharFactionChangeResult::Write()
@@ -300,6 +300,7 @@ WorldPacket const* WorldPackets::Character::CharFactionChangeResult::Write()
_worldPacket << uint8(Display->FacialHairStyleID);
_worldPacket << uint8(Display->FaceID);
_worldPacket << uint8(Display->RaceID);
+ _worldPacket.append(Display->CustomDisplay.data(), Display->CustomDisplay.size());
_worldPacket.WriteString(Display->Name);
}
@@ -522,6 +523,7 @@ WorldPackets::Character::CharCustomizeResponse::CharCustomizeResponse(WorldPacke
FacialHairStyleID = info->FacialHairStyleID;
FaceID = info->FaceID;
CharName = info->CharName;
+ CustomDisplay = info->CustomDisplay;
}
WorldPacket const* WorldPackets::Character::CharCustomizeResponse::Write()
@@ -533,6 +535,7 @@ WorldPacket const* WorldPackets::Character::CharCustomizeResponse::Write()
_worldPacket << uint8(HairStyleID);
_worldPacket << uint8(FacialHairStyleID);
_worldPacket << uint8(FaceID);
+ _worldPacket.append(CustomDisplay.data(), CustomDisplay.size());
_worldPacket.WriteBits(CharName.length(), 6);
_worldPacket.FlushBits();
_worldPacket.WriteString(CharName);
diff --git a/src/server/game/Server/Packets/CharacterPackets.h b/src/server/game/Server/Packets/CharacterPackets.h
index 017dddd1d06..6edf7bc097c 100644
--- a/src/server/game/Server/Packets/CharacterPackets.h
+++ b/src/server/game/Server/Packets/CharacterPackets.h
@@ -48,6 +48,7 @@ namespace WorldPackets
uint8 HairStyle = 0;
uint8 HairColor = 0;
uint8 FacialHairStyle = 0;
+ std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
uint8 OutfitId = 0;
Optional<int32> TemplateSet;
std::string Name;
@@ -72,20 +73,22 @@ namespace WorldPackets
uint8 HairColorID = 0;
uint8 FacialHairStyleID = 0;
uint8 SkinID = 0;
+ std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
};
struct CharRaceOrFactionChangeInfo
{
- Optional<uint8> HairColorID;
+ uint8 HairColorID = 0;
uint8 RaceID = RACE_NONE;
uint8 SexID = GENDER_NONE;
- Optional<uint8> SkinID;
- Optional<uint8> FacialHairStyleID;
+ uint8 SkinID = 0;
+ uint8 FacialHairStyleID = 0;
ObjectGuid Guid;
bool FactionChange = false;
std::string Name;
- Optional<uint8> FaceID;
- Optional<uint8> HairStyleID;
+ uint8 FaceID = 0;
+ uint8 HairStyleID = 0;
+ std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
};
struct CharacterUndeleteInfo
@@ -123,6 +126,7 @@ namespace WorldPackets
uint8 HairStyle = 0;
uint8 HairColor = 0;
uint8 FacialHair = 0;
+ std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
uint8 Level = 0;
int32 ZoneId = 0;
int32 MapId = 0;
@@ -170,9 +174,15 @@ namespace WorldPackets
bool Success = false; ///<
bool IsDeletedCharacters = false; ///< used for character undelete list
+ bool IsDemonHunterCreationAllowed = false;
+ bool HasDemonHunterOnRealm = false;
+ bool HasLevel70OnAccount = false;
+ bool Unknown7x = false;
+
+ Optional<uint32> DisabledClassesMask;
- std::list<CharacterInfo> Characters; ///< all characters on the list
- std::list<RestrictedFactionChangeRuleInfo> FactionChangeRestrictions; ///< @todo: research
+ std::vector<CharacterInfo> Characters; ///< all characters on the list
+ std::vector<RestrictedFactionChangeRuleInfo> FactionChangeRestrictions; ///< @todo: research
};
class CreateCharacter final : public ClientPacket
@@ -311,6 +321,7 @@ namespace WorldPackets
uint8 FacialHairStyleID = 0;
uint8 FaceID = 0;
uint8 RaceID = RACE_NONE;
+ std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
};
CharFactionChangeResult() : ServerPacket(SMSG_CHAR_FACTION_CHANGE_RESULT, 20 + sizeof(CharFactionChangeDisplayInfo)) { }
@@ -705,6 +716,7 @@ namespace WorldPackets
uint8 HairStyleID = 0;
uint8 FacialHairStyleID = 0;
uint8 FaceID = 0;
+ std::array<uint8, PLAYER_CUSTOM_DISPLAY_SIZE> CustomDisplay;
};
class CharCustomizeFailed final : public ServerPacket
diff --git a/src/server/game/Server/Packets/SystemPackets.cpp b/src/server/game/Server/Packets/SystemPackets.cpp
index 68b835c85ab..eb64ecc386b 100644
--- a/src/server/game/Server/Packets/SystemPackets.cpp
+++ b/src/server/game/Server/Packets/SystemPackets.cpp
@@ -48,7 +48,7 @@ WorldPacket const* WorldPackets::System::FeatureSystemStatus::Write()
_worldPacket.WriteBit(CommerceSystemEnabled);
_worldPacket.WriteBit(Unk67);
_worldPacket.WriteBit(WillKickFromWorld);
- _worldPacket.WriteBit(UnkBit61);
+ _worldPacket.WriteBit(KioskModeEnabled);
_worldPacket.FlushBits();
@@ -72,15 +72,6 @@ WorldPacket const* WorldPackets::System::FeatureSystemStatus::Write()
_worldPacket << int32(SessionAlert->DisplayTime);
}
- /*if (bit61)
- {
- var int88 = packet.ReadInt32("int88");
- for (int i = 0; i < int88; i++)
- packet.ReadByte("byte23", i);
- }*/
-
- _worldPacket.FlushBits();
-
return &_worldPacket;
}
@@ -94,6 +85,7 @@ WorldPacket const* WorldPackets::System::FeatureSystemStatusGlueScreen::Write()
_worldPacket.WriteBit(Unk14);
_worldPacket.WriteBit(WillKickFromWorld);
_worldPacket.WriteBit(IsExpansionPreorderInStore);
+ _worldPacket.WriteBit(KioskModeEnabled);
_worldPacket.FlushBits();
_worldPacket << int32(TokenPollTimeSeconds);
diff --git a/src/server/game/Server/Packets/SystemPackets.h b/src/server/game/Server/Packets/SystemPackets.h
index 5d6d2a9c071..03c1e0a5369 100644
--- a/src/server/game/Server/Packets/SystemPackets.h
+++ b/src/server/game/Server/Packets/SystemPackets.h
@@ -84,7 +84,7 @@ namespace WorldPackets
bool RestrictedAccount = false;
bool TutorialsEnabled = false;
bool NPETutorialsEnabled = false;
- bool UnkBit61 = false;
+ bool KioskModeEnabled = false;
};
class FeatureSystemStatusGlueScreen final : public ServerPacket
@@ -102,6 +102,7 @@ namespace WorldPackets
bool Unk14 = false; // NYI
bool WillKickFromWorld = false; // NYI
bool IsExpansionPreorderInStore = false;
+ bool KioskModeEnabled = false;
int32 TokenPollTimeSeconds = 0; // NYI
int32 TokenRedeemIndex = 0; // NYI
};
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index bef4760025f..b7159ea08ae 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -229,9 +229,9 @@ void OpcodeTable::Initialize()
DEFINE_HANDLER(CMSG_CHANGE_MONUMENT_APPEARANCE, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
DEFINE_HANDLER(CMSG_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Party::ChangeSubGroup, &WorldSession::HandleChangeSubGroupOpcode);
DEFINE_HANDLER(CMSG_CHARACTER_RENAME_REQUEST, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::CharacterRenameRequest, &WorldSession::HandleCharRenameOpcode);
- DEFINE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Character::CharCustomize, &WorldSession::HandleCharCustomizeOpcode);
+ DEFINE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::CharCustomize, &WorldSession::HandleCharCustomizeOpcode);
DEFINE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::CharDelete, &WorldSession::HandleCharDeleteOpcode);
- DEFINE_HANDLER(CMSG_CHAR_RACE_OR_FACTION_CHANGE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Character::CharRaceOrFactionChange, &WorldSession::HandleCharRaceOrFactionChangeOpcode);
+ DEFINE_HANDLER(CMSG_CHAR_RACE_OR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::CharRaceOrFactionChange, &WorldSession::HandleCharRaceOrFactionChangeOpcode);
DEFINE_HANDLER(CMSG_CHAT_ADDON_MESSAGE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Chat::ChatAddonMessageChannel, &WorldSession::HandleChatAddonMessageChannelOpcode);
DEFINE_HANDLER(CMSG_CHAT_ADDON_MESSAGE_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Chat::ChatAddonMessage, &WorldSession::HandleChatAddonMessageOpcode);
DEFINE_HANDLER(CMSG_CHAT_ADDON_MESSAGE_INSTANCE_CHAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Chat::ChatAddonMessage, &WorldSession::HandleChatAddonMessageOpcode);
@@ -299,7 +299,7 @@ void OpcodeTable::Initialize()
DEFINE_HANDLER(CMSG_CONFIRM_RESPEC_WIPE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Talent::ConfirmRespecWipe, &WorldSession::HandleConfirmRespecWipeOpcode);
DEFINE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, WorldPacket, &WorldSession::Handle_EarlyProccess);
DEFINE_HANDLER(CMSG_CONVERT_RAID, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Party::ConvertRaid, &WorldSession::HandleConvertRaidOpcode);
- DEFINE_HANDLER(CMSG_CREATE_CHARACTER, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Character::CreateCharacter, &WorldSession::HandleCharCreateOpcode);
+ DEFINE_HANDLER(CMSG_CREATE_CHARACTER, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::CreateCharacter, &WorldSession::HandleCharCreateOpcode);
DEFINE_HANDLER(CMSG_CREATE_SHIPMENT, STATUS_UNHANDLED, PROCESS_INPLACE, WorldPackets::Null, &WorldSession::Handle_NULL);
DEFINE_HANDLER(CMSG_DB_QUERY_BULK, STATUS_AUTHED, PROCESS_INPLACE, WorldPackets::Query::DBQueryBulk, &WorldSession::HandleDBQueryBulk);
DEFINE_HANDLER(CMSG_DECLINE_GUILD_INVITES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Guild::DeclineGuildInvites, &WorldSession::HandleDeclineGuildInvites);
@@ -965,9 +965,9 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHARACTER_UPGRADE_QUEUED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHARACTER_UPGRADE_SPELL_TIER_SET, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHARACTER_UPGRADE_STARTED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
- DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
+ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE_FAILED, STATUS_NEVER, CONNECTION_TYPE_REALM);
- DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
+ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE_RESULT, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAT, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAT_AUTO_RESPONDED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHAT_DOWN, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
@@ -1046,15 +1046,15 @@ void OpcodeTable::Initialize()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ENCHANTMENT_LOG, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ENCOUNTER_END, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ENCOUNTER_START, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
- DEFINE_SERVER_OPCODE_HANDLER(SMSG_ENUM_CHARACTERS_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
+ DEFINE_SERVER_OPCODE_HANDLER(SMSG_ENUM_CHARACTERS_RESULT, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_ENVIRONMENTAL_DAMAGE_LOG, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_ID, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_FACTION_BONUS_INFO, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
- DEFINE_SERVER_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
- DEFINE_SERVER_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS_GLUE_SCREEN, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
+ DEFINE_SERVER_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, CONNECTION_TYPE_REALM);
+ DEFINE_SERVER_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS_GLUE_SCREEN, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, CONNECTION_TYPE_REALM);
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 1cbcb747279..e37e0daa011 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -517,7 +517,7 @@ enum WorldStates
WS_GUILD_WEEKLY_RESET_TIME = 20050, // Next guild week reset time
};
-#define MAX_CHARACTERS_PER_REALM 11
+#define MAX_CHARACTERS_PER_REALM 12
/// Storage class for commands issued for delayed execution
struct CliCommandHolder
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 83313537cdb..3cd2222339c 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -781,10 +781,10 @@ CharactersPerAccount = 50
#
# CharactersPerRealm
# Description: Limit number of characters per account on this realm.
-# Range: 1-11
-# Default: 11 - (Client limitation)
+# Range: 1-12
+# Default: 12 - (Client limitation)
-CharactersPerRealm = 11
+CharactersPerRealm = 12
#
# HeroicCharactersPerRealm