The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
synced_commands.cpp File Reference
#include "synced_commands.hpp"
#include <cassert>
#include "log.hpp"
#include "resources.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/attack.hpp"
#include "actions/move.hpp"
#include "actions/undo.hpp"
#include "preferences.hpp"
#include "game_preferences.hpp"
#include "game_events/manager.hpp"
#include "game_events/pump.hpp"
#include "units/helper.hpp"
#include "recall_list_manager.hpp"
#include "scripting/game_lua_kernel.hpp"
#include "formula/string_utils.hpp"
#include "units/types.hpp"
#include "units/udisplay.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 (lua_ai, child,,,)
 
 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_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

#define DBG_REPLAY   LOG_STREAM(debug, log_replay)

Definition at line 41 of file synced_commands.cpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

#define ERR_REPLAY   LOG_STREAM(err, log_replay)

Definition at line 44 of file synced_commands.cpp.

#define LOG_REPLAY   LOG_STREAM(info, log_replay)

Definition at line 42 of file synced_commands.cpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

#define WRN_REPLAY   LOG_STREAM(warn, log_replay)

Definition at line 43 of file synced_commands.cpp.

Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().

Function Documentation

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 ( lua_ai  ,
child   
)

Definition at line 345 of file synced_commands.cpp.

References resources::lua_kernel, and lua_kernel_base::run().

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.

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 ia synced command liek any other.

Definition at line 376 of file synced_commands.cpp.

References actions::undo_list::add_update_shroud(), team::auto_shroud_updates(), actions::undo_list::commit_vision(), resources::controller, play_controller::current_team(), and resources::undo_stack.

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_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   
)

Variable Documentation

lg::log_domain log_replay("replay")
static