2008-06-03 18:35:58 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-06-03 18:35:58 +00:00
|
|
|
/** @file gamelog.h Functions to be called to log possibly unsafe game events */
|
|
|
|
|
|
|
|
#ifndef GAMELOG_H
|
|
|
|
#define GAMELOG_H
|
|
|
|
|
|
|
|
#include "newgrf_config.h"
|
|
|
|
|
2011-05-02 17:42:12 +00:00
|
|
|
/** The actions we log. */
|
2008-06-03 18:35:58 +00:00
|
|
|
enum GamelogActionType {
|
|
|
|
GLAT_START, ///< Game created
|
|
|
|
GLAT_LOAD, ///< Game loaded
|
|
|
|
GLAT_GRF, ///< GRF changed
|
|
|
|
GLAT_CHEAT, ///< Cheat was used
|
2009-02-08 12:25:13 +00:00
|
|
|
GLAT_SETTING, ///< Setting changed
|
2008-07-24 15:19:26 +00:00
|
|
|
GLAT_GRFBUG, ///< GRF bug was triggered
|
2009-03-30 00:21:43 +00:00
|
|
|
GLAT_EMERGENCY, ///< Emergency savegame
|
2008-06-03 18:35:58 +00:00
|
|
|
GLAT_END, ///< So we know how many GLATs are there
|
|
|
|
GLAT_NONE = 0xFF, ///< No logging active; in savegames, end of list
|
|
|
|
};
|
|
|
|
|
|
|
|
void GamelogStartAction(GamelogActionType at);
|
|
|
|
void GamelogStopAction();
|
|
|
|
|
2012-02-05 15:51:13 +00:00
|
|
|
void GamelogFree(struct LoggedAction *gamelog_action, uint gamelog_actions);
|
2008-06-03 18:35:58 +00:00
|
|
|
void GamelogReset();
|
|
|
|
|
2011-05-02 17:42:12 +00:00
|
|
|
/**
|
|
|
|
* Callback for printing text.
|
|
|
|
* @param s The string to print.
|
|
|
|
*/
|
2008-06-03 18:35:58 +00:00
|
|
|
typedef void GamelogPrintProc(const char *s);
|
|
|
|
void GamelogPrint(GamelogPrintProc *proc); // needed for WIN32 / WINCE crash.log
|
|
|
|
|
2008-07-18 12:11:46 +00:00
|
|
|
void GamelogPrintDebug(int level);
|
2008-06-03 18:35:58 +00:00
|
|
|
void GamelogPrintConsole();
|
|
|
|
|
2009-03-30 00:21:43 +00:00
|
|
|
void GamelogEmergency();
|
|
|
|
bool GamelogTestEmergency();
|
|
|
|
|
2008-06-03 18:35:58 +00:00
|
|
|
void GamelogRevision();
|
|
|
|
void GamelogMode();
|
|
|
|
void GamelogOldver();
|
2009-02-08 12:25:13 +00:00
|
|
|
void GamelogSetting(const char *name, int32 oldval, int32 newval);
|
2008-06-03 18:35:58 +00:00
|
|
|
|
|
|
|
void GamelogGRFUpdate(const GRFConfig *oldg, const GRFConfig *newg);
|
|
|
|
void GamelogGRFAddList(const GRFConfig *newg);
|
|
|
|
void GamelogGRFRemove(uint32 grfid);
|
|
|
|
void GamelogGRFAdd(const GRFConfig *newg);
|
|
|
|
void GamelogGRFCompatible(const GRFIdentifier *newg);
|
|
|
|
|
|
|
|
void GamelogTestRevision();
|
|
|
|
void GamelogTestMode();
|
|
|
|
|
2008-07-24 15:19:26 +00:00
|
|
|
bool GamelogGRFBugReverse(uint32 grfid, uint16 internal_id);
|
|
|
|
|
2011-10-30 13:47:45 +00:00
|
|
|
void GamelogInfo(struct LoggedAction *gamelog_action, uint gamelog_actions, uint32 *last_ottd_rev, byte *ever_modified, bool *removed_newgrfs);
|
|
|
|
|
2008-06-03 18:35:58 +00:00
|
|
|
#endif /* GAMELOG_H */
|