____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include <string>
Go to the source code of this file.
Enumerations | |
| enum | ReplayType { ReplayNone, ReplaySinglePlayer, ReplayMultiPlayer } |
Functions | |
| void | CommandLog (const char *action, const CUnit *unit, int flush, int x, int y, const CUnit *dest, const char *value, int num) |
| < Log commands into file | |
| void | SinglePlayerReplayEachCycle () |
| Replay user commands from log each cycle, multiplayer games. | |
| void | MultiPlayerReplayEachCycle () |
| Load replay. | |
| int | LoadReplay (const std::string &name) |
| End logging. | |
| void | EndReplayLog (void) |
| Clean replay. | |
| void | CleanReplayLog (void) |
| Save the replay list to file. | |
| void | SaveReplayList (CFile *file) |
| Register ccl functions related to network. | |
| void | ReplayCclRegister (void) |
Variables | |
| bool | CommandLogDisabled |
| True, if command log is off. | |
| ReplayType | ReplayGameType |
| Replay game type. | |
Definition in file replay.h.
| enum ReplayType |
| void CleanReplayLog | ( | void | ) |
Save the replay list to file.
Clean replay log
Definition at line 734 of file replay.cpp.
References CommandLogDisabled, DeleteReplay(), DisabledLog, GameObserve, NetPlayers, ReplayGameType, and ReplayNone.
Referenced by CleanGame(), CleanModules(), and LoadReplay().
| void CommandLog | ( | const char * | action, | |
| const CUnit * | unit, | |||
| int | flush, | |||
| int | x, | |||
| int | y, | |||
| const CUnit * | dest, | |||
| const char * | value, | |||
| int | num | |||
| ) |
< Log commands into file
Replay user commands from log each cycle, single player games
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 |
Definition at line 400 of file replay.cpp.
References LogEntry::Action, AppendLog(), CL_OPEN_WRITE, CommandLogDisabled, LogEntry::DestUnitNumber, LogEntry::Flush, GameCycle, LogEntry::GameCycle, CUnitType::Ident, CPlayer::Index, LogEntry::Num, LogEntry::PosX, LogEntry::PosY, SaveFullLog(), sprintf_s(), StartReplay(), SyncRandSeed, LogEntry::SyncRandSeed, ThisPlayer, CUnit::Type, LogEntry::UnitIdent, UnitNumber, LogEntry::UnitNumber, UserDirectory, and LogEntry::Value.
Referenced by CreateGame(), InputKey(), ParseCommand(), ParseExtendedCommand(), ParseNetworkCommand(), SendCommandAttack(), SendCommandAttackGround(), SendCommandAutoRepair(), SendCommandAutoSpellCast(), SendCommandBoard(), SendCommandBuildBuilding(), SendCommandCancelTraining(), SendCommandDiplomacy(), SendCommandDismiss(), SendCommandFollow(), SendCommandMove(), SendCommandPatrol(), SendCommandRepair(), SendCommandResource(), SendCommandSharedVision(), SendCommandSpellCast(), SendCommandStandGround(), SendCommandStopUnit(), SendCommandTrainUnit(), and SendCommandUnload().
| void EndReplayLog | ( | void | ) |
Clean replay.
End logging
Definition at line 717 of file replay.cpp.
References CFile::close(), and DeleteReplay().
Referenced by CleanGame(), CleanModules(), and GameMainLoop().
| int LoadReplay | ( | const std::string & | name | ) |
End logging.
Load a log file to replay a game
| name | name of file to load. |
Definition at line 696 of file replay.cpp.
References CleanReplayLog(), CommandLogDisabled, DisabledLog, GameObserve, InitReplay, LuaLoadFile(), NextLogCycle, ReplayGameType, and ReplaySinglePlayer.
Referenced by StartReplay().
| void MultiPlayerReplayEachCycle | ( | ) |
Load replay.
Replay user commands from log each cycle, multiplayer games
Definition at line 929 of file replay.cpp.
References ReplayEachCycle(), ReplayGameType, and ReplayMultiPlayer.
Referenced by GameMainLoop().
| void ReplayCclRegister | ( | void | ) |
Register Ccl functions with lua
Definition at line 939 of file replay.cpp.
References CclLog(), CclReplayLog(), and Lua.
Referenced by InitCcl().
| void SaveReplayList | ( | CFile * | file | ) |
Register ccl functions related to network.
Save generated replay
| file | file to save to. |
Definition at line 686 of file replay.cpp.
References SaveFullLog().
Referenced by SaveGame().
| void SinglePlayerReplayEachCycle | ( | ) |
Replay user commands from log each cycle, multiplayer games.
Replay user commands from log each cycle, single player games
Definition at line 919 of file replay.cpp.
References ReplayEachCycle(), ReplayGameType, and ReplaySinglePlayer.
Referenced by GameMainLoop().
| bool CommandLogDisabled |
True, if command log is off.
Definition at line 142 of file replay.cpp.
Referenced by CclReplayLog(), CleanReplayLog(), CommandLog(), EditorMainLoop(), LoadGame(), LoadReplay(), and main().
Replay game type.
Definition at line 143 of file replay.cpp.
Referenced by ApplyReplaySettings(), CleanReplayLog(), InputKey(), IsReplayGame(), LoadReplay(), MultiPlayerReplayEachCycle(), and SinglePlayerReplayEachCycle().
1.5.6