示例#1
0
$logMessage = "DEITY_NIGHTLY STARTING: ---- " . date(DATE_RFC1036) . " ----\n";
// TODO: Profile the slowdown point(s) of this script.
// TODO: Need a levelling log deletion.
// TODO: When the message table is created, delete from mail more stringently.
// TODO: Set up a backup of the players table.
$keep_players_until_over_the_number = 2000;
$days_players_have_to_be_older_than_to_be_unconfirmed = 60;
$maximum_players_to_unconfirm = 200;
// *************** DEITY NIGHTLY, manual-run-output occurs at the bottom.*********************
$sql = new DBAccess();
$affected_rows['Increase Days Of Players'] = update_days($sql);
//$sql->Update("UPDATE players SET status = status-".POISON." WHERE status&".POISON);  // Black Poison Fix
$sql->Update("UPDATE players SET status = 0");
// Hmmm, gets rid of all status effects, we may want to make that not have that limit, some day.
$affected_rows['Statuses Removed'] = $sql->a_rows;
$deleted = shorten_chat($sql);
// run the shortening of the chat.
$affected_rows['deleted chats'] = $deleted;
$stats = membership_and_combat_stats($sql, $update_past_stats = true);
$affected_rows['Vicious killer: '] = $stats['vicious_killer'];
//$sql->Update("DELETE FROM mail WHERE send_to='SysMsg'");  //Deletes any mail directed to the sysmsg message bot.
//Nightly Unconfirm old players script settings.
$unconfirmed = unconfirm_older_players_over_minimums($keep_players_until_over_the_number, $days_players_have_to_be_older_than_to_be_unconfirmed, $maximum_players_to_unconfirm, $just_testing = false);
assert($unconfirmed < 21);
$affected_rows['Players Unconfirmed'] = $unconfirmed === false ? 'Under the Minimum number of players' : $unconfirmed;
// Delete from inventory where owner is unconfirmed or non-existent.
$sql->QueryRow("Delete from inventory where owner in (SELECT owner FROM inventory LEFT JOIN players ON owner = uname WHERE confirmed = 0 OR uname is null GROUP BY owner)");
$affected_rows['deleted items'] = $sql->a_rows;
$deleted_mail = delete_old_messages($sql);
// As per the mail function in lib_deity.
$affected_rows['Old Messages Deletion'] = $deleted_mail;
示例#2
0
// TODO: Profile the slowdown point(s) of this script.
// TODO: Need a levelling log deletion.
// TODO: When the message table is created, delete from mail more stringently.
// TODO: Set up a backup of the players table.
$keep_players_until_over_the_number = MIN_PLAYERS_FOR_UNCONFIRM;
$days_players_have_to_be_older_than_to_be_unconfirmed = MIN_DAYS_FOR_UNCONFIRM;
$maximum_players_to_unconfirm = MAX_PLAYERS_TO_UNCONFIRM;
// *************** DEITY NIGHTLY, manual-run-output occurs at the bottom.*********************
DatabaseConnection::getInstance();
DatabaseConnection::$pdo->query('BEGIN TRANSACTION');
$affected_rows['Increase Days Of Players'] = update_days();
//DatabaseConnection::$pdo->query("UPDATE players SET status = status-".POISON." WHERE status&".POISON);  // Black Poison Fix
$status_removal = DatabaseConnection::$pdo->query("UPDATE players SET status = 0");
// Hmmm, gets rid of all status effects, we may want to make that not have that limitation, some day.
$affected_rows['Statuses Removed'] = $status_removal->rowCount();
$deleted = shorten_chat();
// run the shortening of the chat.
$affected_rows['deleted chats'] = $deleted;
update_most_vicious_killer_stat();
// Update the vicious killer stat.
//Nightly Unconfirm old players script settings.
$unconfirmed = unconfirm_older_players_over_minimums($keep_players_until_over_the_number, $days_players_have_to_be_older_than_to_be_unconfirmed, $maximum_players_to_unconfirm, $just_testing = false);
assert($unconfirmed < $maximum_players_to_unconfirm + 1);
$affected_rows['Players Unconfirmed'] = $unconfirmed === false ? 'Under the Minimum number of players' : $unconfirmed;
// Delete from inventory where owner is unconfirmed or non-existent.
$deleted_items = DatabaseConnection::$pdo->query("DELETE FROM inventory WHERE owner IN (SELECT owner FROM inventory LEFT JOIN players ON owner = player_id WHERE uname IS NULL GROUP BY owner)");
$affected_rows['deleted items'] = $deleted_items->rowCount();
$deleted_items = DatabaseConnection::$pdo->query("delete from levelling_log where killsdate < (now() - interval '2 months')");
$affected_rows['deleted levelling_logs'] = $deleted_items->rowCount();
$deleted_mail = delete_old_messages();
// As per the mail function in lib_deity.