EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   DeleteStalePlayerBackups() function typo(i think) (https://www.eqemulator.org/forums/showthread.php?t=26026)

Cripp 08-27-2008 12:20 AM

DeleteStalePlayerBackups() function typo(i think)
 
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 :)

KLS 08-27-2008 12:29 AM

That sounds right. Wonder how long it's been like that I didn't even notice it when I was tinkering near those functions not too long ago.

Cripp 08-27-2008 12:31 AM

i found this lookiing through the 4.4 eqemu source.. then looked at my 7.0 source and it was the same :D


soo id figure its been there for a while lol


All times are GMT -4. The time now is 06:10 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.