[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:
megamage
2009-09-01 16:47:49 -05:00
parent f0e6acda3b
commit dc68c2b269
13 changed files with 164 additions and 45 deletions
+23 -5
View File
@@ -46,7 +46,22 @@ class QueryResult;
class LoginQueryHolder;
class CharacterHandler;
#define NUM_ACCOUNT_DATA_TYPES 8
enum AccountDataType
{
GLOBAL_CONFIG_CACHE = 0, // 0x01 g
PER_CHARACTER_CONFIG_CACHE = 1, // 0x02 p
GLOBAL_BINDINGS_CACHE = 2, // 0x04 g
PER_CHARACTER_BINDINGS_CACHE = 3, // 0x08 p
GLOBAL_MACROS_CACHE = 4, // 0x10 g
PER_CHARACTER_MACROS_CACHE = 5, // 0x20 p
PER_CHARACTER_LAYOUT_CACHE = 6, // 0x40 p
PER_CHARACTER_CHAT_CACHE = 7, // 0x80 p
};
#define NUM_ACCOUNT_DATA_TYPES 8
#define GLOBAL_CACHE_MASK 0x15
#define PER_CHARACTER_CACHE_MASK 0xEA
struct AccountData
{
@@ -127,7 +142,7 @@ class TRINITY_DLL_SPEC WorldSession
char const* GetPlayerName() const;
void SetSecurity(AccountTypes security) { _security = security; }
std::string const& GetRemoteAddress() { return m_Address; }
void SetPlayer(Player *plr) { _player = plr; }
void SetPlayer(Player *plr);
uint8 Expansion() const { return m_expansion; }
/// Session in auth.queue currently
@@ -185,9 +200,11 @@ class TRINITY_DLL_SPEC WorldSession
void SendPetNameQuery(uint64 guid, uint32 petnumber);
// Account Data
AccountData *GetAccountData(uint32 type) { return &m_accountData[type]; }
void SetAccountData(uint32 type, time_t time_, std::string data);
void LoadAccountData();
AccountData *GetAccountData(AccountDataType type) { return &m_accountData[type]; }
void SetAccountData(AccountDataType type, time_t time_, std::string data);
void SendAccountDataTimes();
void LoadGlobalAccountData();
void LoadAccountData(QueryResult* result, uint32 mask);
void LoadTutorialsData();
void SendTutorialsData();
void SaveTutorialsData();
@@ -727,6 +744,7 @@ class TRINITY_DLL_SPEC WorldSession
void LogUnexpectedOpcode(WorldPacket *packet, const char * reason);
void LogUnprocessedTail(WorldPacket *packet);
uint32 m_GUIDLow; // set loggined or recently logout player (while m_playerRecentlyLogout set)
Player *_player;
WorldSocket *m_Socket;
std::string m_Address;