diff --git a/include/server.h b/include/server.h index 3e610d2..c76417b 100644 --- a/include/server.h +++ b/include/server.h @@ -317,6 +317,10 @@ class Server : public QObject { * @brief The minimum time between IC messages, in milliseconds. */ int message_floodguard; + /** + * @brief URL send to the client during handshake to set the remote repository URL. + */ + QUrl asset_url; public slots: /** diff --git a/src/aoclient.cpp b/src/aoclient.cpp index 39fc6cd..ba544d2 100644 --- a/src/aoclient.cpp +++ b/src/aoclient.cpp @@ -265,6 +265,10 @@ void AOClient::sendPacket(AOPacket packet) #ifdef NET_DEBUG qDebug() << "Sent packet:" << packet.header << ":" << packet.contents; #endif + packet.contents.replaceInStrings("#", "") + .replaceInStrings("%", "") + .replaceInStrings("$", "") + .replaceInStrings("&", ""); socket->write(packet.toUtf8()); socket->flush(); } diff --git a/src/packets.cpp b/src/packets.cpp index ba52d85..13931af 100644 --- a/src/packets.cpp +++ b/src/packets.cpp @@ -63,6 +63,9 @@ void AOClient::pktSoftwareId(AreaData* area, int argc, QStringList argv, AOPacke sendPacket("PN", {QString::number(server->player_count), server->max_players}); sendPacket("FL", feature_list); + + QByteArray asset_url = server->asset_url.toEncoded(QUrl::EncodeSpaces); + sendPacket("ASS", {asset_url}); } void AOClient::pktBeginLoad(AreaData* area, int argc, QStringList argv, AOPacket packet) diff --git a/src/server.cpp b/src/server.cpp index 21bf840..2afdbe6 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -295,6 +295,9 @@ void Server::loadServerConfig() message_floodguard = config.value("message_floodguard", "250").toInt(&message_floodguard_conversion_success); if (!message_floodguard_conversion_success) message_floodguard = 30; + asset_url = config.value("asset_url","").toString().toUtf8(); + if (!asset_url.isValid()) + asset_url = NULL; config.endGroup(); //Load dice values