174 bool upload_addon(
const std::string&
id, std::string& response_message,
config& cfg,
bool local_only);
237 std::unique_ptr<network_asio::connection>
conn_;
Add-ons (campaignd) client class.
bool update_last_error(config &response_cfg)
void disconnect()
Disconnects from the add-on server.
install_result install_addon_with_checks(const addons_list &addons, const addon_info &addon)
Performs an add-on download and install cycle.
bool is_connected()
Returns true if the client is connected to the server.
bool delete_remote_addon(const std::string &id, std::string &response_message)
Requests the specified add-on to be removed from the server.
bool do_check_before_overwriting_addon(const addon_info &addon)
Checks whether the given add-on has local .pbl or VCS information and asks before overwriting it.
void wait_for_transfer_done(const std::string &status_message, transfer_mode mode=transfer_mode::download)
Waits for a network transfer, displaying a status window.
const std::string & get_last_server_error_data() const
Returns the last error message extra data sent by the server, or an empty string.
std::unique_ptr< network_asio::connection > conn_
install_outcome
Installation outcome values.
@ success
The add-on was correctly installed.
@ failure
The add-on could not be downloaded from the server.
@ abort
User aborted the operation because of an issue with dependencies or chose not to overwrite the add-on...
const std::string & server_id() const
bool download_addon(config &archive_cfg, const std::string &id, const std::string &title, const version_info &version, bool increase_downloads=true)
Downloads the specified add-on from the server.
void send_request(const config &request, config &response)
Sends a request to the add-ons server.
bool request_addons_list(config &cfg)
Request the add-ons list from the server.
bool try_fetch_addon(const addon_info &addon)
const std::string & server_url() const
Retrieves the add-ons server web URL if available.
void check_connected() const
Makes sure the add-ons server connection is working.
std::set< std::string > server_capabilities_
bool install_addon(config &archive_cfg, const addon_info &info)
Installs the specified add-on using an archive received from the server.
std::string license_notice_
bool using_tls() const
Returns whether the current connection uses TLS.
bool server_supports_delta() const
Returns whether the server supports incremental (delta) downloads and uploads.
addons_client(const addons_client &)=delete
bool server_supports_legacy_auth() const
Returns whether the server supports passphrase authentication on an add-on basis.
std::string last_error_data_
std::string server_version_
void connect()
Tries to establish a connection to the add-ons server.
void send_simple_request(const std::string &request_string, config &response)
Sends a simple request message to the add-ons server.
bool request_distribution_terms(std::string &terms)
Request the add-ons server distribution terms message.
install_result do_resolve_addon_dependencies(const addons_list &addons, const addon_info &addon)
Warns the user about unresolved dependencies and installs them if they choose to do so.
const std::string & get_last_server_error() const
Returns the last error message sent by the server, or an empty string.
const std::string & addr() const
Returns the current hostname:port used for this connection.
const std::string & server_version() const
bool upload_addon(const std::string &id, std::string &response_message, config &cfg, bool local_only)
Uploads an add-on to the server.
addons_client & operator=(const addons_client &)=delete
bool server_supports(const std::string &cap_id) const
Returns whether the server supports the given named capability.
A config object defines a single node in a WML file, with access to child nodes.
Represents version numbers.
std::map< std::string, addon_info > addons_list
Contains the outcome of an add-on install operation.
install_outcome outcome
Overall outcome of the operation.
bool wml_changed
Specifies if WML on disk was altered and needs to be reloaded.