void init(pqxx::connection &conn)
{
std::vector<widestring> aux_screens;
-
+
if (screens.size() == 0 || mainscreen != screens[0])
delete mainscreen;
}
screens.erase(screens.begin(), screens.end());
+ RotateScreen *rs = new RotateScreen();
+ mainscreen = rs;
+
conn.perform(FetchCurrentTournament(&active_tournament));
conn.perform(FetchListOfActiveGroups(&active_groups));
// memory leaks here?
for (unsigned j = 0; j < i->num_machines; ++j) {
- RotateScreen *rs = new RotateScreen();
- screens.push_back(rs);
rs->add_screen(new GroupScreen(conn, i->tournament, i->round, i->parallel, j, i->num_machines, i->players_per_machine));
}
}
}
- // show auxilliary screens if we have zero, two or three other screens going
- if (screens.size() < 4 && screens.size() != 1) {
- RotateScreen *aux_screen = new RotateScreen();
- screens.push_back(aux_screen);
-
+ {
conn.perform(FetchAuxilliaryScreens(&aux_screens));
for (std::vector<widestring>::const_iterator i = aux_screens.begin(); i != aux_screens.end(); ++i) {
if (*i == widestring("top10scores")) {
- aux_screen->add_screen(new Top10ScoreScreen(conn, active_tournament.id));
+ rs->add_screen(new Top10ScoreScreen(conn, active_tournament.id));
continue;
}
if (*i == widestring("top5chosen")) {
- aux_screen->add_screen(new Top5ChosenScreen(conn, active_tournament.id));
+ rs->add_screen(new Top5ChosenScreen(conn, active_tournament.id));
continue;
}
- std::fprintf(stderr, "Foobarbaz?\n");
- }
-
- /*
- * If we still have room, make yet another rotational screen with
- * results from previous groups -- otherwise tack them onto the end
- * of the auxilliary screens.
- */
- RotateScreen *finished_groups_screen = aux_screen;
- if (screens.size() < 4 && screens.size() != 1) {
- finished_groups_screen = new RotateScreen();
- screens.push_back(finished_groups_screen);
}
-
- std::vector<SkeletonGroup> finished_groups;
- conn.perform(FetchListOfFinishedGroups(active_tournament.id, &finished_groups));
-
- for (std::vector<SkeletonGroup>::const_iterator i = finished_groups.begin(); i != finished_groups.end(); ++i) {
- finished_groups_screen->add_screen(new GroupScreen(conn, i->tournament, i->round, i->parallel, 0, 1, 1));
- }
- }
-
- // hack
- screens.push_back(NULL);
- screens.push_back(NULL);
- screens.push_back(NULL);
- screens.push_back(NULL);
-
- if (screens[1] == NULL) {
- mainscreen = screens[0];
- } else {
- mainscreen = new SplitScreen(screens[0], screens[1], screens[2], screens[3]);
}
}
try {
init_freetype();
- pqxx::connection conn("dbname=ccbs host=altersex.samfundet.no user=ccbs password=GeT|>>B_");
+ pqxx::connection conn("dbname=ccbs host=www.positivegaming.com user=ccbs password=GeT|>>B_");
FlagTrigger tournament_changed(conn, "active_tournament");
FlagTrigger rounds_changed(conn, "active_groups");
/* This directive enables mmx-optimized pixelformat conversions */
-/* #define __PTC_MMX__ */
+#define __PTC_MMX__
/* This directive enables little-endian pixelformat converters - ignored for
* the XVideo+Mit-Shm target */
/* If you uncomment this directive, you'll choose X Shared memory extension
* video rendering */
-#define __PTC_XSHM__
+#define __PTC_XSHM__
/* If you uncomment this directive, you'll choose X Double buffer extension
* video rendering */
/* If you uncomment this directive, you'll choose X Direct Graphics Access
* extension (version 1.x) video rendering */
-/* #define __PTC_XDGA1__ */
+/* #define __PTC_XDGA1__ */
/* If you uncomment this directive, you'll choose X Direct Graphics Access
* extension (version 2.x) video rendering */
my $location = shift;
print CGI::header(-status=>'303 See other',
- -location=>'http://ccbs.sesse.net/' . $location,
+ -location=>'http://192.168.1.200/' . $location,
-type=>'text/html; charset=utf-8');
}
sub db_connect {
$ccbs_dbdebug = defined(shift) ? 1 : 0;
- my $dbh = DBI->connect("dbi:Pg:dbname=ccbs;host=altersex.samfundet.no", "ccbs", "GeT|>>B_")
+ my $dbh = DBI->connect("dbi:Pg:dbname=ccbs;host=www.positivegaming.com", "ccbs", "GeT|>>B_")
or die "Couldn't connect to database";
$dbh->{RaiseError} = 1;
return $dbh;