|
@@ -5,9 +5,10 @@
|
|
|
#include <sqlite3.h>
|
|
|
#include "colors.h"
|
|
|
|
|
|
-#define QOVERVIEW 'o'
|
|
|
-#define QRPLAYER 'p'
|
|
|
-#define QMLEADERBOARD 'm'
|
|
|
+#define QOVERVIEW 'o' // default case - see get_filename()
|
|
|
+#define QRPLAYER 'p' // ?player=
|
|
|
+#define QMLEADERBOARD 'm' // ?map=
|
|
|
+#define QFASTEST 'f'
|
|
|
|
|
|
static inline char *get_filename(char * const c) {
|
|
|
char *qout = "queries/mranks.sql";
|
|
@@ -22,6 +23,9 @@ static inline char *get_filename(char * const c) {
|
|
|
case QRPLAYER:
|
|
|
qout = "queries/rplayers.sql";
|
|
|
break;
|
|
|
+ case QFASTEST:
|
|
|
+ qout = "queries/fastest-players.sql";
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
return qout;
|
|
@@ -58,6 +62,14 @@ static inline void print_tblheader(const char *c) {
|
|
|
<TH class='columnname'>Rank</TH>\
|
|
|
</TR>";
|
|
|
break;
|
|
|
+ case QFASTEST:
|
|
|
+ labels = "<table class='leaderboard'>\
|
|
|
+ <th class='tablename' COLSPAN='3'>Map List</th>\
|
|
|
+ <tr>\
|
|
|
+ <th class='columnname'>Name</th>\
|
|
|
+ <th class='columnname'>Highest Velocty (qu/s)</th>\
|
|
|
+ <th class='columnname'>Held By</th>\
|
|
|
+ </tr>";
|
|
|
}
|
|
|
printf("%s", labels);
|
|
|
}
|
|
@@ -84,9 +96,11 @@ static void print_time(const unsigned char *strcs) {
|
|
|
static void qresult(sqlite3_stmt * const sp, const char *c) {
|
|
|
#define ISPLAYERNAME(x, y) (y == 1 && *x == QMLEADERBOARD) || \
|
|
|
(y == 3 && *x == QOVERVIEW)|| \
|
|
|
- (y == 0 && *x == QRPLAYER)
|
|
|
+ (y == 0 && *x == QRPLAYER) || \
|
|
|
+ (y == 2 && *x == QFASTEST)
|
|
|
#define ISMAPNAME(x, y) (y == 0 && *x == QOVERVIEW) ||\
|
|
|
- (y == 1 && *x == QRPLAYER)
|
|
|
+ (y == 1 && *x == QRPLAYER) || \
|
|
|
+ (y == 0 && *x == QFASTEST)
|
|
|
int e;
|
|
|
unsigned int i;
|
|
|
const unsigned int cc = sqlite3_column_count(sp);
|