3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef ROLLBACK_HEADER
21 #define ROLLBACK_HEADER
25 #include "rollback_interface.h"
30 class IRollbackManager: public IRollbackReportSink
33 // IRollbackReportManager
34 virtual void reportAction(const RollbackAction &action) = 0;
35 virtual std::string getActor() = 0;
36 virtual bool isActorGuess() = 0;
37 virtual void setActor(const std::string &actor, bool is_guess) = 0;
38 virtual std::string getSuspect(v3s16 p, float nearness_shortcut,
39 float min_nearness) = 0;
41 virtual ~IRollbackManager(){}
42 virtual void flush() = 0;
43 // Get last actor that did something to position p, but not further than
44 // <seconds> in history
45 virtual std::string getLastNodeActor(v3s16 p, int range, int seconds,
46 v3s16 *act_p, int *act_seconds) = 0;
47 // Get actions to revert <seconds> of history made by <actor>
48 virtual std::list<RollbackAction> getRevertActions(const std::string &actor,
52 IRollbackManager *createRollbackManager(const std::string &filepath, IGameDef *gamedef);