]> git.sesse.net Git - ccbs/blobdiff - bigscreen/ccbs_bigscreen.cpp
Hit the group-fetching code so it compiles.
[ccbs] / bigscreen / ccbs_bigscreen.cpp
index c233f4726742169f2706470bb199e011d8448a17..f50991212b4257bc323c01b3413b81f98ea2992f 100644 (file)
@@ -7,20 +7,32 @@
 #include "flagtrigger.h"
 #include "widestring.h"
 #include "fetch_current_tournament.h"
+#include "fetch_list_of_active_groups.h"
+#include "fetch_group.h"
 #include "fonts.h"
 
 Tournament active_tournament;
+std::vector<SkeletonGroup> 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<SkeletonGroup>::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);
+
+                       Group gr;
+                       conn.perform(FetchGroup(i->tournament, i->round, i->parallel, &gr));
+                       std::fprintf(stderr, "%u players in group\n", gr.players.size());
+               }
        }
 }