_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
#include "stratagus.h"#include "replay.h"#include "actions.h"#include "commands.h"#include "game.h"#include "interface.h"#include "iocompat.h"#include "iolib.h"#include "map.h"#include "netconnect.h"#include "network.h"#include "parameters.h"#include "player.h"#include "script.h"#include "settings.h"#include "sound.h"#include "translate.h"#include "unit.h"#include "unit_manager.h"#include "unittype.h"#include "version.h"#include <sstream>#include <time.h>Classes | |
| class | LogEntry |
| class | FullReplay |
replay.cpp - Replay game. | |
| bool | CommandLogDisabled |
| ReplayType | ReplayGameType |
| True if command log is off. More... | |
| static bool | DisabledLog |
| Replay game type. More... | |
| static CFile * | LogFile |
| Disabled log for replay. More... | |
| static std::string | LastLogFileName |
| Replay log file. More... | |
| static unsigned long | NextLogCycle |
| Last log file name. More... | |
| static int | InitReplay |
| Next log cycle number. More... | |
| static FullReplay * | CurrentReplay |
| Initialize replay. More... | |
| static LogEntry * | ReplayStep |
| void | ExpandPath (std::string &newpath, const std::string &path) |
| void | StartMap (const std::string &filename, bool clean) |
| static FullReplay * | StartReplay () |
| static void | ApplyReplaySettings () |
| static void | DeleteReplay (FullReplay *replay) |
| static void | PrintLogCommand (const LogEntry &log, CFile &file) |
| static void | SaveFullLog (CFile &file) |
| static void | AppendLog (LogEntry *log, CFile &file) |
| void | CommandLog (const char *action, const CUnit *unit, int flush, int x, int y, const CUnit *dest, const char *value, int num) |
| Replay game type. More... | |
| static int | CclLog (lua_State *l) |
| static int | CclReplayLog (lua_State *l) |
| bool | IsReplayGame () |
| void | SaveReplayList (CFile &file) |
| Save the replay list to file. More... | |
| int | LoadReplay (const std::string &name) |
| Load replay. More... | |
| void | EndReplayLog () |
| End logging. More... | |
| void | CleanReplayLog () |
| Clean replay. More... | |
| static void | DoNextReplay () |
| static void | ReplayEachCycle () |
| void | SinglePlayerReplayEachCycle () |
| Replay user commands from log each cycle, single player games. More... | |
| void | MultiPlayerReplayEachCycle () |
| Replay user commands from log each cycle, multiplayer games. More... | |
| int | SaveReplay (const std::string &filename) |
| void | StartReplay (const std::string &filename, bool reveal) |
| void | ReplayCclRegister () |
| Register ccl functions related to network. More... | |
Append the LogEntry structure at the end of currentLog, and to LogFile
| log | Pointer the replay log entry to be added |
| dest | The file to output to |
|
static |
Applies settings the game used at the start of the replay
|
static |
Parse log
|
static |
Parse replay-log
| void CleanReplayLog | ( | ) |
Clean replay.
Clean replay log
| void CommandLog | ( | const char * | action, |
| const CUnit * | unit, | ||
| int | flush, | ||
| int | x, | ||
| int | y, | ||
| const CUnit * | dest, | ||
| const char * | value, | ||
| int | num | ||
| ) |
Replay game type.
Log commands into file.
This could later be used to recover, crashed games.
| action | Command name (move,attack,...). |
| unit | Unit that receive the command. |
| flush | Append command or flush old commands. |
| x | optional X map position. |
| y | optional y map position. |
| dest | optional destination unit. |
| value | optional command argument (unit-type,...). |
| num | optional number argument |
|
static |
Free a replay from memory
| replay | Pointer to the replay to be freed |
|
static |
Do next replay
| void EndReplayLog | ( | ) |
End logging.
End logging
| void ExpandPath | ( | std::string & | newpath, |
| const std::string & | path | ||
| ) |
| bool IsReplayGame | ( | ) |
Check if we're replaying a game
| int LoadReplay | ( | const std::string & | name | ) |
Load replay.
Load a log file to replay a game
| name | name of file to load. |
| void MultiPlayerReplayEachCycle | ( | ) |
Replay user commands from log each cycle, multiplayer games.
Replay user commands from log each cycle, multiplayer games
| void ReplayCclRegister | ( | ) |
Register ccl functions related to network.
Register Ccl functions with lua
|
static |
Replay user commands from log each cycle
Output the FullReplay list to file
| file | The file to output to |
| int SaveReplay | ( | const std::string & | filename | ) |
Save the replay
| filename | Name of the file to save to |
Save the replay list to file.
Save generated replay
| file | file to save to. |
| void SinglePlayerReplayEachCycle | ( | ) |
Replay user commands from log each cycle, single player games.
Replay user commands from log each cycle, single player games
| void StartMap | ( | const std::string & | filename, |
| bool | clean | ||
| ) |
|
static |
Allocate & fill a new FullReplay structure, from GameSettings.
| void StartReplay | ( | const std::string & | filename, |
| bool | reveal | ||
| ) |
| bool CommandLogDisabled |
|
static |
Initialize replay.
|
static |
Replay game type.
|
static |
Next log cycle number.
|
static |
Replay log file.
|
static |
Disabled log for replay.
|
static |
Last log file name.
| ReplayType ReplayGameType |
True if command log is off.
True, if command log is off.
|
static |
1.8.17
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.