Make sure fte servers get listed under quakeworld and not netquake.
Fix some wastes dedicated server compile error. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5645 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
062cdf6b21
commit
7f8b081b8c
8 changed files with 66 additions and 49 deletions
|
@ -6562,7 +6562,7 @@ void Host_FinishLoading(void)
|
|||
"\n"
|
||||
"See the GNU General Public License for more details.\n");
|
||||
|
||||
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX) && defined(WEBCLIENT)
|
||||
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX) && defined(MANIFESTDOWNLOADS)
|
||||
if (Sys_RunInstaller())
|
||||
Sys_Quit();
|
||||
#endif
|
||||
|
|
|
@ -61,6 +61,16 @@ void M_Serverlist_Init(void)
|
|||
Cvar_Register(&slist_cacheinfo, grp);
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
SLFILTER_HIDENETQUAKE,
|
||||
SLFILTER_HIDEQUAKEWORLD,
|
||||
SLFILTER_HIDEPROXIES,
|
||||
SLFILTER_ONLYFAVOURITES,
|
||||
SLFILTER_HIDEEMPTY,
|
||||
SLFILTER_HIDEFULL,
|
||||
SLFILTER_MAX
|
||||
};
|
||||
typedef struct {
|
||||
int servers_top;
|
||||
int visibleslots;
|
||||
|
@ -70,7 +80,8 @@ typedef struct {
|
|||
|
||||
int numslots;
|
||||
qboolean stillpolling;
|
||||
qbyte filter[8];
|
||||
qbyte filter[SLFILTER_MAX];
|
||||
|
||||
menuedit_t *filtertext;
|
||||
|
||||
char refreshtext[64];
|
||||
|
@ -1053,18 +1064,18 @@ static void CalcFilters(emenu_t *menu)
|
|||
|
||||
// Master_SetMaskInteger(false, SLKEY_PING, 0, SLIST_TEST_GREATEREQUAL);
|
||||
Master_SetMaskInteger(false, SLKEY_BASEGAME, SS_UNKNOWN, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[1] && info->filter[2])
|
||||
Master_SetMaskInteger(false, SLKEY_FLAGS, SS_PROXY, SLIST_TEST_CONTAINS);
|
||||
if (info->filter[SLFILTER_HIDENETQUAKE] && info->filter[SLFILTER_HIDEQUAKEWORLD])
|
||||
Master_SetMaskInteger(false, SLKEY_FLAGS, SS_PROXY, SLIST_TEST_CONTAINS); //show only proxies
|
||||
else
|
||||
{
|
||||
if (info->filter[1]) Master_SetMaskInteger(false, SLKEY_BASEGAME, SS_NETQUAKE, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[1]) Master_SetMaskInteger(false, SLKEY_BASEGAME, SS_DARKPLACES, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[2]) Master_SetMaskInteger(false, SLKEY_BASEGAME, SS_QUAKEWORLD, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[SLFILTER_HIDENETQUAKE]) Master_SetMaskInteger(false, SLKEY_BASEGAME, SS_NETQUAKE, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[SLFILTER_HIDENETQUAKE]) Master_SetMaskInteger(false, SLKEY_BASEGAME, SS_DARKPLACES, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[SLFILTER_HIDEQUAKEWORLD]) Master_SetMaskInteger(false, SLKEY_BASEGAME, SS_QUAKEWORLD, SLIST_TEST_NOTEQUAL);
|
||||
}
|
||||
if (info->filter[3]) Master_SetMaskInteger(false, SLKEY_FLAGS, SS_PROXY, SLIST_TEST_NOTCONTAIN);
|
||||
if (!info->filter[5]) Master_SetMaskInteger(false, SLKEY_FLAGS, SS_FAVORITE, SLIST_TEST_CONTAINS);
|
||||
if (info->filter[6]) Master_SetMaskInteger(false, SLKEY_NUMHUMANS, 0, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[7]) Master_SetMaskInteger(false, SLKEY_FREEPLAYERS, 0, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[SLFILTER_HIDEPROXIES]) Master_SetMaskInteger(false, SLKEY_FLAGS, SS_PROXY, SLIST_TEST_NOTCONTAIN);
|
||||
if (!info->filter[SLFILTER_ONLYFAVOURITES]) Master_SetMaskInteger(false, SLKEY_FLAGS, SS_FAVORITE, SLIST_TEST_CONTAINS);
|
||||
if (info->filter[SLFILTER_HIDEEMPTY]) Master_SetMaskInteger(false, SLKEY_NUMHUMANS, 0, SLIST_TEST_NOTEQUAL);
|
||||
if (info->filter[SLFILTER_HIDEFULL]) Master_SetMaskInteger(false, SLKEY_FREEPLAYERS, 0, SLIST_TEST_NOTEQUAL);
|
||||
|
||||
if (*sb_filtertext.string) Master_SetMaskString(false, SLKEY_NAME, sb_filtertext.string, SLIST_TEST_CONTAINS);
|
||||
|
||||
|
@ -1079,16 +1090,13 @@ static qboolean SL_ReFilter (menucheck_t *option, emenu_t *menu, chk_set_t set)
|
|||
case CHK_CHECKED:
|
||||
return !info->filter[option->bits];
|
||||
case CHK_TOGGLE:
|
||||
if (option->bits>0)
|
||||
{
|
||||
info->filter[option->bits] ^= 1;
|
||||
Cvar_Set(&sb_hidenetquake, info->filter[1]?"1":"0");
|
||||
Cvar_Set(&sb_hidequakeworld, info->filter[2]?"1":"0");
|
||||
Cvar_Set(&sb_hideproxies, info->filter[3]?"1":"0");
|
||||
info->filter[option->bits] ^= 1;
|
||||
Cvar_Set(&sb_hidenetquake, info->filter[SLFILTER_HIDENETQUAKE]?"1":"0");
|
||||
Cvar_Set(&sb_hidequakeworld, info->filter[SLFILTER_HIDEQUAKEWORLD]?"1":"0");
|
||||
Cvar_Set(&sb_hideproxies, info->filter[SLFILTER_HIDEPROXIES]?"1":"0");
|
||||
|
||||
Cvar_Set(&sb_hideempty, info->filter[6]?"1":"0");
|
||||
Cvar_Set(&sb_hidefull, info->filter[7]?"1":"0");
|
||||
}
|
||||
Cvar_Set(&sb_hideempty, info->filter[SLFILTER_HIDEEMPTY]?"1":"0");
|
||||
Cvar_Set(&sb_hidefull, info->filter[SLFILTER_HIDEFULL]?"1":"0");
|
||||
|
||||
CalcFilters(menu);
|
||||
|
||||
|
@ -1102,11 +1110,11 @@ static void SL_Remove (emenu_t *menu)
|
|||
{
|
||||
serverlist_t *info = (serverlist_t*)(menu + 1);
|
||||
|
||||
Cvar_Set(&sb_hidenetquake, info->filter[1]?"1":"0");
|
||||
Cvar_Set(&sb_hidequakeworld, info->filter[2]?"1":"0");
|
||||
Cvar_Set(&sb_hideproxies, info->filter[3]?"1":"0");
|
||||
Cvar_Set(&sb_hideempty, info->filter[6]?"1":"0");
|
||||
Cvar_Set(&sb_hidefull, info->filter[7]?"1":"0");
|
||||
Cvar_Set(&sb_hidenetquake, info->filter[SLFILTER_HIDENETQUAKE]?"1":"0");
|
||||
Cvar_Set(&sb_hidequakeworld, info->filter[SLFILTER_HIDEQUAKEWORLD]?"1":"0");
|
||||
Cvar_Set(&sb_hideproxies, info->filter[SLFILTER_HIDEPROXIES]?"1":"0");
|
||||
Cvar_Set(&sb_hideempty, info->filter[SLFILTER_HIDEEMPTY]?"1":"0");
|
||||
Cvar_Set(&sb_hidefull, info->filter[SLFILTER_HIDEFULL]?"1":"0");
|
||||
}
|
||||
|
||||
static qboolean SL_DoRefresh (menuoption_t *opt, emenu_t *menu, int key)
|
||||
|
@ -1205,25 +1213,25 @@ void M_Menu_ServerList2_f(void)
|
|||
#ifdef NQPROT
|
||||
if (M_GameType() == MGT_QUAKE1)
|
||||
{
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*1, "Show NQ ", SL_ReFilter, 1);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*2, "Show QW ", SL_ReFilter, 2);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*1, "Show NQ ", SL_ReFilter, SLFILTER_HIDENETQUAKE);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*2, "Show QW ", SL_ReFilter, SLFILTER_HIDEQUAKEWORLD);
|
||||
}
|
||||
#endif
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*3, "Show Proxies", SL_ReFilter, 3);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*3, "Show Proxies", SL_ReFilter, SLFILTER_HIDEPROXIES);
|
||||
info->filtertext =
|
||||
MC_AddEditCvar (menu, 128, 200, vid.height - 64+8*4, "Filter ", sb_filtertext.name, true);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*5, "Only Favs ", SL_ReFilter, 5);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*6, "Show Empty", SL_ReFilter, 6);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*7, "Show Full ", SL_ReFilter, 7);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*5, "Only Favs ", SL_ReFilter, SLFILTER_ONLYFAVOURITES);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*6, "Show Empty", SL_ReFilter, SLFILTER_HIDEEMPTY);
|
||||
MC_AddCheckBoxFunc(menu, 128, 208, vid.height - 64+8*7, "Show Full ", SL_ReFilter, SLFILTER_HIDEFULL);
|
||||
|
||||
MC_AddCommand(menu, 64, 320, 0, info->refreshtext, SL_DoRefresh);
|
||||
|
||||
info->filter[1] = !!sb_hidenetquake.value;
|
||||
info->filter[2] = !!sb_hidequakeworld.value;
|
||||
info->filter[3] = !!sb_hideproxies.value;
|
||||
info->filter[5] = true;//!sb_showonlyfavourites.value;
|
||||
info->filter[6] = !!sb_hideempty.value;
|
||||
info->filter[7] = !!sb_hidefull.value;
|
||||
info->filter[SLFILTER_HIDENETQUAKE] = !!sb_hidenetquake.value;
|
||||
info->filter[SLFILTER_HIDEQUAKEWORLD] = !!sb_hidequakeworld.value;
|
||||
info->filter[SLFILTER_HIDEPROXIES] = !!sb_hideproxies.value;
|
||||
info->filter[SLFILTER_ONLYFAVOURITES] = true;//!sb_showonlyfavourites.value;
|
||||
info->filter[SLFILTER_HIDEEMPTY] = !!sb_hideempty.value;
|
||||
info->filter[SLFILTER_HIDEFULL] = !!sb_hidefull.value;
|
||||
|
||||
info->mappic = (menupicture_t *)MC_AddPicture(menu, vid.width - 64, vid.height - 64, 64, 64, "012345678901234567890123456789012");
|
||||
|
||||
|
|
|
@ -888,6 +888,14 @@ char *Master_ServerToString (char *s, int len, serverinfo_t *a)
|
|||
return NET_AdrToString(s, len, &a->adr);
|
||||
}
|
||||
|
||||
static int Master_BaseGame(serverinfo_t *a)
|
||||
{
|
||||
int prot = a->special&SS_PROTOCOLMASK;
|
||||
if (prot == SS_DARKPLACES && (a->special&SS_FTESERVER))
|
||||
prot = SS_QUAKEWORLD;
|
||||
return prot;
|
||||
}
|
||||
|
||||
static qboolean Master_ServerIsGreater(serverinfo_t *a, serverinfo_t *b)
|
||||
{
|
||||
if (sort_categories)
|
||||
|
@ -923,9 +931,8 @@ static qboolean Master_ServerIsGreater(serverinfo_t *a, serverinfo_t *b)
|
|||
}
|
||||
return false;
|
||||
|
||||
break;
|
||||
case SLKEY_BASEGAME:
|
||||
return Master_CompareInteger(a->special&SS_PROTOCOLMASK, b->special&SS_PROTOCOLMASK, SLIST_TEST_LESS);
|
||||
return Master_CompareInteger(Master_BaseGame(a), Master_BaseGame(b), SLIST_TEST_LESS);
|
||||
case SLKEY_FLAGS:
|
||||
return Master_CompareInteger(a->special&~SS_PROTOCOLMASK, b->special&~SS_PROTOCOLMASK, SLIST_TEST_LESS);
|
||||
case SLKEY_CUSTOM:
|
||||
|
@ -1037,7 +1044,7 @@ qboolean Master_PassesMasks(serverinfo_t *a)
|
|||
break;
|
||||
|
||||
case SLKEY_BASEGAME:
|
||||
res = Master_CompareInteger(a->special&SS_PROTOCOLMASK, visrules[i].operandi, visrules[i].compareop);
|
||||
res = Master_CompareInteger(Master_BaseGame(a), visrules[i].operandi, visrules[i].compareop);
|
||||
break;
|
||||
case SLKEY_FLAGS:
|
||||
res = Master_CompareInteger(a->special&~SS_PROTOCOLMASK, visrules[i].operandi, visrules[i].compareop);
|
||||
|
@ -1216,7 +1223,7 @@ float Master_ReadKeyFloat(serverinfo_t *server, hostcachekey_t keynum)
|
|||
case SLKEY_FREEPLAYERS:
|
||||
return server->maxplayers - server->players;
|
||||
case SLKEY_BASEGAME:
|
||||
return server->special&SS_PROTOCOLMASK;
|
||||
return Master_BaseGame(server);
|
||||
case SLKEY_FLAGS:
|
||||
return server->special&~SS_PROTOCOLMASK;
|
||||
case SLKEY_TIMELIMIT:
|
||||
|
@ -3166,8 +3173,10 @@ int CL_ReadServerInfo(char *msg, enum masterprotocol_e prototype, qboolean favor
|
|||
info->special |= SS_QUAKE2; //q2 has a range!
|
||||
else if (info->protocol > 60)
|
||||
info->special |= SS_QUAKE3;
|
||||
else
|
||||
else if (!strcmp(Info_ValueForKey(msg, "gamename"), "DarkPlaces-Quake"))
|
||||
info->special |= SS_DARKPLACES;
|
||||
else
|
||||
info->special |= SS_DARKPLACES|SS_FTESERVER; //so its listed under qw-servers (but queried using dpmaster getinfo stuff).
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1224,7 +1224,7 @@ qboolean Sys_RandomBytes(qbyte *string, int len)
|
|||
return res;
|
||||
}
|
||||
|
||||
#ifdef WEBCLIENT
|
||||
#ifdef MANIFESTDOWNLOADS
|
||||
qboolean Sys_RunInstaller(void)
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -569,6 +569,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define VM_ANY
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_CLIENT) || defined(HAVE_SERVER)) && defined(WEBCLIENT)
|
||||
#define MANIFESTDOWNLOADS
|
||||
#endif
|
||||
|
||||
#if (defined(D3D8QUAKE) || defined(D3D9QUAKE) || defined(D3D11QUAKE)) && !defined(D3DQUAKE)
|
||||
#define D3DQUAKE //shouldn't still matter
|
||||
#endif
|
||||
|
|
|
@ -12,10 +12,6 @@
|
|||
#include "winquake.h"
|
||||
#endif
|
||||
|
||||
#if (defined(HAVE_CLIENT) || defined(HAVE_SERVER)) && defined(WEBCLIENT)
|
||||
#define MANIFESTDOWNLOADS
|
||||
#endif
|
||||
|
||||
void FS_BeginManifestUpdates(void);
|
||||
static void QDECL fs_game_callback(cvar_t *var, char *oldvalue);
|
||||
static void COM_InitHomedir(ftemanifest_t *man);
|
||||
|
|
|
@ -6040,7 +6040,7 @@ void SV_Init (quakeparms_t *parms)
|
|||
|
||||
Menu_Download_Update();
|
||||
|
||||
#ifdef WEBCLIENT
|
||||
#ifdef MANIFESTDOWNLOADS
|
||||
if (Sys_RunInstaller())
|
||||
Sys_Quit();
|
||||
#endif
|
||||
|
|
|
@ -1233,7 +1233,7 @@ qboolean Sys_RandomBytes(qbyte *string, int len)
|
|||
return res;
|
||||
}
|
||||
|
||||
#ifdef WEBCLIENT
|
||||
#ifdef MANIFESTDOWNLOADS
|
||||
#include "fs.h"
|
||||
static qboolean Sys_DoInstall(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue