The Battle for Wesnoth  1.15.1+dev
Macros | Functions | Variables
synced_commands.cpp File Reference
#include "synced_commands.hpp"
#include <cassert>
#include "log.hpp"
#include "map/location.hpp"
#include "game_data.hpp"
#include "units/unit.hpp"
#include "team.hpp"
#include "play_controller.hpp"
#include "actions/create.hpp"
#include "actions/advancement.hpp"
#include "actions/attack.hpp"
#include "actions/move.hpp"
#include "actions/undo.hpp"
#include "preferences/general.hpp"
#include "preferences/game.hpp"
#include "game_events/pump.hpp"
#include "map/map.hpp"
#include "units/helper.hpp"
#include "recall_list_manager.hpp"
#include "resources.hpp"
#include "savegame.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "formula/string_utils.hpp"
#include "units/types.hpp"
#include "units/udisplay.hpp"
#include "whiteboard/manager.hpp"
#include "font/standard_colors.hpp"
Include dependency graph for synced_commands.cpp:

Go to the source code of this file.

Macros

#define DBG_REPLAY   LOG_STREAM(debug, log_replay)
 
#define LOG_REPLAY   LOG_STREAM(info, log_replay)
 
#define WRN_REPLAY   LOG_STREAM(warn, log_replay)
 
#define ERR_REPLAY   LOG_STREAM(err, log_replay)
 

Functions

 SYNCED_COMMAND_HANDLER_FUNCTION (recruit, child, use_undo, show, error_handler)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (recall, child, use_undo, show, error_handler)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (attack, child,, show, error_handler)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (disband, child,,, error_handler)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (move, child, use_undo, show, error_handler)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (fire_event, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (custom_command, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (auto_shroud, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (update_shroud,, use_undo,, error_handler)
 from resources::undo_stack->commit_vision(bool is_replay): Updates fog/shroud based on the undo stack, then updates stack as needed. More...
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_unit, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_create_unit, child, use_undo,, error_handler)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_lua, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_kill, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_next_level, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_turn_limit, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_turn, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_set_var, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_gold, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_event, child, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_fog,, use_undo,,)
 
 SYNCED_COMMAND_HANDLER_FUNCTION (debug_shroud,, use_undo,,)
 

Variables

static lg::log_domain log_replay ("replay")
 

Macro Definition Documentation

◆ DBG_REPLAY

#define DBG_REPLAY   LOG_STREAM(debug, log_replay)

Definition at line 44 of file synced_commands.cpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

◆ ERR_REPLAY

#define ERR_REPLAY   LOG_STREAM(err, log_replay)

Definition at line 47 of file synced_commands.cpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

◆ LOG_REPLAY

#define LOG_REPLAY   LOG_STREAM(info, log_replay)

Definition at line 45 of file synced_commands.cpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

◆ WRN_REPLAY

#define WRN_REPLAY   LOG_STREAM(warn, log_replay)

Definition at line 46 of file synced_commands.cpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

Function Documentation

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [1/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( recruit  ,
child  ,
use_undo  ,
show  ,
error_handler   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [2/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( recall  ,
child  ,
use_undo  ,
show  ,
error_handler   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [3/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( attack  ,
child  ,
show  ,
error_handler   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [4/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( disband  ,
child  ,
error_handler   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [5/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( move  ,
child  ,
use_undo  ,
show  ,
error_handler   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [6/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( fire_event  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [7/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( custom_command  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [8/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( auto_shroud  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [9/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( update_shroud  ,
use_undo  ,
error_handler   
)

from resources::undo_stack->commit_vision(bool is_replay): Updates fog/shroud based on the undo stack, then updates stack as needed.

Call this when "updating shroud now". This may fire events and change the game state.

Parameters
[in]is_replaySet to true when this is called during a replay.

This means it is a synced command like any other.

Definition at line 385 of file synced_commands.cpp.

References _(), actions::undo_list::add_update_shroud(), display::announce(), team::auto_shroud_updates(), actions::undo_list::commit_vision(), resources::controller, play_controller::current_team(), display::get_singleton(), font::NORMAL_COLOR, save(), resources::undo_stack, VGETTEXT, and savegame::savegame::YES_NO.

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [10/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_unit  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [11/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_create_unit  ,
child  ,
use_undo  ,
error_handler   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [12/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_lua  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [13/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_kill  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [14/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_next_level  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [15/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_turn_limit  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [16/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_turn  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [17/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_set_var  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [18/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_gold  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [19/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_event  ,
child  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [20/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_fog  ,
use_undo   
)

◆ SYNCED_COMMAND_HANDLER_FUNCTION() [21/21]

SYNCED_COMMAND_HANDLER_FUNCTION ( debug_shroud  ,
use_undo   
)

Variable Documentation

◆ log_replay

lg::log_domain log_replay("replay")
static