Add Asset Packet

This packet is used to send the client the URL of an online content repository, if available.
This commit is contained in:
Salanto 2021-05-04 05:39:50 +02:00
parent bea9fc1a05
commit 8a9bb6dc69
2 changed files with 20 additions and 0 deletions

View File

@ -501,6 +501,16 @@ public:
// The file name of the log file in base/logs.
QString log_filename;
/**
* @brief A QString of an URL that defines the content repository
* send by the server.
*
* @details Introduced in Version 2.9.2.
* Addresses the issue of contenturl devlivery for WebAO
* without relying on someone adding the link manually.
*/
QString asset_url;
void initBASS();
static void load_bass_opus_plugin();
static void CALLBACK BASSreset(HSTREAM handle, DWORD channel, DWORD data,

View File

@ -703,6 +703,16 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
w_courtroom->on_authentication_state_received(authenticated);
}
//AssetURL Packet
else if (header == "ASS") {
if (f_contents.size() > 1) { // This can never be more than one link.
goto end;
}
QUrl t_asset_url = QUrl::fromPercentEncoding(f_contents.at(0).toUtf8());
if (t_asset_url.isValid())
asset_url = t_asset_url.toString();
}
end:
delete p_packet;