std::string name;
};
-Tournament tourn;
+Tournament active_tournament;
/* A trigger that sets a flag whenever it's trigged. */
class FlagTrigger : pqxx::trigger {
void init(pqxx::connection &conn)
{
- conn.perform(FetchCurrentTournament(&tourn));
+ conn.perform(FetchCurrentTournament(&active_tournament));
- if (tourn.id == -1) {
+ if (active_tournament.id == -1) {
std::fprintf(stderr, "No active tournament\n");
} else {
std::fprintf(stderr, "Current tournament is %d (name: '%s')\n",
- tourn.id, tourn.name.c_str());
+ active_tournament.id, active_tournament.name.c_str());
}
}
void main_loop(pqxx::connection &conn)
{
- if (tourn.id == -1) {
+ if (active_tournament.id == -1) {
// No active tournament, sleep a second or so and exit
sleep(1);
return;