The Battle for Wesnoth  1.15.12+dev
Namespaces | Classes | Functions | Variables
campaignd Namespace Reference

Namespaces

 auth
 

Classes

class  blacklist
 Add-on blacklist table. More...
 
class  command_line
 
class  control_line
 Represents a server control line written to a communication socket. More...
 
class  server
 Legacy add-ons server. More...
 

Functions

std::string format_addon_feedback_url (const std::string &format, const config &params)
 Format a feedback URL for an add-on. More...
 
void support_translation (config &addon, const std::string &locale_id)
 
void find_translations (const config &base_dir, config &addon)
 Scans an add-on archive directory for translations. More...
 
void add_license (config &cfg)
 Adds a COPYING.txt file with the full text of the GNU GPL to an add-on. More...
 
std::map< version_info, configget_version_map (config &addon)
 
bool data_apply_removelist (config &data, const config &removelist)
 
void data_apply_addlist (config &data, const config &addlist)
 
bool is_text_markup_char (char c)
 
std::ostream & operator<< (std::ostream &o, const server::request &r)
 

Variables

const std::string illegal_markup_chars = "*`~{^}|@#<&"
 Markup characters recognized by GUI1 code. More...
 

Function Documentation

◆ add_license()

void campaignd::add_license ( config cfg)

Adds a COPYING.txt file with the full text of the GNU GPL to an add-on.

This only has an effect if the add-on archive cfg does not already contain an equivalent file ('copying.txt', 'COPYING', etc.).

Definition at line 125 of file addon_utils.cpp.

References config::add_child(), config::find_child(), LOG_CS, game_config::path, and filesystem::read_file().

Referenced by campaignd::server::handle_upload(), and is_text_markup_char().

◆ data_apply_addlist()

void campaignd::data_apply_addlist ( config data,
const config addlist 
)

◆ data_apply_removelist()

bool campaignd::data_apply_removelist ( config data,
const config removelist 
)

◆ find_translations()

void campaignd::find_translations ( const config base_dir,
config addon 
)

Scans an add-on archive directory for translations.

Any subdirectories of base_dir containing a subdirectory named 'LC_MESSAGES' are assumed to be translation dirs. The names of the subdirectories thus located are recorded into the addon WML node in [translation] children nodes like the following (comments included for documentation purposes):

*     [translation]
*         language="es" # translations/es/LC_MESSAGES/
*     [/translation]
*     [translation]
*         language="ja" # translations/ja/LC_MESSAGES/
*     [/translation]
* 

Definition at line 106 of file addon_utils.cpp.

References filesystem::base_name(), config::child_range(), filesystem::ends_with(), and support_translation().

Referenced by campaignd::server::handle_upload(), and is_text_markup_char().

◆ format_addon_feedback_url()

std::string campaignd::format_addon_feedback_url ( const std::string &  format,
const config params 
)

Format a feedback URL for an add-on.

Parameters
formatThe format string for the URL, presumably obtained from the add-ons server identification.
paramsThe URL format parameters table.
Returns
A string containing a feedback URL or an empty string if that is not possible (e.g. empty or invalid format, empty params table, or a result that is identical in content to the format suggesting that the params table contains incorrect data).

Definition at line 64 of file addon_utils.cpp.

References a, config::attribute_range(), config::empty(), and utils::urlencode().

Referenced by campaignd::server::handle_request_campaign_list(), and is_text_markup_char().

◆ get_version_map()

std::map< version_info, config > campaignd::get_version_map ( config addon)

◆ is_text_markup_char()

bool campaignd::is_text_markup_char ( char  c)
inline

◆ operator<<()

std::ostream& campaignd::operator<< ( std::ostream &  o,
const server::request r 
)

◆ support_translation()

void campaignd::support_translation ( config addon,
const std::string &  locale_id 
)

Definition at line 96 of file addon_utils.cpp.

References config::add_child(), and config::find_child().

Referenced by find_translations(), and is_text_markup_char().

Variable Documentation

◆ illegal_markup_chars

const std::string campaignd::illegal_markup_chars = "*`~{^}|@#<&"

Markup characters recognized by GUI1 code.

These must be the same as the constants defined in marked-up_text.cpp.

Definition at line 62 of file addon_utils.cpp.