aboutsummaryrefslogtreecommitdiff
path: root/src/demoserver.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2021-03-20 21:41:35 +0300
committerGitHub <noreply@github.com>2021-03-20 13:41:35 -0500
commite3ba27c47e4846e1a93057d83464ecff027da7be (patch)
treea066ee78569e0bd4c55b255ef610faa39a363b94 /src/demoserver.cpp
parent4bfd9f0d144688f57b6fa372fb6e82454ca31ea0 (diff)
Deprecate demo playback /min_wait (#498)
Diffstat (limited to 'src/demoserver.cpp')
-rw-r--r--src/demoserver.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/demoserver.cpp b/src/demoserver.cpp
index 579aa8d3..75664659 100644
--- a/src/demoserver.cpp
+++ b/src/demoserver.cpp
@@ -212,35 +212,11 @@ void DemoServer::handle_packet(AOPacket packet)
}
else if (contents[1].startsWith("/min_wait"))
{
- QStringList args = contents[1].split(" ");
- if (args.size() > 1)
- {
- bool ok;
- int p_min_wait = args.at(1).toInt(&ok);
- if (ok)
- {
- if (p_min_wait < 0)
- p_min_wait = -1;
- min_wait = p_min_wait;
- client_sock->write("CT#DEMO#Setting min_wait to ");
- client_sock->write(QString::number(min_wait).toUtf8());
- client_sock->write(" milliseconds.#1#%");
- }
- else
- {
- client_sock->write("CT#DEMO#Not a valid integer!#1#%");
- }
- }
- else
- {
- client_sock->write("CT#DEMO#Current min_wait is ");
- client_sock->write(QString::number(min_wait).toUtf8());
- client_sock->write(" milliseconds.#1#%");
- }
+ client_sock->write("CT#DEMO#min_wait is deprecated. Use the client Settings for minimum wait instead!");
}
else if (contents[1].startsWith("/help"))
{
- client_sock->write("CT#DEMO#Available commands:\nload, play, pause, max_wait, min_wait, help#1#%");
+ client_sock->write("CT#DEMO#Available commands:\nload, play, pause, max_wait, help#1#%");
}
}
}
@@ -285,9 +261,6 @@ void DemoServer::playback()
int duration = wait_packet.get_contents().at(0).toInt();
if (max_wait != -1 && duration + elapsed_time > max_wait)
duration = qMax(0, max_wait - elapsed_time);
- // We use elapsed_time to make sure that the packet we're using min_wait on is "priority" (e.g. IC)
- if (elapsed_time == 0 && min_wait != -1 && duration < min_wait)
- duration = min_wait;
elapsed_time += duration;
timer->start(duration);
}