]> git.sesse.net Git - ccbs/blobdiff - bigscreen/ccbs_bigscreen.cpp
Move the database configuration to the config file.
[ccbs] / bigscreen / ccbs_bigscreen.cpp
index eeee86cefa4bf318806be01e7fe80cd0f282345e..40d5bad57b8aa3419ab2702b5010bc70a476e279 100644 (file)
@@ -206,7 +206,14 @@ int main(int argc, char **argv)
        try {
                init_freetype();
                set_screen_size(screen_width, screen_height);
-               pqxx::connection conn("dbname=ccbs host=www.positivegaming.com user=ccbs password=GeT|>>B_");
+
+               char connstr[1024];
+               snprintf(connstr, sizeof(connstr), "dbname=%s host=%s user=%s password=%s",
+                        get_theme_config("db", "dbname").c_str(),
+                        get_theme_config("db", "host").c_str(),
+                        get_theme_config("db", "user").c_str(),
+                        get_theme_config("db", "password").c_str());
+               pqxx::connection conn(connstr);
                FlagTrigger tournament_changed(conn, "active_tournament");
                FlagTrigger rounds_changed(conn, "active_groups");