volatile sig_atomic_t sig_stop;
-static void inthandler( int signum ) {
- sig_stop = 1;
-}
-
#include "gameserver.h"
#include "highscores.c"
#include "servermonitor_server.c"
#include "vg/vg_opt.h"
#include "network_common.h"
+#include "gameserver_db.h"
+
+static void inthandler( int signum ) {
+ sig_stop = 1;
+}
static const u64 k_connection_unauthorized = 0xffffffffffffffff;
}
int main( int argc, char *argv[] ){
+ db_init();
+ char table[DB_TABLE_UID_MAX];
+ if( db_get_highscore_table_name( "sr003-local-mp_mtzero",
+ "megapark-yellow", 302, table ) ){
+ if( db_writeusertime( table, 76561198072130043, 232, 1 ) ){
+ vg_success( "Written time\n" );
+ i32 v = db_readusertime( table, 76561198072130043 );
+ vg_success( "Returned time: %u\n", v );
+ }
+ }
+ db_free();
+ return 0;
+
signal( SIGINT, inthandler );
signal( SIGQUIT, inthandler );
signal( SIGPIPE, SIG_IGN );
highscores_init( 250000, 10000 );
- if( !highscores_read() )
+ if( !highscores_read(NULL) )
highscores_create_db();
steamworks_ensure_txt( "2103940" );
vg_info( "Shutting down\n..." );
SteamGameServer_Shutdown();
+ db_free();
return 0;
}