The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Functions | Variables
campaignd Namespace Reference

Classes

class  blacklist
 Add-on blacklist table. More...
 
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 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...
 
bool is_text_markup_char (char c)
 

Variables

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

Function Documentation

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 107 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().

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 95 of file addon_utils.cpp.

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

Referenced by campaignd::server::handle_upload().

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 63 of file addon_utils.cpp.

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

Referenced by campaignd::server::handle_request_campaign_list().

bool campaignd::is_text_markup_char ( char  c)
inline

Definition at line 31 of file addon_utils.hpp.

Referenced by campaignd::server::handle_upload().

Variable Documentation

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 61 of file addon_utils.cpp.