diff --git a/CMakeLists.txt b/CMakeLists.txt index 739136b1..c18cf45e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ option(BUILD_SERVER "Disable this if you don't want to build the server library" option(BUILD_CLIENT "Enable this if you want to build the client library" OFF) option(BUILD_PLUGINS "Build everything in the plugins/ folder") option(UPDATE_PLUGINS "Discard local changes and update everything in the plugins/ folder") +option(REHLDS_BUILD "Build a server library for use with ReHLDS (server crashes instantly if this is set incorrectly)") option(SETUP_IDE "Install binaries to the game folder") set(SERVER_WORK_DIR "C:/Games/hlds/steamapps/common/Half-Life" CACHE STRING "Path to your server root folder") diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index fc15fcac..159a0c5e 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -653,6 +653,10 @@ target_include_directories(${SERVER_DLL_NAME} PRIVATE monster) target_compile_definitions(${SERVER_DLL_NAME} PRIVATE -DQUIVER -DVOXEL -DQUAKE2 -DVALVE_DLL -DCLIENT_WEAPONS -D_CRT_SECURE_NO_DEPRECATE) +if (INCREASED_SERVER_LIMITS) + target_compile_definitions(${SERVER_DLL_NAME} PRIVATE -DINCREASED_SERVER_LIMITS) +endif() + if(UNIX) set(ASAN_OPTS "") if (ASAN) diff --git a/pm_shared/pm_defs.h b/pm_shared/pm_defs.h index 46a1cec9..b82d7cb1 100644 --- a/pm_shared/pm_defs.h +++ b/pm_shared/pm_defs.h @@ -19,10 +19,10 @@ #include "archtypes.h" // DAL -#ifdef CLIENT_DLL -#define MAX_PHYSENTS 600 // Must have room for all entities in the world. Must match client engine or else instacrash. +#if defined(INCREASED_SERVER_LIMITS) && !defined(CLIENT_DLL) +#define MAX_PHYSENTS 2048 // Must match rehlds or else instacrash. #else -#define MAX_PHYSENTS 2048 // Must match rehlds or else the server crashes instantly. +#define MAX_PHYSENTS 600 // Must have room for all entities in the world. Must match client engine or else instacrash. #endif #define MAX_MOVEENTS 64 diff --git a/rehlds b/rehlds index 7ea790cd..c84acd94 160000 --- a/rehlds +++ b/rehlds @@ -1 +1 @@ -Subproject commit 7ea790cdf92dceeb22068a0f4b8d07405657658c +Subproject commit c84acd94b4b495749498cc5c3eff667cbb43f93e diff --git a/scripts/build_game.bat b/scripts/build_game.bat index 0bb242c8..1c1278a4 100644 --- a/scripts/build_game.bat +++ b/scripts/build_game.bat @@ -1,13 +1,13 @@ -@echo off -cls - -:: run from the location of this script -cd %~dp0 -cd .. - -mkdir build -cd build -cmake -A Win32 -DBUILD_SERVER=ON .. -cmake --build . --config Release - +@echo off +cls + +:: run from the location of this script +cd %~dp0 +cd .. + +mkdir build +cd build +cmake -A Win32 -DBUILD_SERVER=ON -DINCREASED_SERVER_LIMITS=OFF .. +cmake --build . --config Release + echo. \ No newline at end of file diff --git a/scripts/build_game.sh b/scripts/build_game.sh index c3b4022d..4112ef9c 100644 --- a/scripts/build_game.sh +++ b/scripts/build_game.sh @@ -8,5 +8,5 @@ cd .. rm -rf build mkdir build cd build -cmake -DBUILD_SERVER=ON .. +cmake -DBUILD_SERVER=ON -DINCREASED_SERVER_LIMITS=OFF .. cmake --build . --config Release diff --git a/scripts/build_game_and_plugins.bat b/scripts/build_game_and_plugins.bat index 90886948..2f1f9a51 100644 --- a/scripts/build_game_and_plugins.bat +++ b/scripts/build_game_and_plugins.bat @@ -1,14 +1,14 @@ -@echo off -cls - -:: run from the location of this script -cd %~dp0 -cd .. - -mkdir build -cd build -cmake -A Win32 -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON -DUPDATE_PLUGINS=ON .. -cmake --build . --config Release - -echo. +@echo off +cls + +:: run from the location of this script +cd %~dp0 +cd .. + +mkdir build +cd build +cmake -A Win32 -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON -DUPDATE_PLUGINS=ON -DINCREASED_SERVER_LIMITS=OFF .. +cmake --build . --config Release + +echo. pause \ No newline at end of file diff --git a/scripts/build_game_and_plugins.sh b/scripts/build_game_and_plugins.sh index 072d0cbe..a1b7dba4 100644 --- a/scripts/build_game_and_plugins.sh +++ b/scripts/build_game_and_plugins.sh @@ -8,5 +8,5 @@ cd .. rm -rf build mkdir build cd build -cmake -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON -DUPDATE_PLUGINS=ON .. +cmake -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON -DUPDATE_PLUGINS=ON -DINCREASED_SERVER_LIMITS=OFF .. cmake --build . --config Release diff --git a/scripts/msvc_setup.bat b/scripts/msvc_setup.bat index d6bbc4d7..3c8e3df9 100644 --- a/scripts/msvc_setup.bat +++ b/scripts/msvc_setup.bat @@ -1,13 +1,13 @@ -@echo off -cls - -:: run from the location of this script -cd %~dp0 -cd .. - -mkdir msvc -cd msvc -cmake -A Win32 -DBUILD_CLIENT=ON -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON -DSETUP_IDE=ON .. -cmake-gui - +@echo off +cls + +:: run from the location of this script +cd %~dp0 +cd .. + +mkdir msvc +cd msvc +cmake -A Win32 -DBUILD_CLIENT=ON -DBUILD_SERVER=ON -DBUILD_PLUGINS=ON -DSETUP_IDE=ON -DINCREASED_SERVER_LIMITS=OFF .. +cmake-gui + echo. \ No newline at end of file