mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 13:39:46 -04:00
[Core/Currency] drop conquestPoints and totalHonorPoints columns with porting data to new table.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- porting from characters table
|
||||
insert into `character_currency` (`guid`, `currency`, `total_count`, `week_count`) SELECT characters.guid, 392, characters.totalHonorPoints, 0 FROM characters WHERE characters.totalHonorPoints > 0;
|
||||
insert into `character_currency` (`guid`, `currency`, `total_count`, `week_count`) SELECT characters.guid, 390, characters.conquestPoints, 0 FROM characters WHERE characters.conquestPoints > 0;
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `characters` DROP `conquestPoints`;
|
||||
ALTER TABLE `characters` DROP `totalHonorPoints`;
|
||||
@@ -16663,11 +16663,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
//"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, "
|
||||
// 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
||||
//"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, instance_mode_mask, "
|
||||
// 40 41 42 43 44 45 46 47
|
||||
//"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
|
||||
// 48 49 50 51 52 53 54 55 56 57 58
|
||||
// 40 41 42 43 44 45
|
||||
//"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
|
||||
// 46 47 48 49 50 51 52 53 54 55 56
|
||||
//"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, "
|
||||
// 59 60 61
|
||||
// 57 58 59
|
||||
//"knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid);
|
||||
PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM);
|
||||
|
||||
@@ -16733,8 +16733,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8());
|
||||
SetUInt32Value(PLAYER_XP, fields[7].GetUInt32());
|
||||
|
||||
_LoadIntoDataField(fields[57].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
|
||||
_LoadIntoDataField(fields[59].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
|
||||
_LoadIntoDataField(fields[55].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
|
||||
_LoadIntoDataField(fields[57].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
|
||||
|
||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
|
||||
SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
|
||||
@@ -16751,12 +16751,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32());
|
||||
SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
|
||||
SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_3, 1, fields[47].GetUInt8());
|
||||
SetByteValue(PLAYER_BYTES_3, 1, fields[45].GetUInt8());
|
||||
SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
|
||||
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[46].GetUInt32());
|
||||
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[44].GetUInt32());
|
||||
|
||||
// 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, 2, fields[60].GetUInt8());
|
||||
SetByteValue(PLAYER_FIELD_BYTES, 2, fields[58].GetUInt8());
|
||||
|
||||
InitDisplayIds();
|
||||
|
||||
@@ -16789,7 +16789,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat());
|
||||
|
||||
uint32 mapId = fields[15].GetUInt16();
|
||||
uint32 instanceId = fields[54].GetUInt32();
|
||||
uint32 instanceId = fields[52].GetUInt32();
|
||||
|
||||
uint32 dungeonDiff = fields[39].GetUInt8() & 0x0F;
|
||||
if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY)
|
||||
@@ -16825,9 +16825,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
}
|
||||
|
||||
_LoadCurrency(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCURRENCY));
|
||||
SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[42].GetUInt32());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[43].GetUInt16());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[44].GetUInt16());
|
||||
SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[40].GetUInt32());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[41].GetUInt16());
|
||||
SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[42].GetUInt16());
|
||||
|
||||
_LoadBoundInstances(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES));
|
||||
_LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES));
|
||||
@@ -17146,8 +17146,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
//mails are loaded only when needed ;-) - when player in game click on mailbox.
|
||||
//_LoadMail();
|
||||
|
||||
SetSpecsCount(fields[55].GetUInt8());
|
||||
SetActiveSpec(fields[56].GetUInt8());
|
||||
SetSpecsCount(fields[53].GetUInt8());
|
||||
SetActiveSpec(fields[54].GetUInt8());
|
||||
|
||||
// sanity check
|
||||
if (GetSpecsCount() > MAX_TALENT_SPECS || GetActiveSpec() > MAX_TALENT_SPEC || GetSpecsCount() < MIN_TALENT_SPECS)
|
||||
@@ -17198,7 +17198,7 @@ bool Player::LoadFromDB(uint32 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[45].GetUInt32();
|
||||
uint32 curTitle = fields[43].GetUInt32();
|
||||
if (curTitle && !HasTitle(curTitle))
|
||||
curTitle = 0;
|
||||
|
||||
@@ -17221,14 +17221,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
UpdateAllStats();
|
||||
|
||||
// restore remembered power/health values (but not more max values)
|
||||
uint32 savedHealth = fields[48].GetUInt32();
|
||||
uint32 savedHealth = fields[46].GetUInt32();
|
||||
SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth);
|
||||
uint32 loadedPowers = 0;
|
||||
for (uint32 i = 0; i < MAX_POWERS; ++i)
|
||||
{
|
||||
if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS)
|
||||
{
|
||||
uint32 savedPower = fields[49+loadedPowers].GetUInt32();
|
||||
uint32 savedPower = fields[47+loadedPowers].GetUInt32();
|
||||
uint32 maxPower = GetUInt32Value(UNIT_FIELD_MAXPOWER1 + loadedPowers);
|
||||
SetPower(Powers(i), (savedPower > maxPower) ? maxPower : savedPower);
|
||||
if (++loadedPowers >= MAX_STORED_POWERS)
|
||||
@@ -17307,7 +17307,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
}
|
||||
|
||||
// RaF stuff.
|
||||
m_grantableLevels = fields[61].GetUInt8();
|
||||
m_grantableLevels = fields[59].GetUInt8();
|
||||
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
|
||||
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
|
||||
@@ -18727,8 +18727,6 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
ss << m_taxi.SaveTaxiDestinationsToString();
|
||||
|
||||
stmt->setString(index++, ss.str());
|
||||
stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS));
|
||||
stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_HONOR_POINTS));
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS));
|
||||
stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 0));
|
||||
stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1));
|
||||
@@ -18849,8 +18847,6 @@ void Player::SaveToDB(bool create /*=false*/)
|
||||
ss << m_taxi.SaveTaxiDestinationsToString();
|
||||
|
||||
stmt->setString(index++, ss.str());
|
||||
stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS));
|
||||
stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_HONOR_POINTS));
|
||||
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS));
|
||||
stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 0));
|
||||
stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1));
|
||||
|
||||
@@ -65,7 +65,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PREPARE_STATEMENT(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, 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, instance_mode_mask, "
|
||||
"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
|
||||
"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, "
|
||||
"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC)
|
||||
PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH)
|
||||
PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC)
|
||||
@@ -369,14 +369,14 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
"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, conquestPoints, totalHonorPoints, totalKills, "
|
||||
"death_expire_time, taxi_path, totalKills, "
|
||||
"todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, health, power1, power2, power3, "
|
||||
"power4, power5, latency, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels) VALUES "
|
||||
"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC);
|
||||
"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?,"
|
||||
"map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,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=?,"
|
||||
"conquestPoints=?,totalHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,"
|
||||
"totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,"
|
||||
"watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,latency=?,speccount=?,activespec=?,exploredZones=?,"
|
||||
"equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC);
|
||||
|
||||
@@ -539,7 +539,6 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_DAILY, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_UDP_CHAR_HONOR_POINTS, "UPDATE characters SET totalHonorPoints = ? WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_UDP_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, button, action, type) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PREPARE_STATEMENT(CHAR_UPD_CHAR_ACTION, "UPDATE character_action SET action = ?, type = ? WHERE guid = ? AND button = ? AND spec = ?", CONNECTION_ASYNC);
|
||||
|
||||
@@ -501,7 +501,6 @@ enum CharacterDatabaseStatements
|
||||
CHAR_DEL_CHAR_QUESTSTATUS_DAILY,
|
||||
CHAR_DEL_CHAR_TALENT,
|
||||
CHAR_DEL_CHAR_SKILLS,
|
||||
CHAR_UDP_CHAR_HONOR_POINTS,
|
||||
CHAR_UDP_CHAR_MONEY,
|
||||
CHAR_INS_CHAR_ACTION,
|
||||
CHAR_UPD_CHAR_ACTION,
|
||||
|
||||
Reference in New Issue
Block a user