Hey.. not sure if this was intented or not but...
these 2 functions are called on booting world..
Code:
sint32 SharedDatabase::DeleteStalePlayerCorpses() {
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
int32 affected_rows = 0;
// 604800 seconds = 1 week
if (!RunQuery(query, MakeAnyLenString(&query, "Delete from player_corpses where (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timeofdeath)) > 604800 and not timeofdeath=0"), errbuf, 0, &affected_rows)) {
safe_delete_array(query);
return -1;
}
safe_delete_array(query);
return affected_rows;
}
sint32 SharedDatabase::DeleteStalePlayerBackups() {
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
int32 affected_rows = 0;
// 1209600 seconds = 2 weeks
if (!RunQuery(query, MakeAnyLenString(&query, "Delete from player_corpses where (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timeofdeath)) > 1209600"), errbuf, 0, &affected_rows)) {
safe_delete_array(query);
return -1;
}
safe_delete_array(query);
return affected_rows;
}
shouldnt DeleteStalePlayerBackups() be querying the backup table instead of both of them querying the normal table?
Code:
sint32 SharedDatabase::DeleteStalePlayerBackups() {
char errbuf[MYSQL_ERRMSG_SIZE];
char *query = 0;
int32 affected_rows = 0;
// 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)) {
safe_delete_array(query);
return -1;
}
safe_delete_array(query);
return affected_rows;
}
shrug.. let me know