diff --git a/assignment-client/src/assets/AssetServer.cpp b/assignment-client/src/assets/AssetServer.cpp
index f5f83399d6..fad8ece7bf 100644
--- a/assignment-client/src/assets/AssetServer.cpp
+++ b/assignment-client/src/assets/AssetServer.cpp
@@ -77,6 +77,18 @@ void AssetServer::completeSetup() {
auto assetServerObject = settingsObject[ASSET_SERVER_SETTINGS_KEY].toObject();
+ static const QString MAX_BANDWIDTH_OPTION = "max_bandwidth";
+ auto maxBandwidthValue = assetServerObject[MAX_BANDWIDTH_OPTION];
+ auto maxBandwidthFloat = maxBandwidthValue.toDouble(-1);
+
+ if (maxBandwidthFloat > 0.0) {
+ const int BYTES_PER_MEGABITS = (1024 * 1024) / 8;
+ int maxBandwidth = maxBandwidthFloat * BYTES_PER_MEGABITS;
+ nodeList->setConnectionMaxBandwidth(maxBandwidth);
+ qInfo() << "Set maximum bandwith per connection to" << maxBandwidthFloat << "Mb/s."
+ " (" << maxBandwidth << "bytes/sec)";
+ }
+
// get the path to the asset folder from the domain server settings
static const QString ASSETS_PATH_OPTION = "assets_path";
auto assetsJSONValue = assetServerObject[ASSETS_PATH_OPTION];
diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json
index cde398e01f..80ee32efa1 100644
--- a/domain-server/resources/describe-settings.json
+++ b/domain-server/resources/describe-settings.json
@@ -186,6 +186,15 @@
"help": "The path to the directory assets are stored in.
If this path is relative, it will be relative to the application data directory.
If you change this path you will need to manually copy any existing assets from the previous directory.",
"default": "",
"advanced": true
+ },
+ {
+ "name": "max_bandwidth",
+ "type": "double",
+ "label": "Max Bandwidth Per User",
+ "help": "The maximum upstream bandwidth each user can use (in Mb/s).",
+ "placeholder": "10.0",
+ "default": "",
+ "advanced": true
}
]
},