+void Network::setUseCustomMessageRate(bool useCustomRate)
+{
+ if (_useCustomMessageRate != useCustomRate) {
+ _useCustomMessageRate = useCustomRate;
+ SYNC(ARG(useCustomRate))
+ emit configChanged();
+ emit useCustomMessageRateSet(_useCustomMessageRate);
+ }
+}
+
+
+void Network::setMessageRateBurstSize(quint32 burstSize)
+{
+ if (burstSize < 1) {
+ // Can't go slower than one message at a time. Also blocks old clients from trying to set
+ // this to 0.
+ qDebug() << "Received invalid setMessageRateBurstSize data - message burst size must be "
+ "non-zero positive, given" << burstSize;
+ return;
+ }
+ if (_messageRateBurstSize != burstSize) {
+ _messageRateBurstSize = burstSize;
+ SYNC(ARG(burstSize))
+ emit configChanged();
+ emit messageRateBurstSizeSet(_messageRateBurstSize);
+ }
+}
+
+
+void Network::setMessageRateDelay(quint32 messageDelay)
+{
+ if (messageDelay == 0) {
+ // Nonsensical to have no delay - just check the Unlimited box instead. Also blocks old
+ // clients from trying to set this to 0.
+ qDebug() << "Received invalid setMessageRateDelay data - message delay must be non-zero "
+ "positive, given" << messageDelay;
+ return;
+ }
+ if (_messageRateDelay != messageDelay) {
+ _messageRateDelay = messageDelay;
+ SYNC(ARG(messageDelay))
+ emit configChanged();
+ emit messageRateDelaySet(_messageRateDelay);
+ }
+}
+
+
+void Network::setUnlimitedMessageRate(bool unlimitedRate)
+{
+ if (_unlimitedMessageRate != unlimitedRate) {
+ _unlimitedMessageRate = unlimitedRate;
+ SYNC(ARG(unlimitedRate))
+ emit configChanged();
+ emit unlimitedMessageRateSet(_unlimitedMessageRate);
+ }
+}
+
+