mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Restructure and refactoring of database convert/upgrade check routine, breaking out to individual functions
This commit is contained in:
+606
-600
File diff suppressed because it is too large
Load Diff
+5
-1
@@ -301,7 +301,11 @@ public:
|
||||
void SetRaidGroupLeaderInfo(uint32 gid, uint32 rid);
|
||||
void ClearRaidLeader(uint32 gid = 0xFFFFFFFF, uint32 rid = 0);
|
||||
|
||||
bool CheckDatabaseConversions();
|
||||
/* Database Conversions*/
|
||||
bool CheckDatabaseConversions();
|
||||
bool CheckDatabaseConvertPPDeblob();
|
||||
bool CheckDatabaseConvertCorpseDeblob();
|
||||
bool CheckDatabaseConvertBotsPostPPDeblob();
|
||||
|
||||
/*
|
||||
* Database Variables
|
||||
|
||||
+8
-17
@@ -1215,11 +1215,11 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges)
|
||||
}
|
||||
|
||||
int32 SharedDatabase::DeleteStalePlayerCorpses() {
|
||||
if(RuleB(Zone, EnableShadowrest))
|
||||
{
|
||||
std::string query = StringFormat("UPDATE character_corpses SET IsBurried = 1 WHERE IsBurried = 0 AND "
|
||||
"(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(time_of_death)) > %d AND NOT time_of_death = 0",
|
||||
(RuleI(Character, CorpseDecayTimeMS) / 1000));
|
||||
if(RuleB(Zone, EnableShadowrest)) {
|
||||
std::string query = StringFormat(
|
||||
"UPDATE `character_corpses` SET `is_buried` = 1 WHERE `is_buried` = 0 AND "
|
||||
"(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(time_of_death)) > %d AND NOT time_of_death = 0",
|
||||
(RuleI(Character, CorpseDecayTimeMS) / 1000));
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
return -1;
|
||||
@@ -1227,8 +1227,9 @@ int32 SharedDatabase::DeleteStalePlayerCorpses() {
|
||||
return results.RowsAffected();
|
||||
}
|
||||
|
||||
std::string query = StringFormat("DELETE FROM character_corpses WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(time_of_death)) > %d "
|
||||
"AND NOT time_of_death = 0", (RuleI(Character, CorpseDecayTimeMS) / 1000));
|
||||
std::string query = StringFormat(
|
||||
"DELETE FROM `character_corpses` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(time_of_death)) > %d "
|
||||
"AND NOT time_of_death = 0", (RuleI(Character, CorpseDecayTimeMS) / 1000));
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
return -1;
|
||||
@@ -1236,16 +1237,6 @@ int32 SharedDatabase::DeleteStalePlayerCorpses() {
|
||||
return results.RowsAffected();
|
||||
}
|
||||
|
||||
int32 SharedDatabase::DeleteStalePlayerBackups() {
|
||||
// 1209600 seconds = 2 weeks
|
||||
const std::string query = "DELETE FROM player_corpses_backup WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(time_of_death)) > 1209600";
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
return -1;
|
||||
|
||||
return results.RowsAffected();
|
||||
}
|
||||
|
||||
bool SharedDatabase::GetCommandSettings(std::map<std::string,uint8> &commands) {
|
||||
|
||||
const std::string query = "SELECT command, access FROM commands";
|
||||
|
||||
@@ -41,7 +41,6 @@ public:
|
||||
uint8 GetGMSpeed(uint32 account_id);
|
||||
bool SetHideMe(uint32 account_id, uint8 hideme);
|
||||
int32 DeleteStalePlayerCorpses();
|
||||
int32 DeleteStalePlayerBackups();
|
||||
void LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct* message);
|
||||
void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message);
|
||||
void GetBotInspectMessage(uint32 botid, InspectMessage_Struct* message);
|
||||
|
||||
Reference in New Issue
Block a user