mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
DeleteStalePlayerBackups converted to QueryDatabase
This commit is contained in:
parent
e2c84c5f39
commit
c12805acce
@ -1229,18 +1229,13 @@ int32 SharedDatabase::DeleteStalePlayerCorpses() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32 SharedDatabase::DeleteStalePlayerBackups() {
|
int32 SharedDatabase::DeleteStalePlayerBackups() {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char *query = 0;
|
|
||||||
uint32 affected_rows = 0;
|
|
||||||
|
|
||||||
// 1209600 seconds = 2 weeks
|
// 1209600 seconds = 2 weeks
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "Delete from player_corpses_backup where (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timeofdeath)) > 1209600"), errbuf, 0, &affected_rows)) {
|
const std::string query = "DELETE FROM player_corpses_backup WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timeofdeath)) > 1209600";
|
||||||
safe_delete_array(query);
|
auto results = QueryDatabase(query);
|
||||||
return -1;
|
if (!results.Success())
|
||||||
}
|
return -1;
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
return affected_rows;
|
return results.RowsAffected();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::GetCommandSettings(std::map<std::string,uint8> &commands) {
|
bool SharedDatabase::GetCommandSettings(std::map<std::string,uint8> &commands) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user