#include <rollback.h>
|
void | registerNewActor (const int id, const std::string &name) |
|
void | registerNewNode (const int id, const std::string &name) |
|
int | getActorId (const std::string &name) |
|
int | getNodeId (const std::string &name) |
|
const char * | getActorName (const int id) |
|
const char * | getNodeName (const int id) |
|
bool | createTables () |
|
bool | initDatabase () |
|
bool | registerRow (const ActionRow &row) |
|
const std::list< ActionRow > | actionRowsFromSelect (sqlite3_stmt *stmt) |
|
ActionRow | actionRowFromRollbackAction (const RollbackAction &action) |
|
const std::list< RollbackAction > | rollbackActionsFromActionRows (const std::list< ActionRow > &rows) |
|
const std::list< ActionRow > | getRowsSince (time_t firstTime, const std::string &actor) |
|
const std::list< ActionRow > | getRowsSince_range (time_t firstTime, v3s16 p, int range, int limit) |
|
const std::list< RollbackAction > | getActionsSince_range (time_t firstTime, v3s16 p, int range, int limit) |
|
const std::list< RollbackAction > | getActionsSince (time_t firstTime, const std::string &actor="") |
|
◆ RollbackManager()
RollbackManager::RollbackManager |
( |
const std::string & | world_path, |
|
|
IGameDef * | gamedef ) |
◆ ~RollbackManager()
RollbackManager::~RollbackManager |
( |
| ) |
|
References db, FINALIZE_STATEMENT, flush(), SQLOK_ERRSTREAM, stmt_insert, stmt_knownActor_insert, stmt_knownActor_select, stmt_knownNode_insert, stmt_knownNode_select, stmt_replace, stmt_select, stmt_select_range, and stmt_select_withActor.
◆ actionRowFromRollbackAction()
References ActionRow::actor, RollbackAction::actor, RollbackAction::actor_is_guess, ActionRow::add, getActorId(), getNodeId(), ActionRow::guessed, ActionRow::id, ItemStackRow::id, ActionRow::index, RollbackAction::inventory_add, RollbackAction::inventory_index, RollbackAction::inventory_list, RollbackAction::inventory_location, RollbackAction::inventory_stack, ActionRow::list, ActionRow::location, RollbackNode::meta, RollbackAction::n_new, RollbackAction::n_old, ItemStack::name, RollbackNode::name, ActionRow::newMeta, ActionRow::newNode, ActionRow::newParam1, ActionRow::newParam2, ActionRow::oldMeta, ActionRow::oldNode, ActionRow::oldParam1, ActionRow::oldParam2, RollbackAction::p, RollbackNode::param1, RollbackNode::param2, ActionRow::stack, ActionRow::timestamp, ActionRow::type, RollbackAction::type, RollbackAction::TYPE_MODIFY_INVENTORY_STACK, RollbackAction::unix_time, ActionRow::x, ActionRow::y, and ActionRow::z.
Referenced by flush().
◆ actionRowsFromSelect()
const std::list< ActionRow > RollbackManager::actionRowsFromSelect |
( |
sqlite3_stmt * | stmt | ) |
|
|
private |
References ActionRow::actor, ActionRow::add, ItemStack::count, getActorName(), ActionRow::guessed, ItemStackRow::id, ActionRow::index, itos(), ActionRow::list, ActionRow::location, ActionRow::newMeta, ActionRow::newNode, ActionRow::newParam1, ActionRow::newParam2, ActionRow::nodeMeta, ActionRow::oldMeta, ActionRow::oldNode, ActionRow::oldParam1, ActionRow::oldParam2, SQLOK, ActionRow::stack, ActionRow::timestamp, ActionRow::type, RollbackAction::TYPE_MODIFY_INVENTORY_STACK, RollbackAction::TYPE_SET_NODE, ActionRow::x, ActionRow::y, and ActionRow::z.
Referenced by getRowsSince(), and getRowsSince_range().
◆ addAction()
◆ createTables()
bool RollbackManager::createTables |
( |
| ) |
|
|
private |
◆ flush()
void RollbackManager::flush |
( |
| ) |
|
|
virtual |
◆ getActionsSince()
const std::list< RollbackAction > RollbackManager::getActionsSince |
( |
time_t | firstTime, |
|
|
const std::string & | actor = "" ) |
|
private |
◆ getActionsSince_range()
const std::list< RollbackAction > RollbackManager::getActionsSince_range |
( |
time_t | firstTime, |
|
|
v3s16 | p, |
|
|
int | range, |
|
|
int | limit ) |
|
private |
◆ getActor()
std::string RollbackManager::getActor |
( |
| ) |
|
|
virtual |
◆ getActorId()
int RollbackManager::getActorId |
( |
const std::string & | name | ) |
|
|
private |
◆ getActorName()
const char * RollbackManager::getActorName |
( |
const int | id | ) |
|
|
private |
◆ getNodeActors()
std::list< RollbackAction > RollbackManager::getNodeActors |
( |
v3s16 | pos, |
|
|
int | range, |
|
|
time_t | seconds, |
|
|
int | limit ) |
|
virtual |
◆ getNodeId()
int RollbackManager::getNodeId |
( |
const std::string & | name | ) |
|
|
private |
◆ getNodeName()
const char * RollbackManager::getNodeName |
( |
const int | id | ) |
|
|
private |
◆ getRevertActions()
std::list< RollbackAction > RollbackManager::getRevertActions |
( |
const std::string & | actor_filter, |
|
|
time_t | seconds ) |
|
virtual |
◆ getRowsSince()
const std::list< ActionRow > RollbackManager::getRowsSince |
( |
time_t | firstTime, |
|
|
const std::string & | actor ) |
|
private |
◆ getRowsSince_range()
const std::list< ActionRow > RollbackManager::getRowsSince_range |
( |
time_t | firstTime, |
|
|
v3s16 | p, |
|
|
int | range, |
|
|
int | limit ) |
|
private |
◆ getSuspect()
std::string RollbackManager::getSuspect |
( |
v3s16 | p, |
|
|
float | nearness_shortcut, |
|
|
float | min_nearness ) |
|
virtual |
◆ getSuspectNearness()
float RollbackManager::getSuspectNearness |
( |
bool | is_guess, |
|
|
v3s16 | suspect_p, |
|
|
time_t | suspect_t, |
|
|
v3s16 | action_p, |
|
|
time_t | action_t ) |
|
staticprivate |
◆ initDatabase()
bool RollbackManager::initDatabase |
( |
| ) |
|
|
private |
References createTables(), database_path, db, fs::PathExists(), registerNewActor(), registerNewNode(), SQLOK, stmt_insert, stmt_knownActor_insert, stmt_knownActor_select, stmt_knownNode_insert, stmt_knownNode_select, stmt_replace, stmt_select, stmt_select_range, stmt_select_withActor, and verbosestream.
Referenced by RollbackManager().
◆ isActorGuess()
bool RollbackManager::isActorGuess |
( |
| ) |
|
|
virtual |
◆ registerNewActor()
void RollbackManager::registerNewActor |
( |
const int | id, |
|
|
const std::string & | name ) |
|
private |
◆ registerNewNode()
void RollbackManager::registerNewNode |
( |
const int | id, |
|
|
const std::string & | name ) |
|
private |
◆ registerRow()
bool RollbackManager::registerRow |
( |
const ActionRow & | row | ) |
|
|
private |
References ActionRow::actor, ActionRow::add, ItemStack::count, ActionRow::guessed, ActionRow::id, ItemStackRow::id, ActionRow::index, ActionRow::list, ActionRow::location, ActionRow::newMeta, ActionRow::newNode, ActionRow::newParam1, ActionRow::newParam2, ActionRow::oldMeta, ActionRow::oldNode, ActionRow::oldParam1, ActionRow::oldParam2, SQLOK, ActionRow::stack, stmt_insert, stmt_replace, ActionRow::timestamp, ActionRow::type, RollbackAction::TYPE_MODIFY_INVENTORY_STACK, RollbackAction::TYPE_SET_NODE, ActionRow::x, ActionRow::y, and ActionRow::z.
Referenced by flush().
◆ reportAction()
Implements IRollbackManager.
References RollbackAction::actor, RollbackAction::actor_is_guess, addAction(), current_actor, current_actor_is_guess, gamedef, RollbackAction::getPosition(), getSuspect(), RollbackAction::isImportant(), p(), and RollbackAction::unix_time.
◆ rollbackActionsFromActionRows()
const std::list< RollbackAction > RollbackManager::rollbackActionsFromActionRows |
( |
const std::list< ActionRow > & | rows | ) |
|
|
private |
References RollbackAction::actor, getActorName(), getNodeName(), RollbackAction::inventory_add, RollbackAction::inventory_index, RollbackAction::inventory_list, RollbackAction::inventory_location, RollbackAction::inventory_stack, RollbackNode::meta, RollbackAction::n_new, RollbackAction::n_old, ItemStack::name, RollbackNode::name, RollbackAction::p, RollbackNode::param1, RollbackNode::param2, RollbackAction::type, RollbackAction::TYPE_MODIFY_INVENTORY_STACK, RollbackAction::TYPE_SET_NODE, and RollbackAction::unix_time.
Referenced by getActionsSince(), and getActionsSince_range().
◆ setActor()
void RollbackManager::setActor |
( |
const std::string & | actor, |
|
|
bool | is_guess ) |
|
virtual |
◆ action_latest_buffer
◆ action_todisk_buffer
◆ current_actor
std::string RollbackManager::current_actor |
|
private |
◆ current_actor_is_guess
bool RollbackManager::current_actor_is_guess = false |
|
private |
◆ database_path
std::string RollbackManager::database_path |
|
private |
◆ db
sqlite3* RollbackManager::db |
|
private |
◆ gamedef
IGameDef* RollbackManager::gamedef = nullptr |
|
private |
◆ knownActors
std::vector<Entity> RollbackManager::knownActors |
|
private |
◆ knownNodes
std::vector<Entity> RollbackManager::knownNodes |
|
private |
◆ stmt_insert
sqlite3_stmt* RollbackManager::stmt_insert |
|
private |
◆ stmt_knownActor_insert
sqlite3_stmt* RollbackManager::stmt_knownActor_insert |
|
private |
◆ stmt_knownActor_select
sqlite3_stmt* RollbackManager::stmt_knownActor_select |
|
private |
◆ stmt_knownNode_insert
sqlite3_stmt* RollbackManager::stmt_knownNode_insert |
|
private |
◆ stmt_knownNode_select
sqlite3_stmt* RollbackManager::stmt_knownNode_select |
|
private |
◆ stmt_replace
sqlite3_stmt* RollbackManager::stmt_replace |
|
private |
◆ stmt_select
sqlite3_stmt* RollbackManager::stmt_select |
|
private |
◆ stmt_select_range
sqlite3_stmt* RollbackManager::stmt_select_range |
|
private |
◆ stmt_select_withActor
sqlite3_stmt* RollbackManager::stmt_select_withActor |
|
private |
The documentation for this class was generated from the following files: