Reset bigscreen on changed groups, not just changed tournaments.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 14:42:58 +0000 (14:42 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 14:42:58 +0000 (14:42 +0000)
bigscreen/ccbs_bigscreen.cpp

index f6d8da5..19937b2 100644 (file)
@@ -249,16 +249,19 @@ int main(int argc, char **argv)
                init_freetype();
                pqxx::connection conn("dbname=ccbs host=altersex.samfundet.no user=ccbs password=GeT|>>B_");
                FlagTrigger tournament_changed(conn, "active_tournament");
+               FlagTrigger rounds_changed(conn, "active_groups");
                
-               // when active_tournament is changed, we destroy everything and start from scratch
+               // when active_tournament or active_rounds is changed, we destroy everything and start from scratch
+               // (at least currently)
                for ( ;; ) {
                        tournament_changed.reset_flag();
+                       rounds_changed.reset_flag();
                        init(conn);
                        do {
                                main_loop(conn);
                                conn.get_notifs();
-                       } while (!tournament_changed.get_flag());
-                       std::fprintf(stderr, "active_tournament changed, resetting...\n");
+                       } while (!tournament_changed.get_flag() && !rounds_changed.get_flag());
+                       std::fprintf(stderr, "active_tournament or active_groups changed, resetting...\n");
                }
        } catch (const std::exception &e) {
                std::fprintf(stderr, "Exception: %s\n", e.what());