move timer reset to its own method
This commit is contained in:
parent
86b342badc
commit
43340e8869
@ -24,6 +24,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void handle_packet(AOPacket packet);
|
void handle_packet(AOPacket packet);
|
||||||
void load_demo(QString filename);
|
void load_demo(QString filename);
|
||||||
|
void reset_all_timers();
|
||||||
|
|
||||||
QTcpServer* tcp_server;
|
QTcpServer* tcp_server;
|
||||||
QTcpSocket* client_sock = nullptr;
|
QTcpSocket* client_sock = nullptr;
|
||||||
|
@ -164,17 +164,7 @@ void DemoServer::handle_packet(AOPacket packet)
|
|||||||
client_sock->write(packet.toUtf8());
|
client_sock->write(packet.toUtf8());
|
||||||
// Reset evidence list
|
// Reset evidence list
|
||||||
client_sock->write("LE##%");
|
client_sock->write("LE##%");
|
||||||
// Reset timers
|
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#%");
|
|
||||||
// Set the BG to default (also breaks up the message queue)
|
// Set the BG to default (also breaks up the message queue)
|
||||||
client_sock->write("BN#default#wit#%");
|
client_sock->write("BN#default#wit#%");
|
||||||
// Stop the wait packet timer
|
// Stop the wait packet timer
|
||||||
@ -244,17 +234,7 @@ void DemoServer::handle_packet(AOPacket packet)
|
|||||||
client_sock->write(packet.toUtf8());
|
client_sock->write(packet.toUtf8());
|
||||||
// Reset evidence list
|
// Reset evidence list
|
||||||
client_sock->write("LE##%");
|
client_sock->write("LE##%");
|
||||||
// Reset timers
|
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#%");
|
|
||||||
// Set the BG to default (also breaks up the message queue)
|
// Set the BG to default (also breaks up the message queue)
|
||||||
client_sock->write("BN#default#wit#%");
|
client_sock->write("BN#default#wit#%");
|
||||||
// Stop the wait packet timer
|
// 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()
|
void DemoServer::playback()
|
||||||
{
|
{
|
||||||
if (demo_data.isEmpty())
|
if (demo_data.isEmpty())
|
||||||
|
Loading…
Reference in New Issue
Block a user