Advanced Strategic Command
Classes | Namespaces | Enumerations | Functions | Variables
replay.cpp File Reference

Everything for recording and playing replays. More...

#include <stdarg.h>
#include "replay.h"
#include "typen.h"
#include "buildingtype.h"
#include "vehicletype.h"
#include "spfst.h"
#include "controls.h"
#include "dialog.h"
#include "gameoptions.h"
#include "viewcalculation.h"
#include "itemrepository.h"
#include "containercontrols.h"
#include "resourcenet.h"
#include "guiiconhandler.h"
#include "guifunctions.h"
#include "cannedmessages.h"
#include "spfst-legacy.h"
#include "replaymapdisplay.h"
#include "asc-mainscreen.h"
#include "loaders.h"
#include "turncontrol.h"
#include "widgets/textrenderer.h"
#include "actions/jumpdrivecommand.h"
#include "reactionfire.h"
#include "gameeventsystem.h"
#include "sdl/graphicsqueue.h"
#include "video/videorecorder.h"
#include "iconrepository.h"
#include "dialogs/replayrecorder.h"
#include "sg.h"
#include "actions/action.h"
#include "actions/cargomovecommand.h"
#include "actions/constructbuildingcommand.h"
#include "actions/destructbuildingcommand.h"
#include "actions/destructunitcommand.h"
#include "actions/recycleunitcommand.h"
#include "actions/trainunitcommand.h"
#include "actions/moveunitcommand.h"
#include "actions/consumeammo.h"
#include "actions/consumeresource.h"
#include "actions/buildproductionlinecommand.h"
#include "actions/removeproductionlinecommand.h"
#include "actions/cancelresearchcommand.h"
#include "researchexecution.h"
Include dependency graph for replay.cpp:

Go to the source code of this file.

Classes

class  ReplayRecorderWatcherGlobal
 
class  ReplayRecorder
 
class  ReplayRecorderWatcherLocal
 
class  ReplayGuiFunctions::ReplayPlay
 
class  ReplayGuiFunctions::ReplayPause
 
class  ReplayGuiFunctions::ReplayFaster
 
class  ReplayGuiFunctions::ReplaySlower
 
class  ReplayGuiFunctions::ReplayRewind
 
class  ReplayGuiFunctions::ReplayExit
 
class  ReplayGuiFunctions::ReplayRecord
 
class  ReplayGuiFunctions::ReplayRecordExit
 
class  ReplayGuiIconHandleHandler
 
class  LogActionIntoReplayInfo
 

Namespaces

 ReplayGuiFunctions
 

Enumerations

enum  trpl_actions {
  rpl_attack, rpl_move, rpl_changeheight, rpl_convert,
  rpl_remobj, rpl_buildobj, rpl_putbuilding, rpl_removebuilding,
  rpl_putmine, rpl_removemine, rpl_produceunit, rpl_removeunit,
  rpl_trainunit, rpl_reactionfire, rpl_finished, rpl_shareviewchange,
  rpl_alliancechange, rpl_move2, rpl_buildtnk, rpl_refuel,
  rpl_bldrefuel, rpl_move3, rpl_changeheight2, rpl_buildtnk2,
  rpl_moveUnitUpDown, rpl_move4, rpl_productionResourceUsage, rpl_buildtnk3,
  rpl_refuel2, rpl_buildobj2, rpl_remobj2, rpl_repairUnit,
  rpl_repairUnit2, rpl_refuel3, rpl_produceAmmo, rpl_buildtnk4,
  rpl_buildProdLine, rpl_removeProdLine, rpl_setResearch, rpl_techResearched,
  rpl_putbuilding2, rpl_setGeneratorStatus, rpl_cutFromGame, rpl_removebuilding2,
  rpl_setResourceProcessingAmount, rpl_removebuilding3, rpl_netcontrol, rpl_move5,
  rpl_alliancechange2, rpl_moveUnitUp, rpl_jump, rpl_repairBuilding,
  rpl_recycleUnit, rpl_convert2, rpl_putmine2, rpl_repairUnit3,
  rpl_transferTribute, rpl_reactionFireOn, rpl_reactionFireOff, rpl_selfdestruct,
  rpl_cancelResearch, rpl_runCommandAction
}
 

Functions

void registerReplayGuiFunctions (GuiIconHandler &handler)
 
void runSpecificReplay (int player, int viewingplayer, bool performEndTurnOperations)
 runs the replay for the given player More...
 
void viewOwnReplay (Player &player)
 runs the replay of the current player. This is used primarily for debugging the replay system More...
 
void checkforreplay ()
 checks if there is replay information and -if there is any- runs the replay More...
 
void initReplayLogging (Player &player)
 Initialized the replay logging at the beginning of a players or the ai's turn. More...
 
Resources getUnitResourceCargo (Vehicle *veh)
 
static void logActionToReplay (GameMap *map, Command &command)
 
void hookReplayToSystem ()
 initialized the replay system at program startup More...
 

Variables

trunreplay runreplay
 
int startreplaylate = 0
 a hack to enable the replay in a game that was started without replays More...
 
class ReplayRecorderWatcherGlobal replayRecorderWatcherGlobal
 
ReplayRecorderreplayRecorder = NULL
 

Detailed Description

Everything for recording and playing replays.

Replays being the moves of other players or the AI, which can be viewed later (especially useful in email games)

Definition in file replay.cpp.

Enumeration Type Documentation

Enumerator
rpl_attack 
rpl_move 
rpl_changeheight 
rpl_convert 
rpl_remobj 
rpl_buildobj 
rpl_putbuilding 
rpl_removebuilding 
rpl_putmine 
rpl_removemine 
rpl_produceunit 
rpl_removeunit 
rpl_trainunit 
rpl_reactionfire 
rpl_finished 
rpl_shareviewchange 
rpl_alliancechange 
rpl_move2 
rpl_buildtnk 
rpl_refuel 
rpl_bldrefuel 
rpl_move3 
rpl_changeheight2 
rpl_buildtnk2 
rpl_moveUnitUpDown 
rpl_move4 
rpl_productionResourceUsage 
rpl_buildtnk3 
rpl_refuel2 
rpl_buildobj2 
rpl_remobj2 
rpl_repairUnit 
rpl_repairUnit2 
rpl_refuel3 
rpl_produceAmmo 
rpl_buildtnk4 
rpl_buildProdLine 
rpl_removeProdLine 
rpl_setResearch 
rpl_techResearched 
rpl_putbuilding2 
rpl_setGeneratorStatus 
rpl_cutFromGame 
rpl_removebuilding2 
rpl_setResourceProcessingAmount 
rpl_removebuilding3 
rpl_netcontrol 
rpl_move5 
rpl_alliancechange2 
rpl_moveUnitUp 
rpl_jump 
rpl_repairBuilding 
rpl_recycleUnit 
rpl_convert2 
rpl_putmine2 
rpl_repairUnit3 
rpl_transferTribute 
rpl_reactionFireOn 
rpl_reactionFireOff 
rpl_selfdestruct 
rpl_cancelResearch 
rpl_runCommandAction 

Definition at line 75 of file replay.cpp.

Function Documentation

void checkforreplay ( void  )
Resources getUnitResourceCargo ( Vehicle veh)

Definition at line 725 of file replay.cpp.

References ContainerBase::getCargo(), and Vehicle::getTank().

Referenced by trunreplay::execnextreplaymove().

void hookReplayToSystem ( )

initialized the replay system at program startup

Definition at line 2285 of file replay.cpp.

References ActionContainer::commitCommand, and logActionToReplay().

Referenced by loaddata().

void initReplayLogging ( Player player)

Initialized the replay logging at the beginning of a players or the ai's turn.

Definition at line 687 of file replay.cpp.

References GameMap::ReplayInfo::actmemstream, fatalError(), Player::getParentMap(), Player::getPosition(), GameMap::ReplayInfo::guidata, Player::off, GameMap::replayinfo, savereplay(), startreplaylate, Player::stat, and tnstream::writing.

Referenced by deployMapPlayingHooks().

static void logActionToReplay ( GameMap map,
Command command 
)
static

Definition at line 768 of file replay.cpp.

References LogActionIntoReplayInfo::saveCommand().

Referenced by hookReplayToSystem().

void registerReplayGuiFunctions ( GuiIconHandler handler)
void runSpecificReplay ( int  player,
int  viewingplayer,
bool  performEndTurnOperations 
)

runs the replay for the given player

Definition at line 600 of file replay.cpp.

References actmap, errorMessage(), GameMap::ReplayInfo::guidata, GameMap::ReplayInfo::map, GameMap::replayinfo, and trunreplay::run().

Referenced by checkforreplay(), and viewOwnReplay().

void viewOwnReplay ( Player player)

runs the replay of the current player. This is used primarily for debugging the replay system

Definition at line 630 of file replay.cpp.

References choice_dlg(), Player::getParentMap(), Player::getPosition(), Player::human, CGameOptions::Instance(), GameMap::replayinfo, runSpecificReplay(), Player::stat, and Player::supervisor.

Referenced by hookGuiToMap().

Variable Documentation

ReplayRecorder* replayRecorder = NULL

Definition at line 239 of file replay.cpp.

class ReplayRecorderWatcherGlobal replayRecorderWatcherGlobal
trunreplay runreplay

Definition at line 70 of file replay.cpp.

int startreplaylate = 0

a hack to enable the replay in a game that was started without replays

Definition at line 72 of file replay.cpp.

Referenced by initReplayLogging().