diff --git a/README.md b/README.md index 69a8103..85d6b43 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Bugfixed version of rehlds contains an additional cvars:
  • sv_rehlds_movecmdrate_avg_punish // Time in minutes for which the player will be banned (0 - Permanent, use a negative number for a kick). Default: 5
  • sv_rehlds_movecmdrate_max_burst // Max burst level of 'move' cmds for ban. Default: 2500
  • sv_rehlds_movecmdrate_burst_punish // Time in minutes for which the player will be banned (0 - Permanent, use a negative number for a kick). Default: 5 +
  • sv_rehlds_send_mapcycle <1|0> // Send mapcycle.txt in serverinfo message (HLDS behavior, but it is unused on the client). Default: 0
  • sv_rehlds_stringcmdrate_max_avg // Max average level of 'string' cmds for ban. Default: 80
  • sv_rehlds_stringcmdrate_avg_punish // Time in minutes for which the player will be banned (0 - Permanent, use a negative number for a kick). Default: 5
  • sv_rehlds_stringcmdrate_max_burst // Max burst level of 'string' cmds for ban. Default: 400 diff --git a/msvc/ReHLDS.sln b/msvc/ReHLDS.sln index 498b7ed..7af60dc 100644 --- a/msvc/ReHLDS.sln +++ b/msvc/ReHLDS.sln @@ -23,6 +23,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gradle", "gradle", "{FFC337 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dedicated", "..\rehlds\dedicated\msvc\dedicated.vcxproj", "{D49883F3-5C5C-4B9F-B9C7-B31518F228D4}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D2516ABB-21F2-4393-8CC9-2BD2D3316CD6}" + ProjectSection(SolutionItems) = preProject + ..\README.md = ..\README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Play|Win32 = Debug Play|Win32 diff --git a/rehlds/engine/server.h b/rehlds/engine/server.h index 7e93c96..232c4b9 100644 --- a/rehlds/engine/server.h +++ b/rehlds/engine/server.h @@ -530,6 +530,7 @@ extern cvar_t sv_rcon_condebug; extern cvar_t sv_rehlds_userinfo_transmitted_fields; extern cvar_t sv_rehlds_attachedentities_playeranimationspeed_fix; extern cvar_t sv_rehlds_local_gametime; +extern cvar_t sv_rehlds_send_mapcycle; #endif extern int sv_playermodel; diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index a743f52..85d4f36 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -312,6 +312,7 @@ cvar_t sv_rcon_condebug = { "sv_rcon_condebug", "1", 0, 1.0f, nullptr }; cvar_t sv_rehlds_userinfo_transmitted_fields = { "sv_rehlds_userinfo_transmitted_fields", "", 0, 0.0f, nullptr }; cvar_t sv_rehlds_attachedentities_playeranimationspeed_fix = {"sv_rehlds_attachedentities_playeranimationspeed_fix", "0", 0, 0.0f, nullptr}; cvar_t sv_rehlds_local_gametime = {"sv_rehlds_local_gametime", "0", 0, 0.0f, nullptr}; +cvar_t sv_rehlds_send_mapcycle = { "sv_rehlds_send_mapcycle", "0", 0, 0.0f, nullptr }; #endif delta_t *SV_LookupDelta(char *name) @@ -1219,23 +1220,34 @@ void SV_SendServerinfo_internal(sizebuf_t *msg, client_t *client) MSG_WriteString(msg, Cvar_VariableString("hostname")); MSG_WriteString(msg, g_psv.modelname); - int len = 0; - unsigned char *mapcyclelist = COM_LoadFileForMe(mapcyclefile.string, &len); #ifdef REHLDS_FIXES - if (mapcyclelist && len) + if (sv_rehlds_send_mapcycle.value) { - MSG_WriteString(msg, (const char *)mapcyclelist); + int len = 0; + unsigned char *mapcyclelist = COM_LoadFileForMe(mapcyclefile.string, &len); + if (mapcyclelist && len) + { + // Trim to 8190 (see MSG_ReadString, also 1 less than expected - see READ_STRING in HLSDK), otherwise client will be unable to parse message + mapcyclelist[8190] = 0; + MSG_WriteString(msg, (const char *)mapcyclelist); + } + else + { + MSG_WriteString(msg, "mapcycle failure"); + } + // FIXED: Mem leak. + if (mapcyclelist) + { + COM_FreeFile(mapcyclelist); + } } else { - MSG_WriteString(msg, "mapcycle failure"); - } - // FIXED: Mem leak. - if (mapcyclelist) - { - COM_FreeFile(mapcyclelist); + MSG_WriteString(msg, ""); } #else // REHLDS_FIXES + int len = 0; + unsigned char *mapcyclelist = COM_LoadFileForMe(mapcyclefile.string, &len); if (mapcyclelist && len) { MSG_WriteString(msg, (const char *)mapcyclelist); @@ -1246,6 +1258,8 @@ void SV_SendServerinfo_internal(sizebuf_t *msg, client_t *client) MSG_WriteString(msg, "mapcycle failure"); } #endif // REHLDS_FIXES + + // isVAC2Secure MSG_WriteByte(msg, 0); MSG_WriteByte(msg, svc_sendextrainfo); @@ -7905,6 +7919,7 @@ void SV_Init(void) Cvar_RegisterVariable(&sv_rehlds_userinfo_transmitted_fields); Cvar_RegisterVariable(&sv_rehlds_attachedentities_playeranimationspeed_fix); Cvar_RegisterVariable(&sv_rehlds_local_gametime); + Cvar_RegisterVariable(&sv_rehlds_send_mapcycle); #endif for (int i = 0; i < MAX_MODELS; i++)