]> git.sesse.net Git - ccbs/blobdiff - bigscreen/ccbs_bigscreen.cpp
Fetch the list of current active rounds and display it.
[ccbs] / bigscreen / ccbs_bigscreen.cpp
index c233f4726742169f2706470bb199e011d8448a17..9db87c8f9be0f9024c344ef2ea502a2b1ca2adab 100644 (file)
@@ -7,20 +7,27 @@
 #include "flagtrigger.h"
 #include "widestring.h"
 #include "fetch_current_tournament.h"
+#include "fetch_list_of_active_groups.h"
 #include "fonts.h"
 
 Tournament active_tournament;
+std::vector<Group> active_groups;
 unsigned char framebuf[800 * 600 * 4];
 
 void init(pqxx::connection &conn)
 {
        conn.perform(FetchCurrentTournament(&active_tournament));
+       conn.perform(FetchListOfActiveGroups(&active_groups));
 
        if (active_tournament.id == -1) {
                std::fprintf(stderr, "No active tournament\n");
        } else {
-               std::fprintf(stderr, "Current tournament is %d (name: '%s')\n",
-                       active_tournament.id, active_tournament.name.c_str());
+               std::fprintf(stderr, "Current tournament is %d\n", active_tournament.id);
+
+               for (std::vector<Group>::const_iterator i = active_groups.begin(); i != active_groups.end(); ++i) {
+                       std::fprintf(stderr, "tourn: %u  round: %u   parallel: %u\n",
+                               i->tournament, i->round, i->parallel);
+               }
        }
 }