diff --git a/src/sv_main.c b/src/sv_main.c index 7bf151f0..77477c59 100644 --- a/src/sv_main.c +++ b/src/sv_main.c @@ -194,6 +194,10 @@ cvar_t sv_pext_mvdsv_serversideweapon = { "sv_pext_mvdsv_serversideweapon", "1" cvar_t sv_extlimits = { "sv_extlimits", "2" }; +#if defined(FTE_PEXT_TRANS) +cvar_t sv_pext_ezquake_verfortrans = {"pext_ezquake_verfortrans", "7814", CVAR_NONE}; +#endif + qbool sv_error = false; client_t *WatcherId = NULL; // QW262 @@ -3507,6 +3511,10 @@ void SV_InitLocal (void) Cvar_Register (&sv_pext_mvdsv_serversideweapon); #endif +#ifdef FTE_PEXT_TRANS + Cvar_Register(&sv_pext_ezquake_verfortrans); +#endif + Cvar_Register (&sv_reliable_sound); Cvar_Register(&qws_name); diff --git a/src/sv_user.c b/src/sv_user.c index 71f6d70d..79da10e3 100644 --- a/src/sv_user.c +++ b/src/sv_user.c @@ -352,6 +352,33 @@ static void Cmd_New_f (void) } #endif +#if defined(FTE_PEXT_TRANS) + if (sv_client->fteprotocolextensions & FTE_PEXT_TRANS) + { + const char *client_string = Info_Get(&sv_client->_userinfo_ctx_, "*client"); + char *ptr = strchr(client_string, ' '); + if (ptr != NULL) { + ptr++; + if (strncmp(client_string, "ezQuake", 7) == 0 && *ptr != '\0') + { + extern cvar_t sv_pext_ezquake_verfortrans; + char *endptr; + long revision = strtol(ptr, &endptr, 10); + if (*endptr != '\0' || (revision > 0 && revision < sv_pext_ezquake_verfortrans.value)) + { + SV_ClientPrintf(sv_client, PRINT_HIGH, "\n\nWARNING:\n" + "Alpha support disabled due to buggy client, " + "if the map contains transparency you may be at a disadvantage.\n" + "Please upgrade to one of the following:\n" + "> ezQuake (https://www.ezquake.com)\n" + "> FTEQW (http://fte.triptohell.info/)\n"); + sv_client->fteprotocolextensions &= ~FTE_PEXT_TRANS; + } + } + } + } +#endif + //NOTE: This doesn't go through ClientReliableWrite since it's before the user //spawns. These functions are written to not overflow if (sv_client->num_backbuf)