diff options
| author | in1tiate <radwoodward@vikings.grayson.edu> | 2021-04-22 23:46:55 -0500 |
|---|---|---|
| committer | in1tiate <radwoodward@vikings.grayson.edu> | 2021-04-22 23:46:55 -0500 |
| commit | 43340e88695b2adc7b8fc8141540178727fd8869 (patch) | |
| tree | 04a4d9a6351e6098286b0c4d75d15df3a62bbf96 /src/demoserver.cpp | |
| parent | 86b342badcbf15469fc827a7fbec5baf8be8fa30 (diff) | |
move timer reset to its own method
Diffstat (limited to 'src/demoserver.cpp')
| -rw-r--r-- | src/demoserver.cpp | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/demoserver.cpp b/src/demoserver.cpp index 8b82d75c..b9721bf2 100644 --- a/src/demoserver.cpp +++ b/src/demoserver.cpp @@ -164,17 +164,7 @@ void DemoServer::handle_packet(AOPacket packet) client_sock->write(packet.toUtf8()); // Reset evidence list client_sock->write("LE##%"); - // Reset timers - client_sock->write("TI#0#3#0#%"); - client_sock->write("TI#0#1#0#%"); - client_sock->write("TI#1#1#0#%"); - client_sock->write("TI#1#3#0#%"); - client_sock->write("TI#2#1#0#%"); - client_sock->write("TI#2#3#0#%"); - client_sock->write("TI#3#1#0#%"); - client_sock->write("TI#3#3#0#%"); - client_sock->write("TI#4#1#0#%"); - client_sock->write("TI#4#3#0#%"); + reset_all_timers(); // Set the BG to default (also breaks up the message queue) client_sock->write("BN#default#wit#%"); // Stop the wait packet timer @@ -244,17 +234,7 @@ void DemoServer::handle_packet(AOPacket packet) client_sock->write(packet.toUtf8()); // Reset evidence list client_sock->write("LE##%"); - // Reset timers - client_sock->write("TI#0#3#0#%"); - client_sock->write("TI#0#1#0#%"); - client_sock->write("TI#1#1#0#%"); - client_sock->write("TI#1#3#0#%"); - client_sock->write("TI#2#1#0#%"); - client_sock->write("TI#2#3#0#%"); - client_sock->write("TI#3#1#0#%"); - client_sock->write("TI#3#3#0#%"); - client_sock->write("TI#4#1#0#%"); - client_sock->write("TI#4#3#0#%"); + reset_all_timers(); // Set the BG to default (also breaks up the message queue) client_sock->write("BN#default#wit#%"); // Stop the wait packet timer @@ -297,6 +277,20 @@ void DemoServer::load_demo(QString filename) } } +void DemoServer::reset_all_timers() +{ + client_sock->write("TI#0#3#0#%"); + client_sock->write("TI#0#1#0#%"); + client_sock->write("TI#1#1#0#%"); + client_sock->write("TI#1#3#0#%"); + client_sock->write("TI#2#1#0#%"); + client_sock->write("TI#2#3#0#%"); + client_sock->write("TI#3#1#0#%"); + client_sock->write("TI#3#3#0#%"); + client_sock->write("TI#4#1#0#%"); + client_sock->write("TI#4#3#0#%"); +} + void DemoServer::playback() { if (demo_data.isEmpty()) |
