Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
RollbackAction Struct Reference

#include <rollback_interface.h>

+ Collaboration diagram for RollbackAction:

Public Types

enum  Type { TYPE_NOTHING , TYPE_SET_NODE , TYPE_MODIFY_INVENTORY_STACK }
 

Public Member Functions

 RollbackAction ()=default
 
void setSetNode (v3s16 p_, const RollbackNode &n_old_, const RollbackNode &n_new_)
 
void setModifyInventoryStack (const std::string &inventory_location_, const std::string &inventory_list_, u32 index_, bool add_, const ItemStack &inventory_stack_)
 
std::string toString () const
 
bool isImportant (IGameDef *gamedef) const
 
bool getPosition (v3s16 *dst) const
 
bool applyRevert (Map *map, InventoryManager *imgr, IGameDef *gamedef) const
 

Public Attributes

enum RollbackAction::Type type = TYPE_NOTHING
 
time_t unix_time = 0
 
std::string actor
 
bool actor_is_guess = false
 
v3s16 p
 
RollbackNode n_old
 
RollbackNode n_new
 
std::string inventory_location
 
std::string inventory_list
 
u32 inventory_index
 
bool inventory_add
 
ItemStack inventory_stack
 

Member Enumeration Documentation

◆ Type

Enumerator
TYPE_NOTHING 
TYPE_SET_NODE 
TYPE_MODIFY_INVENTORY_STACK 

Constructor & Destructor Documentation

◆ RollbackAction()

RollbackAction::RollbackAction ( )
default

Member Function Documentation

◆ applyRevert()

◆ getPosition()

bool RollbackAction::getPosition ( v3s16 * dst) const

References InventoryLocation::deSerialize(), inventory_location, InventoryLocation::NODEMETA, InventoryLocation::p, p, InventoryLocation::type, type, TYPE_MODIFY_INVENTORY_STACK, and TYPE_SET_NODE.

Referenced by RollbackManager::reportAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isImportant()

bool RollbackAction::isImportant ( IGameDef * gamedef) const

References NodeDefManager::get(), LIQUID_FLOWING, ContentFeatures::liquid_type, RollbackNode::meta, n_new, n_old, RollbackNode::name, IGameDef::ndef(), type, and TYPE_SET_NODE.

Referenced by RollbackManager::reportAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setModifyInventoryStack()

void RollbackAction::setModifyInventoryStack ( const std::string & inventory_location_,
const std::string & inventory_list_,
u32 index_,
bool add_,
const ItemStack & inventory_stack_ )
inline

References inventory_add, inventory_index, inventory_list, inventory_location, inventory_stack, type, and TYPE_MODIFY_INVENTORY_STACK.

Referenced by IDropAction::apply(), and IMoveAction::apply().

+ Here is the caller graph for this function:

◆ setSetNode()

void RollbackAction::setSetNode ( v3s16 p_,
const RollbackNode & n_old_,
const RollbackNode & n_new_ )
inline

References n_new, n_old, p, type, and TYPE_SET_NODE.

Referenced by Map::addNodeAndUpdate(), Server::handleCommand_NodeMetaFields(), and ServerMap::transformLiquids().

+ Here is the caller graph for this function:

◆ toString()

std::string RollbackAction::toString ( ) const

References ItemStack::getItemString(), inventory_add, inventory_index, inventory_list, inventory_location, inventory_stack, itos(), RollbackNode::meta, n_new, n_old, RollbackNode::name, p, RollbackNode::param1, RollbackNode::param2, serializeJsonString(), type, TYPE_MODIFY_INVENTORY_STACK, and TYPE_SET_NODE.

+ Here is the call graph for this function:

Member Data Documentation

◆ actor

◆ actor_is_guess

bool RollbackAction::actor_is_guess = false

◆ inventory_add

◆ inventory_index

◆ inventory_list

◆ inventory_location

◆ inventory_stack

◆ n_new

◆ n_old

◆ p

◆ type

◆ unix_time


The documentation for this struct was generated from the following files: