# HG changeset patch # User meillo@marmaro.de # Date 1210792053 -7200 # Node ID 3ff1fbe4693d1597ad4f7009a646a5f162629972 # Parent 831599184108ab3bf4c44f23dab8dad0ae794c28 moved gamecheck and some vars out diff -r 831599184108 -r 3ff1fbe4693d game.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/game.h Wed May 14 21:07:33 2008 +0200 @@ -0,0 +1,25 @@ +char query[1024]; +char* gamename; +int gameid; +int gametime; + + +void check_game() { + int rows; + MYSQL_ROW row; + + sprintf(query, "select id, time from game where name = '%s' ", gamename); + db_query(query); + result = mysql_store_result(conn); + rows = mysql_num_rows(result); + row = mysql_fetch_row(result); + gameid = atoi(row[0]); + gametime = atoi(row[1]); + mysql_free_result(result); + + if (rows != 1) { + printf("game '%s' does not exist\n", gamename); + exit(1); + } +} +