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

Namespaces

 auth
 

Classes

class  blacklist
 Add-on blacklist table. More...
 
class  control_line
 Represents a server control line written to a communication socket. More...
 
class  command_line
 
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)
 
std::string client_address (const any_socket_ptr &sock)
 

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

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

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

◆ client_address()

std::string campaignd::client_address ( const any_socket_ptr sock)
inline

◆ data_apply_addlist()

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

Definition at line 183 of file addon_utils.cpp.

References config::child_range(), data, and f.

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

◆ data_apply_removelist()

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

Definition at line 166 of file addon_utils.cpp.

References config::child_range(), d, data, and f.

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

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

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

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

◆ 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 config::attribute_range(), config::empty(), and utils::urlencode().

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

◆ 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

Definition at line 34 of file addon_utils.hpp.

References c, and illegal_markup_chars.

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

◆ operator<<()

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

Definition at line 486 of file server.cpp.

◆ support_translation()

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

Definition at line 94 of file addon_utils.cpp.

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

Referenced by find_translations().

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.

Referenced by is_text_markup_char().