X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=gameserver.c;h=e36e60f704c345030c9189fab49d27ab42046353;hb=74b2136d5b41b18e2eec698f1fd11b503aa1100a;hp=11721e7a4dc8abef2f45db49765d58ea1246dc1b;hpb=3b1909cad505b859b9c6524498b1969cd018af8c;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/gameserver.c b/gameserver.c index 11721e7..e36e60f 100644 --- a/gameserver.c +++ b/gameserver.c @@ -707,7 +707,7 @@ static enum request_status gameserver_cat_table( vg_strnull( &q, buf, 512 ); vg_strcat( &q, "SELECT * FROM \"" ); vg_strcat( &q, table_name ); - vg_strcat( &q, "\" ORDER BY time DESC LIMIT 10;" ); + vg_strcat( &q, "\" ORDER BY time ASC LIMIT 10;" ); if( !vg_strgood(&q) ) return k_request_status_out_of_memory; @@ -924,6 +924,7 @@ static u64 seconds_to_server_ticks( double s ){ } static void test_runner( db_request *req ){ +#if 0 vg_warn( "RUNNER\n" ); char table[DB_TABLE_UID_MAX]; if( db_get_highscore_table_name( "sr002-local-mp_mtzero", @@ -934,8 +935,16 @@ static void test_runner( db_request *req ){ vg_success( "Returned time: %u\n", v ); } } +#endif } +#define SIDELOAD +#ifdef SIDELOAD +#include "gameserver_sideload.h" +static int bsideload = 0; +const char *sideload_path = NULL; +#endif + int main( int argc, char *argv[] ){ signal( SIGINT, inthandler ); signal( SIGQUIT, inthandler ); @@ -946,7 +955,12 @@ int main( int argc, char *argv[] ){ if( vg_long_opt( "noauth" ) ) gameserver.auth_mode = eServerModeNoAuthentication; - /* TODO: Options to override, ammend, remove etc */ +#ifdef SIDELOAD + if( (arg = vg_long_opt_arg( "sideload" )) ){ + sideload_path = arg; + bsideload = 1; + } +#endif } vg_set_mem_quota( 80*1024*1024 ); @@ -959,6 +973,15 @@ int main( int argc, char *argv[] ){ db_send_request(req); } +#ifdef SIDELOAD + if( bsideload ){ + sideload( sideload_path ); + db_kill(); + db_free(); + return 0; + } +#endif + monitor_start_server(); /* UNIX socket monitor */ /* steamworks init