mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
[8433] Implement proper store and use character specific account data.
* Base at TOM_RUS reseach save/load character specific account data in new table `character_account_data`
* Move its in sql update from `account_data` to new table.
* For client packets that can be send in loggined state or just after logout but assocualted
with recently logout character add new login status STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT
* Store low guid for loggedin player or recently logout into WorldSession.
Author: VladimirMangos, TOM_RUS
--HG--
branch : trunk
This commit is contained in:
@@ -90,6 +90,7 @@ bool LoginQueryHolder::Initialize()
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBGDATA, "SELECT instance_id, team, join_x, join_y, join_z, join_o, join_map, taxi_start, taxi_end, mount_spell FROM character_battleground_data WHERE guid = '%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid='%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADTALENTS, "SELECT spell, spec FROM character_talent WHERE guid='%u'", GUID_LOPART(m_guid));
|
||||
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA, "SELECT type, time, data FROM character_account_data WHERE guid='%u'", GUID_LOPART(m_guid));
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -602,12 +603,9 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
||||
data << pCurrChar->GetOrientation();
|
||||
SendPacket(&data);
|
||||
|
||||
data.Initialize( SMSG_ACCOUNT_DATA_TIMES, 4+1+8*4 ); // changed in WotLK
|
||||
data << uint32(time(NULL)); // unix time of something
|
||||
data << uint8(1);
|
||||
for(int i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)
|
||||
data << uint32(GetAccountData(i)->Time); // also unix time
|
||||
SendPacket(&data);
|
||||
// load player specific part before send times
|
||||
LoadAccountData(holder->GetResult(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA),PER_CHARACTER_CACHE_MASK);
|
||||
SendAccountDataTimes();
|
||||
|
||||
data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 2); // added in 2.2.0
|
||||
data << uint8(2); // unknown value
|
||||
|
||||
Reference in New Issue
Block a user