2017-03-13 22:36:50 -07:00
|
|
|
#include "dbquery.h"
|
2017-03-18 23:05:09 -07:00
|
|
|
#include <stdlib.h>
|
2017-03-10 16:59:58 -08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
void html(void) {
|
|
|
|
const char *html_top = "Content-Type: text/html\n\n\
|
|
|
|
<html><head><meta content=\"text/html; charset=UTF-8\" />\
|
|
|
|
<link rel=\"stylesheet\" type=\"text/css\" href=\"page.css\">\
|
|
|
|
<title>/v/ - Xonotic</title>\
|
|
|
|
<p class='hidden'>:-) / nice one<br></p>";
|
|
|
|
const char *html_bot = "<br><br><p classname='footer'>Pages under construction.<br>\
|
|
|
|
Service may sporadically become unavailable.<br>\
|
|
|
|
In-game database is not directly synced with this web server.\
|
|
|
|
</p>\
|
|
|
|
</body></html>";
|
2017-03-18 23:05:09 -07:00
|
|
|
const char *html_mid = "<br>\
|
|
|
|
<H2>hi / good luck and have fun.<br><br>Available Pages</H2>\
|
|
|
|
<H3>Map Leaderboards</H3>\
|
2017-03-19 00:22:53 -07:00
|
|
|
<p>cts?map=[map name]</p>\
|
2017-03-18 23:05:09 -07:00
|
|
|
<H3>Player Ranks</H3>\
|
2017-03-19 00:22:53 -07:00
|
|
|
<p>cts?player=[client id fingerprint]<br>\
|
2017-03-18 23:05:09 -07:00
|
|
|
<hr>";
|
|
|
|
const char *qstr = getenv("QUERY_STRING");
|
2017-03-12 20:03:51 -07:00
|
|
|
printf("%s", html_top);
|
2017-03-18 23:05:09 -07:00
|
|
|
if (qstr == NULL) {
|
|
|
|
printf("%s", html_mid);
|
|
|
|
}
|
|
|
|
getquery(qstr);
|
2017-03-12 20:03:51 -07:00
|
|
|
printf("%s", html_bot);
|
2017-03-10 16:59:58 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
2017-03-13 19:18:50 -07:00
|
|
|
html();
|
|
|
|
return 0;
|
2017-03-10 16:59:58 -08:00
|
|
|
}
|