From 96b2ef2727d3d3ed07db641874fd1c5d56db44f5 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 28 Mar 2025 01:44:41 +0700 Subject: [PATCH 01/29] Update build.yml --- .github/workflows/build.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e62c178e..8217211f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,9 @@ jobs: buildTests: 'Tests' steps: + - name: Configure + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Checkout uses: actions/checkout@v4 with: @@ -105,11 +108,6 @@ jobs: container: debian:11-slim steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install dependencies run: | dpkg --add-architecture i386 @@ -121,6 +119,15 @@ jobs: git cmake rsync \ g++ gcc + - name: Configure + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Build and Run unittests run: | rm -rf build && CC=gcc CXX=g++ cmake -DCMAKE_BUILD_TYPE=Unittests -B build && cmake --build build -j8 From b59bbb1c83f6a1def9ef856002cf1b581936ddbd Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 28 Mar 2025 01:03:52 +0300 Subject: [PATCH 02/29] CMake improvements, add 64-bit support for use in Xash3D FWGS (#1053) * cmake: do not strip debuginfo during link if DEBUG was enabled * cmake: use compiler id instead of env checks to determine Intel compiler or Clang * cmake: introduce XASH_COMPAT option, which will let regamedll to be built for 64-bit and non-x86 targets * cmake: add LibraryNaming module from hlsdk-portable repository and platform detection header * cmake: now, integrate LibraryNaming into regamedll CMakeLists file. Disable x86 options on non-x86 platforms * server: add support for 64-bit ABI used in Xash3D FWGS --- regamedll/CMakeLists.txt | 94 +++++++--- regamedll/cmake/LibraryNaming.cmake | 198 ++++++++++++++++++++ regamedll/dlls/qstring.h | 35 +++- regamedll/public/build.h | 269 ++++++++++++++++++++++++++++ 4 files changed, 565 insertions(+), 31 deletions(-) create mode 100644 regamedll/cmake/LibraryNaming.cmake create mode 100644 regamedll/public/build.h diff --git a/regamedll/CMakeLists.txt b/regamedll/CMakeLists.txt index bc0a990e..c1a13f9b 100644 --- a/regamedll/CMakeLists.txt +++ b/regamedll/CMakeLists.txt @@ -20,20 +20,47 @@ cmake_minimum_required(VERSION 3.1) project(regamedll CXX) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + option(DEBUG "Build with debug information." OFF) option(USE_STATIC_LIBSTDC "Enables static linking libstdc++." OFF) option(USE_LEGACY_LIBC "Enables linking against legacy libc (<= 2.15) for compat with older distros (Debian 8/Ubuntu 16.04/Centos 7)." OFF) +option(XASH_COMPAT "Enable Xash3D FWGS compatiblity (support for it's 64-bit ABI support and crossplatform library suffix)") set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Avoid -rdynamic -fPIC options -set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") -set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") +if (NOT XASH_COMPAT) + set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") + set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") +endif() -set(COMPILE_FLAGS "-m32 -U_FORTIFY_SOURCE") -set(LINK_FLAGS "-m32 -s") -set(LINK_LIBS dl aelf32) +set(COMPILE_FLAGS "-U_FORTIFY_SOURCE") +set(LINK_LIBS dl) + +# do not strip debuginfo during link +if (NOT DEBUG) + set(LINK_FLAGS "-s") +endif() + +# add -m32 flag only on 64-bit systems, if building for 64-bit wasn't enabled with XASH_COMPAT +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + if (XASH_COMPAT) + set(COMPILE_FLAGS "${COMPILE_FLAGS} -DXASH_64BIT") + else() + set(COMPILE_FLAGS "${COMPILE_FLAGS} -m32") + set(LINK_FLAGS "${LINK_FLAGS} -m32") + list(APPEND LINK_LIBS aelf32) + set(CMAKE_SIZEOF_VOID_P 4) + endif() +endif() + +if(XASH_COMPAT) + # Xash3D FWGS Library Naming Scheme compliance + # see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/extensions/library-naming.md + include(LibraryNaming) +endif() set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wall -fno-exceptions -fno-builtin -Wno-unknown-pragmas") @@ -47,7 +74,7 @@ else() endif() # Check Intel C++ compiler -if ("$ENV{CXX}" MATCHES "icpc") +if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") # # -fp-model=precise # ICC uses -fp-model fast=1 by default for more aggressive optimizations on floating-point calculations @@ -75,11 +102,15 @@ if ("$ENV{CXX}" MATCHES "icpc") set(COMPILE_FLAGS "${COMPILE_FLAGS} -ipo") set(LINK_FLAGS "${LINK_FLAGS} -ipo") endif() -else() - # Produce code optimized for the most common IA32/AMD64/EM64T processors. - # As new processors are deployed in the marketplace, the behavior of this option will change. +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if (NOT XASH_COMPAT OR XASH_AMD64 OR XASH_X86) + # Produce code optimized for the most common IA32/AMD64/EM64T processors. + # As new processors are deployed in the marketplace, the behavior of this option will change. + set(COMPILE_FLAGS "${COMPILE_FLAGS} \ + -mtune=generic -msse3") + endif() + set(COMPILE_FLAGS "${COMPILE_FLAGS} \ - -mtune=generic -msse3\ -fpermissive -fno-sized-deallocation\ -Wno-delete-non-virtual-dtor -Wno-invalid-offsetof\ -Wno-unused-variable -Wno-unused-value -Wno-unused-result -Wno-unused-function\ @@ -87,7 +118,7 @@ else() -Wno-sign-compare -Wno-format -Wno-ignored-attributes -Wno-strict-aliasing") # Check Clang compiler - if ("$ENV{CXX}" MATCHES "clang") + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(COMPILE_FLAGS "${COMPILE_FLAGS} \ -Wno-unused-local-typedef\ -Wno-unused-private-field\ @@ -102,16 +133,11 @@ else() # GCC >= 8.3 if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) - set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-stringop-truncation -Wno-format-truncation -Wno-class-memaccess") + set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-stringop-truncation -Wno-format-truncation -Wno-class-memaccess -fcf-protection=none") endif() endif() endif() -# GCC >= 8.3 -if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0) - set(COMPILE_FLAGS "${COMPILE_FLAGS} -fcf-protection=none") -endif() - if (NOT DEBUG) set(LINK_FLAGS "${LINK_FLAGS} \ -Wl,-gc-sections -Wl,--version-script=\"${PROJECT_SOURCE_DIR}/../version_script.lds\"") @@ -378,14 +404,36 @@ if (USE_STATIC_LIBSTDC) set(LINK_FLAGS "${LINK_FLAGS} -static-libgcc -static-libstdc++") endif() -set(LINK_FLAGS "${LINK_FLAGS} \ - -Wl,-rpath,'$ORIGIN/.' \ - -L${PROJECT_SOURCE_DIR}/lib/linux32") +set(LINK_FLAGS "${LINK_FLAGS} -Wl,-rpath,'$ORIGIN/.'") + +if (CMAKE_SIZEOF_VOID_P EQUAL 4) + set(LINK_FLAGS "${LINK_FLAGS} -L${PROJECT_SOURCE_DIR}/lib/linux32") +endif() set_target_properties(regamedll PROPERTIES - OUTPUT_NAME cs - PREFIX "" COMPILE_FLAGS ${COMPILE_FLAGS} LINK_FLAGS ${LINK_FLAGS} - POSITION_INDEPENDENT_CODE OFF ) + +if (XASH_COMPAT) + if (CMAKE_SYSTEM_NAME STREQUAL "Android") + set_target_properties(regamedll PROPERTIES + OUTPUT_NAME server) + else() + set_target_properties(regamedll PROPERTIES + PREFIX "" + OUTPUT_NAME cs${POSTFIX}) + endif() +else() + set_target_properties(regamedll PROPERTIES + OUTPUT_NAME cs + PREFIX "" + POSITION_INDEPENDENT_CODE OFF) +endif() + +install(TARGETS regamedll + RUNTIME DESTINATION "cstrike/dlls/" + LIBRARY DESTINATION "cstrike/dlls/" + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) diff --git a/regamedll/cmake/LibraryNaming.cmake b/regamedll/cmake/LibraryNaming.cmake new file mode 100644 index 00000000..a20529ae --- /dev/null +++ b/regamedll/cmake/LibraryNaming.cmake @@ -0,0 +1,198 @@ +include(CheckSymbolExists) + +macro(check_build_target symbol) + check_symbol_exists(${symbol} "build.h" ${symbol}) +endmacro() + +macro(check_group_build_target symbol group) + if(NOT ${group}) + check_build_target(${symbol}) + if(${symbol}) + set(${group} TRUE) + endif() + else() + set(${symbol} FALSE) + endif() +endmacro() + +# So there is a problem: +# 1. Number of these symbols only grows, as we support more and more ports +# 2. CMake was written by morons and can't check these symbols in parallel +# 3. MSVC is very slow at everything (startup, parsing, generating error) + +# Solution: group these symbols and set variable if one of them was found +# this way we can reorder to reorder them by most common configurations +# but we can't generate this list anymore! ... OR IS IT ??? + +# Well, after reordering positions in engine's buildenums.h, we can partially autogenerate this list! +# echo "check_build_target(XASH_64BIT)" +# grep "#define PLATFORM" buildenums.h | cut -d' ' -f 2 | cut -d_ -f 2- | awk '{ print "check_group_build_target(XASH_" $1 " XASH_PLATFORM)" }' +# grep "#define ARCHITECTURE" buildenums.h | cut -d' ' -f 2 | cut -d_ -f 2- | awk '{ print "check_group_build_target(XASH_" $1 " XASH_ARCHITECTURE)" +# grep "#define ENDIAN" buildenums.h | cut -d' ' -f 2 | cut -d_ -f 2- | awk '{ print "check_group_build_target(XASH_" $1 "_ENDIAN XASH_ENDIANNESS)"}' +# echo "if(XASH_ARM)" +# grep '^#undef XASH' build.h | grep "XASH_ARM[v_]" | awk '{ print "check_build_target(" $2 ")"}' +# echo "endif()" +# echo "if(XASH_RISCV)" +# grep '^#undef XASH' build.h | grep "XASH_RISCV_" | awk '{ print "check_build_target(" $2 ")"}' +# echo "endif()" + +# NOTE: Android must have priority over Linux to work correctly! + +set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/") +check_build_target(XASH_64BIT) +check_group_build_target(XASH_WIN32 XASH_PLATFORM) +check_group_build_target(XASH_ANDROID XASH_PLATFORM) +check_group_build_target(XASH_LINUX XASH_PLATFORM) +check_group_build_target(XASH_FREEBSD XASH_PLATFORM) +check_group_build_target(XASH_APPLE XASH_PLATFORM) +check_group_build_target(XASH_NETBSD XASH_PLATFORM) +check_group_build_target(XASH_OPENBSD XASH_PLATFORM) +check_group_build_target(XASH_EMSCRIPTEN XASH_PLATFORM) +check_group_build_target(XASH_DOS4GW XASH_PLATFORM) +check_group_build_target(XASH_HAIKU XASH_PLATFORM) +check_group_build_target(XASH_SERENITY XASH_PLATFORM) +check_group_build_target(XASH_IRIX XASH_PLATFORM) +check_group_build_target(XASH_NSWITCH XASH_PLATFORM) +check_group_build_target(XASH_PSVITA XASH_PLATFORM) +check_group_build_target(XASH_WASI XASH_PLATFORM) +check_group_build_target(XASH_SUNOS XASH_PLATFORM) +check_group_build_target(XASH_X86 XASH_ARCHITECTURE) +check_group_build_target(XASH_AMD64 XASH_ARCHITECTURE) +check_group_build_target(XASH_ARM XASH_ARCHITECTURE) +check_group_build_target(XASH_MIPS XASH_ARCHITECTURE) +check_group_build_target(XASH_PPC XASH_ARCHITECTURE) +check_group_build_target(XASH_JS XASH_ARCHITECTURE) +check_group_build_target(XASH_E2K XASH_ARCHITECTURE) +check_group_build_target(XASH_RISCV XASH_ARCHITECTURE) +check_group_build_target(XASH_LITTLE_ENDIAN XASH_ENDIANNESS) +check_group_build_target(XASH_BIG_ENDIAN XASH_ENDIANNESS) +if(XASH_ARM) +check_build_target(XASH_ARM_HARDFP) +check_build_target(XASH_ARM_SOFTFP) +check_build_target(XASH_ARMv4) +check_build_target(XASH_ARMv5) +check_build_target(XASH_ARMv6) +check_build_target(XASH_ARMv7) +check_build_target(XASH_ARMv8) +endif() +if(XASH_RISCV) +check_build_target(XASH_RISCV_DOUBLEFP) +check_build_target(XASH_RISCV_SINGLEFP) +check_build_target(XASH_RISCV_SOFTFP) +endif() +unset(CMAKE_REQUIRED_INCLUDES) + +# engine/common/build.c +if(XASH_ANDROID) + set(BUILDOS "android") +elseif(XASH_WIN32 OR XASH_LINUX OR XASH_APPLE) + set(BUILDOS "") # no prefix for default OS +elseif(XASH_FREEBSD) + set(BUILDOS "freebsd") +elseif(XASH_NETBSD) + set(BUILDOS "netbsd") +elseif(XASH_OPENBSD) + set(BUILDOS "openbsd") +elseif(XASH_EMSCRIPTEN) + set(BUILDOS "emscripten") +elseif(XASH_DOS4GW) + set(BUILDOS "DOS4GW") +elseif(XASH_HAIKU) + set(BUILDOS "haiku") +elseif(XASH_SERENITY) + set(BUILDOS "serenityos") +elseif(XASH_NSWITCH) + set(BUILDOS "nswitch") +elseif(XASH_PSVITA) + set(BUILDOS "psvita") +elseif(XASH_IRIX) + set(BUILDOS "irix") +elseif(XASH_WASI) + set(BUILDOS "wasi") +elseif(XASH_SUNOS) + set(BUILDOS "sunos") +else() + message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") +endif() + +if(XASH_AMD64) + set(BUILDARCH "amd64") +elseif(XASH_X86) + if(XASH_WIN32 OR XASH_LINUX OR XASH_APPLE) + set(BUILDARCH "") # no prefix for default OS + else() + set(BUILDARCH "i386") + endif() +elseif(XASH_ARM AND XASH_64BIT) + set(BUILDARCH "arm64") +elseif(XASH_ARM) + set(BUILDARCH "armv") + if(XASH_ARMv8) + set(BUILDARCH "${BUILDARCH}8_32") + elseif(XASH_ARMv7) + set(BUILDARCH "${BUILDARCH}7") + elseif(XASH_ARMv6) + set(BUILDARCH "${BUILDARCH}6") + elseif(XASH_ARMv5) + set(BUILDARCH "${BUILDARCH}5") + elseif(XASH_ARMv4) + set(BUILDARCH "${BUILDARCH}4") + else() + message(SEND_ERROR "Unknown ARM") + endif() + + if(XASH_ARM_HARDFP) + set(BUILDARCH "${BUILDARCH}hf") + else() + set(BUILDARCH "${BUILDARCH}l") + endif() +elseif(XASH_MIPS) + set(BUILDARCH "mips") + if(XASH_64BIT) + set(BUILDARCH "${BUILDARCH}64") + endif() + + if(XASH_LITTLE_ENDIAN) + set(BUILDARCH "${BUILDARCH}el") + endif() +elseif(XASH_RISCV) + set(BUILDARCH "riscv") + if(XASH_64BIT) + set(BUILDARCH "${BUILDARCH}64") + else() + set(BUILDARCH "${BUILDARCH}32") + endif() + + if(XASH_RISCV_DOUBLEFP) + set(BUILDARCH "${BUILDARCH}d") + elseif(XASH_RISCV_SINGLEFP) + set(BUILDARCH "${BUILDARCH}f") + endif() +elseif(XASH_JS) + set(BUILDARCH "javascript") +elseif(XASH_E2K) + set(BUILDARCH "e2k") +elseif(XASH_PPC) + set(BUILDARCH "ppc") + if(XASH_64BIT) + set(BUILDARCH "${BUILDARCH}64") + endif() + + if(XASH_LITTLE_ENDIAN) + set(BUILDARCH "${BUILDARCH}el") + endif() +else() + message(SEND_ERROR "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") +endif() + +if(BUILDOS STREQUAL "android") + set(POSTFIX "") # force disable for Android, as Android ports aren't distributed in normal way and doesn't follow library naming +elseif(BUILDOS AND BUILDARCH) + set(POSTFIX "_${BUILDOS}_${BUILDARCH}") +elseif(BUILDARCH) + set(POSTFIX "_${BUILDARCH}") +else() + set(POSTFIX "") +endif() + +message(STATUS "Library postfix: " ${POSTFIX}) diff --git a/regamedll/dlls/qstring.h b/regamedll/dlls/qstring.h index 0b158292..1f5d679d 100644 --- a/regamedll/dlls/qstring.h +++ b/regamedll/dlls/qstring.h @@ -30,16 +30,18 @@ #define QSTRING_DEFINE -constexpr unsigned int iStringNull = {0}; - // Quake string (helper class) class QString final { public: +#if XASH_64BIT + using qstring_t = int; +#else using qstring_t = unsigned int; +#endif - QString(): m_string(iStringNull) {}; - QString(qstring_t string): m_string(string) {}; + QString(); + QString(qstring_t string); bool IsNull() const; bool IsNullOrEmpty() const; @@ -52,13 +54,15 @@ public: bool operator==(const char *pszString) const; operator const char *() const; - operator unsigned int() const; + operator qstring_t() const; const char *str() const; private: qstring_t m_string; }; +constexpr QString::qstring_t iStringNull = {0}; + #ifdef USE_QSTRING #define string_t QString #endif @@ -70,10 +74,25 @@ private: extern globalvars_t *gpGlobals; -#define STRING(offset) ((const char *)(gpGlobals->pStringBase + (unsigned int)(offset))) -#define MAKE_STRING(str) ((unsigned int)(str) - (unsigned int)(STRING(0))) +#define STRING(offset) ((const char *)(gpGlobals->pStringBase + (QString::qstring_t)(offset))) +#if XASH_64BIT +// Xash3D FWGS in 64-bit mode has internal string pool which allows mods to continue use 32-bit string_t +inline int MAKE_STRING(const char *str) +{ + ptrdiff_t diff = str - STRING(0); + if (diff >= INT_MIN && diff <= INT_MAX) + return (int)diff; + + return ALLOC_STRING(str); +} +#else +#define MAKE_STRING(str) ((QString::qstring_t)(str) - (QString::qstring_t)(STRING(0))) +#endif // Inlines +inline QString::QString(): m_string(iStringNull) {} +inline QString::QString(qstring_t string): m_string(string) {} + inline bool QString::IsNull() const { return m_string == iStringNull; @@ -115,7 +134,7 @@ inline QString::operator const char *() const return str(); } -inline QString::operator unsigned int() const +inline QString::operator qstring_t() const { return m_string; } diff --git a/regamedll/public/build.h b/regamedll/public/build.h new file mode 100644 index 00000000..24fd9d5b --- /dev/null +++ b/regamedll/public/build.h @@ -0,0 +1,269 @@ +/* +build.h - compile-time build information + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +*/ +#pragma once +#ifndef BUILD_H +#define BUILD_H + +/* +All XASH_* macros set by this header are guaranteed to have positive value +otherwise not defined. + +Every macro is intended to be the unified interface for buildsystems that lack +platform & CPU detection, and a neat quick way for checks in platform code +For Q_build* macros, refer to buildenums.h + +Any new define must be undefined at first +You can generate #undef list below with this oneliner: + $ sed 's/\t//g' build.h | grep '^#define XASH' | awk '{ print $2 }' | \ + sort | uniq | awk '{ print "#undef " $1 }' + +Then you can use another oneliner to query all variables: + $ grep '^#undef XASH' build.h | awk '{ print $2 }' +*/ + +#undef XASH_64BIT +#undef XASH_AMD64 +#undef XASH_ANDROID +#undef XASH_APPLE +#undef XASH_ARM +#undef XASH_ARM_HARDFP +#undef XASH_ARM_SOFTFP +#undef XASH_ARMv4 +#undef XASH_ARMv5 +#undef XASH_ARMv6 +#undef XASH_ARMv7 +#undef XASH_ARMv8 +#undef XASH_BIG_ENDIAN +#undef XASH_DOS4GW +#undef XASH_E2K +#undef XASH_EMSCRIPTEN +#undef XASH_FREEBSD +#undef XASH_HAIKU +#undef XASH_IOS +#undef XASH_IRIX +#undef XASH_JS +#undef XASH_LINUX +#undef XASH_LITTLE_ENDIAN +#undef XASH_MIPS +#undef XASH_MOBILE_PLATFORM +#undef XASH_NETBSD +#undef XASH_OPENBSD +#undef XASH_POSIX +#undef XASH_PPC +#undef XASH_RISCV +#undef XASH_RISCV_DOUBLEFP +#undef XASH_RISCV_SINGLEFP +#undef XASH_RISCV_SOFTFP +#undef XASH_SERENITY +#undef XASH_SUNOS +#undef XASH_WIN32 +#undef XASH_X86 +#undef XASH_NSWITCH +#undef XASH_PSVITA +#undef XASH_WASI +#undef XASH_WASM + +//================================================================ +// +// PLATFORM DETECTION CODE +// +//================================================================ +#if defined _WIN32 + #define XASH_WIN32 1 +#elif defined __EMSCRIPTEN__ + #define XASH_EMSCRIPTEN 1 +#elif defined __WATCOMC__ && defined __DOS__ + #define XASH_DOS4GW 1 +#else // POSIX compatible + #define XASH_POSIX 1 + #if defined __linux__ + #if defined __ANDROID__ + #define XASH_ANDROID 1 + #endif + #define XASH_LINUX 1 + #elif defined __FreeBSD__ + #define XASH_FREEBSD 1 + #elif defined __NetBSD__ + #define XASH_NETBSD 1 + #elif defined __OpenBSD__ + #define XASH_OPENBSD 1 + #elif defined __HAIKU__ + #define XASH_HAIKU 1 + #elif defined __serenity__ + #define XASH_SERENITY 1 + #elif defined __sgi + #define XASH_IRIX 1 + #elif defined __APPLE__ + #include + #define XASH_APPLE 1 + #if TARGET_OS_IOS + #define XASH_IOS 1 + #endif // TARGET_OS_IOS + #elif defined __SWITCH__ + #define XASH_NSWITCH 1 + #elif defined __vita__ + #define XASH_PSVITA 1 + #elif defined __wasi__ + #define XASH_WASI 1 + #elif defined __sun__ + #define XASH_SUNOS 1 + #else + #error + #endif +#endif + +// XASH_SAILFISH is special: SailfishOS by itself is a normal GNU/Linux platform +// It doesn't make sense to split it to separate platform +// but we still need XASH_MOBILE_PLATFORM for the engine. +// So this macro is defined entirely in build-system: see main wscript +// HLSDK/PrimeXT/other SDKs users note: you may ignore this macro +#if XASH_ANDROID || XASH_IOS || XASH_NSWITCH || XASH_PSVITA || XASH_SAILFISH + #define XASH_MOBILE_PLATFORM 1 +#endif + +//================================================================ +// +// ENDIANNESS DEFINES +// +//================================================================ + +#if !defined XASH_ENDIANNESS + #if defined XASH_WIN32 || __LITTLE_ENDIAN__ + //!!! Probably all WinNT installations runs in little endian + #define XASH_LITTLE_ENDIAN 1 + #elif __BIG_ENDIAN__ + #define XASH_BIG_ENDIAN 1 + #elif defined __BYTE_ORDER__ && defined __ORDER_BIG_ENDIAN__ && defined __ORDER_LITTLE_ENDIAN__ // some compilers define this + #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + #define XASH_BIG_ENDIAN 1 + #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + #define XASH_LITTLE_ENDIAN 1 + #endif + #else + #include + #if __BYTE_ORDER == __BIG_ENDIAN + #define XASH_BIG_ENDIAN 1 + #elif __BYTE_ORDER == __LITTLE_ENDIAN + #define XASH_LITTLE_ENDIAN 1 + #endif + #endif // !XASH_WIN32 +#endif + +//================================================================ +// +// CPU ARCHITECTURE DEFINES +// +//================================================================ +#if defined __x86_64__ || defined _M_X64 + #define XASH_64BIT 1 + #define XASH_AMD64 1 +#elif defined __i386__ || defined _X86_ || defined _M_IX86 + #define XASH_X86 1 +#elif defined __aarch64__ || defined _M_ARM64 + #define XASH_64BIT 1 + #define XASH_ARM 8 +#elif defined __mips__ + #define XASH_MIPS 1 +#elif defined __EMSCRIPTEN__ + #define XASH_JS 1 +#elif defined __e2k__ + #define XASH_64BIT 1 + #define XASH_E2K 1 +#elif defined __PPC__ || defined __powerpc__ + #define XASH_PPC 1 + #if defined __PPC64__ || defined __powerpc64__ + #define XASH_64BIT 1 + #endif +#elif defined _M_ARM // msvc + #define XASH_ARM 7 + #define XASH_ARM_HARDFP 1 +#elif defined __arm__ + #if __ARM_ARCH == 8 || __ARM_ARCH_8__ + #define XASH_ARM 8 + #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ + #define XASH_ARM 7 + #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ + #define XASH_ARM 6 + #elif __ARM_ARCH == 5 || __ARM_ARCH_5__ + #define XASH_ARM 5 + #elif __ARM_ARCH == 4 || __ARM_ARCH_4__ + #define XASH_ARM 4 + #else + #error "Unknown ARM" + #endif + + #if defined __SOFTFP__ || __ARM_PCS_VFP == 0 + #define XASH_ARM_SOFTFP 1 + #else // __SOFTFP__ + #define XASH_ARM_HARDFP 1 + #endif // __SOFTFP__ +#elif defined __riscv + #define XASH_RISCV 1 + + #if __riscv_xlen == 64 + #define XASH_64BIT 1 + #elif __riscv_xlen != 32 + #error "Unknown RISC-V ABI" + #endif + + #if defined __riscv_float_abi_soft + #define XASH_RISCV_SOFTFP 1 + #elif defined __riscv_float_abi_single + #define XASH_RISCV_SINGLEFP 1 + #elif defined __riscv_float_abi_double + #define XASH_RISCV_DOUBLEFP 1 + #else + #error "Unknown RISC-V float ABI" + #endif +#elif defined __wasm__ + #if defined __wasm64__ + #define XASH_64BIT 1 + #endif + #define XASH_WASM 1 +#else + #error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug" +#endif + +#if !XASH_64BIT && ( defined( __LP64__ ) || defined( _LP64 )) +#define XASH_64BIT 1 +#endif + +#if XASH_ARM == 8 + #define XASH_ARMv8 1 +#elif XASH_ARM == 7 + #define XASH_ARMv7 1 +#elif XASH_ARM == 6 + #define XASH_ARMv6 1 +#elif XASH_ARM == 5 + #define XASH_ARMv5 1 +#elif XASH_ARM == 4 + #define XASH_ARMv4 1 +#endif + +#endif // BUILD_H From a7395b054d0173491f6f2aca0a90475bf7a6b073 Mon Sep 17 00:00:00 2001 From: Huga <93875972+Huga22118@users.noreply.github.com> Date: Fri, 28 Mar 2025 05:06:17 +0700 Subject: [PATCH 03/29] Bot Chatter: Bots will react to enemy snipers presence (#1055) Friendly fire fixes Bot Chatter: Bots will react to enemy snipers presence previously unused chatter on both 1.6 and czero but is used on cs source Probably fixed where teammate that use sniperrifles looking at bots that don't use sniperrifles got warned --- regamedll/dlls/bot/cs_bot.h | 22 +++++++++ regamedll/dlls/bot/cs_bot_chatter.cpp | 50 +++++++++++++++++++ regamedll/dlls/bot/cs_bot_chatter.h | 15 ++++++ regamedll/dlls/bot/cs_bot_init.cpp | 5 ++ regamedll/dlls/bot/cs_bot_update.cpp | 23 +++++++-- regamedll/dlls/bot/cs_bot_vision.cpp | 69 +++++++++++++++++++++++++++ 6 files changed, 181 insertions(+), 3 deletions(-) diff --git a/regamedll/dlls/bot/cs_bot.h b/regamedll/dlls/bot/cs_bot.h index 9670744f..ea22a18d 100644 --- a/regamedll/dlls/bot/cs_bot.h +++ b/regamedll/dlls/bot/cs_bot.h @@ -533,6 +533,11 @@ public: bool IsAwareOfEnemyDeath() const; // return true if we *noticed* that our enemy died int GetLastVictimID() const; // return the ID (entindex) of the last victim we killed, or zero +#ifdef REGAMEDLL_ADD + bool CanSeeSniper(void) const; ///< return true if we can see an enemy sniper + bool HasSeenSniperRecently(void) const; ///< return true if we have seen a sniper recently +#endif + // navigation bool HasPath() const; void DestroyPath(); @@ -921,6 +926,11 @@ private: float m_fireWeaponTimestamp; +#ifdef REGAMEDLL_ADD + bool m_isEnemySniperVisible; ///< do we see an enemy sniper right now + CountdownTimer m_sawEnemySniperTimer; ///< tracking time since saw enemy sniper +#endif + // reaction time system enum { MAX_ENEMY_QUEUE = 20 }; struct ReactionState @@ -1250,6 +1260,18 @@ inline int CCSBot::GetLastVictimID() const return m_lastVictimID; } +#ifdef REGAMEDLL_ADD +inline bool CCSBot::CanSeeSniper(void) const +{ + return m_isEnemySniperVisible; +} + +inline bool CCSBot::HasSeenSniperRecently(void) const +{ + return !m_sawEnemySniperTimer.IsElapsed(); +} +#endif + inline bool CCSBot::HasPath() const { return m_pathLength != 0; diff --git a/regamedll/dlls/bot/cs_bot_chatter.cpp b/regamedll/dlls/bot/cs_bot_chatter.cpp index f58759fe..d48898ae 100644 --- a/regamedll/dlls/bot/cs_bot_chatter.cpp +++ b/regamedll/dlls/bot/cs_bot_chatter.cpp @@ -246,6 +246,17 @@ void BotHostageBeingTakenMeme::Interpret(CCSBot *pSender, CCSBot *pReceiver) con pReceiver->GetChatter()->Say("Affirmative"); } +#ifdef REGAMEDLL_ADD +//--------------------------------------------------------------------------------------------------------------- +/** + * A teammate warned about snipers, so we shouldn't warn again for awhile + */ +void BotWarnSniperMeme::Interpret(CCSBot* sender, CCSBot* receiver) const +{ + receiver->GetChatter()->FriendSpottedSniper(); +} +#endif + BotSpeakable::BotSpeakable() { m_phrase = nullptr; @@ -1270,6 +1281,9 @@ void BotChatterInterface::Reset() m_planInterval.Invalidate(); m_encourageTimer.Invalidate(); m_escortingHostageTimer.Invalidate(); +#ifdef REGAMEDLL_ADD + m_warnSniperTimer.Invalidate(); +#endif } // Register a statement for speaking @@ -1626,6 +1640,42 @@ void BotChatterInterface::EnemySpotted() AddStatement(say); } +#ifdef REGAMEDLL_ADD +//--------------------------------------------------------------------------------------------------------------- +/** + * If a friend warned of snipers, don't warn again for awhile + */ +void BotChatterInterface::FriendSpottedSniper(void) +{ + m_warnSniperTimer.Start(60.0f); +} + +//--------------------------------------------------------------------------------------------------------------- +/** + * Warn of an enemy sniper + */ +void BotChatterInterface::SpottedSniper(void) +{ + if (!m_warnSniperTimer.IsElapsed()) + { + return; + } + + if (m_me->GetFriendsRemaining() == 0) + { + // no-one to warn + return; + } + + BotStatement* say = new BotStatement(this, REPORT_INFORMATION, 10.0f); + + say->AppendPhrase(TheBotPhrases->GetPhrase("SniperWarning")); + say->AttachMeme(new BotWarnSniperMeme()); + + AddStatement(say); +} +#endif + NOXREF void BotChatterInterface::Clear(Place place) { BotStatement *say = new BotStatement(this, REPORT_INFORMATION, 10.0f); diff --git a/regamedll/dlls/bot/cs_bot_chatter.h b/regamedll/dlls/bot/cs_bot_chatter.h index 4a4591cf..8d3a5baa 100644 --- a/regamedll/dlls/bot/cs_bot_chatter.h +++ b/regamedll/dlls/bot/cs_bot_chatter.h @@ -140,6 +140,14 @@ public: virtual void Interpret(CCSBot *pSender, CCSBot *pReceiver) const; // cause the given bot to act on this meme }; +#ifdef REGAMEDLL_ADD +class BotWarnSniperMeme : public BotMeme +{ +public: + virtual void Interpret(CCSBot* sender, CCSBot* receiver) const; ///< cause the given bot to act on this meme +}; +#endif + enum BotStatementType { REPORT_VISIBLE_ENEMIES, @@ -531,6 +539,10 @@ public: void KilledFriend(); void FriendlyFire(); +#ifdef REGAMEDLL_ADD + void SpottedSniper(void); + void FriendSpottedSniper(void); +#endif bool SeesAtLeastOneEnemy() const { return m_seeAtLeastOneEnemy; } private: @@ -557,6 +569,9 @@ private: CountdownTimer m_spottedLooseBombTimer; CountdownTimer m_heardNoiseTimer; CountdownTimer m_escortingHostageTimer; +#ifdef REGAMEDLL_ADD + CountdownTimer m_warnSniperTimer; +#endif }; inline BotChatterInterface::VerbosityType BotChatterInterface::GetVerbosity() const diff --git a/regamedll/dlls/bot/cs_bot_init.cpp b/regamedll/dlls/bot/cs_bot_init.cpp index 665b3c33..c7a19bb0 100644 --- a/regamedll/dlls/bot/cs_bot_init.cpp +++ b/regamedll/dlls/bot/cs_bot_init.cpp @@ -194,6 +194,11 @@ void CCSBot::ResetValues() m_currentArea = nullptr; m_lastKnownArea = nullptr; +#ifdef REGAMEDLL_ADD + m_isEnemySniperVisible = false; + m_sawEnemySniperTimer.Invalidate(); +#endif + m_avoidFriendTimer.Invalidate(); m_isFriendInTheWay = false; m_isWaitingBehindFriend = false; diff --git a/regamedll/dlls/bot/cs_bot_update.cpp b/regamedll/dlls/bot/cs_bot_update.cpp index 37d49665..de75bf6a 100644 --- a/regamedll/dlls/bot/cs_bot_update.cpp +++ b/regamedll/dlls/bot/cs_bot_update.cpp @@ -255,7 +255,7 @@ void CCSBot::Update() Vector dir = m_spotEncounter->path.to - m_spotEncounter->path.from; float length = dir.NormalizeInPlace(); - for (auto &order : m_spotEncounter->spotList) { + for (auto& order : m_spotEncounter->spotList) { UTIL_DrawBeamPoints(m_spotEncounter->path.from + order.t * length * dir, *order.spot->GetPosition(), 3, 0, 255, 255); } } @@ -339,7 +339,7 @@ void CCSBot::Update() UpdateReactionQueue(); // "threat" may be the same as our current enemy - CBasePlayer *threat = GetRecognizedEnemy(); + CBasePlayer* threat = GetRecognizedEnemy(); if (threat) { // adjust our personal "safe" time @@ -592,6 +592,10 @@ void CCSBot::Update() SecondaryAttack(); } +#ifdef REGAMEDLL_ADD + if (!IsBlind()) + { +#endif // check encounter spots UpdatePeripheralVision(); @@ -601,11 +605,24 @@ void CCSBot::Update() GetChatter()->SpottedBomber(GetBomber()); } +#ifdef REGAMEDLL_ADD + // watch for snipers + if (CanSeeSniper() && !HasSeenSniperRecently()) + { + GetChatter()->SpottedSniper(); + + const float sniperRecentInterval = 20.0f; + m_sawEnemySniperTimer.Start(sniperRecentInterval); + } +#endif + if (CanSeeLooseBomb()) { GetChatter()->SpottedLooseBomb(TheCSBots()->GetLooseBomb()); } - +#ifdef REGAMEDLL_ADD +} +#endif // Scenario interrupts switch (TheCSBots()->GetScenario()) { diff --git a/regamedll/dlls/bot/cs_bot_vision.cpp b/regamedll/dlls/bot/cs_bot_vision.cpp index f7b16acc..6e9d8ddc 100644 --- a/regamedll/dlls/bot/cs_bot_vision.cpp +++ b/regamedll/dlls/bot/cs_bot_vision.cpp @@ -697,6 +697,13 @@ CBasePlayer *CCSBot::FindMostDangerousThreat() m_closestVisibleFriend = nullptr; m_closestVisibleHumanFriend = nullptr; +#ifdef REGAMEDLL_ADD + m_isEnemySniperVisible = false; + CBasePlayer* sniperThreat = NULL; + float sniperThreatRange = 99999999999.9f; + bool sniperThreatIsFacingMe = false; +#endif + float closeFriendRange = 99999999999.9f; float closeHumanFriendRange = 99999999999.9f; @@ -789,6 +796,51 @@ CBasePlayer *CCSBot::FindMostDangerousThreat() Vector d = pev->origin - pPlayer->pev->origin; float distSq = d.LengthSquared(); +#ifdef REGAMEDLL_ADD + if (isSniperRifle(pPlayer->m_pActiveItem)) { + m_isEnemySniperVisible = true; + if (sniperThreat) + { + if (IsPlayerLookingAtMe(pPlayer)) + { + if (sniperThreatIsFacingMe) + { + // several snipers are facing us - keep closest + if (distSq < sniperThreatRange) + { + sniperThreat = pPlayer; + sniperThreatRange = distSq; + sniperThreatIsFacingMe = true; + } + } + else + { + // even if this sniper is farther away, keep it because he's aiming at us + sniperThreat = pPlayer; + sniperThreatRange = distSq; + sniperThreatIsFacingMe = true; + } + } + else + { + // this sniper is not looking at us, only consider it if we dont have a sniper facing us + if (!sniperThreatIsFacingMe && distSq < sniperThreatRange) + { + sniperThreat = pPlayer; + sniperThreatRange = distSq; + } + } + } + else + { + // first sniper we see + sniperThreat = pPlayer; + sniperThreatRange = distSq; + sniperThreatIsFacingMe = IsPlayerLookingAtMe(pPlayer); + } + } +#endif + // maintain set of visible threats, sorted by increasing distance if (threatCount == 0) { @@ -950,6 +1002,23 @@ CBasePlayer *CCSBot::FindMostDangerousThreat() { return currentThreat; } + + // if we are a sniper and we see a sniper threat, attack it unless + // there are other close enemies facing me + if (IsSniper() && sniperThreat) + { + const float closeCombatRange = 500.0f; + + for (t = 0; t < threatCount; ++t) + { + if (threat[t].range < closeCombatRange && IsPlayerLookingAtMe(threat[t].enemy)) + { + return threat[t].enemy; + } + } + + return sniperThreat; + } #endif // otherwise, find the closest threat that without using shield From 756deb1ea9cbb5e8222de8f3ac726f80c1c1c24c Mon Sep 17 00:00:00 2001 From: golukon <119600102+golukon@users.noreply.github.com> Date: Fri, 28 Mar 2025 01:08:42 +0300 Subject: [PATCH 04/29] fix: calculate UpdateLocation fun not so often (#1040) --- regamedll/dlls/player.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 3f23a629..ceaa9dbe 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -10116,7 +10116,11 @@ bool CBasePlayer::IsObservingPlayer(CBasePlayer *pPlayer) void CBasePlayer::UpdateLocation(bool forceUpdate) { +#ifdef REGAMEDLL_FIXES + if (!forceUpdate && m_flLastUpdateTime > gpGlobals->time - 2.0f) +#else if (!forceUpdate && m_flLastUpdateTime >= gpGlobals->time + 2.0f) +#endif return; const char *placeName = nullptr; From 6adb795fee5a00cbccb02004aa4dd8909f4c2b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Mu=C3=B1oz?= Date: Thu, 27 Mar 2025 19:09:24 -0300 Subject: [PATCH 05/29] Team Say refactory/enhancement (#1042) Disable say_team when FFA mode is enabled Only for CT and T, Spectators can still use say_team --- regamedll/dlls/client.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 08efa039..63560fad 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -841,6 +841,12 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) char *pszConsoleFormat = nullptr; bool consoleUsesPlaceName = false; +#ifdef REGAMEDLL_ADD + // there's no team on FFA mode + if (teamonly && CSGameRules()->IsFreeForAll() && (pPlayer->m_iTeam == CT || pPlayer->m_iTeam == TERRORIST)) + teamonly = FALSE; +#endif + // team only if (teamonly) { @@ -995,7 +1001,13 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) if (gpGlobals->deathmatch != 0.0f && CSGameRules()->m_VoiceGameMgr.PlayerHasBlockedPlayer(pReceiver, pPlayer)) continue; - if (teamonly && pReceiver->m_iTeam != pPlayer->m_iTeam) + if (teamonly +#ifdef REGAMEDLL_FIXES + && CSGameRules()->PlayerRelationship(pPlayer, pReceiver) != GR_TEAMMATE +#else + && pReceiver->m_iTeam != pPlayer->m_iTeam +#endif + ) continue; if ( @@ -1008,7 +1020,13 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) continue; } - if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY && pReceiver->m_iTeam == pPlayer->m_iTeam) + if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY +#ifdef REGAMEDLL_FIXES + && CSGameRules()->PlayerRelationship(pPlayer, pReceiver) == GR_TEAMMATE +#else + && pReceiver->m_iTeam == pPlayer->m_iTeam +#endif + ) || pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_NONE) { MESSAGE_BEGIN(MSG_ONE, gmsgSayText, nullptr, pReceiver->pev); From b8e9726347ef4b02803923f8ba6248c0f598ce6c Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:09:56 +0500 Subject: [PATCH 06/29] fix: bots can't buy sec ammo if preferred pistol (ex. "WeaponPreference = deagle" in BotProfile.db) (#1034) --- regamedll/dlls/bot/states/cs_bot_buy.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/regamedll/dlls/bot/states/cs_bot_buy.cpp b/regamedll/dlls/bot/states/cs_bot_buy.cpp index f210423e..c34351f0 100644 --- a/regamedll/dlls/bot/states/cs_bot_buy.cpp +++ b/regamedll/dlls/bot/states/cs_bot_buy.cpp @@ -462,17 +462,26 @@ void BuyState::OnUpdate(CCSBot *me) me->ClientCommand("vesthelm"); me->ClientCommand("vest"); - // pistols - if we have no preferred pistol, buy at random - if (TheCSBots()->AllowPistols() && !me->GetProfile()->HasPistolPreference()) + if (TheCSBots()->AllowPistols() +#ifndef REGAMEDLL_FIXES + && !me->GetProfile()->HasPistolPreference() +#endif + ) { if (m_buyPistol) { - int which = RANDOM_LONG(0, MAX_BUY_WEAPON_SECONDARY - 1); +#ifdef REGAMEDLL_FIXES + // pistols - if we have no preferred pistol, buy at random + if (!me->GetProfile()->HasPistolPreference()) +#endif + { + int which = RANDOM_LONG(0, MAX_BUY_WEAPON_SECONDARY - 1); - if (me->m_iTeam == TERRORIST) - me->ClientCommand(secondaryWeaponBuyInfoT[which].buyAlias); - else - me->ClientCommand(secondaryWeaponBuyInfoCT[which].buyAlias); + if (me->m_iTeam == TERRORIST) + me->ClientCommand(secondaryWeaponBuyInfoT[which].buyAlias); + else + me->ClientCommand(secondaryWeaponBuyInfoCT[which].buyAlias); + } // only buy one pistol m_buyPistol = false; From 316405b00df72c1703cacc8f09decb6a3d60324c Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:10:32 +0500 Subject: [PATCH 07/29] add new cvar "bot_excellent_morale" (#1035) --- README.md | 1 + dist/game.cfg | 9 ++++++++- regamedll/dlls/bot/cs_bot.h | 5 +++++ regamedll/dlls/bot/cs_bot_init.cpp | 2 ++ regamedll/dlls/bot/cs_bot_init.h | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bdfc9f8..88c393b1 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_ammo_respawn_time | 20 | 0.0 | - | The respawn time for ammunition. | | mp_vote_flags | km | 0 | - | Vote systems enabled in server.
`0` voting disabled
`k` votekick enabled via `vote` command
`m` votemap enabled via `votemap` command | | mp_votemap_min_time | 180 | 0.0 | - | Minimum seconds that must elapse on map before `votemap` command can be used. | +| bot_excellent_morale | 0 | 0 | 1 | Bots always have great morale regardless of defeat or victory. | diff --git a/dist/game.cfg b/dist/game.cfg index c5dad01c..65ffb07e 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -521,7 +521,7 @@ mp_give_c4_frags "3" // Default value: "1.0" mp_hostages_rescued_ratio "1.0" -// Legacy func_vehicle behavior when blocked by another entity. +// Legacy func_vehicle behavior when blocked by another entity. // New one is more useful for playing multiplayer. // // 0 - New behavior @@ -620,3 +620,10 @@ mp_vote_flags "km" // // Default value: "180" mp_votemap_min_time "180" + +// Bots always have great morale regardless of defeat or victory. +// 0 - disabled (default behaviour) +// 1 - enabled +// +// Default value: "0" +bot_excellent_morale "0" diff --git a/regamedll/dlls/bot/cs_bot.h b/regamedll/dlls/bot/cs_bot.h index ea22a18d..8f63e1a6 100644 --- a/regamedll/dlls/bot/cs_bot.h +++ b/regamedll/dlls/bot/cs_bot.h @@ -1119,6 +1119,11 @@ inline bool CCSBot::IsAtBombsite() inline CCSBot::MoraleType CCSBot::GetMorale() const { +#ifdef REGAMEDLL_ADD + if (cv_bot_excellent_morale.value != 0.0f) + return EXCELLENT; +#endif + return m_morale; } diff --git a/regamedll/dlls/bot/cs_bot_init.cpp b/regamedll/dlls/bot/cs_bot_init.cpp index c7a19bb0..3199cf91 100644 --- a/regamedll/dlls/bot/cs_bot_init.cpp +++ b/regamedll/dlls/bot/cs_bot_init.cpp @@ -65,6 +65,7 @@ cvar_t cv_bot_join_delay = { "bot_join_delay", "0", FCVAR_SERVER, 0. cvar_t cv_bot_freeze = { "bot_freeze", "0", 0, 0.0f, nullptr }; cvar_t cv_bot_mimic = { "bot_mimic", "0", 0, 0.0f, nullptr }; cvar_t cv_bot_mimic_yaw_offset = { "bot_mimic_yaw_offset", "0", 0, 0.0f, nullptr }; +cvar_t cv_bot_excellent_morale = { "bot_excellent_morale", "0", 0, 0.0f, nullptr }; #else // Migrated to bot_quota_mode, use "match" cvar_t cv_bot_quota_match = { "bot_quota_match", "0", FCVAR_SERVER, 0.0f, nullptr }; @@ -136,6 +137,7 @@ void Bot_RegisterCVars() CVAR_REGISTER(&cv_bot_freeze); CVAR_REGISTER(&cv_bot_mimic); CVAR_REGISTER(&cv_bot_mimic_yaw_offset); + CVAR_REGISTER(&cv_bot_excellent_morale); #endif } diff --git a/regamedll/dlls/bot/cs_bot_init.h b/regamedll/dlls/bot/cs_bot_init.h index b50e020c..691c518f 100644 --- a/regamedll/dlls/bot/cs_bot_init.h +++ b/regamedll/dlls/bot/cs_bot_init.h @@ -65,6 +65,7 @@ extern cvar_t cv_bot_join_delay; extern cvar_t cv_bot_freeze; extern cvar_t cv_bot_mimic; extern cvar_t cv_bot_mimic_yaw_offset; +extern cvar_t cv_bot_excellent_morale; #else extern cvar_t cv_bot_quota_match; #endif From dbec1b589c0509942b13570df674efacf3b2dd7d Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:17:02 +0500 Subject: [PATCH 08/29] Randomspawn (#1013) add new cvar mp_randomspawn improved search for the best angle added mp_randomspawn 2 for debugging added info_spawn_point entity to .fgd --- README.md | 1 + dist/game.cfg | 9 + regamedll/dlls/bot/cs_bot_manager.cpp | 160 ++++++++++++++++++ regamedll/dlls/bot/cs_bot_manager.h | 3 + regamedll/dlls/client.cpp | 6 +- regamedll/dlls/game.cpp | 3 + regamedll/dlls/game.h | 1 + regamedll/dlls/player.cpp | 59 ++++++- regamedll/dlls/player.h | 2 +- .../GameDefinitionFile/regamedll-cs.fgd | 4 + regamedll/game_shared/bot/nav_area.h | 19 +++ 11 files changed, 256 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 88c393b1..b3053cf9 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_vote_flags | km | 0 | - | Vote systems enabled in server.
`0` voting disabled
`k` votekick enabled via `vote` command
`m` votemap enabled via `votemap` command | | mp_votemap_min_time | 180 | 0.0 | - | Minimum seconds that must elapse on map before `votemap` command can be used. | | bot_excellent_morale | 0 | 0 | 1 | Bots always have great morale regardless of defeat or victory. | +| mp_randomspawn | 0 | 0 | 1 | Random player spawns
`0` disabled
`1` enabled
`NOTE`: Navigation `maps/.nav` file required | diff --git a/dist/game.cfg b/dist/game.cfg index 65ffb07e..e25eaf20 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -627,3 +627,12 @@ mp_votemap_min_time "180" // // Default value: "0" bot_excellent_morale "0" + +// Random player spawns +// 0 - disabled (default behaviour) +// 1 - enabled +// +// NOTE: Navigation "maps/.nav" file required +// +// Default value: "0" +mp_randomspawn "0" diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index a5be7342..e68bea53 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -1144,6 +1144,166 @@ private: CCSBotManager::Zone *m_zone; }; +#ifdef REGAMEDLL_ADD +LINK_ENTITY_TO_CLASS(info_spawn_point, CPointEntity, CCSPointEntity) + +inline bool IsFreeSpace(Vector vecOrigin, int iHullNumber, edict_t *pSkipEnt = nullptr) +{ + if (UTIL_PointContents(vecOrigin) != CONTENTS_EMPTY) + return false; + + TraceResult trace; + UTIL_TraceHull(vecOrigin, vecOrigin, dont_ignore_monsters, iHullNumber, pSkipEnt, &trace); + + return (!trace.fStartSolid && !trace.fAllSolid && trace.fInOpen); +} + +inline bool pointInRadius(Vector vecOrigin, float radius) +{ + CBaseEntity *pEntity = nullptr; + while ((pEntity = UTIL_FindEntityInSphere(pEntity, vecOrigin, radius))) + { + if (FClassnameIs(pEntity->edict(), "info_spawn_point")) + return true; + } + + return false; +} + +// a simple algorithm that searches for the farthest point (so that the player does not look at the wall) +inline Vector GetBestAngle(const Vector &vecStart) +{ + const float ANGLE_STEP = 30.0f; + float bestAngle = 0.0f; + float bestDistance = 0.0f; + Vector vecBestAngle = Vector(0, -1, 0); + + for (float angleYaw = 0.0f; angleYaw <= 360.0f; angleYaw += ANGLE_STEP) + { + TraceResult tr; + UTIL_MakeVectors(Vector(0, angleYaw, 0)); + + Vector vecEnd(vecStart + gpGlobals->v_forward * 8192); + UTIL_TraceLine(vecStart, vecEnd, ignore_monsters, nullptr, &tr); + + float distance = (vecStart - tr.vecEndPos).Length(); + + if (distance > bestDistance) + { + bestDistance = distance; + vecBestAngle.y = angleYaw; + } + } + + return vecBestAngle; +} + +// this function from leaked csgo sources 2020y +inline bool IsValidArea(CNavArea *area) +{ + ShortestPathCost cost; + bool bNotOrphaned; + + // check that we can path from the nav area to a ct spawner to confirm it isn't orphaned. + CBaseEntity *CTSpawn = UTIL_FindEntityByClassname(nullptr, "info_player_start"); + + if (CTSpawn) + { + CNavArea *CTSpawnArea = TheNavAreaGrid.GetNearestNavArea(&CTSpawn->pev->origin); + bNotOrphaned = NavAreaBuildPath(area, CTSpawnArea, nullptr, cost); + + if (bNotOrphaned) + return true; + } + + // double check that we can path from the nav area to a t spawner to confirm it isn't orphaned. + CBaseEntity *TSpawn = UTIL_FindEntityByClassname(nullptr, "info_player_deathmatch"); + + if (TSpawn) + { + CNavArea *TSpawnArea = TheNavAreaGrid.GetNearestNavArea(&TSpawn->pev->origin); + bNotOrphaned = NavAreaBuildPath(area, TSpawnArea, nullptr, cost); + + if (bNotOrphaned) + return true; + } + + return false; +} + +void GetSpawnPositions() +{ + const float MIN_AREA_SIZE = 32.0f; + const int MAX_SPAWNS_POINTS = 128; + const float MAX_SLOPE = 0.85f; + + int totalSpawns = 0; + + for (NavAreaList::iterator iter = TheNavAreaList.begin(); iter != TheNavAreaList.end(); iter++) + { + if (totalSpawns >= MAX_SPAWNS_POINTS) + break; + + CNavArea *area = *iter; + + if (!area) + continue; + + // ignore small areas + if (area->GetSizeX() < MIN_AREA_SIZE || area->GetSizeY() < MIN_AREA_SIZE) + continue; + + // ignore areas jump, crouch etc + if (area->GetAttributes()) + continue; + + if (area->GetAreaSlope() < MAX_SLOPE) + { + //CONSOLE_ECHO("Skip area slope: %0.3f\n", area->GetAreaSlope()); + continue; + } + + Vector vecOrigin = *area->GetCenter() + Vector(0, 0, HalfHumanHeight + 5); + + if (!IsFreeSpace(vecOrigin, human_hull)) + { + //CONSOLE_ECHO("No free space!\n"); + continue; + } + + if (pointInRadius(vecOrigin, 128.0f)) + continue; + + if (!IsValidArea(area)) + continue; + + Vector bestAngle = GetBestAngle(vecOrigin); + + if (bestAngle.y != -1) + { + CBaseEntity* pPoint = CBaseEntity::Create("info_spawn_point", vecOrigin, bestAngle, nullptr); + + if (pPoint) + { + totalSpawns++; + //CONSOLE_ECHO("Add spawn at x:%f y:%f z:%f with angle %0.1f slope %0.3f \n", vecOrigin.x, vecOrigin.y, vecOrigin.z, bestAngle.y, area->GetAreaSlope()); + + // use only for debugging + if (randomspawn.value > 1.0f) + { + SET_MODEL(ENT(pPoint->pev), "models/player.mdl"); + pPoint->pev->sequence = ACT_IDLE; + pPoint->pev->rendermode = kRenderTransAdd; + pPoint->pev->renderamt = 150.0f; + } + } + } + } + + CONSOLE_ECHO("Total spawns points: %i\n", totalSpawns); +} +#endif + // Search the map entities to determine the game scenario and define important zones. void CCSBotManager::ValidateMapData() { diff --git a/regamedll/dlls/bot/cs_bot_manager.h b/regamedll/dlls/bot/cs_bot_manager.h index 9552c697..0d5e6e37 100644 --- a/regamedll/dlls/bot/cs_bot_manager.h +++ b/regamedll/dlls/bot/cs_bot_manager.h @@ -269,3 +269,6 @@ inline bool AreBotsAllowed() } void PrintAllEntities(); +#ifdef REGAMEDLL_ADD +void GetSpawnPositions(); +#endif \ No newline at end of file diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 63560fad..971a41cf 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -3834,8 +3834,10 @@ void EXT_FUNC ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) #ifdef REGAMEDLL_ADD CSGameRules()->ServerActivate(); - if (location_area_info.value) - LoadNavigationMap(); + if (LoadNavigationMap() == NAV_OK) + { + GetSpawnPositions(); + } #endif } diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 5680db82..daaf6e73 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -188,6 +188,8 @@ cvar_t ammo_respawn_time = { "mp_ammo_respawn_time", "20", FCVAR_SERVER, 2 cvar_t vote_flags = { "mp_vote_flags", "km", 0, 0.0f, nullptr }; cvar_t votemap_min_time = { "mp_votemap_min_time", "180", 0, 180.0f, nullptr }; +cvar_t randomspawn = { "mp_randomspawn", "0", FCVAR_SERVER, 0.0f, nullptr }; + void GameDLL_Version_f() { if (Q_stricmp(CMD_ARGV(1), "version") != 0) @@ -459,6 +461,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&vote_flags); CVAR_REGISTER(&votemap_min_time); + CVAR_REGISTER(&randomspawn); CVAR_REGISTER(&cv_bot_enable); CVAR_REGISTER(&cv_hostage_ai_enable); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 09da5305..48cec02a 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -208,6 +208,7 @@ extern cvar_t weapon_respawn_time; extern cvar_t ammo_respawn_time; extern cvar_t vote_flags; extern cvar_t votemap_min_time; +extern cvar_t randomspawn; #endif diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index ceaa9dbe..5453b522 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -5338,17 +5338,24 @@ pt_end: } // checks if the spot is clear of players -BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot) +BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot, float fRadius) { if (!pSpot->IsTriggered(pPlayer)) return FALSE; CBaseEntity *pEntity = nullptr; - while ((pEntity = UTIL_FindEntityInSphere(pEntity, pSpot->pev->origin, MAX_PLAYER_USE_RADIUS))) + + while ((pEntity = UTIL_FindEntityInSphere(pEntity, pSpot->pev->origin, fRadius))) { // if ent is a client, don't spawn on 'em - if (pEntity->IsPlayer() && pEntity != pPlayer) + if (pEntity->IsPlayer() && pEntity != pPlayer +#ifdef REGAMEDLL_FIXES + && pEntity->IsAlive() +#endif + ) + { return FALSE; + } } return TRUE; @@ -5373,17 +5380,34 @@ bool CBasePlayer::SelectSpawnSpot(const char *pEntClassName, CBaseEntity *&pSpot { if (pSpot) { - // check if pSpot is valid - if (IsSpawnPointValid(this, pSpot)) +#ifdef REGAMEDLL_ADD + if (FClassnameIs(pSpot->edict(), "info_spawn_point")) { - if (pSpot->pev->origin == Vector(0, 0, 0)) + if (!IsSpawnPointValid(this, pSpot, 512.0f) || pSpot->pev->origin == Vector(0, 0, 0)) { pSpot = UTIL_FindEntityByClassname(pSpot, pEntClassName); continue; } + else + { + return true; + } + } + else +#endif + { + // check if pSpot is valid + if (IsSpawnPointValid(this, pSpot, MAX_PLAYER_USE_RADIUS)) + { + if (pSpot->pev->origin == Vector(0, 0, 0)) + { + pSpot = UTIL_FindEntityByClassname(pSpot, pEntClassName); + continue; + } - // if so, go to pSpot - return true; + // if so, go to pSpot + return true; + } } } @@ -5441,6 +5465,24 @@ edict_t *EXT_FUNC CBasePlayer::__API_HOOK(EntSelectSpawnPoint)() if (!FNullEnt(pSpot)) goto ReturnSpot; } +#ifdef REGAMEDLL_ADD + else if (randomspawn.value > 0) + { + pSpot = g_pLastSpawn; + + if (SelectSpawnSpot("info_spawn_point", pSpot)) + { + g_pLastSpawn = pSpot; + + return pSpot->edict(); + } + + if (m_iTeam == CT) + goto CTSpawn; + else if (m_iTeam == TERRORIST) + goto TSpawn; + } +#endif // VIP spawn point else if (g_pGameRules->IsDeathmatch() && m_bIsVIP) { @@ -5468,6 +5510,7 @@ CTSpawn: // The terrorist spawn points else if (g_pGameRules->IsDeathmatch() && m_iTeam == TERRORIST) { +TSpawn: pSpot = g_pLastTerroristSpawn; if (SelectSpawnSpot("info_player_deathmatch", pSpot)) diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index b13c2c82..6890d30b 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -1044,7 +1044,7 @@ int TrainSpeed(int iSpeed, int iMax); void LogAttack(CBasePlayer *pAttacker, CBasePlayer *pVictim, int teamAttack, int healthHit, int armorHit, int newHealth, int newArmor, const char *killer_weapon_name); bool CanSeeUseable(CBasePlayer *me, CBaseEntity *pEntity); void FixPlayerCrouchStuck(edict_t *pPlayer); -BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot); +BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot, float fRadius); CBaseEntity *FindEntityForward(CBaseEntity *pMe); real_t GetPlayerPitch(const edict_t *pEdict); real_t GetPlayerYaw(const edict_t *pEdict); diff --git a/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd b/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd index 3d56907e..cab21059 100644 --- a/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd +++ b/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd @@ -3143,3 +3143,7 @@ @PointClass base(BaseCommand) size(-8 -8 -8, 8 8 8) = point_clientcommand : "It issues commands to the client console" [ ] + +@PointClass iconsprite("sprites/CS/info_player_start.spr") base(PlayerClass) = info_spawn_point : "Random spawn start" +[ +] \ No newline at end of file diff --git a/regamedll/game_shared/bot/nav_area.h b/regamedll/game_shared/bot/nav_area.h index c4cf8a1f..10eca2f8 100644 --- a/regamedll/game_shared/bot/nav_area.h +++ b/regamedll/game_shared/bot/nav_area.h @@ -345,6 +345,25 @@ public: void AddLadderUp(CNavLadder *ladder) { m_ladder[LADDER_UP].push_back(ladder); } void AddLadderDown(CNavLadder *ladder) { m_ladder[LADDER_DOWN].push_back(ladder); } + inline float GetAreaSlope() + { + Vector u, v; + + // compute our unit surface normal + u.x = m_extent.hi.x - m_extent.lo.x; + u.y = 0.0f; + u.z = m_neZ - m_extent.lo.z; + + v.x = 0.0f; + v.y = m_extent.hi.y - m_extent.lo.y; + v.z = m_swZ - m_extent.lo.z; + + Vector normal = CrossProduct(u, v); + normal.NormalizeInPlace(); + + return normal.z; + } + private: friend void ConnectGeneratedAreas(); friend void MergeGeneratedAreas(); From 518f142635a2825cb6b132776019a96cfe2e7127 Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:20:28 +0500 Subject: [PATCH 09/29] Add new CVar mp_default_weapons_random (#1015) --- README.md | 1 + dist/game.cfg | 7 +++++++ regamedll/dlls/game.cpp | 2 ++ regamedll/dlls/game.h | 1 + regamedll/dlls/player.cpp | 37 +++++++++++++++++++++++++++++++++++-- 5 files changed, 46 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3053cf9..639b335f 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_ct_give_player_knife | 1 | 0 | 1 | Whether Counter-Terrorist player spawn with knife. | | mp_ct_default_weapons_primary | "" | "" | - | The default primary (rifle) weapon that the CTs will spawn with. | | mp_ct_default_weapons_secondary | "usp" | "" | - | The default secondary (pistol) weapon that the CTs will spawn with. | +| mp_default_weapons_random | 0 | 0 | 1 | Randomize default weapons (if there are multiple).
`0` disabled
`1` enabled | | mp_give_player_c4 | 1 | 0 | 1 | Whether this map should spawn a C4 bomb for a player or not.
`0` disabled
`1` enabled | | mp_weapons_allow_map_placed | 1 | 0 | 1 | When set, map weapons (located on the floor by map) will be shown.
`0` hide all map weapons.
`1` enabled
`NOTE`: Effect will work after round restart. | | mp_free_armor | 0 | 0 | 2 | Give free armor on player spawn.
`0` disabled
`1` Give Kevlar
`2` Give Kevlar + Helmet | diff --git a/dist/game.cfg b/dist/game.cfg index e25eaf20..c84fde86 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -466,6 +466,13 @@ mp_ct_default_weapons_primary "" // Default value: "usp" mp_ct_default_weapons_secondary "usp" +// Randomize default weapons (if there are multiple) +// 0 - disabled (default behaviour) +// 1 - enabled +// +// Default value: "0" +mp_default_weapons_random "0" + // Give the player free armor on player spawn // 0 - No armor (default behavior) // 1 - Give Kevlar diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index daaf6e73..baaed369 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -160,6 +160,7 @@ cvar_t t_default_grenades = { "mp_t_default_grenades", "", 0, 0.0 cvar_t t_give_player_knife = { "mp_t_give_player_knife", "1", 0, 1.0f, nullptr }; cvar_t t_default_weapons_secondary = { "mp_t_default_weapons_secondary", "glock18", 0, 0.0f, nullptr }; cvar_t t_default_weapons_primary = { "mp_t_default_weapons_primary", "", 0, 0.0f, nullptr }; +cvar_t default_weapons_random = { "mp_default_weapons_random", "", 0, 0.0f, nullptr }; cvar_t free_armor = { "mp_free_armor", "0", 0, 0.0f, nullptr }; cvar_t teamflash = { "mp_team_flash", "1", 0, 1.0f, nullptr }; cvar_t allchat = { "sv_allchat", "0", 0, 0.0f, nullptr }; @@ -433,6 +434,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&t_give_player_knife); CVAR_REGISTER(&t_default_weapons_secondary); CVAR_REGISTER(&t_default_weapons_primary); + CVAR_REGISTER(&default_weapons_random); CVAR_REGISTER(&free_armor); CVAR_REGISTER(&teamflash); CVAR_REGISTER(&allchat); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 48cec02a..e7dba1f2 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -186,6 +186,7 @@ extern cvar_t t_default_grenades; extern cvar_t t_give_player_knife; extern cvar_t t_default_weapons_secondary; extern cvar_t t_default_weapons_primary; +extern cvar_t default_weapons_random; extern cvar_t free_armor; extern cvar_t teamflash; extern cvar_t allchat; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 5453b522..b32928c3 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1644,6 +1644,10 @@ void EXT_FUNC CBasePlayer::__API_HOOK(GiveDefaultItems)() // Give default secondary equipment { char *secondaryString = NULL; + int secondaryCount = 0; + const int MAX_SECONDARY = 13; // x2 + 1 + WeaponInfoStruct *secondaryWeaponInfoArray[MAX_SECONDARY]; + if (m_iTeam == CT) secondaryString = ct_default_weapons_secondary.string; else if (m_iTeam == TERRORIST) @@ -1665,18 +1669,34 @@ void EXT_FUNC CBasePlayer::__API_HOOK(GiveDefaultItems)() if (weaponInfo) { const auto iItemID = GetItemIdByWeaponId(weaponInfo->id); if (iItemID != ITEM_NONE && !HasRestrictItem(iItemID, ITEM_TYPE_EQUIPPED) && IsSecondaryWeapon(iItemID)) { - GiveWeapon(weaponInfo->gunClipSize * iAmountOfBPAmmo, weaponInfo->entityName); + if (default_weapons_random.value != 0.0f) { + if (secondaryCount < MAX_SECONDARY) { + secondaryWeaponInfoArray[secondaryCount++] = weaponInfo; + } + } + else { + GiveWeapon(weaponInfo->gunClipSize * iAmountOfBPAmmo, weaponInfo->entityName); + } } } secondaryString = SharedParse(secondaryString); } + + if (default_weapons_random.value != 0.0f) { + WeaponInfoStruct *weaponInfo = secondaryWeaponInfoArray[RANDOM_LONG(0, secondaryCount - 1)]; + if (weaponInfo) + GiveWeapon(weaponInfo->gunClipSize * iAmountOfBPAmmo, weaponInfo->entityName); + } } } // Give default primary equipment { char *primaryString = NULL; + int primaryCount = 0; + const int MAX_PRIMARY = 39; // x2 + 1 + WeaponInfoStruct *primaryWeaponInfoArray[MAX_PRIMARY]; if (m_iTeam == CT) primaryString = ct_default_weapons_primary.string; @@ -1699,12 +1719,25 @@ void EXT_FUNC CBasePlayer::__API_HOOK(GiveDefaultItems)() if (weaponInfo) { const auto iItemID = GetItemIdByWeaponId(weaponInfo->id); if (iItemID != ITEM_NONE && !HasRestrictItem(iItemID, ITEM_TYPE_EQUIPPED) && IsPrimaryWeapon(iItemID)) { - GiveWeapon(weaponInfo->gunClipSize * iAmountOfBPAmmo, weaponInfo->entityName); + if (default_weapons_random.value != 0.0f) { + if (primaryCount < MAX_PRIMARY) { + primaryWeaponInfoArray[primaryCount++] = weaponInfo; + } + } + else { + GiveWeapon(weaponInfo->gunClipSize * iAmountOfBPAmmo, weaponInfo->entityName); + } } } primaryString = SharedParse(primaryString); } + + if (default_weapons_random.value != 0.0f) { + WeaponInfoStruct *weaponInfo = primaryWeaponInfoArray[RANDOM_LONG(0, primaryCount - 1)]; + if (weaponInfo) + GiveWeapon(weaponInfo->gunClipSize * iAmountOfBPAmmo, weaponInfo->entityName); + } } } From 94a7eb4cbb2ae163d7d07af2ee9814e2fa6a3d6f Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:21:24 +0500 Subject: [PATCH 10/29] added forgot pistols fiveseven and dualelite touching for vip (#1045) --- regamedll/dlls/weapons.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 47a77c6f..b98749cb 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -618,11 +618,17 @@ void CBasePlayerItem::DefaultTouch(CBaseEntity *pOther) CBasePlayer *pPlayer = static_cast(pOther); if (pPlayer->m_bIsVIP - && m_iId != WEAPON_USP + && +#ifndef REGAMEDLL_FIXES + m_iId != WEAPON_USP && m_iId != WEAPON_GLOCK18 && m_iId != WEAPON_P228 && m_iId != WEAPON_DEAGLE - && m_iId != WEAPON_KNIFE) + && m_iId != WEAPON_KNIFE +#else + !IsSecondaryWeapon(m_iId) +#endif + ) { return; } From d8faea0966e80450814de7a10d63b55cd2e87416 Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:28:15 +0500 Subject: [PATCH 11/29] Add new CVar mp_jump_height (#1022) --- README.md | 1 + dist/game.cfg | 5 +++++ regamedll/dlls/game.cpp | 2 ++ regamedll/dlls/game.h | 1 + regamedll/dlls/player.cpp | 4 ++-- regamedll/pm_shared/pm_shared.cpp | 7 ++++++- 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 639b335f..7611beb1 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_ammo_respawn_time | 20 | 0.0 | - | The respawn time for ammunition. | | mp_vote_flags | km | 0 | - | Vote systems enabled in server.
`0` voting disabled
`k` votekick enabled via `vote` command
`m` votemap enabled via `votemap` command | | mp_votemap_min_time | 180 | 0.0 | - | Minimum seconds that must elapse on map before `votemap` command can be used. | +| mp_jump_height | 45 | 0.0 | - | Player jump height. | | bot_excellent_morale | 0 | 0 | 1 | Bots always have great morale regardless of defeat or victory. | | mp_randomspawn | 0 | 0 | 1 | Random player spawns
`0` disabled
`1` enabled
`NOTE`: Navigation `maps/.nav` file required | diff --git a/dist/game.cfg b/dist/game.cfg index c84fde86..95c7b32a 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -628,6 +628,11 @@ mp_vote_flags "km" // Default value: "180" mp_votemap_min_time "180" +// Player jump height +// +// Default value: "45" +mp_jump_height "45" + // Bots always have great morale regardless of defeat or victory. // 0 - disabled (default behaviour) // 1 - enabled diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index baaed369..37b264fb 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -172,6 +172,7 @@ cvar_t deathmsg_flags = { "mp_deathmsg_flags", "abc", 0, 0.0f cvar_t assist_damage_threshold = { "mp_assist_damage_threshold", "40", 0, 40.0f, nullptr }; cvar_t freezetime_duck = { "mp_freezetime_duck", "1", 0, 1.0f, nullptr }; cvar_t freezetime_jump = { "mp_freezetime_jump", "1", 0, 1.0f, nullptr }; +cvar_t jump_height = { "mp_jump_height", "45", FCVAR_SERVER, 45.0f, nullptr }; cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr }; @@ -453,6 +454,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&freezetime_duck); CVAR_REGISTER(&freezetime_jump); + CVAR_REGISTER(&jump_height); CVAR_REGISTER(&defuser_allocation); CVAR_REGISTER(&location_area_info); CVAR_REGISTER(&chat_loc_fallback); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index e7dba1f2..f016c0f3 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -201,6 +201,7 @@ extern cvar_t deathmsg_flags; extern cvar_t assist_damage_threshold; extern cvar_t freezetime_duck; extern cvar_t freezetime_jump; +extern cvar_t jump_height; extern cvar_t defuser_allocation; extern cvar_t location_area_info; extern cvar_t chat_loc_fallback; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index b32928c3..d510b6ce 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1487,7 +1487,7 @@ void CBasePlayer::PackDeadPlayerItems() { DropShield(); #ifdef REGAMEDLL_ADD - if(iPackGun != GR_PLR_DROP_GUN_ALL) + if (iPackGun != GR_PLR_DROP_GUN_ALL) #endif { bSkipPrimSec = true; @@ -2219,7 +2219,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib) { CBasePlayer *pAttacker = CBasePlayer::Instance(pevAttacker); - if(pAttacker /*safety*/ && !pAttacker->IsBot() && pAttacker->m_iTeam != m_iTeam) + if (pAttacker /*safety*/ && !pAttacker->IsBot() && pAttacker->m_iTeam != m_iTeam) { if (pAttacker->HasShield()) killerHasShield = true; diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index e9efb376..2de5f5fd 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -2429,13 +2429,18 @@ inline real_t PM_JumpHeight(bool longjump) #ifdef REGAMEDLL_API if (longjump) { - if(pmoveplayer->m_flLongJumpHeight > 0.0) + if (pmoveplayer->m_flLongJumpHeight > 0.0) return pmoveplayer->m_flLongJumpHeight; } else if (pmoveplayer->m_flJumpHeight > 0.0) return pmoveplayer->m_flJumpHeight; #endif + +#ifdef REGAMEDLL_ADD + return Q_sqrt(2.0 * 800.0f * (longjump ? 56.0f : Q_max(jump_height.value, 0.0f))); +#else return Q_sqrt(2.0 * 800.0f * (longjump ? 56.0f : 45.0f)); +#endif } LINK_HOOK_VOID_CHAIN2(PM_Jump) From b44b09d07be0dd0c8f9df9bf3c243f332c4f190c Mon Sep 17 00:00:00 2001 From: golukon <119600102+golukon@users.noreply.github.com> Date: Fri, 28 Mar 2025 01:30:32 +0300 Subject: [PATCH 12/29] feat: add new cvar "mp_logkills" (#1039) --- README.md | 1 + regamedll/dlls/game.cpp | 2 ++ regamedll/dlls/game.h | 1 + regamedll/dlls/multiplay_gamerules.cpp | 48 ++++++++++++++------------ 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 7611beb1..e9a42cfc 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_ammo_respawn_time | 20 | 0.0 | - | The respawn time for ammunition. | | mp_vote_flags | km | 0 | - | Vote systems enabled in server.
`0` voting disabled
`k` votekick enabled via `vote` command
`m` votemap enabled via `votemap` command | | mp_votemap_min_time | 180 | 0.0 | - | Minimum seconds that must elapse on map before `votemap` command can be used. | +| mp_logkills | 1 | 0 | 1 | Log kills.
`0` disabled
`1` enabled | | mp_jump_height | 45 | 0.0 | - | Player jump height. | | bot_excellent_morale | 0 | 0 | 1 | Bots always have great morale regardless of defeat or victory. | | mp_randomspawn | 0 | 0 | 1 | Random player spawns
`0` disabled
`1` enabled
`NOTE`: Navigation `maps/.nav` file required | diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 37b264fb..a6e15b26 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -190,6 +190,7 @@ cvar_t ammo_respawn_time = { "mp_ammo_respawn_time", "20", FCVAR_SERVER, 2 cvar_t vote_flags = { "mp_vote_flags", "km", 0, 0.0f, nullptr }; cvar_t votemap_min_time = { "mp_votemap_min_time", "180", 0, 180.0f, nullptr }; +cvar_t logkills = { "mp_logkills", "1", FCVAR_SERVER, 0.0f, nullptr }; cvar_t randomspawn = { "mp_randomspawn", "0", FCVAR_SERVER, 0.0f, nullptr }; void GameDLL_Version_f() @@ -469,6 +470,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&cv_bot_enable); CVAR_REGISTER(&cv_hostage_ai_enable); + CVAR_REGISTER(&logkills); // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index f016c0f3..bf5130d2 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -210,6 +210,7 @@ extern cvar_t weapon_respawn_time; extern cvar_t ammo_respawn_time; extern cvar_t vote_flags; extern cvar_t votemap_min_time; +extern cvar_t logkills; extern cvar_t randomspawn; #endif diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 7a84afd4..1ba7122b 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -4160,29 +4160,33 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(DeathNotice)(CBasePlayer *pVictim, pVictim->CSPlayer()->m_iNumKilledByUnanswered[iPlayerIndexKiller - 1]++; } } +#ifdef REGAMEDLL_ADD + if (static_cast(logkills.value)) +#endif + { + // Did he kill himself? + if (pVictim->pev == pevKiller) + { + // killed self + char *team = GetTeam(pVictim->m_iTeam); + UTIL_LogPrintf("\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n", STRING(pVictim->pev->netname), GETPLAYERUSERID(pVictim->edict()), + GETPLAYERAUTHID(pVictim->edict()), team, killer_weapon_name); + } + else if (pevKiller->flags & FL_CLIENT) + { + const char *VictimTeam = GetTeam(pVictim->m_iTeam); + const char *KillerTeam = (pKiller && pKiller->IsPlayer()) ? GetTeam(pKiller->m_iTeam) : ""; - // Did he kill himself? - if (pVictim->pev == pevKiller) - { - // killed self - char *team = GetTeam(pVictim->m_iTeam); - UTIL_LogPrintf("\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n", STRING(pVictim->pev->netname), GETPLAYERUSERID(pVictim->edict()), - GETPLAYERAUTHID(pVictim->edict()), team, killer_weapon_name); - } - else if (pevKiller->flags & FL_CLIENT) - { - const char *VictimTeam = GetTeam(pVictim->m_iTeam); - const char *KillerTeam = (pKiller && pKiller->IsPlayer()) ? GetTeam(pKiller->m_iTeam) : ""; - - UTIL_LogPrintf("\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n", STRING(pevKiller->netname), GETPLAYERUSERID(ENT(pevKiller)), GETPLAYERAUTHID(ENT(pevKiller)), - KillerTeam, STRING(pVictim->pev->netname), GETPLAYERUSERID(pVictim->edict()), GETPLAYERAUTHID(pVictim->edict()), VictimTeam, killer_weapon_name); - } - else - { - // killed by the world - char *team = GetTeam(pVictim->m_iTeam); - UTIL_LogPrintf("\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n", STRING(pVictim->pev->netname), GETPLAYERUSERID(pVictim->edict()), - GETPLAYERAUTHID(pVictim->edict()), team, killer_weapon_name); + UTIL_LogPrintf("\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n", STRING(pevKiller->netname), GETPLAYERUSERID(ENT(pevKiller)), GETPLAYERAUTHID(ENT(pevKiller)), + KillerTeam, STRING(pVictim->pev->netname), GETPLAYERUSERID(pVictim->edict()), GETPLAYERAUTHID(pVictim->edict()), VictimTeam, killer_weapon_name); + } + else + { + // killed by the world + char *team = GetTeam(pVictim->m_iTeam); + UTIL_LogPrintf("\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n", STRING(pVictim->pev->netname), GETPLAYERUSERID(pVictim->edict()), + GETPLAYERAUTHID(pVictim->edict()), team, killer_weapon_name); + } } // TODO: It is called in CBasePlayer::Killed too, most likely, From b10f23e1e9b4f7c30ebe08db291fb0ca0e8adb22 Mon Sep 17 00:00:00 2001 From: Vaqtincha <51029683+Vaqtincha@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:59:34 +0500 Subject: [PATCH 13/29] Add new CVars mp_playerid_showhealth & mp_playerid_field (#1046) * Add new CVars playerid_showhealth & mp_playerid_field --- README.md | 2 ++ dist/game.cfg | 19 +++++++++++ regamedll/dlls/game.cpp | 6 ++++ regamedll/dlls/game.h | 2 ++ regamedll/dlls/player.cpp | 71 +++++++++++++++++++++++++++++++++++++-- 5 files changed, 98 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9a42cfc..e515ac06 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,8 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_jump_height | 45 | 0.0 | - | Player jump height. | | bot_excellent_morale | 0 | 0 | 1 | Bots always have great morale regardless of defeat or victory. | | mp_randomspawn | 0 | 0 | 1 | Random player spawns
`0` disabled
`1` enabled
`NOTE`: Navigation `maps/.nav` file required | +| mp_playerid_showhealth | 1 | 0 | 2 | Player ID display mode.
`0` don't show health
`1` show health for teammates only (default CS behaviour)
`2` show health for all players | +| mp_playerid_field | 3 | 0 | 3 | Player ID field display mode.
`0` don't show additional information
`1` show team name
`2` show health percentage
`3` show both team name and health percentage | diff --git a/dist/game.cfg b/dist/game.cfg index 95c7b32a..3b77122f 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -648,3 +648,22 @@ bot_excellent_morale "0" // // Default value: "0" mp_randomspawn "0" + +// Player ID display mode +// +// 0 - don't show health (default behaviour) +// 1 - show health for teammates only (default CS behaviour) +// 2 - show health for all players +// +// Default value: "1" +mp_playerid_showhealth "1" + +// Player ID field display mode +// +// 0 - don't show additional information +// 1 - show team name +// 2 - show health percentage +// 3 - show both team name and health percentage +// +// Default value: "3" +mp_playerid_field "3" diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index a6e15b26..6aaefbb7 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -193,6 +193,9 @@ cvar_t votemap_min_time = { "mp_votemap_min_time", "180", 0, 180.0f, null cvar_t logkills = { "mp_logkills", "1", FCVAR_SERVER, 0.0f, nullptr }; cvar_t randomspawn = { "mp_randomspawn", "0", FCVAR_SERVER, 0.0f, nullptr }; +cvar_t playerid_showhealth = { "mp_playerid_showhealth", "1", 0, 1.0f, nullptr }; +cvar_t playerid_field = { "mp_playerid_field", "3", 0, 3.0f, nullptr }; + void GameDLL_Version_f() { if (Q_stricmp(CMD_ARGV(1), "version") != 0) @@ -472,6 +475,9 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&cv_hostage_ai_enable); CVAR_REGISTER(&logkills); + CVAR_REGISTER(&playerid_showhealth); + CVAR_REGISTER(&playerid_field); + // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index bf5130d2..b3198ac4 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -212,6 +212,8 @@ extern cvar_t vote_flags; extern cvar_t votemap_min_time; extern cvar_t logkills; extern cvar_t randomspawn; +extern cvar_t playerid_showhealth; +extern cvar_t playerid_field; #endif diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index d510b6ce..81548d34 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -115,6 +115,57 @@ void CBasePlayer::SendItemStatus() MESSAGE_END(); } +#ifdef REGAMEDLL_ADD + +enum PlayerIdShowHealth +{ + PLAYERID_HIDE = 0, // Don't show health + PLAYERID_TEAMMATES = 1, // Show health for teammates only (default CS) + PLAYERID_ALL = 2 // Show health for all players +}; + +enum PlayerIdField +{ + PLAYERID_FIELD_NONE = 0, // No extra info + PLAYERID_FIELD_TEAM = 1, // Show team name + PLAYERID_FIELD_HEALTH = 2, // Show health percentage + PLAYERID_FIELD_BOTH = 3 // Show both team name and health +}; + +inline const char *GetPlayerIdString(bool sameTeam) +{ + int showHealth = static_cast(playerid_showhealth.value); + int fieldType = static_cast(playerid_field.value); + + // Don't show health + if (showHealth == PLAYERID_HIDE) + { + return (fieldType == PLAYERID_FIELD_NONE) ? "1 %p2" : "1 %c1: %p2"; + } + + // Health only for teammates + if (showHealth == PLAYERID_TEAMMATES && !sameTeam) + { + switch (fieldType) + { + case PLAYERID_FIELD_TEAM: return "1 %c1: %p2"; + case PLAYERID_FIELD_HEALTH: return "1 %p2"; + case PLAYERID_FIELD_BOTH: return "1 %c1: %p2"; + default: return "1 %p2"; + } + } + + // Show health to everyone + switch (fieldType) + { + case PLAYERID_FIELD_TEAM: return "1 %c1: %p2\n2 : %i3%%"; + case PLAYERID_FIELD_HEALTH: return "1 %p2\n2 %h: %i3%%"; + case PLAYERID_FIELD_BOTH: return "1 %c1: %p2\n2 %h: %i3%%"; + default: return "1 %p2\n2 : %i3%%"; + } +} +#endif + const char *GetCSModelName(int item_id) { const char *modelName = nullptr; @@ -8149,11 +8200,19 @@ void CBasePlayer::UpdateStatusBar() if (sameTeam || GetObserverMode() != OBS_NONE) { if (playerid.value != PLAYERID_MODE_OFF || GetObserverMode() != OBS_NONE) +#ifndef REGAMEDLL_ADD Q_strlcpy(sbuf0, "1 %c1: %p2\n2 %h: %i3%%"); +#else + Q_strlcpy(sbuf0, GetPlayerIdString(sameTeam)); +#endif else Q_strlcpy(sbuf0, " "); - - newSBarState[SBAR_ID_TARGETHEALTH] = int((pEntity->pev->health / pEntity->pev->max_health) * 100); +#ifdef REGAMEDLL_ADD + if (static_cast(playerid_showhealth.value) != PLAYERID_FIELD_NONE) +#endif + { + newSBarState[SBAR_ID_TARGETHEALTH] = int((pEntity->pev->health / pEntity->pev->max_health) * 100); + } if (!(m_flDisplayHistory & DHF_FRIEND_SEEN) && !(pev->flags & FL_SPECTATOR)) { @@ -8164,10 +8223,18 @@ void CBasePlayer::UpdateStatusBar() else if (GetObserverMode() == OBS_NONE) { if (playerid.value != PLAYERID_MODE_TEAMONLY && playerid.value != PLAYERID_MODE_OFF) +#ifndef REGAMEDLL_ADD Q_strlcpy(sbuf0, "1 %c1: %p2"); +#else + Q_strlcpy(sbuf0, GetPlayerIdString(sameTeam)); +#endif else Q_strlcpy(sbuf0, " "); +#ifdef REGAMEDLL_ADD + if (static_cast(playerid_showhealth.value) == PLAYERID_ALL) + newSBarState[SBAR_ID_TARGETHEALTH] = int((pEntity->pev->health / pEntity->pev->max_health) * 100); +#endif if (!(m_flDisplayHistory & DHF_ENEMY_SEEN)) { m_flDisplayHistory |= DHF_ENEMY_SEEN; From ce11175e89a9d71cc5c5034a0e5b6be71e47f9e7 Mon Sep 17 00:00:00 2001 From: Garey Date: Fri, 28 Mar 2025 04:05:43 +0500 Subject: [PATCH 14/29] Add cvar for stamina restoration speed based on fps reference. (#1005) * Add variable for framerate (FPS), that used as reference when restoring stamina (fuser2) after jump. --- README.md | 1 + dist/game.cfg | 6 ++++++ regamedll/dlls/game.cpp | 4 ++++ regamedll/dlls/game.h | 1 + regamedll/pm_shared/pm_shared.cpp | 13 +++++++++++++ 5 files changed, 25 insertions(+) diff --git a/README.md b/README.md index e515ac06..f6da4953 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_ammo_respawn_time | 20 | 0.0 | - | The respawn time for ammunition. | | mp_vote_flags | km | 0 | - | Vote systems enabled in server.
`0` voting disabled
`k` votekick enabled via `vote` command
`m` votemap enabled via `votemap` command | | mp_votemap_min_time | 180 | 0.0 | - | Minimum seconds that must elapse on map before `votemap` command can be used. | +| mp_stamina_restore_rate | 0 | 0.0 | - | Framerate (FPS), that used as reference when restoring stamina (fuser2) after jump. | | mp_logkills | 1 | 0 | 1 | Log kills.
`0` disabled
`1` enabled | | mp_jump_height | 45 | 0.0 | - | Player jump height. | | bot_excellent_morale | 0 | 0 | 1 | Bots always have great morale regardless of defeat or victory. | diff --git a/dist/game.cfg b/dist/game.cfg index 3b77122f..560629c2 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -628,6 +628,12 @@ mp_vote_flags "km" // Default value: "180" mp_votemap_min_time "180" +// Framerate (FPS), that is used as a reference when restoring stamina (fuser2) after a jump. +// 0 - disabled +// +// Default value: "0" +mp_stamina_restore_rate "0" + // Player jump height // // Default value: "45" diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 6aaefbb7..f36e80d8 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -190,6 +190,8 @@ cvar_t ammo_respawn_time = { "mp_ammo_respawn_time", "20", FCVAR_SERVER, 2 cvar_t vote_flags = { "mp_vote_flags", "km", 0, 0.0f, nullptr }; cvar_t votemap_min_time = { "mp_votemap_min_time", "180", 0, 180.0f, nullptr }; +cvar_t stamina_restore_rate = { "mp_stamina_restore_rate", "0", 0, 0.f, nullptr }; + cvar_t logkills = { "mp_logkills", "1", FCVAR_SERVER, 0.0f, nullptr }; cvar_t randomspawn = { "mp_randomspawn", "0", FCVAR_SERVER, 0.0f, nullptr }; @@ -478,6 +480,8 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&playerid_showhealth); CVAR_REGISTER(&playerid_field); + CVAR_REGISTER(&stamina_restore_rate); + // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index b3198ac4..ac937891 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -210,6 +210,7 @@ extern cvar_t weapon_respawn_time; extern cvar_t ammo_respawn_time; extern cvar_t vote_flags; extern cvar_t votemap_min_time; +extern cvar_t stamina_restore_rate; extern cvar_t logkills; extern cvar_t randomspawn; extern cvar_t playerid_showhealth; diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index 2de5f5fd..6904a756 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -886,6 +886,18 @@ void PM_WalkMove() { real_t flRatio = (100 - pmove->fuser2 * 0.001 * 19) * 0.01; +#ifdef REGAMEDLL_ADD + // change stamina restoration speed by fps reference + if (stamina_restore_rate.value > 0.0f) + { + real_t flReferenceFrametime = 1.0f / stamina_restore_rate.value; + + float flFrametimeRatio = pmove->frametime / flReferenceFrametime; + + flRatio = pow(flRatio, flFrametimeRatio); + } +#endif + pmove->velocity[0] *= flRatio; pmove->velocity[1] *= flRatio; } @@ -2611,6 +2623,7 @@ void EXT_FUNC __API_HOOK(PM_Jump)() { // NOTE: don't do it in .f (float) real_t flRatio = (100.0 - pmove->fuser2 * 0.001 * 19.0) * 0.01; + pmove->velocity[2] *= flRatio; } From d3fc7ac000383b28780d2d79abba417c7f544a5c Mon Sep 17 00:00:00 2001 From: Garey Date: Fri, 28 Mar 2025 04:16:07 +0500 Subject: [PATCH 15/29] New flymove more accurate method (#1006) --- README.md | 1 + dist/game.cfg | 7 ++ regamedll/dlls/game.cpp | 3 + regamedll/dlls/game.h | 3 + regamedll/pm_shared/pm_shared.cpp | 175 ++++++++++++++++++++++++++++++ 5 files changed, 189 insertions(+) diff --git a/README.md b/README.md index f6da4953..b39c0f19 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_ammo_respawn_time | 20 | 0.0 | - | The respawn time for ammunition. | | mp_vote_flags | km | 0 | - | Vote systems enabled in server.
`0` voting disabled
`k` votekick enabled via `vote` command
`m` votemap enabled via `votemap` command | | mp_votemap_min_time | 180 | 0.0 | - | Minimum seconds that must elapse on map before `votemap` command can be used. | +| mp_flymove_method | 0 | 0 | 1 | Set the method used for flymove calculations.
`0` default method
`1` alternative method (more accurate) | | mp_stamina_restore_rate | 0 | 0.0 | - | Framerate (FPS), that used as reference when restoring stamina (fuser2) after jump. | | mp_logkills | 1 | 0 | 1 | Log kills.
`0` disabled
`1` enabled | | mp_jump_height | 45 | 0.0 | - | Player jump height. | diff --git a/dist/game.cfg b/dist/game.cfg index 560629c2..70bd646b 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -628,6 +628,13 @@ mp_vote_flags "km" // Default value: "180" mp_votemap_min_time "180" +// Set the method used for flymove calculations. +// 0 - default method +// 1 - alternative method (more accurate) +// +// Default value: "0" +mp_flymove_method "0" + // Framerate (FPS), that is used as a reference when restoring stamina (fuser2) after a jump. // 0 - disabled // diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index f36e80d8..e5ee0c2b 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -190,6 +190,7 @@ cvar_t ammo_respawn_time = { "mp_ammo_respawn_time", "20", FCVAR_SERVER, 2 cvar_t vote_flags = { "mp_vote_flags", "km", 0, 0.0f, nullptr }; cvar_t votemap_min_time = { "mp_votemap_min_time", "180", 0, 180.0f, nullptr }; +cvar_t flymove_method = { "mp_flymove_method", "0", 0, 0.0f, nullptr }; cvar_t stamina_restore_rate = { "mp_stamina_restore_rate", "0", 0, 0.f, nullptr }; cvar_t logkills = { "mp_logkills", "1", FCVAR_SERVER, 0.0f, nullptr }; @@ -482,6 +483,8 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&stamina_restore_rate); + CVAR_REGISTER(&flymove_method); + // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index ac937891..95609f12 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -210,6 +210,7 @@ extern cvar_t weapon_respawn_time; extern cvar_t ammo_respawn_time; extern cvar_t vote_flags; extern cvar_t votemap_min_time; +extern cvar_t flymove_method; extern cvar_t stamina_restore_rate; extern cvar_t logkills; extern cvar_t randomspawn; @@ -222,4 +223,6 @@ extern cvar_t scoreboard_showmoney; extern cvar_t scoreboard_showhealth; extern cvar_t scoreboard_showdefkit; + + void GameDLLInit(); diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index 6904a756..846b410d 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -641,9 +641,184 @@ void PM_FixupGravityVelocity() pmove->velocity[2] -= (pmove->movevars->gravity * pmove->frametime * ent_gravity * 0.5); PM_CheckVelocity(); } +#ifdef REGAMEDLL_ADD +int PM_FlyMove_New() +{ + int bumpcount, numbumps; + vec3_t dir; + float d; + int numplanes; + vec3_t planes[MAX_CLIP_PLANES]; + vec3_t primal_velocity; + vec3_t clipVelocity; + int i, j, k; + pmtrace_t trace; + vec3_t end; + float time_left; + float into; + vec3_t endVelocity; + vec3_t endClipVelocity; + int blocked; + numbumps = 4; + + VectorCopy(pmove->velocity, primal_velocity); + + + time_left = pmove->frametime; + + numplanes = 0; + blocked = 0x00; // Assume not blocked + + // never turn against original velocity + VectorCopy(pmove->velocity, planes[numplanes]); + VectorNormalize(planes[numplanes]); + numplanes++; + + for (bumpcount = 0; bumpcount < numbumps; bumpcount++) { + + // calculate position we are trying to move to + VectorMA(pmove->origin, time_left, pmove->velocity, end); + + // see if we can make it there + trace = pmove->PM_PlayerTrace(pmove->origin, end, PM_NORMAL, -1); + + if (trace.allsolid) { + // entity is completely trapped in another solid + pmove->velocity[2] = 0; // don't build up falling damage, but allow sideways acceleration + return 4; + } + + if (trace.fraction > 0) { + // actually covered some distance + VectorCopy(trace.endpos, pmove->origin); + } + + if (trace.fraction == 1) { + break; // moved the entire distance + } + + // save entity for contact + PM_AddToTouched(trace, pmove->velocity); + + // If the plane we hit has a high z component in the normal, then + // it's probably a floor + if (trace.plane.normal[2] > 0.7f) + { + // floor + blocked |= 0x01; + } + + // If the plane has a zero z component in the normal, then it's a + // step or wall + if (!trace.plane.normal[2]) + { + // step / wall + blocked |= 0x02; + } + + time_left -= time_left * trace.fraction; + + if (numplanes >= MAX_CLIP_PLANES) { + // this shouldn't really happen + VectorClear(pmove->velocity); + break; + } + + // + // if this is the same plane we hit before, nudge velocity + // out along it, which fixes some epsilon issues with + // non-axial planes + // + for (i = 0; i < numplanes; i++) { + if (DotProduct(trace.plane.normal, planes[i]) > 0.99) { + VectorAdd(trace.plane.normal, pmove->velocity, pmove->velocity); + break; + } + } + if (i < numplanes) { + continue; + } + VectorCopy(trace.plane.normal, planes[numplanes]); + numplanes++; + + // + // modify velocity so it parallels all of the clip planes + // + + // find a plane that it enters + for (i = 0; i < numplanes; i++) { + into = DotProduct(pmove->velocity, planes[i]); + if (into >= 0.1) { + continue; // move doesn't interact with the plane + } + + // slide along the plane + PM_ClipVelocity(pmove->velocity, planes[i], clipVelocity, 1); + + // slide along the plane + PM_ClipVelocity(endVelocity, planes[i], endClipVelocity, 1); + + // see if there is a second plane that the new move enters + for (j = 0; j < numplanes; j++) { + if (j == i) { + continue; + } + if (DotProduct(clipVelocity, planes[j]) >= 0.1) { + continue; // move doesn't interact with the plane + } + + // try clipping the move to the plane + PM_ClipVelocity(clipVelocity, planes[j], clipVelocity, 1); + PM_ClipVelocity(endClipVelocity, planes[j], endClipVelocity, 1); + + // see if it goes back into the first clip plane + if (DotProduct(clipVelocity, planes[i]) >= 0) { + continue; + } + + // slide the original velocity along the crease + CrossProduct(planes[i], planes[j], dir); + VectorNormalize(dir); + d = DotProduct(dir, pmove->velocity); + VectorScale(dir, d, clipVelocity); + + CrossProduct(planes[i], planes[j], dir); + VectorNormalize(dir); + d = DotProduct(dir, endVelocity); + VectorScale(dir, d, endClipVelocity); + + // see if there is a third plane the the new move enters + for (k = 0; k < numplanes; k++) { + if (k == i || k == j) { + continue; + } + if (DotProduct(clipVelocity, planes[k]) >= 0.1) { + continue; // move doesn't interact with the plane + } + + // stop dead at a tripple plane interaction + VectorClear(pmove->velocity); + return 4; + } + } + + // if we have fixed all interactions, try another move + VectorCopy(clipVelocity, pmove->velocity); + VectorCopy(endClipVelocity, endVelocity); + break; + } + } + + return blocked; +} +#endif int PM_FlyMove() { +#ifdef REGAMEDLL_ADD + if (flymove_method.value) + return PM_FlyMove_New(); +#endif int bumpcount, numbumps; vec3_t dir; float d; From f5cc6f3a8bcc1484f405520661f6ec74af1b7d0b Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 4 Apr 2025 02:19:53 +0700 Subject: [PATCH 16/29] AngleQuaternion: fix buffer overflow --- regamedll/dlls/animation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/animation.cpp b/regamedll/dlls/animation.cpp index 7d5df6f0..fbf6a1bb 100644 --- a/regamedll/dlls/animation.cpp +++ b/regamedll/dlls/animation.cpp @@ -547,7 +547,9 @@ void AngleQuaternion(vec_t *angles, vec_t *quaternion) { static const ALIGN16_BEG size_t ps_signmask[4] ALIGN16_END = { 0x80000000, 0, 0x80000000, 0 }; - __m128 a = _mm_loadu_ps(angles); + vec4_t _ps_angles = { angles[0], angles[1], angles[2], 0.0f }; + + __m128 a = _mm_loadu_ps(_ps_angles); a = _mm_mul_ps(a, _mm_load_ps(_ps_0p5)); //a *= 0.5 __m128 s, c; sincos_ps(a, &s, &c); From 6f70d6dd8e61943f1a093d292b8768dc7cc50ef8 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 4 Apr 2025 02:41:19 +0700 Subject: [PATCH 17/29] ZBot: Implemented immediate reloading of nav data after bot analysis, without requiring a full map restart ZBot: Added cleanup for dangling navigation pointers in bots, enabling seamless map reanalysis Minor refactoring --- regamedll/dlls/bot/cs_bot.cpp | 126 ++++++++++++++++++ regamedll/dlls/bot/cs_bot.h | 6 + regamedll/dlls/bot/cs_bot_init.cpp | 2 +- regamedll/dlls/bot/cs_bot_learn.cpp | 17 +-- regamedll/dlls/bot/cs_bot_manager.cpp | 173 ++++++++++++++++++++----- regamedll/dlls/bot/cs_bot_manager.h | 9 +- regamedll/dlls/bot/cs_bot_vision.cpp | 2 +- regamedll/dlls/client.cpp | 11 +- regamedll/dlls/game.cpp | 4 +- regamedll/dlls/player.cpp | 2 + regamedll/dlls/util.cpp | 2 +- regamedll/game_shared/bot/nav.h | 7 + regamedll/game_shared/bot/nav_area.cpp | 56 ++++++-- regamedll/game_shared/bot/nav_area.h | 1 + regamedll/game_shared/bot/nav_file.cpp | 7 + regamedll/msvc/ReGameDLL.vcxproj | 5 +- 16 files changed, 355 insertions(+), 75 deletions(-) diff --git a/regamedll/dlls/bot/cs_bot.cpp b/regamedll/dlls/bot/cs_bot.cpp index dd85448c..b89a6912 100644 --- a/regamedll/dlls/bot/cs_bot.cpp +++ b/regamedll/dlls/bot/cs_bot.cpp @@ -900,3 +900,129 @@ float CCSBot::GetRangeToFarthestEscortedHostage() const return away.m_farRange; } + +// Remove all occurrences of a given area from the path list +void CCSBot::RemovePath(CNavArea *area) +{ + int i = 0; + while (i < m_pathLength) + { + if (m_path[i].area == area) + { + // If this area is linked to a ladder, clear the reference + if (m_path[i].ladder == m_pathLadder) + m_pathLadder = nullptr; + + m_pathLength--; + + // adjust the current path index if the removed element is being used + if (i == m_pathIndex) + { + if (i > 0) + m_pathIndex = i - 1; + else + m_pathIndex = 0; + } + + if (m_pathLength != i) + Q_memmove(&m_path[i], &m_path[i + 1], (m_pathLength - i) * sizeof(m_path[0])); + + // clear the slot + Q_memset(&m_path[m_pathLength], 0, sizeof(m_path[m_pathLength])); + } + else + { + i++; + } + } +} + +// Remove a hiding spot from the checked spots list +void CCSBot::RemoveHidingSpot(HidingSpot *spot) +{ + int i = 0; + while (i < m_pathLength) + { + if (m_checkedHidingSpot[i].spot == spot) + { + m_checkedHidingSpotCount--; + + if (m_checkedHidingSpotCount != i) + Q_memmove(&m_checkedHidingSpot[i], &m_checkedHidingSpot[i + 1], (m_checkedHidingSpotCount - i) * sizeof(m_checkedHidingSpot[0])); + + // clear the slot + Q_memset(&m_checkedHidingSpot[m_checkedHidingSpotCount], 0, sizeof(m_checkedHidingSpot[m_checkedHidingSpotCount])); + } + else + { + i++; + } + } +} + +// Handle navigation-related cleanup when a nav area, spot, or encounter is destroyed +void CCSBot::OnDestroyNavDataNotify(NavNotifyDestroyType navNotifyType, void *dead) +{ + switch (navNotifyType) + { + case NAV_NOTIFY_DESTROY_AREA: + { + CNavArea *area = static_cast(dead); + + // If the destroyed area was linked to a spot encounter, clear it + if (m_spotEncounter) + { + if (m_spotEncounter->from.area == area || m_spotEncounter->to.area == area) + m_spotEncounter = nullptr; + } + + RemovePath(area); + + // Invalidate any references to the destroyed area + + if (m_noiseArea == area) + m_noiseArea = nullptr; + + if (m_currentArea == area) + m_currentArea = nullptr; + + if (m_lastKnownArea == area) + m_lastKnownArea = nullptr; + + if (m_hideState.GetSearchArea() == area) + m_hideState.SetSearchArea(nullptr); + + if (m_huntState.GetHuntArea() == area) + m_huntState.ClearHuntArea(); + + break; + } + case NAV_NOTIFY_DESTROY_SPOT_ENCOUNTER: + { + CNavArea *area = static_cast(dead); + + // Remove the encounter if it references the destroyed area + if (m_spotEncounter && area->HasSpotEncounter(m_spotEncounter)) + m_spotEncounter = nullptr; + + break; + } + case NAV_NOTIFY_DESTROY_SPOT: + { + HidingSpot *spot = static_cast(dead); + + // Remove the destroyed hiding spot from the spot order list + if (m_spotEncounter) + { + SpotOrderList &spotOrderList = m_spotEncounter->spotList; + spotOrderList.erase(std::remove_if(spotOrderList.begin(), spotOrderList.end(), [&](SpotOrder &spotOrder) { + return spotOrder.spot == spot; + } + ), spotOrderList.end()); + } + + RemoveHidingSpot(spot); + break; + } + } +} diff --git a/regamedll/dlls/bot/cs_bot.h b/regamedll/dlls/bot/cs_bot.h index 8f63e1a6..0ba29985 100644 --- a/regamedll/dlls/bot/cs_bot.h +++ b/regamedll/dlls/bot/cs_bot.h @@ -71,6 +71,7 @@ public: virtual const char *GetName() const { return "Hunt"; } void ClearHuntArea() { m_huntArea = nullptr; } + CNavArea *GetHuntArea() { return m_huntArea; } private: CNavArea *m_huntArea; @@ -204,6 +205,7 @@ public: const Vector &GetHidingSpot() const { return m_hidingSpot; } void SetSearchArea(CNavArea *area) { m_searchFromArea = area; } + CNavArea *GetSearchArea() { return m_searchFromArea; } void SetSearchRange(float range) { m_range = range; } void SetDuration(float time) { m_duration = time; } @@ -544,6 +546,10 @@ public: float GetFeetZ() const; // return Z of bottom of feet + void OnDestroyNavDataNotify(NavNotifyDestroyType navNotifyType, void *dead); + void RemovePath(CNavArea *area); + void RemoveHidingSpot(HidingSpot *spot); + enum PathResult { PROGRESSING, // we are moving along the path diff --git a/regamedll/dlls/bot/cs_bot_init.cpp b/regamedll/dlls/bot/cs_bot_init.cpp index 3199cf91..2db6b02d 100644 --- a/regamedll/dlls/bot/cs_bot_init.cpp +++ b/regamedll/dlls/bot/cs_bot_init.cpp @@ -337,7 +337,7 @@ void CCSBot::ResetValues() // NOTE: For some reason, this can be called twice when a bot is added. void CCSBot::SpawnBot() { - TheCSBots()->ValidateMapData(); + TheCSBots()->LoadNavigationMap(); ResetValues(); Q_strlcpy(m_name, STRING(pev->netname)); diff --git a/regamedll/dlls/bot/cs_bot_learn.cpp b/regamedll/dlls/bot/cs_bot_learn.cpp index 3cf041e3..e68a77a5 100644 --- a/regamedll/dlls/bot/cs_bot_learn.cpp +++ b/regamedll/dlls/bot/cs_bot_learn.cpp @@ -477,31 +477,24 @@ void CCSBot::StartSaveProcess() void CCSBot::UpdateSaveProcess() { - char msg[256]; - char cmd[128]; - char gd[64]{}; GET_GAME_DIR(gd); char filename[MAX_OSPATH]; Q_snprintf(filename, sizeof(filename), "%s\\%s", gd, TheBots->GetNavMapFilename()); - - HintMessageToAllPlayers("Saving..."); SaveNavigationMap(filename); + char msg[256]{}; Q_snprintf(msg, sizeof(msg), "Navigation file '%s' saved.", filename); HintMessageToAllPlayers(msg); + CONSOLE_ECHO("%s\n", msg); hideProgressMeter(); StartNormalProcess(); -#ifndef REGAMEDLL_FIXES - Q_snprintf(cmd, sizeof(cmd), "map %s\n", STRING(gpGlobals->mapname)); -#else - Q_snprintf(cmd, sizeof(cmd), "changelevel %s\n", STRING(gpGlobals->mapname)); -#endif - - SERVER_COMMAND(cmd); + // tell bot manager that the analysis is completed + if (TheCSBots()) + TheCSBots()->AnalysisCompleted(); } void CCSBot::StartNormalProcess() diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index e68bea53..15fc3de2 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -231,13 +231,12 @@ bool CCSBotManager::IsOnOffense(CBasePlayer *pPlayer) const // Invoked when a map has just been loaded void CCSBotManager::ServerActivate() { - DestroyNavigationMap(); m_isMapDataLoaded = false; m_zoneCount = 0; m_gameScenario = SCENARIO_DEATHMATCH; - ValidateMapData(); + LoadNavigationMap(); RestartRound(); m_isLearningMap = false; @@ -591,7 +590,8 @@ void CCSBotManager::ServerCommand(const char *pcmd) } else if (FStrEq(pcmd, "bot_nav_load")) { - ValidateMapData(); + m_isMapDataLoaded = false; // force nav reload + LoadNavigationMap(); } else if (FStrEq(pcmd, "bot_nav_use_place")) { @@ -1144,7 +1144,6 @@ private: CCSBotManager::Zone *m_zone; }; -#ifdef REGAMEDLL_ADD LINK_ENTITY_TO_CLASS(info_spawn_point, CPointEntity, CCSPointEntity) inline bool IsFreeSpace(Vector vecOrigin, int iHullNumber, edict_t *pSkipEnt = nullptr) @@ -1163,6 +1162,9 @@ inline bool pointInRadius(Vector vecOrigin, float radius) CBaseEntity *pEntity = nullptr; while ((pEntity = UTIL_FindEntityInSphere(pEntity, vecOrigin, radius))) { + if (!UTIL_IsValidEntity(pEntity->edict())) + continue; // ignore the entity marked for deletion + if (FClassnameIs(pEntity->edict(), "info_spawn_point")) return true; } @@ -1171,12 +1173,10 @@ inline bool pointInRadius(Vector vecOrigin, float radius) } // a simple algorithm that searches for the farthest point (so that the player does not look at the wall) -inline Vector GetBestAngle(const Vector &vecStart) +inline bool GetIdealLookYawForSpawnPoint(const Vector &vecStart, float &flIdealLookYaw) { const float ANGLE_STEP = 30.0f; - float bestAngle = 0.0f; float bestDistance = 0.0f; - Vector vecBestAngle = Vector(0, -1, 0); for (float angleYaw = 0.0f; angleYaw <= 360.0f; angleYaw += ANGLE_STEP) { @@ -1187,15 +1187,14 @@ inline Vector GetBestAngle(const Vector &vecStart) UTIL_TraceLine(vecStart, vecEnd, ignore_monsters, nullptr, &tr); float distance = (vecStart - tr.vecEndPos).Length(); - if (distance > bestDistance) { bestDistance = distance; - vecBestAngle.y = angleYaw; + flIdealLookYaw = angleYaw; } } - return vecBestAngle; + return bestDistance > 0.0f; } // this function from leaked csgo sources 2020y @@ -1231,58 +1230,69 @@ inline bool IsValidArea(CNavArea *area) return false; } -void GetSpawnPositions() -{ - const float MIN_AREA_SIZE = 32.0f; - const int MAX_SPAWNS_POINTS = 128; - const float MAX_SLOPE = 0.85f; +#ifdef REGAMEDLL_ADD +// Generates spawn points (info_spawn_point entities) for players and bots based on the navigation map data +// It uses the navigation areas to find valid spots for spawn points considering factors like area size, slope, +// available free space, and distance from other spawn points. +void GenerateSpawnPointsFromNavData() +{ + // Remove any existing spawn points + UTIL_RemoveOther("info_spawn_point"); + + const int MAX_SPAWNS_POINTS = 128; // Max allowed spawn points + + const float MAX_SLOPE = 0.85f; // Maximum slope allowed for a spawn point + const float MIN_AREA_SIZE = 32.0f; // Minimum area size for a valid spawn point + const float MIN_NEARBY_SPAWNPOINT = 128.0f; // Minimum distance between spawn point + + // Total number of spawn points generated int totalSpawns = 0; - for (NavAreaList::iterator iter = TheNavAreaList.begin(); iter != TheNavAreaList.end(); iter++) + for (CNavArea *area : TheNavAreaList) { if (totalSpawns >= MAX_SPAWNS_POINTS) break; - CNavArea *area = *iter; - if (!area) continue; - // ignore small areas + // Skip areas that are too small if (area->GetSizeX() < MIN_AREA_SIZE || area->GetSizeY() < MIN_AREA_SIZE) continue; - // ignore areas jump, crouch etc - if (area->GetAttributes()) + // Skip areas with unwanted attributes (jump, crouch, etc.) + if (area->GetAttributes() != 0) continue; + // Skip areas with steep slopes if (area->GetAreaSlope() < MAX_SLOPE) { //CONSOLE_ECHO("Skip area slope: %0.3f\n", area->GetAreaSlope()); continue; } + // Calculate the spawn point position above the area center Vector vecOrigin = *area->GetCenter() + Vector(0, 0, HalfHumanHeight + 5); + // Ensure there is free space at the calculated position if (!IsFreeSpace(vecOrigin, human_hull)) { //CONSOLE_ECHO("No free space!\n"); continue; } - if (pointInRadius(vecOrigin, 128.0f)) - continue; + if (pointInRadius(vecOrigin, MIN_NEARBY_SPAWNPOINT)) + continue; // spawn point is too close to others if (!IsValidArea(area)) continue; - Vector bestAngle = GetBestAngle(vecOrigin); - - if (bestAngle.y != -1) + // Calculate ideal spawn point yaw angle + float flIdealSpawnPointYaw = 0.0f; + if (GetIdealLookYawForSpawnPoint(vecOrigin, flIdealSpawnPointYaw)) { - CBaseEntity* pPoint = CBaseEntity::Create("info_spawn_point", vecOrigin, bestAngle, nullptr); - + CBaseEntity *pPoint = CBaseEntity::Create("info_spawn_point", vecOrigin, Vector(0, flIdealSpawnPointYaw, 0), nullptr); if (pPoint) { totalSpawns++; @@ -1302,24 +1312,64 @@ void GetSpawnPositions() CONSOLE_ECHO("Total spawns points: %i\n", totalSpawns); } + #endif -// Search the map entities to determine the game scenario and define important zones. -void CCSBotManager::ValidateMapData() +// Load the map's navigation data +bool CCSBotManager::LoadNavigationMap() { + // check if the map data is already loaded or if bots are not allowed if (m_isMapDataLoaded || !AreBotsAllowed()) - return; + return false; m_isMapDataLoaded = true; - if (LoadNavigationMap()) + // Clear navigation map data from previous map + DestroyNavigationMap(); + + // Try to load the map's navigation file + NavErrorType navStatus = ::LoadNavigationMap(); + if (navStatus != NAV_OK) { - CONSOLE_ECHO("Failed to load navigation map.\n"); - return; + CONSOLE_ECHO("ERROR: Failed to load 'maps/%s.nav' file navigation map!\n", STRING(gpGlobals->mapname)); + + switch (navStatus) + { + case NAV_CANT_ACCESS_FILE: + CONSOLE_ECHO("\tNavigation file not found or access denied.\n"); + break; + case NAV_INVALID_FILE: + CONSOLE_ECHO("\tInvalid navigation file format.\n"); + break; + case NAV_BAD_FILE_VERSION: + CONSOLE_ECHO("\tBad navigation file version.\n"); + break; + case NAV_CORRUPT_DATA: + CONSOLE_ECHO("\tCorrupted navigation data detected.\n"); + break; + default: + break; + } + + if (navStatus != NAV_CANT_ACCESS_FILE) + CONSOLE_ECHO("\tTry regenerating it using the command: bot_nav_analyze\n"); + + return false; } - CONSOLE_ECHO("Navigation map loaded.\n"); + // Determine the scenario for the current map (e.g., bomb defuse, hostage rescue etc) + DetermineMapScenario(); +#ifdef REGAMEDLL_ADD + GenerateSpawnPointsFromNavData(); +#endif + + return true; +} + +// Search the map entities to determine the game scenario and define important zones. +void CCSBotManager::DetermineMapScenario() +{ m_zoneCount = 0; m_gameScenario = SCENARIO_DEATHMATCH; @@ -1459,6 +1509,59 @@ void CCSBotManager::ValidateMapData() } } +// Tell all bots that the given nav data no longer exists +// This function is called when a part of the map or the nav data is destroyed +void CCSBotManager::OnDestroyNavDataNotify(NavNotifyDestroyType navNotifyType, void *dead) +{ + for (int i = 1; i <= gpGlobals->maxClients; i++) + { + CBasePlayer *pPlayer = UTIL_PlayerByIndex(i); + + if (!UTIL_IsValidPlayer(pPlayer)) + continue; + + if (!pPlayer->IsBot()) + continue; + + // Notify the bot about the destroyed nav data + CCSBot *pBot = static_cast(pPlayer); + pBot->OnDestroyNavDataNotify(navNotifyType, dead); + } +} + +// Called when the map analysis process has completed +// This function makes sure all bots are removed from the map analysis process +// and are reset to normal bot behavior. It also reloads the navigation map +// and triggers a game restart after the analysis is completed +void CCSBotManager::AnalysisCompleted() +{ + // Ensure that all bots are no longer involved in map analysis and start their normal process + for (int i = 1; i <= gpGlobals->maxClients; i++) + { + CBasePlayer *pPlayer = UTIL_PlayerByIndex(i); + + if (!UTIL_IsValidPlayer(pPlayer)) + continue; + + if (!pPlayer->IsBot()) + continue; + + CCSBot *pBot = static_cast(pPlayer); + pBot->StartNormalProcess(); + } + + m_isLearningMap = false; + m_isMapDataLoaded = false; + m_isAnalysisRequested = false; + + // Try to reload the navigation map from the file + if (LoadNavigationMap()) + { + // Initiate a game restart in 3 seconds + CVAR_SET_FLOAT("sv_restart", 3); + } +} + bool CCSBotManager::AddBot(const BotProfile *profile, BotProfileTeamType team) { if (!AreBotsAllowed()) diff --git a/regamedll/dlls/bot/cs_bot_manager.h b/regamedll/dlls/bot/cs_bot_manager.h index 0d5e6e37..6f3b0e68 100644 --- a/regamedll/dlls/bot/cs_bot_manager.h +++ b/regamedll/dlls/bot/cs_bot_manager.h @@ -56,13 +56,16 @@ public: virtual bool IsImportantPlayer(CBasePlayer *pPlayer) const; // return true if pPlayer is important to scenario (VIP, bomb carrier, etc) public: - void ValidateMapData(); + bool LoadNavigationMap(); + void DetermineMapScenario(); void OnFreeEntPrivateData(CBaseEntity *pEntity); + void OnDestroyNavDataNotify(NavNotifyDestroyType navNotifyType, void *dead); bool IsLearningMap() const { return m_isLearningMap; } void SetLearningMapFlag() { m_isLearningMap = true; } bool IsAnalysisRequested() const { return m_isAnalysisRequested; } void RequestAnalysis() { m_isAnalysisRequested = true; } void AckAnalysisRequest() { m_isAnalysisRequested = false; } + void AnalysisCompleted(); // difficulty levels static BotDifficultyType GetDifficultyLevel() @@ -269,6 +272,4 @@ inline bool AreBotsAllowed() } void PrintAllEntities(); -#ifdef REGAMEDLL_ADD -void GetSpawnPositions(); -#endif \ No newline at end of file +void GenerateSpawnPointsFromNavData(); diff --git a/regamedll/dlls/bot/cs_bot_vision.cpp b/regamedll/dlls/bot/cs_bot_vision.cpp index 6e9d8ddc..56f75678 100644 --- a/regamedll/dlls/bot/cs_bot_vision.cpp +++ b/regamedll/dlls/bot/cs_bot_vision.cpp @@ -1003,7 +1003,7 @@ CBasePlayer *CCSBot::FindMostDangerousThreat() return currentThreat; } - // if we are a sniper and we see a sniper threat, attack it unless + // if we are a sniper and we see a sniper threat, attack it unless // there are other close enemies facing me if (IsSniper() && sniperThreat) { diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 971a41cf..b802a2e3 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -844,7 +844,7 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) #ifdef REGAMEDLL_ADD // there's no team on FFA mode if (teamonly && CSGameRules()->IsFreeForAll() && (pPlayer->m_iTeam == CT || pPlayer->m_iTeam == TERRORIST)) - teamonly = FALSE; + teamonly = FALSE; #endif // team only @@ -1001,7 +1001,7 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) if (gpGlobals->deathmatch != 0.0f && CSGameRules()->m_VoiceGameMgr.PlayerHasBlockedPlayer(pReceiver, pPlayer)) continue; - if (teamonly + if (teamonly #ifdef REGAMEDLL_FIXES && CSGameRules()->PlayerRelationship(pPlayer, pReceiver) != GR_TEAMMATE #else @@ -1020,7 +1020,7 @@ void Host_Say(edict_t *pEntity, BOOL teamonly) continue; } - if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY + if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY #ifdef REGAMEDLL_FIXES && CSGameRules()->PlayerRelationship(pPlayer, pReceiver) == GR_TEAMMATE #else @@ -3833,11 +3833,6 @@ void EXT_FUNC ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) #ifdef REGAMEDLL_ADD CSGameRules()->ServerActivate(); - - if (LoadNavigationMap() == NAV_OK) - { - GetSpawnPositions(); - } #endif } diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index e5ee0c2b..a022348e 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -174,9 +174,9 @@ cvar_t freezetime_duck = { "mp_freezetime_duck", "1", 0, 1.0f, cvar_t freezetime_jump = { "mp_freezetime_jump", "1", 0, 1.0f, nullptr }; cvar_t jump_height = { "mp_jump_height", "45", FCVAR_SERVER, 45.0f, nullptr }; -cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr }; +cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr }; -cvar_t legacy_vehicle_block = { "mp_legacy_vehicle_block", "1", 0, 0.0f, nullptr }; +cvar_t legacy_vehicle_block = { "mp_legacy_vehicle_block", "1", 0, 0.0f, nullptr }; cvar_t dying_time = { "mp_dying_time", "3.0", 0, 3.0f, nullptr }; cvar_t defuser_allocation = { "mp_defuser_allocation", "0", 0, 0.0f, nullptr }; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 81548d34..1f096d13 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -5594,7 +5594,9 @@ CTSpawn: // The terrorist spawn points else if (g_pGameRules->IsDeathmatch() && m_iTeam == TERRORIST) { +#ifdef REGAMEDLL_ADD TSpawn: +#endif pSpot = g_pLastTerroristSpawn; if (SelectSpawnSpot("info_player_deathmatch", pSpot)) diff --git a/regamedll/dlls/util.cpp b/regamedll/dlls/util.cpp index b1102c47..e0ffed53 100644 --- a/regamedll/dlls/util.cpp +++ b/regamedll/dlls/util.cpp @@ -1464,7 +1464,7 @@ void UTIL_Remove(CBaseEntity *pEntity) pEntity->pev->targetname = 0; } -NOXREF BOOL UTIL_IsValidEntity(edict_t *pent) +BOOL UTIL_IsValidEntity(edict_t *pent) { if (!pent || pent->free || (pent->v.flags & FL_KILLME)) return FALSE; diff --git a/regamedll/game_shared/bot/nav.h b/regamedll/game_shared/bot/nav.h index a917aa99..d23a734e 100644 --- a/regamedll/game_shared/bot/nav.h +++ b/regamedll/game_shared/bot/nav.h @@ -71,6 +71,13 @@ enum NavAttributeType NAV_NO_JUMP = 0x08, // inhibit discontinuity jumping }; +enum NavNotifyDestroyType +{ + NAV_NOTIFY_DESTROY_AREA, + NAV_NOTIFY_DESTROY_SPOT, + NAV_NOTIFY_DESTROY_SPOT_ENCOUNTER +}; + enum NavDirType { NORTH = 0, diff --git a/regamedll/game_shared/bot/nav_area.cpp b/regamedll/game_shared/bot/nav_area.cpp index 6c596051..a5f8f748 100644 --- a/regamedll/game_shared/bot/nav_area.cpp +++ b/regamedll/game_shared/bot/nav_area.cpp @@ -72,17 +72,29 @@ NOXREF void buildGoodSizedList() void DestroyHidingSpots() { - // remove all hiding spot references from the nav areas - for (auto area : TheNavAreaList) - area->m_hidingSpotList.clear(); - - HidingSpot::m_nextID = 0; - // free all the HidingSpots - for (auto spot : TheHidingSpotList) + for (HidingSpot *spot : TheHidingSpotList) + { + TheCSBots()->OnDestroyNavDataNotify(NAV_NOTIFY_DESTROY_SPOT, spot); delete spot; + } TheHidingSpotList.clear(); + + // remove all hiding spot references from the nav areas + for (CNavArea *area : TheNavAreaList) + { + area->m_hidingSpotList.clear(); + + // free all the HidingSpots in area + for (SpotEncounter &e : area->m_spotEncounterList) + e.spotList.clear(); + + TheCSBots()->OnDestroyNavDataNotify(NAV_NOTIFY_DESTROY_SPOT_ENCOUNTER, area); + area->m_spotEncounterList.clear(); + } + + HidingSpot::m_nextID = 0; } // For use when loading from a file @@ -249,6 +261,9 @@ CNavArea::CNavArea(CNavNode *nwNode, class CNavNode *neNode, class CNavNode *seN // Destructor CNavArea::~CNavArea() { + // tell all bots that this area no longer exists + TheCSBots()->OnDestroyNavDataNotify(NAV_NOTIFY_DESTROY_AREA, this); + // if we are resetting the system, don't bother cleaning up - all areas are being destroyed if (m_isReset) return; @@ -344,6 +359,7 @@ void CNavArea::FinishMerge(CNavArea *adjArea) // remove subsumed adjacent area TheNavAreaList.remove(adjArea); + TheCSBots()->OnDestroyNavDataNotify(NAV_NOTIFY_DESTROY_AREA, this); delete adjArea; } @@ -536,6 +552,7 @@ bool CNavArea::SplitEdit(bool splitAlongX, float splitEdge, CNavArea **outAlpha, // remove original area TheNavAreaList.remove(this); + TheCSBots()->OnDestroyNavDataNotify(NAV_NOTIFY_DESTROY_AREA, this); delete this; return true; @@ -868,6 +885,7 @@ bool CNavArea::MergeEdit(CNavArea *adj) // remove subsumed adjacent area TheNavAreaList.remove(adj); + TheCSBots()->OnDestroyNavDataNotify(NAV_NOTIFY_DESTROY_AREA, adj); delete adj; return true; @@ -900,6 +918,9 @@ void DestroyNavigationMap() { CNavArea::m_isReset = true; + // destroy all hiding spots + DestroyHidingSpots(); + // remove each element of the list and delete them while (!TheNavAreaList.empty()) { @@ -913,8 +934,8 @@ void DestroyNavigationMap() // destroy ladder representations DestroyLadders(); - // destroy all hiding spots - DestroyHidingSpots(); + // cleanup from previous analysis + CleanupApproachAreaAnalysisPrep(); // destroy navigation nodes created during map learning CNavNode *node, *next; @@ -2828,6 +2849,22 @@ SpotEncounter *CNavArea::GetSpotEncounter(const CNavArea *from, const CNavArea * return nullptr; } +// Checks if a SpotEncounter is present in the list of encounters for the given CNavArea +bool CNavArea::HasSpotEncounter(const SpotEncounter *encounter) +{ + SpotEncounter *e; + + for (SpotEncounterList::iterator iter = m_spotEncounterList.begin(); iter != m_spotEncounterList.end(); iter++) + { + e = &(*iter); + + if (e == encounter) + return true; + } + + return false; +} + // Add spot encounter data when moving from area to area void CNavArea::AddSpotEncounters(const class CNavArea *from, NavDirType fromDir, const CNavArea *to, NavDirType toDir) { @@ -3968,6 +4005,7 @@ void EditNavAreas(NavEditCmdType cmd) case EDIT_DELETE: EMIT_SOUND_DYN(ENT(pLocalPlayer->pev), CHAN_ITEM, "buttons/blip1.wav", 1, ATTN_NORM, 0, 100); TheNavAreaList.remove(area); + TheCSBots()->OnDestroyNavDataNotify(NAV_NOTIFY_DESTROY_AREA, area); delete area; return; case EDIT_ATTRIB_CROUCH: diff --git a/regamedll/game_shared/bot/nav_area.h b/regamedll/game_shared/bot/nav_area.h index 10eca2f8..2792cd3b 100644 --- a/regamedll/game_shared/bot/nav_area.h +++ b/regamedll/game_shared/bot/nav_area.h @@ -273,6 +273,7 @@ public: void ComputeHidingSpots(); // analyze local area neighborhood to find "hiding spots" in this area - for map learning void ComputeSniperSpots(); // analyze local area neighborhood to find "sniper spots" in this area - for map learning + bool HasSpotEncounter(const SpotEncounter *encounter); SpotEncounter *GetSpotEncounter(const CNavArea *from, const CNavArea *to); // given the areas we are moving between, return the spots we will encounter void ComputeSpotEncounters(); // compute spot encounter data - for map learning diff --git a/regamedll/game_shared/bot/nav_file.cpp b/regamedll/game_shared/bot/nav_file.cpp index cf97f6f6..cee5618e 100644 --- a/regamedll/game_shared/bot/nav_file.cpp +++ b/regamedll/game_shared/bot/nav_file.cpp @@ -623,6 +623,13 @@ bool SaveNavigationMap(const char *filename) area->Save(fd, version); } + // Ensure that all data is flushed to disk +#ifdef WIN32 + _commit(fd); +#else + fsync(fd); +#endif + _close(fd); return true; } diff --git a/regamedll/msvc/ReGameDLL.vcxproj b/regamedll/msvc/ReGameDLL.vcxproj index f33cfa3d..80e93c92 100644 --- a/regamedll/msvc/ReGameDLL.vcxproj +++ b/regamedll/msvc/ReGameDLL.vcxproj @@ -932,7 +932,7 @@ Disabled true REGAMEDLL_ADD;REGAMEDLL_API;REGAMEDLL_FIXES;REGAMEDLL_SSE;REGAMEDLL_SELF;REGAMEDLL_CHECKS;UNICODE_FIXES;BUILD_LATEST;BUILD_LATEST_FIXES;CLIENT_WEAPONS;USE_QSTRING;_CRT_SECURE_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) - Fast + Precise /arch:IA32 %(AdditionalOptions) /Zc:threadSafeInit- %(AdditionalOptions) MultiThreadedDebug @@ -969,7 +969,7 @@ Full true REGAMEDLL_ADD;REGAMEDLL_API;REGAMEDLL_FIXES;REGAMEDLL_SSE;REGAMEDLL_SELF;REGAMEDLL_CHECKS;UNICODE_FIXES;BUILD_LATEST;BUILD_LATEST_FIXES;CLIENT_WEAPONS;USE_QSTRING;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) - Fast + Precise /arch:IA32 %(AdditionalOptions) /Zc:threadSafeInit- %(AdditionalOptions) MultiThreaded @@ -1102,6 +1102,7 @@ Use precompiled.h NoExtensions + Precise true From 35082b5f26a7b8d34483f6f28b85539ec86fa916 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 4 Apr 2025 02:42:29 +0700 Subject: [PATCH 18/29] fix build.sh for clang compiler --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 876b458d..6dbfad24 100755 --- a/build.sh +++ b/build.sh @@ -33,7 +33,7 @@ main() case "$C" in ("intel"|"icc") CC=icc CXX=icpc ;; ("gcc"|"g++") CC=gcc CXX=g++ ;; - ("clang|llvm") CC=clang CXX=clang++ ;; + ("clang"|"llvm") CC=clang CXX=clang++ ;; *) ;; esac From a4d74392f05a1ab4cf2d06ab90a9faebd9d6af7d Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 4 Apr 2025 02:49:40 +0700 Subject: [PATCH 19/29] Update player's HUD after round restart time expires, not before it --- regamedll/dlls/multiplay_gamerules.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 1ba7122b..17b166a4 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -1817,6 +1817,11 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(RestartRound)() if (!UTIL_IsValidPlayer(pPlayer)) continue; +#ifdef REGAMEDLL_FIXES + if (!pPlayer->IsBot()) + pPlayer->ForceClientDllUpdate(); +#endif + pPlayer->Reset(); } @@ -3246,19 +3251,6 @@ void CHalfLifeMultiplay::CareerRestart() } m_bSkipSpawn = false; - - for (int i = 1; i <= gpGlobals->maxClients; i++) - { - CBasePlayer *pPlayer = UTIL_PlayerByIndex(i); - - if (!UTIL_IsValidPlayer(pPlayer)) - continue; - - if (!pPlayer->IsBot()) - { - pPlayer->ForceClientDllUpdate(); - } - } } BOOL CHalfLifeMultiplay::IsMultiplayer() From f3d8d1b5fd2e9f34adb0a0cdf8bb34132fc9ea4e Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 4 Apr 2025 08:24:33 +0700 Subject: [PATCH 20/29] fix typo --- regamedll/dlls/bot/cs_bot.cpp | 2 +- regamedll/dlls/bot/cs_bot_manager.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/regamedll/dlls/bot/cs_bot.cpp b/regamedll/dlls/bot/cs_bot.cpp index b89a6912..2302e461 100644 --- a/regamedll/dlls/bot/cs_bot.cpp +++ b/regamedll/dlls/bot/cs_bot.cpp @@ -941,7 +941,7 @@ void CCSBot::RemovePath(CNavArea *area) void CCSBot::RemoveHidingSpot(HidingSpot *spot) { int i = 0; - while (i < m_pathLength) + while (i < m_checkedHidingSpotCount) { if (m_checkedHidingSpot[i].spot == spot) { diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index 15fc3de2..8c7c7a1f 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -1535,7 +1535,7 @@ void CCSBotManager::OnDestroyNavDataNotify(NavNotifyDestroyType navNotifyType, v // and triggers a game restart after the analysis is completed void CCSBotManager::AnalysisCompleted() { - // Ensure that all bots are no longer involved in map analysis and start their normal process + // Ensure that all bots are no longer involved in map analysis and start their normal process for (int i = 1; i <= gpGlobals->maxClients; i++) { CBasePlayer *pPlayer = UTIL_PlayerByIndex(i); @@ -1554,10 +1554,10 @@ void CCSBotManager::AnalysisCompleted() m_isMapDataLoaded = false; m_isAnalysisRequested = false; - // Try to reload the navigation map from the file + // Try to reload the navigation map from the file if (LoadNavigationMap()) { - // Initiate a game restart in 3 seconds + // Initiate a game restart in 3 seconds CVAR_SET_FLOAT("sv_restart", 3); } } From 0fc5213049d5ce2bb262acfc73f681203b56a1b1 Mon Sep 17 00:00:00 2001 From: GLoOoccK <155241167+GLoOoccK@users.noreply.github.com> Date: Fri, 4 Apr 2025 12:47:40 -0300 Subject: [PATCH 21/29] Implements UpdateStatusBar Hook (#968) --- regamedll/dlls/API/CAPI_Impl.cpp | 1 + regamedll/dlls/API/CAPI_Impl.h | 6 ++++++ regamedll/dlls/player.cpp | 4 +++- regamedll/dlls/player.h | 1 + regamedll/public/regamedll/regamedll_api.h | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index 41175c83..aebde38a 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -336,6 +336,7 @@ GAMEHOOK_REGISTRY(CSGameRules_SendDeathMessage); GAMEHOOK_REGISTRY(CBasePlayer_PlayerDeathThink); GAMEHOOK_REGISTRY(CBasePlayer_Observer_Think); GAMEHOOK_REGISTRY(CBasePlayer_RemoveAllItems); +GAMEHOOK_REGISTRY(CBasePlayer_UpdateStatusBar); int CReGameApi::GetMajorVersion() { return REGAMEDLL_API_VERSION_MAJOR; diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index 2635be5b..a9c89e99 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -749,6 +749,10 @@ typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBase typedef IHookChainClassImpl CReGameHook_CBasePlayer_RemoveAllItems; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_RemoveAllItems; +// CBasePlayer::UpdateStatusBar hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_UpdateStatusBar; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_UpdateStatusBar; + class CReGameHookchains: public IReGameHookchains { public: // CBasePlayer virtual @@ -910,6 +914,7 @@ public: CReGameHookRegistry_CBasePlayer_PlayerDeathThink m_CBasePlayer_PlayerDeathThink; CReGameHookRegistry_CBasePlayer_Observer_Think m_CBasePlayer_Observer_Think; CReGameHookRegistry_CBasePlayer_RemoveAllItems m_CBasePlayer_RemoveAllItems; + CReGameHookRegistry_CBasePlayer_UpdateStatusBar m_CBasePlayer_UpdateStatusBar; public: virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn(); @@ -1070,6 +1075,7 @@ public: virtual IReGameHookRegistry_CBasePlayer_PlayerDeathThink *CBasePlayer_PlayerDeathThink(); virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think(); virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems(); + virtual IReGameHookRegistry_CBasePlayer_UpdateStatusBar *CBasePlayer_UpdateStatusBar(); }; extern CReGameHookchains g_ReGameHookchains; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 1f096d13..34b48223 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -8166,7 +8166,9 @@ void CBasePlayer::InitStatusBar() m_SbarString0[0] = '\0'; } -void CBasePlayer::UpdateStatusBar() +LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, UpdateStatusBar) + +void EXT_FUNC CBasePlayer::__API_HOOK(UpdateStatusBar)() { int newSBarState[SBAR_END]; char sbuf0[MAX_SBAR_STRING]; diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 6890d30b..78293ed9 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -450,6 +450,7 @@ public: void PlayerDeathThink_OrigFunc(); void Observer_Think_OrigFunc(); void RemoveAllItems_OrigFunc(BOOL removeSuit); + void UpdateStatusBar_OrigFunc(); CCSPlayer *CSPlayer() const; #endif // REGAMEDLL_API diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 74879aa4..4bb6462b 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -628,6 +628,10 @@ typedef IHookChainRegistryClass IReGameHookRegistry_CBa typedef IHookChainClass IReGameHook_CBasePlayer_RemoveAllItems; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RemoveAllItems; +// CBasePlayer::UpdateStatusBar hook +typedef IHookChainClass IReGameHook_CBasePlayer_UpdateStatusBar; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateStatusBar; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -790,6 +794,7 @@ public: virtual IReGameHookRegistry_CBasePlayer_PlayerDeathThink *CBasePlayer_PlayerDeathThink() = 0; virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think() = 0; virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems() = 0; + virtual IReGameHookRegistry_CBasePlayer_UpdateStatusBar *CBasePlayer_UpdateStatusBar() = 0; }; struct ReGameFuncs_t { From 312dc3eb84ec58ea440420e4264baebd65b4d25c Mon Sep 17 00:00:00 2001 From: s1lentq Date: Sun, 6 Apr 2025 04:01:26 +0700 Subject: [PATCH 22/29] Fix defuse behavior when bomb explodes - Ensure DefuseBombEnd is called when defusing and bomb explodes to properly stop defuse - Fixes the issue where defuse progress bar continued draw after bomb explosion --- regamedll/dlls/ggrenade.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/regamedll/dlls/ggrenade.cpp b/regamedll/dlls/ggrenade.cpp index 41e92f27..87835565 100644 --- a/regamedll/dlls/ggrenade.cpp +++ b/regamedll/dlls/ggrenade.cpp @@ -1170,6 +1170,12 @@ void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy if (!m_bIsC4) return; +#ifdef REGAMEDLL_FIXES + // block the start of defuse if the bomb timer has expired + if (m_flC4Blow > 0 && gpGlobals->time >= m_flC4Blow) + return; +#endif + // TODO: We must be sure that the activator is a player. CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pActivator->pev); @@ -1503,6 +1509,13 @@ void CGrenade::C4Think() { DefuseBombEnd(pPlayer, false); } +#ifdef REGAMEDLL_FIXES + // if the bomb timer has expired and defuse is still ongoing, stop the defuse + else if (gpGlobals->time >= m_flC4Blow) + { + DefuseBombEnd(pPlayer, false); + } +#endif } else { From 797c265db3f276d3976e0b00f0eac84ee4b39da9 Mon Sep 17 00:00:00 2001 From: Eason <62255465+jonathan-up@users.noreply.github.com> Date: Mon, 7 Apr 2025 02:13:23 +0800 Subject: [PATCH 23/29] API: Implemented CBasePlayer::Observer_FindNextPlayer() (#1065) --- regamedll/dlls/API/CSPlayer.cpp | 5 +++++ regamedll/public/regamedll/API/CSPlayer.h | 1 + regamedll/public/regamedll/regamedll_api.h | 2 +- regamedll/version/version.h | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index 8ebf7930..2252b416 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -412,6 +412,11 @@ EXT_FUNC void CCSPlayer::Observer_SetMode(int iMode) BasePlayer()->Observer_SetMode(iMode); } +EXT_FUNC void CCSPlayer::Observer_FindNextPlayer(bool bReverse, const char *name) +{ + BasePlayer()->Observer_FindNextPlayer(bReverse, name); +} + EXT_FUNC bool CCSPlayer::SelectSpawnSpot(const char *pEntClassName, CBaseEntity *&pSpot) { return BasePlayer()->SelectSpawnSpot(pEntClassName, pSpot); diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index 05b81b70..251cd6f5 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -117,6 +117,7 @@ public: virtual void Reset(); virtual void OnSpawnEquip(bool addDefault = true, bool equipGame = true); virtual void SetScoreboardAttributes(CBasePlayer *destination = nullptr); + virtual void Observer_FindNextPlayer(bool bReverse, const char *name = nullptr); bool IsPlayerDominated(int iPlayerIndex) const; void SetPlayerDominated(CBasePlayer *pPlayer, bool bDominated); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 4bb6462b..6b9aadd7 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 28 +#define REGAMEDLL_API_VERSION_MINOR 29 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; diff --git a/regamedll/version/version.h b/regamedll/version/version.h index 62c33001..d3e8b9db 100644 --- a/regamedll/version/version.h +++ b/regamedll/version/version.h @@ -6,5 +6,5 @@ #pragma once #define VERSION_MAJOR 5 -#define VERSION_MINOR 28 +#define VERSION_MINOR 29 #define VERSION_MAINTENANCE 0 From 5bf71bdb18ec41aab1f48ab927151db9b6967207 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Tue, 8 Apr 2025 06:31:12 +0700 Subject: [PATCH 24/29] CCSBot::FindMostDangerousThreat: Fix crash when m_pActiveItem is null Related #1055 --- regamedll/dlls/bot/cs_bot_vision.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/bot/cs_bot_vision.cpp b/regamedll/dlls/bot/cs_bot_vision.cpp index 56f75678..5e4e3026 100644 --- a/regamedll/dlls/bot/cs_bot_vision.cpp +++ b/regamedll/dlls/bot/cs_bot_vision.cpp @@ -797,7 +797,9 @@ CBasePlayer *CCSBot::FindMostDangerousThreat() float distSq = d.LengthSquared(); #ifdef REGAMEDLL_ADD - if (isSniperRifle(pPlayer->m_pActiveItem)) { + CBasePlayerWeapon *pCurrentWeapon = static_cast(pPlayer->m_pActiveItem); + if (pCurrentWeapon && isSniperRifle(pCurrentWeapon)) + { m_isEnemySniperVisible = true; if (sniperThreat) { From 99d93ba8a74ac777fbb173c928bcda87e04477c2 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 17 Apr 2025 04:59:11 +0700 Subject: [PATCH 25/29] Fix crash nav generation with impossibly-large grid --- regamedll/game_shared/bot/nav_area.cpp | 13 +++++++++++++ regamedll/game_shared/bot/nav_file.cpp | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/regamedll/game_shared/bot/nav_area.cpp b/regamedll/game_shared/bot/nav_area.cpp index a5f8f748..845b2a3f 100644 --- a/regamedll/game_shared/bot/nav_area.cpp +++ b/regamedll/game_shared/bot/nav_area.cpp @@ -1793,6 +1793,13 @@ void GenerateNavigationAreaMesh() break; } + if (!TheNavAreaList.size()) + { + // If we somehow have no areas, don't try to create an impossibly-large grid + TheNavAreaGrid.Initialize(0, 0, 0, 0); + return; + } + Extent extent; extent.lo.x = 9999999999.9f; extent.lo.y = 9999999999.9f; @@ -4674,6 +4681,12 @@ void CNavAreaGrid::Initialize(float minX, float maxX, float minY, float maxY) // Add an area to the grid void CNavAreaGrid::AddNavArea(CNavArea *area) { + if (!m_grid) + { + // If we somehow have no grid (manually creating a nav area without loading or generating a mesh), don't crash + TheNavAreaGrid.Initialize(0, 0, 0, 0); + } + // add to grid const Extent *extent = area->GetExtent(); diff --git a/regamedll/game_shared/bot/nav_file.cpp b/regamedll/game_shared/bot/nav_file.cpp index cee5618e..e43a0200 100644 --- a/regamedll/game_shared/bot/nav_file.cpp +++ b/regamedll/game_shared/bot/nav_file.cpp @@ -846,6 +846,11 @@ NavErrorType LoadNavigationMap() unsigned int count; result = navFile.Read(&count, sizeof(unsigned int)); + if (count == 0) + { + return NAV_INVALID_FILE; + } + Extent extent; extent.lo.x = 9999999999.9f; extent.lo.y = 9999999999.9f; From a4f48f4e425c2a36485fdcd78e7aacebb415c027 Mon Sep 17 00:00:00 2001 From: GLoOoccK <155241167+GLoOoccK@users.noreply.github.com> Date: Sun, 20 Apr 2025 11:13:08 -0300 Subject: [PATCH 26/29] `FIX`: Remove grenades and C4 (#1066) --- regamedll/dlls/multiplay_gamerules.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 17b166a4..2b91a50f 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -656,8 +656,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)() #endif // Remove grenades and C4 - const int grenadesRemoveCount = 20; - UTIL_RemoveOther("grenade", grenadesRemoveCount); + UTIL_RemoveOther("grenade"); #ifndef REGAMEDLL_FIXES // Remove defuse kit From 8d5aa54cebe8ab08ad345d9146c85b30dbc2bde6 Mon Sep 17 00:00:00 2001 From: GLoOoccK <155241167+GLoOoccK@users.noreply.github.com> Date: Sun, 20 Apr 2025 11:32:49 -0300 Subject: [PATCH 27/29] API: Knockback (#1069) --- README.md | 1 + dist/game.cfg | 7 +++++++ regamedll/dlls/API/CAPI_Impl.cpp | 1 + regamedll/dlls/API/CAPI_Impl.h | 6 ++++++ regamedll/dlls/API/CSPlayer.cpp | 5 +++++ regamedll/dlls/game.cpp | 4 ++++ regamedll/dlls/game.h | 1 + regamedll/dlls/player.cpp | 22 ++++++++++++++++++---- regamedll/dlls/player.h | 2 ++ regamedll/public/regamedll/API/CSPlayer.h | 1 + regamedll/public/regamedll/regamedll_api.h | 7 ++++++- regamedll/version/version.h | 2 +- 12 files changed, 53 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b39c0f19..a1198f08 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_randomspawn | 0 | 0 | 1 | Random player spawns
`0` disabled
`1` enabled
`NOTE`: Navigation `maps/.nav` file required | | mp_playerid_showhealth | 1 | 0 | 2 | Player ID display mode.
`0` don't show health
`1` show health for teammates only (default CS behaviour)
`2` show health for all players | | mp_playerid_field | 3 | 0 | 3 | Player ID field display mode.
`0` don't show additional information
`1` show team name
`2` show health percentage
`3` show both team name and health percentage | +| mp_knockback | 170 | - | - | Knockback force applied to the victim when damaged by strong weapons (e.g. `AWP`, `AK47`).
Works only if not crouching, and not hit in the legs.
Set to `0` to disable. | diff --git a/dist/game.cfg b/dist/game.cfg index 70bd646b..f566ee9b 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -680,3 +680,10 @@ mp_playerid_showhealth "1" // // Default value: "3" mp_playerid_field "3" + +// Knockback force applied to the victim when damaged by strong weapons (e.g. AWP, AK47). +// Works only if not crouching, and not hit in the legs. +// Set to "0" to disable. +// +// Default: "170" +mp_knockback "170" diff --git a/regamedll/dlls/API/CAPI_Impl.cpp b/regamedll/dlls/API/CAPI_Impl.cpp index aebde38a..55da8ae3 100644 --- a/regamedll/dlls/API/CAPI_Impl.cpp +++ b/regamedll/dlls/API/CAPI_Impl.cpp @@ -337,6 +337,7 @@ GAMEHOOK_REGISTRY(CBasePlayer_PlayerDeathThink); GAMEHOOK_REGISTRY(CBasePlayer_Observer_Think); GAMEHOOK_REGISTRY(CBasePlayer_RemoveAllItems); GAMEHOOK_REGISTRY(CBasePlayer_UpdateStatusBar); +GAMEHOOK_REGISTRY(CBasePlayer_TakeDamageImpulse); int CReGameApi::GetMajorVersion() { return REGAMEDLL_API_VERSION_MAJOR; diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index a9c89e99..727fdf9e 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -753,6 +753,10 @@ typedef IHookChainRegistryClassImpl CReGameHookRegistry typedef IHookChainClassImpl CReGameHook_CBasePlayer_UpdateStatusBar; typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_UpdateStatusBar; +// CBasePlayer::TakeDamageImpulse hook +typedef IHookChainClassImpl CReGameHook_CBasePlayer_TakeDamageImpulse; +typedef IHookChainRegistryClassImpl CReGameHookRegistry_CBasePlayer_TakeDamageImpulse; + class CReGameHookchains: public IReGameHookchains { public: // CBasePlayer virtual @@ -915,6 +919,7 @@ public: CReGameHookRegistry_CBasePlayer_Observer_Think m_CBasePlayer_Observer_Think; CReGameHookRegistry_CBasePlayer_RemoveAllItems m_CBasePlayer_RemoveAllItems; CReGameHookRegistry_CBasePlayer_UpdateStatusBar m_CBasePlayer_UpdateStatusBar; + CReGameHookRegistry_CBasePlayer_TakeDamageImpulse m_CBasePlayer_TakeDamageImpulse; public: virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn(); @@ -1076,6 +1081,7 @@ public: virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think(); virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems(); virtual IReGameHookRegistry_CBasePlayer_UpdateStatusBar *CBasePlayer_UpdateStatusBar(); + virtual IReGameHookRegistry_CBasePlayer_TakeDamageImpulse *CBasePlayer_TakeDamageImpulse(); }; extern CReGameHookchains g_ReGameHookchains; diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index 2252b416..cab27a47 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -539,6 +539,11 @@ EXT_FUNC bool CCSPlayer::CheckActivityInGame() return (fabs(deltaYaw) >= 0.1f && fabs(deltaPitch) >= 0.1f); } +EXT_FUNC void CCSPlayer::TakeDamageImpulse(CBasePlayer *pAttacker, float flKnockbackForce, float flVelModifier) +{ + BasePlayer()->TakeDamageImpulse(pAttacker, flKnockbackForce, flVelModifier); +} + void CCSPlayer::ResetVars() { m_szModel[0] = '\0'; diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index a022348e..2c6d9fbf 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -199,6 +199,8 @@ cvar_t randomspawn = { "mp_randomspawn", "0", FCVAR_SERVER, 0.0f, nu cvar_t playerid_showhealth = { "mp_playerid_showhealth", "1", 0, 1.0f, nullptr }; cvar_t playerid_field = { "mp_playerid_field", "3", 0, 3.0f, nullptr }; +cvar_t knockback = { "mp_knockback", "170", 0, 170.0f, nullptr }; + void GameDLL_Version_f() { if (Q_stricmp(CMD_ARGV(1), "version") != 0) @@ -485,6 +487,8 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&flymove_method); + CVAR_REGISTER(&knockback); + // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 95609f12..ecf1001c 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -216,6 +216,7 @@ extern cvar_t logkills; extern cvar_t randomspawn; extern cvar_t playerid_showhealth; extern cvar_t playerid_field; +extern cvar_t knockback; #endif diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 34b48223..67aa43e4 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1233,7 +1233,7 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva if (!ShouldDoLargeFlinch(m_LastHitGroup, iGunType)) { - m_flVelocityModifier = 0.5f; + TakeDamageImpulse(pAttack, 0.0f, 0.5f); if (m_LastHitGroup == HITGROUP_HEAD) m_bHighDamage = (flDamage > 60); @@ -1246,10 +1246,13 @@ BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entva { if (pev->velocity.Length() < 300) { - Vector attack_velocity = (pev->origin - pAttack->pev->origin).Normalize() * 170; - pev->velocity = pev->velocity + attack_velocity; +#ifdef REGAMEDLL_ADD + float knockbackValue = knockback.value; +#else + float knockbackValue = 170; +#endif - m_flVelocityModifier = 0.65f; + TakeDamageImpulse(pAttack, knockbackValue, 0.65f); } SetAnimation(PLAYER_LARGE_FLINCH); @@ -10867,6 +10870,17 @@ bool CBasePlayer::Kill() return true; } +LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, TakeDamageImpulse, (CBasePlayer *pAttacker, float flKnockbackForce, float flVelModifier), pAttacker, flKnockbackForce, flVelModifier) + +void EXT_FUNC CBasePlayer::__API_HOOK(TakeDamageImpulse)(CBasePlayer *pAttacker, float flKnockbackForce, float flVelModifier) +{ + if (flKnockbackForce != 0.0f) + pev->velocity += (pev->origin - pAttacker->pev->origin).Normalize() * flKnockbackForce; + + if (flVelModifier != 0.0f) + m_flVelocityModifier = flVelModifier; +} + const usercmd_t *CBasePlayer::GetLastUserCommand() const { #ifdef REGAMEDLL_API diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 78293ed9..f3ec649c 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -451,6 +451,7 @@ public: void Observer_Think_OrigFunc(); void RemoveAllItems_OrigFunc(BOOL removeSuit); void UpdateStatusBar_OrigFunc(); + void TakeDamageImpulse_OrigFunc(CBasePlayer *pAttacker, float flKnockbackForce, float flVelModifier); CCSPlayer *CSPlayer() const; #endif // REGAMEDLL_API @@ -659,6 +660,7 @@ public: void UseEmpty(); void DropIdlePlayer(const char *reason); bool Kill(); + void TakeDamageImpulse(CBasePlayer *pAttacker, float flKnockbackForce, float flVelModifier); // templates template diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index 251cd6f5..3ead37a2 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -118,6 +118,7 @@ public: virtual void OnSpawnEquip(bool addDefault = true, bool equipGame = true); virtual void SetScoreboardAttributes(CBasePlayer *destination = nullptr); virtual void Observer_FindNextPlayer(bool bReverse, const char *name = nullptr); + virtual void TakeDamageImpulse(CBasePlayer *pAttacker, float flKnockbackForce, float flVelModifier); bool IsPlayerDominated(int iPlayerIndex) const; void SetPlayerDominated(CBasePlayer *pPlayer, bool bDominated); diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 6b9aadd7..fda245bc 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 29 +#define REGAMEDLL_API_VERSION_MINOR 30 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; @@ -632,6 +632,10 @@ typedef IHookChainRegistryClass IReGameHookRegist typedef IHookChainClass IReGameHook_CBasePlayer_UpdateStatusBar; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateStatusBar; +// CBasePlayer::TakeDamageImpulse hook +typedef IHookChainClass IReGameHook_CBasePlayer_TakeDamageImpulse; +typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TakeDamageImpulse; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -795,6 +799,7 @@ public: virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think() = 0; virtual IReGameHookRegistry_CBasePlayer_RemoveAllItems *CBasePlayer_RemoveAllItems() = 0; virtual IReGameHookRegistry_CBasePlayer_UpdateStatusBar *CBasePlayer_UpdateStatusBar() = 0; + virtual IReGameHookRegistry_CBasePlayer_TakeDamageImpulse *CBasePlayer_TakeDamageImpulse() = 0; }; struct ReGameFuncs_t { diff --git a/regamedll/version/version.h b/regamedll/version/version.h index d3e8b9db..3838a2f8 100644 --- a/regamedll/version/version.h +++ b/regamedll/version/version.h @@ -6,5 +6,5 @@ #pragma once #define VERSION_MAJOR 5 -#define VERSION_MINOR 29 +#define VERSION_MINOR 30 #define VERSION_MAINTENANCE 0 From 61c361e96ca69737a27164ff4233cdd9501d5cc2 Mon Sep 17 00:00:00 2001 From: STAM Date: Wed, 16 Jul 2025 18:16:26 +0300 Subject: [PATCH 28/29] ci-build updated + added signing + migrated to windows-2025 runner + wmic deprecated and migrated to ps --- .github/workflows/build.yml | 165 ++++++++++++++++++++++++++++++++++-- regamedll/msvc/PreBuild.bat | 33 ++++++-- regamedll/msvc/icon.ico | Bin 0 -> 120527 bytes 3 files changed, 185 insertions(+), 13 deletions(-) create mode 100644 regamedll/msvc/icon.ico diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8217211f..61c85856 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,16 +5,18 @@ on: branches: [master] paths-ignore: - '**.md' + - '.github/**' pull_request: types: [opened, reopened, synchronize] release: types: [published] + workflow_dispatch: jobs: windows: name: 'Windows' - runs-on: windows-2019 + runs-on: windows-2025 env: solution: 'msvc/ReGameDLL.sln' @@ -34,12 +36,48 @@ jobs: - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - with: - vs-version: '16' + +# TODO: add support of 141_xp toolchain at VS2022+ +# - name: Install v140, v141 and v142 toolsets +# shell: cmd +# run: | +# "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify ^ +# --installPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" ^ +# --add Microsoft.VisualStudio.Component.WindowsXP ^ +# --add Microsoft.VisualStudio.Component.VC.v140 ^ +# --add Microsoft.VisualStudio.Component.VC.v140.x86.x64 ^ +# --add Microsoft.VisualStudio.Component.VC.v140.xp ^ +# --add Microsoft.VisualStudio.Component.VC.140.CRT ^ +# --add Microsoft.VisualStudio.Component.VC.v141 ^ +# --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 ^ +# --add Microsoft.VisualStudio.Component.VC.v141.xp ^ +# --add Microsoft.VisualStudio.Component.VC.v142 ^ +# --add Microsoft.VisualStudio.Component.VC.v142.x86.x64 ^ +# --quiet --norestart + + - name: Select PlatformToolset + id: select_toolset + shell: pwsh + run: | + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $vs2019 = & $vswhere -products * -version "[16.0,17.0)" -property installationPath -latest + $vs2022 = & $vswhere -products * -version "[17.0,)" -property installationPath -latest + + if ($vs2019) { + "toolset=v140_xp" >> $env:GITHUB_OUTPUT + Write-Host "Selected v140_xp toolset" + } elseif ($vs2022) { + "toolset=v143" >> $env:GITHUB_OUTPUT + Write-Host "Selected v143 toolset" + } else { + Write-Error "No suitable Visual Studio installation found" + exit 1 + } - name: Build and Run unittests run: | - msbuild ${{ env.solution }} -p:Configuration="${{ env.buildTests }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false + $toolset = '${{ steps.select_toolset.outputs.toolset }}' + msbuild ${{ env.solution }} -p:Configuration="${{ env.buildTests }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=$toolset /p:XPDeprecationWarning=false .\"msvc\Tests\mp.exe" If ($LASTEXITCODE -ne 0 -And $LASTEXITCODE -ne 3) @@ -48,8 +86,13 @@ jobs: - name: Build run: | - msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false - msbuild ${{ env.solution }} -p:Configuration="${{ env.buildReleasePlay }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false + $toolset = '${{ steps.select_toolset.outputs.toolset }}' + msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=$toolset /p:XPDeprecationWarning=false + msbuild ${{ env.solution }} -p:Configuration="${{ env.buildReleasePlay }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=$toolset /p:XPDeprecationWarning=false + - name: Get rcedit from chocolatey + shell: pwsh + run: | + choco install rcedit -y - name: Move files run: | @@ -60,6 +103,49 @@ jobs: move msvc\${{ env.buildRelease }}\mp.dll publish\bin\win32\cstrike\dlls\mp.dll move msvc\${{ env.buildRelease }}\mp.pdb publish\debug\mp.pdb + - name: Get app version + id: get_version + shell: pwsh + run: | + $versionFile = "regamedll/version/appversion.h" + if (-not (Test-Path $versionFile)) { + Write-Error "Version file not found: $versionFile" + exit 1 + } + + $content = Get-Content $versionFile + foreach ($line in $content) { + if ($line -match '^\s*#define\s+APP_VERSION\s+"([^"]+)"') { + $version = $matches[1] + "version=$version" >> $env:GITHUB_OUTPUT + Write-Host "Found version: $version" + exit 0 + } + } + Write-Error "APP_VERSION not found in file" + exit 1 + + - name: Show version + run: echo "Version is ${{ steps.get_version.outputs.version }}" + + - name: Import PFX and sign + if: github.event_name != 'pull_request' + env: + KEY_PFX_PASS: ${{ secrets.KEY_PFX_PASS }} + # https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md + run: | + $pfxBase64 = "${{ secrets.KEY_PFX_B64 }}" + [IO.File]::WriteAllBytes("${{ github.workspace }}\signing-cert.pfx", [Convert]::FromBase64String($pfxBase64)) + certutil -f -p "${{ secrets.KEY_PFX_PASS }}" -importPFX "${{ github.workspace }}\signing-cert.pfx" + & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\signtool.exe' sign /a /f "${{ github.workspace }}\signing-cert.pfx" /p $env:KEY_PFX_PASS /d "Regamedll_CS is a result of reverse engineering of original library mod HLDS (build 6153beta) using DWARF debug info embedded into linux version of HLDS, cs.so" /du "https://rehlds.dev/" /tr "http://timestamp.digicert.com" /td sha256 /fd sha256 /v ${{ github.workspace }}\publish\bin\win32\cstrike\dlls\mp.dll + Remove-Item -Recurse -Force "${{ github.workspace }}\signing-cert.pfx" + shell: "pwsh" + + - name: Edit resources at windows binaries + run: | + rcedit ${{ github.workspace }}\publish\bin\win32\cstrike\dlls\mp.dll --set-version-string ProductName "Regamedll_CS - mp.dll" --set-file-version "${{ steps.get_version.outputs.version }}" --set-product-version "${{ steps.get_version.outputs.version }}" --set-version-string FileDescription "Regamedll_CS (mp.dll) - provide more stable (than official) version of Counter-Strike game with extended API for mods and plugins, Commit: $env:GITHUB_SHA" --set-version-string "Comments" "Regamedll_CS is a result of reverse engineering of original library mod HLDS (build 6153beta) using DWARF debug info embedded into linux version of HLDS, cs.so. Commit: $env:GITHUB_SHA" --set-version-string CompanyName "ReHLDS Dev Team" --set-version-string LegalCopyright "Copyright 2025 Valve, ReHLDS DevTeam" --set-icon regamedll/msvc/icon.ico + shell: "pwsh" + - name: Deploy artifacts uses: actions/upload-artifact@v4 with: @@ -128,6 +214,49 @@ jobs: submodules: recursive fetch-depth: 0 + - name: GPG Import + run: | + echo "${{ secrets.PUB_ASC }}" > "${{ secrets.PUB_ASC_FILE }}" + echo "${{ secrets.KEY_ASC }}" > "${{ secrets.KEY_ASC_FILE }}" + + # Import the public key + gpg --batch --yes --import "${{ secrets.PUB_ASC_FILE }}" + if [[ $? -ne 0 ]]; then + echo "Error: Failed to import the public key" + exit 1 + fi + + # Import the private key + gpg --batch --yes --import "${{ secrets.KEY_ASC_FILE }}" + if [[ $? -ne 0 ]]; then + echo "Error: Failed to import the private key" + exit 2 + fi + + # Extract the fingerprint of the imported public key + GPG_LINUX_FINGERPRINT=$(gpg --list-keys --with-colons | grep '^fpr' | head -n 1 | cut -d: -f10) + + # Check if the fingerprint was extracted + if [[ -z "$GPG_LINUX_FINGERPRINT" ]]; then + echo "Error: Failed to extract the fingerprint of the key" + exit 3 + fi + + # Set the trust level for the key + echo "$GPG_LINUX_FINGERPRINT:6:" | gpg --batch --import-ownertrust + if [ $? -ne 0 ]; then + echo "Error: Failed to set trust for the key $GPG_LINUX_FINGERPRINT" + exit 4 + fi + + echo "Key $GPG_LINUX_FINGERPRINT successfully imported and trusted" + gpg --list-keys + + #export for global use + echo "GPG_LINUX_FINGERPRINT=$GPG_LINUX_FINGERPRINT" >> $GITHUB_ENV + shell: bash + if: github.event_name != 'pull_request' + - name: Build and Run unittests run: | rm -rf build && CC=gcc CXX=g++ cmake -DCMAKE_BUILD_TYPE=Unittests -B build && cmake --build build -j8 @@ -224,7 +353,29 @@ jobs: run: | rsync -a dist/ bin/win32/cstrike rsync -a dist/ bin/linux32/cstrike + + # new runner, niw signs + echo "${{ secrets.PUB_ASC }}" > "${{ secrets.PUB_ASC_FILE }}" + echo "${{ secrets.KEY_ASC }}" > "${{ secrets.KEY_ASC_FILE }}" + gpg --batch --yes --import "${{ secrets.PUB_ASC_FILE }}" + gpg --batch --yes --import "${{ secrets.KEY_ASC_FILE }}" + GPG_LINUX_FINGERPRINT=$(gpg --list-keys --with-colons | grep '^fpr' | head -n 1 | cut -d: -f10) + echo "$GPG_LINUX_FINGERPRINT:6:" | gpg --batch --import-ownertrust + echo "GPG_LINUX_FINGERPRINT=$GPG_LINUX_FINGERPRINT" >> $GITHUB_ENV + + sign_file() { + local file=$1 + gpg --batch --yes --detach-sign --armor -u "$GPG_LINUX_FINGERPRINT" "$file" + if [ $? -ne 0 ]; then + echo "Error: Failed to sign $file" + exit 2 + fi + echo "$file signed successfully." + } + + # Pack and sign final archive 7z a -tzip regamedll-bin-${{ env.APP_VERSION }}.zip bin/ cssdk/ + sign_file "regamedll-bin-${{ env.APP_VERSION }}.zip" - name: Publish artifacts uses: softprops/action-gh-release@v2 @@ -235,6 +386,8 @@ jobs: with: files: | *.zip + *.7z + *.asc env: GITHUB_TOKEN: ${{ secrets.API_TOKEN }} diff --git a/regamedll/msvc/PreBuild.bat b/regamedll/msvc/PreBuild.bat index 38dac044..b861b43c 100644 --- a/regamedll/msvc/PreBuild.bat +++ b/regamedll/msvc/PreBuild.bat @@ -18,13 +18,32 @@ set commitURL= set commitCount=0 set branch_name=master -for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a" -set "YYYY=%dt:~0,4%" -set "MM=%dt:~4,2%" -set "DD=%dt:~6,2%" -set "hour=%dt:~8,2%" -set "min=%dt:~10,2%" -set "sec=%dt:~12,2%" +for /f "tokens=*" %%i in ('powershell -NoProfile -Command ^ + "$now = Get-Date; Write-Output ('{0:yyyy}|{0:MM}|{0:dd}|{0:HH}|{0:mm}|{0:ss}' -f $now)"') do ( + for /f "tokens=1-6 delims=|" %%a in ("%%i") do ( + set "YYYY=%%a" + set "MM=%%b" + set "DD=%%c" + set "hour=%%d" + set "min=%%e" + set "sec=%%f" + ) +) + +echo YYYY=%YYYY% +echo MM=%MM% +echo DD=%DD% +echo hour=%hour% +echo min=%min% +echo sec=%sec% + +:: for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a" +:: set "YYYY=%dt:~0,4%" +:: set "MM=%dt:~4,2%" +:: set "DD=%dt:~6,2%" +:: set "hour=%dt:~8,2%" +:: set "min=%dt:~10,2%" +:: set "sec=%dt:~12,2%" :: :: Remove leading zero from MM (e.g 09 > 9) diff --git a/regamedll/msvc/icon.ico b/regamedll/msvc/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8c7e14c00008537f866fe9cb9804ab45aa0c1f45 GIT binary patch literal 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jhg)w$L^sp{7eS( z;n}u!2I@Kn*v`Dp!rCX;!B>9;Fn-&c{&xqqfe(TW!1}bl)Oi8er-O?cstgPz~PWl7(n z2}xJagyej%{Yl`6ze~oCZcDLSOIxzrw6^5Z=C))dt*#S?Ynj8k+xAa-I4RJ>0DiXJ z)0fUy9<)yfVctqukqtL*5vP6jbl@0m-~M0lIIuqE(jM?w|ATxAu&t+K8r1%D0yqc! z3|Oz<1(s3hvl-9zjPgQXu{6ttZ`-k-xPI#nQII|y*mqii_w(2wlal`u_8)?d0zU@E z@lYmPPTDpoZ%_J+W7|{UbHNAchvDy(={w(C3LeYyj=iq{?ZY{s?bP4EsJj<V z8JGdy3hn~l+X3(mP~G|BK(aLY#$;P8JkyF*eK$c5W64^2Q%5^v#brq{=Fh;vNitP1 Z8&74YwF09H(Yp)y#WLRsFxZ+T{|8;wV1@ty literal 0 HcmV?d00001 From aef0be9a512bdd6866ee2a30a4c71223e0434c5a Mon Sep 17 00:00:00 2001 From: STAM Date: Sat, 19 Jul 2025 22:57:47 +0300 Subject: [PATCH 29/29] [chore] License transition from GPLv3 to MIT --- LICENSE | 695 ++---------------------------------------- LICENSE-TRANSITION.md | 16 + README.md | 17 +- 3 files changed, 50 insertions(+), 678 deletions(-) create mode 100644 LICENSE-TRANSITION.md diff --git a/LICENSE b/LICENSE index 9cecc1d4..4fa78b54 100644 --- a/LICENSE +++ b/LICENSE @@ -1,674 +1,21 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. +MIT License + +Copyright (c) 2015–2025 ReGameDLL_CS Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSE-TRANSITION.md b/LICENSE-TRANSITION.md new file mode 100644 index 00000000..905e4930 --- /dev/null +++ b/LICENSE-TRANSITION.md @@ -0,0 +1,16 @@ +# License Transition Notice + +ReGameDLL_CS was originally licensed under the GNU General Public License v3.0 (GPLv3). + +As of July 2025, the project has transitioned to the MIT License with the explicit agreement of the major contributors, including: + +- s1lent +- Vaqtincha +- In-line +- wopox +- WPMGPRoSToTeMa + +All significant contributors have agreed to this license transition. +All previous contributions are now considered to be licensed under the MIT License unless otherwise noted. + +For questions, contact us via GitHub or the ReHLDS dev chat. diff --git a/README.md b/README.md index a1198f08..0703cff5 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,27 @@ -# ReGameDLL_CS [![GitHub release (by tag)](https://img.shields.io/github/downloads/s1lentq/ReGameDLL_CS/latest/total)](https://github.com/s1lentq/ReGameDLL_CS/releases/latest) ![GitHub all releases](https://img.shields.io/github/downloads/s1lentq/ReGameDLL_CS/total) [![Percentage of issues still open](http://isitmaintained.com/badge/open/s1lentq/ReGameDLL_CS.svg)](http://isitmaintained.com/project/s1lentq/ReGameDLL_CS "Percentage of issues still open") [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) Counter-Strike 1.6 GameDLL +# ReGameDLL_CS [![GitHub release (by tag)](https://img.shields.io/github/downloads/rehlds/ReGameDLL_CS/latest/total)](https://github.com/rehlds/ReGameDLL_CS/releases/latest) ![GitHub all releases](https://img.shields.io/github/downloads/rehlds/ReGameDLL_CS/total) [![Percentage of issues still open](http://isitmaintained.com/badge/open/rehlds/ReGameDLL_CS.svg)](http://isitmaintained.com/project/rehlds/ReGameDLL_CS "Percentage of issues still open") [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://www.gnu.org/licenses/gpl-3.0) Counter-Strike 1.6 GameDLL Reverse-engineered gamedll (mp.dll / Counter-Strike) ## What is this? -Regamedll_CS is a result of reverse engineering of original library mod HLDS (build 6153beta) using DWARF debug info embedded into linux version of HLDS, cs.so +ReGameDLL_CS is a result of reverse engineering of original library mod HLDS (build 6153beta) using DWARF debug info embedded into linux version of HLDS, cs.so ## Goals of the project * Provide more stable (than official) version of Counter-Strike game with extended API for mods and plugins +## 🛠 License + +ReGameDLL_CS is licensed under the [MIT License](./LICENSE). + +### License Transition +> [!NOTE] +> Originally released under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html), ReHReGameDLL_CSLDS transitioned to the MIT License in July 2025 with the agreement of the core contributors. +> See [LICENSE-TRANSITION.md](./LICENSE-TRANSITION.md) for details. + ## How can use it? ReGameDLL_CS is fully compatible with official mod CS 1.6 / CZero by Valve. All you have to do is to download binaries and replace original mp.dll/cs.so ## Downloads -* [Release builds](https://github.com/s1lentq/ReGameDLL_CS/releases) -* [Dev builds](https://github.com/s1lentq/ReGameDLL_CS/actions/workflows/build.yml) +* [Release builds](https://github.com/rehlds/ReGameDLL_CS/releases) +* [Dev builds](https://github.com/rehlds/ReGameDLL_CS/actions/workflows/build.yml) Warning! ReGameDLL_CS is not binary compatible with original hlds since it's compiled with compilers other than ones used for original mod CS. This means that plugins that do binary code analysis (Orpheu for example) probably will not work with ReGameDLL_CS.