re-enabling the savage hack

This commit is contained in:
Thomas Debesse 2015-06-22 13:15:19 +02:00
parent 359270d3f1
commit 4d277b770b
4 changed files with 23 additions and 11 deletions

View File

@ -362,6 +362,9 @@ add_custom_command (TARGET translation
# Executable
install (TARGETS xqf DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
# Query script
install (PROGRAMS ${CMAKE_SOURCE_DIR}/src/script/qstat_savage.sh DESTINATION "${PACKAGE_DATA_DIR}/script")
# UI
install (FILES ${CMAKE_SOURCE_DIR}/src/xqf.ui DESTINATION ${PACKAGE_DATA_DIR}/ui)
@ -380,7 +383,7 @@ endforeach (SIZE ${icon_SIZE})
install (FILES ${CMAKE_SOURCE_DIR}/pixmaps/scalable/xqf.svg DESTINATION ${PIXMAPS_ENTRY_PATH}/scalable/apps)
# Config
install (FILES ${CMAKE_SOURCE_DIR}/src/qstat.cfg ${CMAKE_SOURCE_DIR}/src/qstat_savage.sh DESTINATION ${PACKAGE_DATA_DIR})
install (FILES ${CMAKE_SOURCE_DIR}/src/qstat.cfg DESTINATION ${PACKAGE_DATA_DIR})
# Man pages
install (FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.6 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6)

View File

@ -1,13 +1,25 @@
#! /bin/sh
#url="http://masterserver.savage.s2games.com/gamelist_full.dat"
url="$1"
if [ "x${url}" = 'x' ]
if [ "x${1}" = 'x' -o "x${1}" = 'x--help' ]
then
printf 'Usage: %s -sam http://masterserver.savage.s2games.com/gamelist_full.dat\n' "${0}"
exit
fi
if [ "x${2}" = 'x' ]
then
printf 'missing argument for "%s"\n' "${1}"
exit
fi
if [ "x${1}" != 'x-sam' ]
then
printf 'unknown option "%s"\n' "${1}"
exit
fi
url="${2}"
http_helper="wget -t 1 -T 20 -q -e robots=off --user-agent=XQF -O -"
server_type="SAS"
header="7e4103"

View File

@ -1061,9 +1061,10 @@ static struct stat_conn *stat_update_master_qstat (struct stat_job *job, struct
/* savage hack */
if (m->type == SAS_SERVER) {
argv[argi++] = "sh";
argv[argi++] = QSTAT_SAVAGE_SCRIPT;
argv[argi++] = PACKAGE_DATA_DIR "/script/qstat_savage.sh";
argv[argi++] = "-sam";
argv[argi++] = m->url;
argv[argi++] = NULL;
}
else if (m->master_type == MASTER_GSLIST) {
int ret = 0;

View File

@ -31,10 +31,6 @@
# define HTTP_HELPER "wget -t 1 -T 20 -q -e robots=off --user-agent=XQF/" XQF_VERSION " -O -"
#endif
#ifndef QSTAT_SAVAGE_SCRIPT
#define QSTAT_SAVAGE_SCRIPT "qstat_savage.sh"
#endif
#define QSTAT_DELIM '\t'
#define QSTAT_DELIM_STR "\t"
#define QSTAT_MASTER_DELIM ' '