]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/rollback.h
Merge pull request #59 from PrairieAstronomer/readme_irrlicht_change
[dragonfireclient.git] / src / rollback.h
index 2e6955c8d40bc1fd049b558ede0feb3f653a52d0..ff96e513f5453938cc4df0bcd4f73f3351801855 100644 (file)
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef ROLLBACK_HEADER
-#define ROLLBACK_HEADER
+#pragma once
 
 #include <string>
 #include "irr_v3d.h"
@@ -29,8 +28,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 class IGameDef;
 
-class ActionRow;
-class Entity;
+struct ActionRow;
+struct Entity;
 
 class RollbackManager: public IRollbackManager
 {
@@ -47,7 +46,6 @@ class RollbackManager: public IRollbackManager
        void flush();
 
        void addAction(const RollbackAction & action);
-       std::list<RollbackAction> getEntriesSince(time_t first_time);
        std::list<RollbackAction> getNodeActors(v3s16 pos, int range,
                        time_t seconds, int limit);
        std::list<RollbackAction> getRevertActions(
@@ -61,7 +59,7 @@ class RollbackManager: public IRollbackManager
        const char * getActorName(const int id);
        const char * getNodeName(const int id);
        bool createTables();
-       void initDatabase();
+       bool initDatabase();
        bool registerRow(const ActionRow & row);
        const std::list<ActionRow> actionRowsFromSelect(sqlite3_stmt * stmt);
        ActionRow actionRowFromRollbackAction(const RollbackAction & action);
@@ -80,10 +78,10 @@ class RollbackManager: public IRollbackManager
                time_t suspect_t, v3s16 action_p, time_t action_t);
 
 
-       IGameDef * gamedef;
+       IGameDef *gamedef = nullptr;
 
        std::string current_actor;
-       bool current_actor_is_guess;
+       bool current_actor_is_guess = false;
 
        std::list<RollbackAction> action_todisk_buffer;
        std::list<RollbackAction> action_latest_buffer;
@@ -103,5 +101,3 @@ class RollbackManager: public IRollbackManager
        std::vector<Entity> knownActors;
        std::vector<Entity> knownNodes;
 };
-
-#endif