CPPFLAGS=-I/usr/include/postgresql $(shell freetype-config --cflags) -Itinyptc/
CXXFLAGS=-O2 -Wall
LDFLAGS=-L/usr/X11R6/lib
-LIBS=$(shell freetype-config --libs) $(shell libpq3-config) -lpqxx tinyptc/libtinyptc.a -lX11 -lXext -lXxf86vm -lXxf86dga
+LIBS=$(shell freetype-config --libs) -lpqxx tinyptc/libtinyptc.a -lX11 -lXext -lXxf86vm -lXxf86dga
CCBS_BIGSCREEN_SQL_OBJS=fetch_current_tournament.o fetch_list_of_active_groups.o \
fetch_list_of_finished_groups.o \
curr_group.players[curr_group.players.size() - 1].scores.push_back(sc);
}
-}
-
-void FetchGroup::OnCommit()
-{
*dest_group = curr_group;
}
public:
FetchGroup(unsigned tournament, unsigned round, unsigned parallel, Group *group);
void operator() (pqxx::transaction<> &t);
- void OnCommit();
};
#endif /* !defined(_FETCH_CURRENT_TOURNAMENT_H) */
+#include <cstdio>
#include <vector>
#include <stdexcept>
#include "fonts.h"
#include <cstdio>
#include <algorithm>
#include <map>
+#include <assert.h>
#include "resolution.h"
#include "groupscreen.h"
+#include <stdlib.h>
+#include <cstring>
#include <iconv.h>
#include <endian.h>
#include <exception>
delete[] to_buf;
}
+namespace pqxx
+{
+
template<>
-void pqxx::from_string<widestring>(const char *from, widestring &to)
+void from_string<widestring>(const char *from, widestring &to)
{
to = from;
}
+}
# Fetch the name of the song if we can
$ref = $dbh->selectrow_hashref('SELECT title FROM songs WHERE song=?',
undef, $cgi->param("song$1-$2"));
- ccbs::user_error(_("The song") . $ref->{'title'} _("doesn't have steps for ") .
+ ccbs::user_error(_("The song") . $ref->{'title'} . _("doesn't have steps for ") .
$cgi->param("playmode$1-$2") . " " . $cgi->param("difficulty$1-$2") . _(" on ").
$tournamentdata->{'machinename'} . ".");
}
# First of all, check that there are no null values!
my $ref = $dbh->selectrow_hashref('SELECT COUNT(*) AS num_incomplete FROM scores WHERE tournament=? AND round=? AND (song IS NULL OR playmode IS NULL OR difficulty IS NULL OR chosen IS NULL or score IS NULL)', undef, $tournament, $round-1);
if ($ref->{'num_incomplete'} != 0) {
- ccbs::user_error(_("There's still") . $ref->{'num_incomplete'} . _("songs left in this round which don't have all data registered.");
+ ccbs::user_error(_("There's still") . $ref->{'num_incomplete'} . _("songs left in this round which don't have all data registered."));
}
# Find out how many people will go on from the _current_ group (ie. the one
my $ref = $dbh->selectrow_hashref('SELECT * FROM machinesongs NATURAL JOIN songratings WHERE song NOT IN ( SELECT song FROM randomsongsused ) AND machine=( SELECT machine FROM tournaments WHERE tournament=? ) AND playmode=\'single\' AND difficulty=\'expert\' ORDER BY random() LIMIT 1',
undef, $tournament);
if (!defined($ref)) {
- ccbs::user_error(_("There aren't any songs left in the song selector!");
+ ccbs::user_error(_("There aren't any songs left in the song selector!"));
}
$dbh->do('INSERT INTO randomsongsused (song) VALUES (?)',
undef, $ref->{'song'});
[% END %]
[% FOR r = rounds %]
-[% IF r.locked || public %]
+[% IF r.locked || !public %]
<h2><a name="round[% r.round %]">Runde [% r.round %]</a></h2>
<div>
)
AND playmode=$3
ORDER BY feetrating DESC LIMIT 1
- ) * 1000 AS max_score FROM tournamentparticipation;
+ ) * 1000 AS max_score FROM tournamentparticipation WHERE tournament=$1;
$$
LANGUAGE SQL
STABLE
IF ts.song IS NOT NULL THEN
ret.max_score := ret.max_score + ( SELECT max_score FROM get_max_score_for_songs($1, $4) WHERE song=ts.song );
ELSE
- ret.max_score := ret.max_score + ( SELECT max_score FROM get_max_score_for_players($1, $4) WHERE song=tp.player );
+ ret.max_score := ret.max_score + ( SELECT max_score FROM get_max_score_for_players($1, $2, $4) WHERE song=tp.player );
END IF;
END IF;
END LOOP;