RollbackManager::~RollbackManager()
{
+ flush();
+
SQLOK(sqlite3_finalize(stmt_insert));
SQLOK(sqlite3_finalize(stmt_replace));
SQLOK(sqlite3_finalize(stmt_select));
" FOREIGN KEY (`oldNode`) REFERENCES `node`(`id`),\n"
" FOREIGN KEY (`newNode`) REFERENCES `node`(`id`)\n"
");\n"
- "CREATE INDEX IF NOT EXISTS `actionActor` ON `action`(`actor`);\n"
- "CREATE INDEX IF NOT EXISTS `actionTimestamp` ON `action`(`timestamp`);\n",
+ "CREATE INDEX IF NOT EXISTS `actionIndex` ON `action`(`x`,`y`,`z`,`timestamp`,`actor`);\n",
NULL, NULL, NULL));
verbosestream << "SQL Rollback: SQLite3 database structure was created" << std::endl;
float likely_suspect_nearness = 0;
for (std::list<RollbackAction>::const_reverse_iterator
i = action_latest_buffer.rbegin();
- i != action_latest_buffer.rend(); i++) {
+ i != action_latest_buffer.rend(); ++i) {
if (i->unix_time < first_time) {
break;
}
for (iter = action_todisk_buffer.begin();
iter != action_todisk_buffer.end();
- iter++) {
+ ++iter) {
if (iter->actor == "") {
continue;
}
std::list<RollbackAction> RollbackManager::getNodeActors(v3s16 pos, int range,
time_t seconds, int limit)
{
+ flush();
time_t cur_time = time(0);
time_t first_time = cur_time - seconds;