* [2008_10_18_01_characters_characters.sql] Rename field characters.gmstate to extra_flags base at new stored value meaning. Testing also new sql updates naming scheme.

This commit is contained in:
vladimir-mangos 2008-10-18 05:25:59 +04:00
parent dbb399d808
commit 606f5c0f6a
6 changed files with 19 additions and 12 deletions

View file

@ -175,7 +175,7 @@ CREATE TABLE `characters` (
`trans_z` float NOT NULL default '0', `trans_z` float NOT NULL default '0',
`trans_o` float NOT NULL default '0', `trans_o` float NOT NULL default '0',
`transguid` bigint(20) unsigned NOT NULL default '0', `transguid` bigint(20) unsigned NOT NULL default '0',
`gmstate` int(11) unsigned NOT NULL default '0', `extra_flags` int(11) unsigned NOT NULL default '0',
`stable_slots` tinyint(1) unsigned NOT NULL default '0', `stable_slots` tinyint(1) unsigned NOT NULL default '0',
`at_login` int(11) unsigned NOT NULL default '0', `at_login` int(11) unsigned NOT NULL default '0',
`zone` int(11) unsigned NOT NULL default '0', `zone` int(11) unsigned NOT NULL default '0',

View file

@ -0,0 +1,2 @@
ALTER TABLE characters
CHANGE COLUMN gmstate extra_flags int(11) unsigned NOT NULL default '0';

View file

@ -92,6 +92,7 @@ pkgdata_DATA = \
06750_mangos_command.sql \ 06750_mangos_command.sql \
06751_realmd_account.sql \ 06751_realmd_account.sql \
06760_mangos_creature_template.sql \ 06760_mangos_creature_template.sql \
2008_10_18_01_characters_characters.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -165,4 +166,5 @@ EXTRA_DIST = \
06750_mangos_command.sql \ 06750_mangos_command.sql \
06751_realmd_account.sql \ 06751_realmd_account.sql \
06760_mangos_creature_template.sql \ 06760_mangos_creature_template.sql \
2008_10_18_01_characters_characters.sql \
README README

View file

@ -26,11 +26,14 @@ See an example below:
| | Name of affected DB (default recommended name) | | Name of affected DB (default recommended name)
| | Can be: characters, mangos, realmd | | Can be: characters, mangos, realmd
| | | |
| Counter show number of sql update in updates list for provided data | Counter show number of sql update in updates list for provided date
| and set proper order for sql updates for some date | and set proper order for sql updates for same date
| |
MaNGOS commit date related to sql update. For related commit MaNGOS commit date related to sql update. For related commit
you can see http://github.com/mangos/mangos/commits/master you can see http://github.com/mangos/mangos/commits/master
Expected commit will be in commits list for provided date and it will have Expected commit will be in commits list for provided date and it will have
sql update file name (2008_10_17_01_characters_character_spell.sql in our case) in list sql update file name (2008_10_17_01_characters_character_spell.sql in our case) in list
changed files, After appling this update DB compatiable with found commit. changed files, After appling this update DB compatiable with found commit.
=== For commiters ====
Please, include sql update name in first line of commit description for simplify it search by users in commits list.

View file

@ -59,7 +59,7 @@ bool LoginQueryHolder::Initialize()
// NOTE: all fields in `characters` must be read to prevent lost character data at next save in case wrong DB structure. // NOTE: all fields in `characters` must be read to prevent lost character data at next save in case wrong DB structure.
// !!! NOTE: including unused `zone`,`online` // !!! NOTE: including unused `zone`,`online`
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADFROM, "SELECT guid, account, data, name, race, class, position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, gmstate, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADFROM, "SELECT guid, account, data, name, race, class, position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT leaderGuid FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT leaderGuid FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));

View file

@ -13315,7 +13315,7 @@ float Player::GetFloatValueFromDB(uint16 index, uint64 guid)
bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{ {
//// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [28] [29] 30 31 32 //// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 [28] [29] 30 31 32
//QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, data, name, race, class, position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, gmstate, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty FROM characters WHERE guid = '%u'", guid); //QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, data, name, race, class, position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty FROM characters WHERE guid = '%u'", guid);
QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM); QueryResult *result = holder->GetResult(PLAYER_LOGIN_QUERY_LOADFROM);
if(!result) if(!result)
@ -13550,7 +13550,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
m_taxi.LoadTaxiMask( fields[11].GetString() ); // must be before InitTaxiNodesForLevel m_taxi.LoadTaxiMask( fields[11].GetString() ); // must be before InitTaxiNodesForLevel
uint32 gmstate = fields[25].GetUInt32(); uint32 extraflags = fields[25].GetUInt32();
m_stableSlots = fields[26].GetUInt32(); m_stableSlots = fields[26].GetUInt32();
if(m_stableSlots > 2) if(m_stableSlots > 2)
@ -13740,7 +13740,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
case 0: break; // disable case 0: break; // disable
case 1: SetGameMaster(true); break; // enable case 1: SetGameMaster(true); break; // enable
case 2: // save state case 2: // save state
if(gmstate & PLAYER_EXTRA_GM_ON) if(extraflags & PLAYER_EXTRA_GM_ON)
SetGameMaster(true); SetGameMaster(true);
break; break;
} }
@ -13751,7 +13751,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
case 0: break; // disable case 0: break; // disable
case 1: SetAcceptTicket(true); break; // enable case 1: SetAcceptTicket(true); break; // enable
case 2: // save state case 2: // save state
if(gmstate & PLAYER_EXTRA_GM_ACCEPT_TICKETS) if(extraflags & PLAYER_EXTRA_GM_ACCEPT_TICKETS)
SetAcceptTicket(true); SetAcceptTicket(true);
break; break;
} }
@ -13762,7 +13762,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
case 0: break; // disable case 0: break; // disable
case 1: SetGMChat(true); break; // enable case 1: SetGMChat(true); break; // enable
case 2: // save state case 2: // save state
if(gmstate & PLAYER_EXTRA_GM_CHAT) if(extraflags & PLAYER_EXTRA_GM_CHAT)
SetGMChat(true); SetGMChat(true);
break; break;
} }
@ -13773,7 +13773,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
case 0: break; // disable case 0: break; // disable
case 1: SetAcceptWhispers(true); break; // enable case 1: SetAcceptWhispers(true); break; // enable
case 2: // save state case 2: // save state
if(gmstate & PLAYER_EXTRA_ACCEPT_WHISPERS) if(extraflags & PLAYER_EXTRA_ACCEPT_WHISPERS)
SetAcceptWhispers(true); SetAcceptWhispers(true);
break; break;
} }
@ -14758,7 +14758,7 @@ void Player::SaveToDB()
"map, dungeon_difficulty, position_x, position_y, position_z, orientation, data, " "map, dungeon_difficulty, position_x, position_y, position_z, orientation, data, "
"taximask, online, cinematic, " "taximask, online, cinematic, "
"totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, " "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, "
"trans_x, trans_y, trans_z, trans_o, transguid, gmstate, stable_slots, at_login, zone, " "trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, "
"death_expire_time, taxi_path) VALUES (" "death_expire_time, taxi_path) VALUES ("
<< GetGUIDLow() << ", " << GetGUIDLow() << ", "
<< GetSession()->GetAccountId() << ", '" << GetSession()->GetAccountId() << ", '"