#include <replay.hpp>
Public Types | |
enum | DATA_TYPE { ALL_DATA, NON_UNDO_DATA } |
enum | MARK_SENT { MARK_AS_UNSENT, MARK_AS_SENT } |
Static Public Member Functions | |
static void | process_error (const std::string &msg) |
Private Member Functions | |
void | add_chat_log_entry (const config &speak, std::back_insert_iterator< std::vector< chat_msg > > &i) const |
config & | command (int) |
void | remove_command (int) |
config & | add_command () |
Adds a new empty command to the command list at the end. More... | |
config & | add_nonundoable_command () |
adds a new command to the command list at the current position. More... | |
Private Attributes | |
replay_recorder_base * | base_ |
std::vector< int > | message_locations |
Definition at line 52 of file replay.hpp.
enum replay::DATA_TYPE |
Enumerator | |
---|---|
ALL_DATA | |
NON_UNDO_DATA |
Definition at line 98 of file replay.hpp.
enum replay::MARK_SENT |
Enumerator | |
---|---|
MARK_AS_UNSENT | |
MARK_AS_SENT |
Definition at line 122 of file replay.hpp.
|
explicit |
Definition at line 182 of file replay.cpp.
|
private |
Definition at line 350 of file replay.cpp.
References i, preferences::is_ignored(), and preferences::parse_should_show_lobby_join().
Referenced by build_chat_log().
bool replay::add_chat_message_location | ( | ) |
adds a chat message if it wasn't added yet.
Definition at line 325 of file replay.cpp.
References base_, and replay_recorder_base::get_pos().
Referenced by speak().
bool replay::add_chat_message_location | ( | int | pos | ) |
Definition at line 330 of file replay.cpp.
References base_, gui2::event::find(), replay_recorder_base::get_command_at(), config::has_child(), message_locations, and pos.
|
private |
Adds a new empty command to the command list at the end.
Definition at line 568 of file replay.cpp.
References replay_recorder_base::add_child(), at_end(), base_, and set_to_end().
Referenced by add_countdown_update(), add_rename(), add_start(), add_synced_command(), end_turn(), init_side(), and user_input().
void replay::add_config | ( | const config & | cfg, |
MARK_SENT | mark = MARK_AS_UNSENT |
||
) |
Definition at line 627 of file replay.cpp.
References base_, config::child_range(), replay_recorder_base::insert_command(), MARK_AS_SENT, and replay_recorder_base::size().
Referenced by turn_info::handle_turn().
Definition at line 233 of file replay.cpp.
References config::add_child(), and add_command().
Referenced by playmp_controller::after_human_turn().
void replay::add_label | ( | const terrain_label * | label | ) |
Definition at line 266 of file replay.cpp.
References config::add_child(), add_nonundoable_command(), and terrain_label::write().
Referenced by events::menu_handler::label_terrain().
void replay::add_log_data | ( | const std::string & | key, |
const std::string & | var | ||
) |
Definition at line 305 of file replay.cpp.
References base_, and replay_recorder_base::get_upload_log().
Referenced by ai_testing::log_draw(), ai_testing::log_game_end(), ai_testing::log_game_start(), ai_testing::log_turn(), and ai_testing::log_victory().
void replay::add_log_data | ( | const std::string & | category, |
const std::string & | key, | ||
const std::string & | var | ||
) |
Definition at line 311 of file replay.cpp.
References base_, config::child_or_add(), and replay_recorder_base::get_upload_log().
void replay::add_log_data | ( | const std::string & | category, |
const std::string & | key, | ||
const config & | c | ||
) |
Definition at line 318 of file replay.cpp.
References config::add_child(), base_, config::child_or_add(), and replay_recorder_base::get_upload_log().
|
private |
adds a new command to the command list at the current position.
Definition at line 578 of file replay.cpp.
References base_, replay_recorder_base::get_pos(), replay_recorder_base::insert_command(), and replay_recorder_base::set_pos().
Referenced by add_label(), and clear_labels().
void replay::add_rename | ( | const std::string & | name, |
const map_location & | loc | ||
) |
Definition at line 287 of file replay.cpp.
References config::add_child(), add_command(), and map_location::write().
Referenced by events::menu_handler::rename_unit().
void replay::add_start | ( | ) |
Definition at line 226 of file replay.cpp.
References config::add_child(), and add_command().
bool replay::add_start_if_not_there_yet | ( | ) |
Definition at line 638 of file replay.cpp.
References at_end(), base_, replay_recorder_base::get_command_at(), replay_recorder_base::get_pos(), config::has_child(), and replay_recorder_base::insert_command().
Referenced by play_controller::start_game().
void replay::add_synced_command | ( | const std::string & | name, |
const config & | command | ||
) |
Definition at line 241 of file replay.cpp.
References config::add_child(), add_command(), resources::controller, play_controller::current_side(), config::debug(), and LOG_REPLAY.
Referenced by ai::attack_result::do_execute(), actions::move_unit_and_record(), and synced_context::run_and_store().
void replay::add_unit_checksum | ( | const map_location & | loc, |
config & | cfg | ||
) |
Definition at line 205 of file replay.cpp.
References config::add_child(), unit_map::find(), get_checksum(), game_config::mp_debug, resources::units, unit_map::iterator_base< iter_types >::valid(), and map_location::write().
bool replay::at_end | ( | ) | const |
Definition at line 611 of file replay.cpp.
References base_, replay_recorder_base::get_pos(), and ncommands().
Referenced by add_command(), add_start_if_not_there_yet(), synced_context::ask_server_choice(), get_next_action(), replay_controller::recorder_at_end(), and undo_cut().
const std::vector< chat_msg > & replay::build_chat_log | ( | ) |
Definition at line 373 of file replay.cpp.
References add_chat_log_entry(), config::child(), command(), message_locations, message_log, and speak().
void replay::clear_labels | ( | const std::string & | team_name, |
bool | force | ||
) |
Definition at line 277 of file replay.cpp.
References config::add_child(), and add_nonundoable_command().
Referenced by events::menu_handler::clear_labels().
Definition at line 556 of file replay.cpp.
References base_, and replay_recorder_base::get_command_at().
Referenced by build_chat_log(), get_data_range(), get_last_real_command(), get_next_action(), and undo_cut().
void replay::delete_upcoming_commands | ( | ) |
Definition at line 187 of file replay.cpp.
References base_, and replay_recorder_base::delete_upcoming_commands().
Referenced by playsingle_controller::hotkey_handler::replay_exit().
bool replay::empty | ( | ) |
Definition at line 622 of file replay.cpp.
References ncommands().
void replay::end_turn | ( | ) |
Definition at line 298 of file replay.cpp.
References config::add_child(), and add_command().
Referenced by playsingle_controller::sync_end_turn().
Definition at line 391 of file replay.cpp.
References config::add_child(), ALL_DATA, c, command(), and NON_UNDO_DATA.
Referenced by replay_network_sender::commit_and_sync(), and replay_network_sender::sync_non_undoable().
config & replay::get_last_real_command | ( | ) |
Definition at line 423 of file replay.cpp.
References base_, c, command(), ERR_REPLAY, and replay_recorder_base::get_pos().
config * replay::get_next_action | ( | ) |
Definition at line 598 of file replay.cpp.
References at_end(), base_, command(), replay_recorder_base::get_pos(), LOG_REPLAY, ncommands(), and replay_recorder_base::set_pos().
Referenced by synced_context::ask_server_choice(), do_replay_handle(), user_choice_manager::search_in_replay(), and play_controller::start_game().
void replay::init_side | ( | ) |
Definition at line 218 of file replay.cpp.
References config::add_child(), add_command(), resources::controller, and play_controller::current_side().
Referenced by play_controller::maybe_do_init_side().
int replay::ncommands | ( | ) | const |
Definition at line 563 of file replay.cpp.
References base_, and replay_recorder_base::size().
Referenced by at_end(), replay_network_sender::commit_and_sync(), empty(), get_next_action(), redo(), replay_network_sender::sync_non_undoable(), and undo_cut().
|
static |
Definition at line 198 of file replay.cpp.
References resources::controller, ERR_REPLAY, flush(), and play_controller::process_oos().
Referenced by synced_context::ask_server_choice(), set_scontext_synced::do_final_checkup(), do_replay_handle(), mp_sync::get_user_choice_multiple_sides(), actions::move_unit_from_replay(), actions::move_unit_internal(), playmp_controller::process_network_data(), user_choice_manager::search_in_replay(), show_oos_error_error_function(), and verify().
Definition at line 410 of file replay.cpp.
References replay_recorder_base::add_child(), base_, config::child_range(), replay_recorder_base::get_pos(), ncommands(), and replay_recorder_base::set_to_end().
Referenced by actions::undo::dismiss_action::redo(), actions::undo::recruit_action::redo(), actions::undo::recall_action::redo(), actions::undo::move_action::redo(), and actions::undo_list::undo().
Definition at line 359 of file replay.cpp.
References base_, message_locations, and replay_recorder_base::remove_command().
Referenced by undo_cut().
void replay::revert_action | ( | ) |
Definition at line 591 of file replay.cpp.
References base_, replay_recorder_base::get_pos(), and replay_recorder_base::set_pos().
Referenced by synced_context::ask_server_choice(), do_replay_handle(), and user_choice_manager::search_in_replay().
void replay::set_to_end | ( | ) |
Definition at line 617 of file replay.cpp.
References base_, and replay_recorder_base::set_to_end().
Referenced by add_command(), and undo_cut().
Definition at line 342 of file replay.cpp.
References add_chat_message_location(), config::add_child(), base_, replay_recorder_base::insert_command(), and replay_recorder_base::size().
Referenced by build_chat_log(), and events::menu_handler::send_chat_message().
void replay::start_replay | ( | ) |
Definition at line 586 of file replay.cpp.
References base_, and replay_recorder_base::set_pos().
void replay::undo | ( | ) |
Definition at line 550 of file replay.cpp.
References undo_cut().
Referenced by synced_context::run_and_store().
Definition at line 482 of file replay.cpp.
References config::add_child_at(), at_end(), c, config::child(), command(), config::empty(), ERR_REPLAY, fix_rename_command(), i, ncommands(), remove_command(), set_to_end(), and config::swap().
Referenced by actions::undo_list::undo(), and undo().
void replay::user_input | ( | const std::string & | name, |
const config & | input, | ||
int | from_side | ||
) |
adds a user_input to the replay
from_side | the side that had to make the decision, -1 for 'server' |
Definition at line 251 of file replay.cpp.
References config::add_child(), and add_command().
Referenced by user_choice_manager::ask_local_choice(), and synced_context::ask_server_choice().
|
private |
Definition at line 151 of file replay.hpp.
Referenced by add_chat_message_location(), add_command(), add_config(), add_log_data(), add_nonundoable_command(), add_start_if_not_there_yet(), at_end(), command(), delete_upcoming_commands(), get_last_real_command(), get_next_action(), ncommands(), redo(), remove_command(), revert_action(), set_to_end(), speak(), and start_replay().
|
private |
Definition at line 152 of file replay.hpp.
Referenced by add_chat_message_location(), build_chat_log(), and remove_command().