]> git.sesse.net Git - ccbs/commitdiff
Merge branch 'mainline-0.1' of /srv/git.sesse.net/private/ccbs into mainline-0.1
authorSteinar H. Gunderson <Steinar H. Gunderson sesse@debian.org>
Thu, 9 Feb 2012 22:22:52 +0000 (23:22 +0100)
committerSteinar H. Gunderson <Steinar H. Gunderson sesse@debian.org>
Thu, 9 Feb 2012 22:22:52 +0000 (23:22 +0100)
bigscreen/Makefile
bigscreen/fetch_group.cpp
bigscreen/fetch_group.h
bigscreen/fonts.cpp
bigscreen/groupscreen.cpp
bigscreen/widestring.cpp
html/do-edit-scores.pl
html/do-start-round.pl
html/templates/show-tournament.tmpl
sql/ccbs.sql

index e95b4af62906c1833d7ffe89c3eda2263e7e72d0..401074b2e2dab99e31222fd8def417689c920791 100644 (file)
@@ -3,7 +3,7 @@ CXX=g++
 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 \
index 7bca2f63e42b06018227716c6198df3a66929290..2c58762de64e9550156694f444c4dd62902bf79c 100644 (file)
@@ -60,9 +60,5 @@ void FetchGroup::operator() (pqxx::transaction<> &t)
 
                curr_group.players[curr_group.players.size() - 1].scores.push_back(sc);
        }
-}
-
-void FetchGroup::OnCommit()
-{
        *dest_group = curr_group;
 }
index 78b943ed6e4b6af2bee00346bbf47e84cafd9ad9..33e6a0b97fe68825bb75a38d4cbdc3d7cd5151a4 100644 (file)
@@ -14,7 +14,6 @@ private:
 public:
        FetchGroup(unsigned tournament, unsigned round, unsigned parallel, Group *group);
        void operator() (pqxx::transaction<> &t);
-       void OnCommit();
 };
 
 #endif /* !defined(_FETCH_CURRENT_TOURNAMENT_H) */
index cedd03affddd01fa4c859d3642177ea88bd9d646..df2360be5fc37436e1f005cf6aab9c4994093295 100644 (file)
@@ -1,3 +1,4 @@
+#include <cstdio>
 #include <vector>
 #include <stdexcept>
 #include "fonts.h"
index a9251a316a0ed663ee9ec5d900c953ee25fa069b..b2a63159540810fcd1f3d6be6202fc3b44d735e2 100644 (file)
@@ -1,6 +1,7 @@
 #include <cstdio>
 #include <algorithm>
 #include <map>
+#include <assert.h>
 
 #include "resolution.h"
 #include "groupscreen.h"
index 4b67ec7c2b168e158ccc90e1b90a7ad228d03256..a0d781a4edf5d22ded01667e4e84bc259c522670 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdlib.h>
+#include <cstring>
 #include <iconv.h>
 #include <endian.h>
 #include <exception>
@@ -65,9 +67,13 @@ void widestring::operator= (const char *from)
        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;
 }
 
+}
index 9dc81ffa1bb7c8c0398b8ad89ea025db10dea008..d70a98c2596896b11c536e7f162994f615e7391c 100755 (executable)
@@ -47,7 +47,7 @@ for my $p ($cgi->param()) {
                                # 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'} . ".");
                        }
index 6a9738d3c1b2620443130e60162cd23d815ef89c..fe4139a47275680feb39a96f539b669b7b07d827 100755 (executable)
@@ -40,7 +40,7 @@ if ($round == 1) {
        # 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
@@ -118,7 +118,7 @@ for my $g (1..$num_groups) {
                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'});
index 80a103fc99c62928cb938d7913b7c5970ca253de..71fe1a6249ed1ecde7e3923de96f438d53f6dea7 100644 (file)
@@ -91,7 +91,7 @@
 [% END %]
 
 [% FOR r = rounds %]
-[% IF r.locked || public %]
+[% IF r.locked || !public %]
   <h2><a name="round[% r.round %]">Runde [% r.round %]</a></h2>
 
   <div>
index 4cdf07b9c32b3892c5dbda59a7bd2c345ac7f20e..0463f742014ea9517ae9195403497d0028c96bba 100644 (file)
@@ -251,7 +251,7 @@ CREATE FUNCTION get_max_score_for_players(integer, integer, varchar) RETURNS SET
              )
              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
@@ -293,7 +293,7 @@ BEGIN
                                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;