aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-21 08:27:47 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-21 08:27:50 +0200
commitf5aaf1b1cc94e28d4fa423a3d0b8ca286cf7f87d (patch)
tree839418cbb8a8f5ee4bbabc79c3ca915babab8302 /src/main.cpp
parente1322b06148b633df365d8916404a2748945de65 (diff)
Implement online/offline users (pinging)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a6dfb5f..5317907 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -724,6 +724,11 @@ int main(int argc, char **argv)
lastFocusedTimer.restart();
}
+
+ for(Channel *channel : channels)
+ {
+ channel->update();
+ }
if(lastFocusedTimer.getElapsedTime().asMilliseconds() > 3000)
{
@@ -757,6 +762,15 @@ int main(int argc, char **argv)
//video.draw(window);
window.display();
}
+
+ for(Channel *channel : channels)
+ {
+ channel->update();
+ }
+
+ // We need to wait until our `ping` packet for disconnecting is sent to all channels
+ printf("Shutting down...");
+ this_thread::sleep_for(chrono::seconds(3));
return 0;
}