├── .gitattributes ├── .github └── workflows │ └── build.yml ├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── README.md ├── build.sh ├── msvc └── reapi.sln ├── reapi ├── CMakeLists.txt ├── common │ ├── info.cpp │ ├── info.h │ └── stdc++compat.cpp ├── extra │ └── amxmodx │ │ └── scripting │ │ ├── include │ │ ├── cssdk_const.inc │ │ ├── reapi.inc │ │ ├── reapi_engine.inc │ │ ├── reapi_engine_const.inc │ │ ├── reapi_gamedll.inc │ │ ├── reapi_gamedll_const.inc │ │ ├── reapi_rechecker.inc │ │ ├── reapi_reunion.inc │ │ └── reapi_vtc.inc │ │ ├── message_test.sma │ │ └── reapi_test.sma ├── include │ ├── com_client.h │ ├── com_delta_packet.h │ ├── com_net.h │ ├── com_progdefs.h │ ├── cssdk │ │ ├── common │ │ │ ├── IGameServerData.h │ │ │ ├── IObjectContainer.h │ │ │ ├── ObjectList.h │ │ │ ├── Sequence.h │ │ │ ├── SteamCommon.h │ │ │ ├── beamdef.h │ │ │ ├── cl_entity.h │ │ │ ├── com_model.h │ │ │ ├── con_nprint.h │ │ │ ├── const.h │ │ │ ├── crc.h │ │ │ ├── cvardef.h │ │ │ ├── demo_api.h │ │ │ ├── director_cmds.h │ │ │ ├── dlight.h │ │ │ ├── dll_state.h │ │ │ ├── entity_state.h │ │ │ ├── entity_types.h │ │ │ ├── enums.h │ │ │ ├── event_api.h │ │ │ ├── event_args.h │ │ │ ├── event_flags.h │ │ │ ├── hltv.h │ │ │ ├── in_buttons.h │ │ │ ├── ivoicetweak.h │ │ │ ├── kbutton.h │ │ │ ├── mathlib.h │ │ │ ├── net_api.h │ │ │ ├── netadr.h │ │ │ ├── nowin.h │ │ │ ├── parsemsg.cpp │ │ │ ├── parsemsg.h │ │ │ ├── particledef.h │ │ │ ├── pmtrace.h │ │ │ ├── port.h │ │ │ ├── qfont.h │ │ │ ├── qlimits.h │ │ │ ├── quakedef.h │ │ │ ├── r_efx.h │ │ │ ├── r_studioint.h │ │ │ ├── ref_params.h │ │ │ ├── screenfade.h │ │ │ ├── studio_event.h │ │ │ ├── triangleapi.h │ │ │ ├── usercmd.h │ │ │ ├── vmodes.h │ │ │ ├── weaponinfo.h │ │ │ ├── winsani_in.h │ │ │ └── winsani_out.h │ │ ├── dlls │ │ │ ├── API │ │ │ │ ├── CSEntity.h │ │ │ │ ├── CSInterfaces.h │ │ │ │ ├── CSPlayer.h │ │ │ │ ├── CSPlayerItem.h │ │ │ │ └── CSPlayerWeapon.h │ │ │ ├── activity.h │ │ │ ├── activitymap.h │ │ │ ├── airtank.h │ │ │ ├── ammo.h │ │ │ ├── basemonster.h │ │ │ ├── bmodels.h │ │ │ ├── bot │ │ │ │ ├── cs_bot.h │ │ │ │ ├── cs_bot_chatter.h │ │ │ │ ├── cs_bot_manager.h │ │ │ │ └── cs_gamestate.h │ │ │ ├── buttons.h │ │ │ ├── cbase.h │ │ │ ├── cdll_dll.h │ │ │ ├── client.h │ │ │ ├── csbot_dll.h │ │ │ ├── decals.h │ │ │ ├── doors.h │ │ │ ├── effects.h │ │ │ ├── enginecallback.h │ │ │ ├── explode.h │ │ │ ├── extdef.h │ │ │ ├── extdll.h │ │ │ ├── func_break.h │ │ │ ├── func_tank.h │ │ │ ├── gamerules.h │ │ │ ├── gib.h │ │ │ ├── h_battery.h │ │ │ ├── h_cycler.h │ │ │ ├── healthkit.h │ │ │ ├── hintmessage.h │ │ │ ├── hookchains.h │ │ │ ├── hostage │ │ │ │ ├── hostage.h │ │ │ │ ├── hostage_improv.h │ │ │ │ ├── hostage_localnav.h │ │ │ │ └── hostage_states.h │ │ │ ├── items.h │ │ │ ├── lights.h │ │ │ ├── mapinfo.h │ │ │ ├── maprules.h │ │ │ ├── monsterevent.h │ │ │ ├── monsters.h │ │ │ ├── mortar.h │ │ │ ├── observer.h │ │ │ ├── pathcorner.h │ │ │ ├── plats.h │ │ │ ├── player.h │ │ │ ├── qstring.h │ │ │ ├── regamedll_api.h │ │ │ ├── regamedll_const.h │ │ │ ├── revert_saved.h │ │ │ ├── saverestore.h │ │ │ ├── schedule.h │ │ │ ├── skill.h │ │ │ ├── sound.h │ │ │ ├── spectator.h │ │ │ ├── subs.h │ │ │ ├── training_gamerules.h │ │ │ ├── trains.h │ │ │ ├── triggers.h │ │ │ ├── unisignals.h │ │ │ ├── util.h │ │ │ ├── vector.h │ │ │ ├── vehicle.h │ │ │ ├── weapons.h │ │ │ ├── weapontype.h │ │ │ └── wpn_shared.h │ │ ├── engine │ │ │ ├── FlightRecorder.h │ │ │ ├── IMessageManager.h │ │ │ ├── Sequence.h │ │ │ ├── archtypes.h │ │ │ ├── bspfile.h │ │ │ ├── cmd_rehlds.h │ │ │ ├── common_rehlds.h │ │ │ ├── crc32c.cpp │ │ │ ├── crc32c.h │ │ │ ├── custom.h │ │ │ ├── customentity.h │ │ │ ├── d_local.h │ │ │ ├── edict.h │ │ │ ├── eiface.h │ │ │ ├── keydefs.h │ │ │ ├── maintypes.h │ │ │ ├── model.h │ │ │ ├── modelgen.h │ │ │ ├── osconfig.h │ │ │ ├── pr_dlls.h │ │ │ ├── progdefs.h │ │ │ ├── progs.h │ │ │ ├── rehlds_api.h │ │ │ ├── rehlds_interfaces.h │ │ │ ├── shake.h │ │ │ ├── spritegn.h │ │ │ ├── static_map.h │ │ │ ├── studio.h │ │ │ ├── sys_shared.cpp │ │ │ ├── sys_shared.h │ │ │ └── userid_rehlds.h │ │ ├── game_shared │ │ │ ├── GameEvent.h │ │ │ ├── bitvec.h │ │ │ ├── bot │ │ │ │ ├── bot.h │ │ │ │ ├── bot_constants.h │ │ │ │ ├── bot_manager.h │ │ │ │ ├── bot_profile.h │ │ │ │ ├── bot_util.h │ │ │ │ ├── improv.h │ │ │ │ ├── nav.h │ │ │ │ ├── nav_area.h │ │ │ │ ├── nav_node.h │ │ │ │ ├── nav_path.h │ │ │ │ └── simple_state_machine.h │ │ │ ├── perf_counter.h │ │ │ ├── shared_util.h │ │ │ ├── simple_checksum.h │ │ │ ├── steam_util.h │ │ │ ├── voice_common.h │ │ │ └── voice_gamemgr.h │ │ ├── pm_shared │ │ │ ├── pm_defs.h │ │ │ ├── pm_info.h │ │ │ ├── pm_materials.h │ │ │ ├── pm_movevars.h │ │ │ └── pm_shared.h │ │ └── public │ │ │ ├── FileSystem.h │ │ │ ├── basetypes.h │ │ │ ├── commonmacros.h │ │ │ ├── interface.cpp │ │ │ ├── interface.h │ │ │ ├── strtools.h │ │ │ ├── tier0 │ │ │ ├── dbg.cpp │ │ │ ├── dbg.h │ │ │ └── platform.h │ │ │ ├── utlarray.h │ │ │ ├── utlmemory.h │ │ │ └── utlvector.h │ ├── metamod │ │ ├── dllapi.h │ │ ├── engine_api.h │ │ ├── enginecallbacks.h │ │ ├── h_export.h │ │ ├── meta_api.h │ │ ├── mutil.h │ │ └── plinfo.h │ ├── rechecker_api.h │ ├── reunion_api.h │ └── vtc_api.h ├── lib │ └── linux32 │ │ ├── libgcc_s.so.1 │ │ ├── libm.so │ │ ├── librt.so │ │ └── libstdc++.so.6 ├── msvc │ ├── PostBuild.bat │ ├── reapi.def │ ├── reapi.rc │ ├── reapi.vcxproj │ ├── reapi.vcxproj.filters │ └── resource.h ├── src │ ├── amx_hook.cpp │ ├── amx_hook.h │ ├── amxxmodule.cpp │ ├── amxxmodule.h │ ├── api_config.cpp │ ├── api_config.h │ ├── dllapi.cpp │ ├── engine_api.cpp │ ├── entity_callback_dispatcher.cpp │ ├── entity_callback_dispatcher.h │ ├── h_export.cpp │ ├── hook_callback.cpp │ ├── hook_callback.h │ ├── hook_list.cpp │ ├── hook_list.h │ ├── hook_manager.cpp │ ├── hook_manager.h │ ├── hook_message_manager.cpp │ ├── hook_message_manager.h │ ├── main.cpp │ ├── main.h │ ├── member_list.cpp │ ├── member_list.h │ ├── meta_api.cpp │ ├── mods │ │ ├── mod_rechecker_api.cpp │ │ ├── mod_rechecker_api.h │ │ ├── mod_regamedll_api.cpp │ │ ├── mod_regamedll_api.h │ │ ├── mod_rehlds_api.cpp │ │ ├── mod_rehlds_api.h │ │ ├── mod_reunion_api.cpp │ │ ├── mod_reunion_api.h │ │ ├── mod_vtc_api.cpp │ │ ├── mod_vtc_api.h │ │ ├── queryfile_handler.cpp │ │ └── queryfile_handler.h │ ├── natives │ │ ├── natives_common.cpp │ │ ├── natives_common.h │ │ ├── natives_helper.h │ │ ├── natives_hookchains.cpp │ │ ├── natives_hookchains.h │ │ ├── natives_hookmessage.cpp │ │ ├── natives_hookmessage.h │ │ ├── natives_members.cpp │ │ ├── natives_members.h │ │ ├── natives_misc.cpp │ │ ├── natives_misc.h │ │ ├── natives_rechecker.cpp │ │ ├── natives_rechecker.h │ │ ├── natives_reunion.cpp │ │ ├── natives_reunion.h │ │ ├── natives_vtc.cpp │ │ └── natives_vtc.h │ ├── platform.h │ ├── precompiled.cpp │ ├── precompiled.h │ ├── reapi_utils.cpp │ ├── reapi_utils.h │ ├── sdk_util.cpp │ └── type_conversion.h └── version │ ├── appversion.bat │ ├── appversion.sh │ ├── glibc_test.sh │ ├── msvc │ ├── version.vcxproj │ └── version.vcxproj.filters │ └── version.h └── version_script.lds /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | # Sources 7 | *.c text eol=crlf diff=c 8 | *.cc text eol=crlf diff=cpp 9 | *.cxx text eol=crlf diff=cpp 10 | *.cpp text eol=crlf diff=cpp 11 | *.c++ text eol=crlf diff=cpp 12 | *.hpp text eol=crlf diff=cpp 13 | *.h text eol=crlf diff=c 14 | *.h++ text eol=crlf diff=cpp 15 | *.hh text eol=crlf diff=cpp 16 | *.inc text eol=crlf linguist-language=pawn 17 | *.sma text eol=crlf linguist-language=pawn 18 | 19 | # Scripts 20 | *.sh text eol=lf 21 | *.bat text eol=crlf 22 | *.def text eol=crlf 23 | *.rc text eol=crlf 24 | 25 | # Compiled Object files 26 | *.o binary 27 | *.a binary 28 | *.obj binary 29 | *.lib binary 30 | 31 | # Resources files 32 | *.zip binary 33 | 34 | # Project files 35 | *.sln text eol=crlf 36 | *.vcxproj text eol=crlf 37 | *.vcxproj.filters text eol=crlf 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/build 2 | *.bat 3 | **/msvc/Debug* 4 | **/msvc/Release* 5 | **/msvc/*.sdf 6 | **/msvc/*.opensdf 7 | **/msvc/*.user 8 | **/msvc/*.suo 9 | **/msvc/*.db 10 | **/msvc/*.opendb 11 | **/msvc/*.txt 12 | **/msvc/*.aps 13 | **/msvc/.vs 14 | **/msvc/ipch 15 | **/PublishPath*.txt 16 | **/*.log 17 | 18 | publish 19 | **/appversion.h 20 | **/reapi_version.inc 21 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | project(reapi CXX) 3 | 4 | if (WIN32) 5 | message(FATAL_ERROR "CMakeLists.txt Windows platform isn't supported yet. Use msvc/reapi.sln instead it!") 6 | endif() 7 | 8 | 9 | add_custom_target(appversion DEPENDS 10 | COMMAND "${PROJECT_SOURCE_DIR}/reapi/version/appversion.sh" "${PROJECT_SOURCE_DIR}" "reapi" 11 | ) 12 | 13 | add_subdirectory(reapi) 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [ReAPI](https://github.com/rehlds/ReAPI) [![Download](https://img.shields.io/github/downloads/s1lentq/ReGameDLL_CS/latest/total)](https://github.com/s1lentq/ReAPI/releases/latest) [![Downloads](https://img.shields.io/github/downloads/s1lentq/ReAPI/total)]() [![Percentage of issues still open](http://isitmaintained.com/badge/open/s1lentq/ReAPI.svg)](http://isitmaintained.com/project/s1lentq/ReAPI "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) 2 | 3 | AMX Mod X module, using API regamedll & rehlds 4 | 5 | ## Build instructions 6 | ### Checking requirements 7 | There are several software requirements for building ReAPI: 8 | 9 | #### Windows 10 |
11 | Visual Studio 2015 (C++14 standard) and later
12 | 
13 | 14 | #### Linux 15 |
16 | git >= 1.8.5
17 | cmake >= 3.10
18 | GCC >= 4.9.2 (Optional)
19 | ICC >= 15.0.1 20141023 (Optional)
20 | LLVM (Clang) >= 6.0 (Optional)
21 | 
22 | 23 | ### Building 24 | 25 | #### Windows 26 | Use `Visual Studio` to build, open `msvc/ReAPI.sln` and just select from the solution configurations list `Release` or `Debug` 27 | 28 | #### Linux 29 | 30 | * Optional options using `build.sh --compiler=[gcc] --jobs=[N] -D[option]=[ON or OFF]` (without square brackets) 31 | 32 |
33 | -c=|--compiler=[icc|gcc|clang]  - Select preferred C/C++ compiler to build
34 | -j=|--jobs=[N]                  - Specifies the number of jobs (commands) to run simultaneously (For faster building)
35 | 
36 | Definitions (-D)
37 | DEBUG                           - Enables debugging mode
38 | USE_STATIC_LIBSTDC              - Enables static linking library libstdc++
39 | 
40 | 41 | * ICC
./build.sh --compiler=intel
42 | * LLVM (Clang)
./build.sh --compiler=clang
43 | * GCC
./build.sh --compiler=gcc
44 | 45 | ##### Checking build environment (Debian / Ubuntu) 46 | 47 |
48 | Click to expand 49 | 50 | 70 | 71 |
72 | 73 | ## How can I help the project? 74 | Just install it on your game server and report problems you faced.
75 | Merge requests are also welcome :shipit: 76 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | main() 4 | { 5 | CC=gcc 6 | CXX=g++ 7 | 8 | if [[ "$*" =~ "--help" ]]; then 9 | help 10 | exit 0; 11 | fi 12 | 13 | n=0 14 | args=() 15 | for i in "$@" 16 | do 17 | case $i in 18 | -j=*|--jobs=*) 19 | jobs="-j${i#*=}" 20 | shift 21 | ;; 22 | -c=*|--compiler=*) 23 | C="${i#*=}" 24 | shift 25 | ;; 26 | *) 27 | args[$n]="$i" 28 | ((++n)) 29 | ;; 30 | esac 31 | done 32 | 33 | case "$C" in 34 | ("intel"|"icc") CC=icc CXX=icpc ;; 35 | ("gcc"|"g++") CC=gcc CXX=g++ ;; 36 | ("clang|llvm") CC=clang CXX=clang++ ;; 37 | *) 38 | ;; 39 | esac 40 | 41 | rm -rf build 42 | mkdir build 43 | pushd build &> /dev/null 44 | CC=$CC CXX=$CXX cmake ${args[@]} .. 45 | make ${jobs} 46 | popd > /dev/null 47 | } 48 | 49 | help() 50 | { 51 | printf "Usage: ./build.sh \n\n" 52 | printf " -c= | --compiler= - Select preferred C/C++ compiler to build\n" 53 | printf " -j= | --jobs= - Specifies the number of jobs (commands) to run simultaneously (For faster building)\n\n" 54 | } 55 | 56 | # Initialize 57 | main $* 58 | 59 | # Exit normally 60 | exit 0 61 | -------------------------------------------------------------------------------- /msvc/reapi.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reapi", "..\reapi\msvc\reapi.vcxproj", "{74E2532F-BE55-4B2B-8C34-C9A4B5EC11AC}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version", "..\reapi\version\msvc\version.vcxproj", "{8520B2EC-8DE2-4B76-8FA7-02F156C79C04}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {74E2532F-BE55-4B2B-8C34-C9A4B5EC11AC}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {74E2532F-BE55-4B2B-8C34-C9A4B5EC11AC}.Debug|Win32.Build.0 = Debug|Win32 18 | {74E2532F-BE55-4B2B-8C34-C9A4B5EC11AC}.Release|Win32.ActiveCfg = Release|Win32 19 | {74E2532F-BE55-4B2B-8C34-C9A4B5EC11AC}.Release|Win32.Build.0 = Release|Win32 20 | {8520B2EC-8DE2-4B76-8FA7-02F156C79C04}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {8520B2EC-8DE2-4B76-8FA7-02F156C79C04}.Debug|Win32.Build.0 = Debug|Win32 22 | {8520B2EC-8DE2-4B76-8FA7-02F156C79C04}.Release|Win32.ActiveCfg = Release|Win32 23 | {8520B2EC-8DE2-4B76-8FA7-02F156C79C04}.Release|Win32.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {ED60E017-84B1-4D63-8802-644D7E6B4EA8} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /reapi/common/info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Key + value + 2 x slash + NULL 4 | const int MAX_INFO_STRING = 256; 5 | const int MAX_KV_LEN = 127; 6 | const int INFO_MAX_BUFFER_VALUES = 4; 7 | 8 | const char *Info_ValueForKey(const char *s, const char *key); 9 | void Info_RemoveKey(char *s, const char *key); 10 | void Info_SetValueForStarKey(char *s, const char *key, const char *value, int maxsize); 11 | -------------------------------------------------------------------------------- /reapi/common/stdc++compat.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if !defined(_WIN32) && !defined(BUILD_STATIC_LIBSTDC) // if build with static libstdc++ then ignore 5 | 6 | // This file adds the necessary compatibility tricks to avoid symbols with 7 | // version GLIBCXX_3.4.16 and bigger, keeping binary compatibility with libstdc++ 4.6.1. 8 | namespace std 9 | { 10 | 11 | #if __cpp_exceptions 12 | logic_error::logic_error(const char *__arg) : exception(), _M_msg(__arg) {} 13 | out_of_range::out_of_range(const char *__arg) : logic_error(__arg) {} 14 | out_of_range::~out_of_range() _GLIBCXX_USE_NOEXCEPT {} 15 | #endif // #if __cpp_exceptions 16 | 17 | // We shouldn't be throwing exceptions at all, but it sadly turns out we call STL (inline) functions that do. 18 | void __throw_out_of_range_fmt(const char *fmt, ...) 19 | { 20 | #if __cpp_exceptions 21 | va_list ap; 22 | char buf[1024]; // That should be big enough. 23 | 24 | va_start(ap, fmt); 25 | vsnprintf(buf, sizeof(buf), fmt, ap); 26 | buf[sizeof(buf) - 1] = '\0'; 27 | va_end(ap); 28 | 29 | throw std::out_of_range(buf); 30 | #else 31 | abort(); 32 | #endif 33 | } 34 | }; // namespace std 35 | 36 | // Was added in GCC 4.9 37 | // Technically, this symbol is not in GLIBCXX_3.4.20, but in CXXABI_1.3.8, but that's equivalent, version-wise. 38 | // Those calls are added by the compiler 39 | // itself on `new Class[n]` calls. 40 | extern "C" 41 | void __cxa_throw_bad_array_new_length() 42 | { 43 | #if __cpp_exceptions 44 | throw std::bad_array_new_length(); 45 | #else 46 | abort(); 47 | #endif 48 | } 49 | 50 | #if defined(__INTEL_COMPILER) && __cplusplus >= 201402L 51 | // This operator delete sized deallocations was added in c++14 52 | // and required at least not less than CXXABI_1.3.9 53 | // we should to keep CXXABI_1.3.8 for binary compatibility with oldest libstdc++. 54 | // GCC and Clang allow to compile C++14 code with -fno-sized-deallocation to disable the new feature, but ICC isn't allow 55 | // so that our C++14 library code would never call that version of operator delete, 56 | // for ICC compiler we must override those operators for static linking to the library. 57 | void operator delete[](void *ptr, std::size_t size) noexcept 58 | { 59 | ::operator delete(ptr); 60 | } 61 | 62 | void operator delete(void *ptr, std::size_t size) noexcept 63 | { 64 | ::operator delete(ptr); 65 | } 66 | #endif 67 | 68 | #endif // !defined(_WIN32) 69 | -------------------------------------------------------------------------------- /reapi/extra/amxmodx/scripting/include/reapi_rechecker.inc: -------------------------------------------------------------------------------- 1 | #if defined _reapi_rechecker_included 2 | #endinput 3 | #endif 4 | #define _reapi_rechecker_included 5 | 6 | enum ResourceType 7 | { 8 | RES_TYPE_NONE = 0, 9 | RES_TYPE_EXISTS, // to comparison with the specified hash value 10 | RES_TYPE_MISSING, // check it missing file on client 11 | RES_TYPE_IGNORE, // ignore the specified hash value 12 | RES_TYPE_HASH_ANY, // any file with any the hash value 13 | }; 14 | 15 | enum ReCheckerFunc 16 | { 17 | /* 18 | * Description: - 19 | * Params: (const client, const filename[], const cmd[], const ResourceType:type, const responseHash, bool:isBreak) 20 | */ 21 | RC_FileConsistencyProcess = BEGIN_FUNC_REGION(rechecker), 22 | 23 | /* 24 | * Description: - 25 | * Params: (const client) 26 | */ 27 | RC_FileConsistencyFinal, 28 | 29 | /* 30 | * Description: - 31 | * Params: (const client, const filename[], const cmd[], const responseHash) 32 | */ 33 | RC_CmdExec, 34 | 35 | // [...] 36 | }; 37 | 38 | /* 39 | * Send request the file for the client to get hash 40 | * 41 | * @param file The file (Can contain a relative path to the file) 42 | * @param function The forward to call 43 | * @param type The request type, can be only RES_TYPE_EXISTS, RES_TYPE_MISSING or RES_TYPE_HASH_ANY 44 | * @param hash Hash of file to request. 45 | * 46 | * @return Returns a hook handle. Use UnRegisterQueryFile to remove the forward 47 | */ 48 | native QueryFileHook:RegisterQueryFile(const file[], const function[], const ResourceType:type, const hash = -1); 49 | 50 | /* 51 | * Unregister the forward. 52 | * Use the return value from RegisterQueryFile as the parameter here! 53 | * 54 | * @param hook The hook to remove 55 | * 56 | * @return Returns true if the hook is successfully removed, otherwise false 57 | */ 58 | native bool:UnRegisterQueryFile(QueryFileHook:hook); 59 | -------------------------------------------------------------------------------- /reapi/extra/amxmodx/scripting/include/reapi_reunion.inc: -------------------------------------------------------------------------------- 1 | #if defined _reapi_reunion_included 2 | #endinput 3 | #endif 4 | #define _reapi_reunion_included 5 | 6 | enum client_auth_type 7 | { 8 | CA_TYPE_NONE = 0, 9 | CA_TYPE_DPROTO, 10 | CA_TYPE_STEAM, 11 | CA_TYPE_STEAMEMU, 12 | CA_TYPE_REVEMU, 13 | CA_TYPE_OLDREVEMU, 14 | CA_TYPE_HLTV, 15 | CA_TYPE_SC2009, 16 | CA_TYPE_AVSMP, 17 | CA_TYPE_SXEI, 18 | CA_TYPE_REVEMU2013, 19 | CA_TYPE_SSE3, 20 | }; 21 | 22 | #define is_user_steam(%0) (REU_GetAuthtype(%0) == CA_TYPE_STEAM) 23 | 24 | /* 25 | * Gets client protocol. 26 | * 27 | * @param index Client index 28 | * 29 | * @return Client protocol 30 | */ 31 | native REU_GetProtocol(const index); 32 | 33 | /* 34 | * Gets client auth type. 35 | * 36 | * @param index Client index 37 | * 38 | * @return Client auth type 39 | */ 40 | native client_auth_type:REU_GetAuthtype(const index); 41 | 42 | /* 43 | * Get client authkey 44 | * 45 | * @param index Client index 46 | * @param index Buffer to copy the authkey 47 | * @param index Maximum buffer size 48 | * 49 | * @return Number of cells copied to buffer 50 | * 51 | */ 52 | native REU_GetAuthKey(const index, dest[], maxlen); 53 | 54 | /* 55 | * Check if the client is running RevEmu with limited user rights. 56 | * 57 | * @param index Client index 58 | * 59 | * @return 1/0 60 | */ 61 | native bool:REU_IsRevemuWithoutAdminRights(const index); 62 | -------------------------------------------------------------------------------- /reapi/extra/amxmodx/scripting/include/reapi_vtc.inc: -------------------------------------------------------------------------------- 1 | #if defined _reapi_vtc_included 2 | #endinput 3 | #endif 4 | #define _reapi_vtc_included 5 | 6 | /* 7 | * Checks whether the player is talking at the moment. 8 | * 9 | * @param index Client index 10 | * 11 | * @return true if client is speaking, false otherwise 12 | */ 13 | native bool:VTC_IsClientSpeaking(const index); 14 | 15 | /* 16 | * Mutes the player. 17 | * 18 | * @param index Client index 19 | * 20 | * @noreturn 21 | */ 22 | native VTC_MuteClient(const index); 23 | 24 | /* 25 | * Unmutes the player. 26 | * 27 | * @param index Client index 28 | * 29 | * @noreturn 30 | */ 31 | native VTC_UnmuteClient(const index); 32 | 33 | /* 34 | * Checks whether the player is muted at the moment. 35 | * 36 | * @param index Client index 37 | * 38 | * @return true if client is muted, false otherwise 39 | */ 40 | native bool:VTC_IsClientMuted(const index); 41 | 42 | /* 43 | * Play the audio file via the voice stream. 44 | * 45 | * @param receiver Receiver index 46 | * @param soundFilePath The path to the sound file 47 | * 48 | * @note Usage example: 49 | * VTC_PlaySound(id, "sound/ambience/Opera.wav"); 50 | * 51 | * @noreturn 52 | */ 53 | native VTC_PlaySound(const receiver, const soundFilePath[]); 54 | 55 | /* 56 | * Called when the player started talking. 57 | * 58 | * @param index Client index 59 | * 60 | * @noreturn 61 | */ 62 | forward VTC_OnClientStartSpeak(const index); 63 | 64 | /* 65 | * Called when the player stopped talking. 66 | * 67 | * @param index Client index 68 | * 69 | * @noreturn 70 | */ 71 | forward VTC_OnClientStopSpeak(const index); 72 | -------------------------------------------------------------------------------- /reapi/extra/amxmodx/scripting/reapi_test.sma: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | public plugin_init() 5 | { 6 | register_plugin("ReAPI Test", "1.0", "s1lent"); 7 | RegisterHookChain(RG_CBasePlayer_GiveAmmo, "CBasePlayer_GiveAmmo"); 8 | } 9 | 10 | public CBasePlayer_GiveAmmo(const this, iAmount, szName[], iMax) 11 | { 12 | server_print(" -> CBasePlayer_GiveAmmo: index:(%d), amount:(%d), name:(%s), max:(%d)", this, iAmount, szName, iMax); 13 | return HC_CONTINUE; 14 | } 15 | -------------------------------------------------------------------------------- /reapi/include/com_delta_packet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "entity_state.h" 32 | 33 | typedef struct packet_entities_s 34 | { 35 | int num_entities; 36 | unsigned char flags[32]; 37 | entity_state_t *entities; 38 | } packet_entities_t; 39 | 40 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/IGameServerData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "maintypes.h" 4 | #include "interface.h" 5 | 6 | class IGameServerData : public IBaseInterface { 7 | public: 8 | virtual ~IGameServerData() { }; 9 | 10 | virtual void WriteDataRequest(const void *buffer, int bufferSize) = 0; 11 | 12 | virtual int ReadDataResponse(void *data, int len) = 0; 13 | }; 14 | 15 | #define GAMESERVERDATA_INTERFACE_VERSION "GameServerData001" 16 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/IObjectContainer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | class IObjectContainer { 32 | public: 33 | virtual ~IObjectContainer() {} 34 | 35 | virtual void Init() = 0; 36 | 37 | virtual bool Add(void *newObject) = 0; 38 | virtual bool Remove(void *object) = 0; 39 | virtual void Clear(bool freeElementsMemory) = 0; 40 | 41 | virtual void *GetFirst() = 0; 42 | virtual void *GetNext() = 0; 43 | 44 | virtual int CountElements() = 0; 45 | virtual bool Contains(void *object) = 0; 46 | virtual bool IsEmpty() = 0; 47 | }; 48 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/ObjectList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "IObjectContainer.h" 32 | 33 | class ObjectList: public IObjectContainer { 34 | public: 35 | EXT_FUNC void Init(); 36 | EXT_FUNC bool Add(void *newObject); 37 | EXT_FUNC void *GetFirst(); 38 | EXT_FUNC void *GetNext(); 39 | 40 | ObjectList(); 41 | virtual ~ObjectList(); 42 | 43 | EXT_FUNC void Clear(bool freeElementsMemory = false); 44 | EXT_FUNC int CountElements(); 45 | void *RemoveTail(); 46 | void *RemoveHead(); 47 | 48 | bool AddTail(void *newObject); 49 | bool AddHead(void *newObject); 50 | EXT_FUNC bool Remove(void *object); 51 | EXT_FUNC bool Contains(void *object); 52 | EXT_FUNC bool IsEmpty(); 53 | 54 | typedef struct element_s { 55 | struct element_s *prev; // pointer to the last element or NULL 56 | struct element_s *next; // pointer to the next elemnet or NULL 57 | void *object; // the element's object 58 | } element_t; 59 | 60 | protected: 61 | element_t *m_head; // first element in list 62 | element_t *m_tail; // last element in list 63 | element_t *m_current; // current element in list 64 | int m_number; 65 | }; 66 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/beamdef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( BEAMDEFH ) 16 | #define BEAMDEFH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #define FBEAM_STARTENTITY 0x00000001 22 | #define FBEAM_ENDENTITY 0x00000002 23 | #define FBEAM_FADEIN 0x00000004 24 | #define FBEAM_FADEOUT 0x00000008 25 | #define FBEAM_SINENOISE 0x00000010 26 | #define FBEAM_SOLID 0x00000020 27 | #define FBEAM_SHADEIN 0x00000040 28 | #define FBEAM_SHADEOUT 0x00000080 29 | #define FBEAM_STARTVISIBLE 0x10000000 // Has this client actually seen this beam's start entity yet? 30 | #define FBEAM_ENDVISIBLE 0x20000000 // Has this client actually seen this beam's end entity yet? 31 | #define FBEAM_ISACTIVE 0x40000000 32 | #define FBEAM_FOREVER 0x80000000 33 | 34 | typedef struct beam_s BEAM; 35 | struct beam_s 36 | { 37 | BEAM *next; 38 | int type; 39 | int flags; 40 | vec3_t source; 41 | vec3_t target; 42 | vec3_t delta; 43 | float t; // 0 .. 1 over lifetime of beam 44 | float freq; 45 | float die; 46 | float width; 47 | float amplitude; 48 | float r, g, b; 49 | float brightness; 50 | float speed; 51 | float frameRate; 52 | float frame; 53 | int segments; 54 | int startEntity; 55 | int endEntity; 56 | int modelIndex; 57 | int frameCount; 58 | struct model_s *pFollowModel; 59 | struct particle_s *particles; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/com_model.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/common/com_model.h -------------------------------------------------------------------------------- /reapi/include/cssdk/common/con_nprint.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( CON_NPRINTH ) 16 | #define CON_NPRINTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | typedef struct con_nprint_s 26 | { 27 | int index; // Row # 28 | float time_to_live; // # of seconds before it dissappears 29 | float color[ 3 ]; // RGB colors ( 0.0 -> 1.0 scale ) 30 | } con_nprint_t; 31 | 32 | void Con_NPrintf( int idx, const char *fmt, ... ); 33 | void Con_NXPrintf( struct con_nprint_s *info, const char *fmt, ... ); 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/crc.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | /* crc.h */ 16 | #pragma once 17 | 18 | #include "quakedef.h" 19 | 20 | // MD5 Hash 21 | typedef struct 22 | { 23 | unsigned int buf[4]; 24 | unsigned int bits[2]; 25 | unsigned char in[64]; 26 | } MD5Context_t; 27 | 28 | typedef unsigned int CRC32_t; 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" 33 | { 34 | #endif 35 | 36 | void CRC32_Init(CRC32_t *pulCRC); 37 | CRC32_t CRC32_Final(CRC32_t pulCRC); 38 | void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch); 39 | void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *pBuffer, int nBuffer); 40 | BOOL CRC_File(CRC32_t *crcvalue, char *pszFileName); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | byte COM_BlockSequenceCRCByte(byte *base, int length, int sequence); 47 | int CRC_MapFile(CRC32_t *crcvalue, char *pszFileName); 48 | 49 | void MD5Init(MD5Context_t *ctx); 50 | void MD5Update(MD5Context_t *ctx, const unsigned char *buf, unsigned int len); 51 | void MD5Final(unsigned char digest[16], MD5Context_t *ctx); 52 | void MD5Transform(unsigned int buf[4], const unsigned int in[16]); 53 | 54 | BOOL MD5_Hash_File(unsigned char digest[16], char *pszFileName, BOOL bUsefopen, BOOL bSeed, unsigned int seed[4]); 55 | char *MD5_Print(unsigned char hash[16]); 56 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/cvardef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | 16 | #ifndef CVARDEF_H 17 | #define CVARDEF_H 18 | 19 | #define FCVAR_ARCHIVE (1<<0) // set to cause it to be saved to vars.rc 20 | #define FCVAR_USERINFO (1<<1) // changes the client's info string 21 | #define FCVAR_SERVER (1<<2) // notifies players when changed 22 | #define FCVAR_EXTDLL (1<<3) // defined by external DLL 23 | #define FCVAR_CLIENTDLL (1<<4) // defined by the client dll 24 | #define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value 25 | #define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server. 26 | #define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). 27 | #define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log 28 | #define FCVAR_NOEXTRAWHITEPACE (1<<9) // strip trailing/leading white space from this cvar 29 | 30 | typedef struct cvar_s 31 | { 32 | const char *name; 33 | char *string; 34 | int flags; 35 | float value; 36 | struct cvar_s *next; 37 | } cvar_t; 38 | 39 | using cvar_callback_t = void (*)(const char *pszNewValue); 40 | 41 | struct cvar_listener_t 42 | { 43 | cvar_listener_t(const char *var_name, cvar_callback_t handler) : 44 | func(handler), name(var_name) {} 45 | 46 | cvar_callback_t func; 47 | const char *name; 48 | }; 49 | 50 | #endif // CVARDEF_H 51 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/demo_api.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( DEMO_APIH ) 16 | #define DEMO_APIH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct demo_api_s 22 | { 23 | int ( *IsRecording ) ( void ); 24 | int ( *IsPlayingback ) ( void ); 25 | int ( *IsTimeDemo ) ( void ); 26 | void ( *WriteBuffer ) ( int size, unsigned char *buffer ); 27 | } demo_api_t; 28 | 29 | extern demo_api_t demoapi; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/director_cmds.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/common/director_cmds.h -------------------------------------------------------------------------------- /reapi/include/cssdk/common/dlight.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( DLIGHTH ) 16 | #define DLIGHTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct dlight_s 22 | { 23 | vec3_t origin; 24 | float radius; 25 | color24 color; 26 | float die; // stop lighting after this time 27 | float decay; // drop this each second 28 | float minlight; // don't add when contributing less 29 | int key; 30 | qboolean dark; // subtracts light instead of adding 31 | } dlight_t; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/dll_state.h: -------------------------------------------------------------------------------- 1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ 2 | // 3 | // Purpose: 4 | // 5 | // $NoKeywords: $ 6 | //============================================================================= 7 | 8 | //DLL State Flags 9 | 10 | #define DLL_INACTIVE 0 // no dll 11 | #define DLL_ACTIVE 1 // dll is running 12 | #define DLL_PAUSED 2 // dll is paused 13 | #define DLL_CLOSE 3 // closing down dll 14 | #define DLL_TRANS 4 // Level Transition 15 | 16 | // DLL Pause reasons 17 | 18 | #define DLL_NORMAL 0 // User hit Esc or something. 19 | #define DLL_QUIT 4 // Quit now 20 | #define DLL_RESTART 5 // Switch to launcher for linux, does a quit but returns 1 21 | 22 | // DLL Substate info ( not relevant ) 23 | #define ENG_NORMAL (1<<0) 24 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/entity_types.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // entity_types.h 16 | #if !defined( ENTITY_TYPESH ) 17 | #define ENTITY_TYPESH 18 | 19 | #define ET_NORMAL 0 20 | #define ET_PLAYER 1 21 | #define ET_TEMPENTITY 2 22 | #define ET_BEAM 3 23 | // BMODEL or SPRITE that was split across BSP nodes 24 | #define ET_FRAGMENTED 4 25 | 26 | #endif // !ENTITY_TYPESH 27 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/enums.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 2009, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | 16 | #ifndef ENUMS_H 17 | #define ENUMS_H 18 | 19 | typedef enum netsrc_s 20 | { 21 | NS_CLIENT, 22 | NS_SERVER, 23 | NS_MULTICAST // xxxMO 24 | } netsrc_t; 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/event_api.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined ( EVENT_APIH ) 16 | #define EVENT_APIH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #define EVENT_API_VERSION 1 22 | 23 | typedef struct event_api_s 24 | { 25 | int version; 26 | void ( *EV_PlaySound ) ( int ent, float *origin, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch ); 27 | void ( *EV_StopSound ) ( int ent, int channel, const char *sample ); 28 | int ( *EV_FindModelIndex )( const char *pmodel ); 29 | int ( *EV_IsLocal ) ( int playernum ); 30 | int ( *EV_LocalPlayerDucking ) ( void ); 31 | void ( *EV_LocalPlayerViewheight ) ( float * ); 32 | void ( *EV_LocalPlayerBounds ) ( int hull, float *mins, float *maxs ); 33 | int ( *EV_IndexFromTrace) ( struct pmtrace_s *pTrace ); 34 | struct physent_s *( *EV_GetPhysent ) ( int idx ); 35 | void ( *EV_SetUpPlayerPrediction ) ( int dopred, int bIncludeLocalClient ); 36 | void ( *EV_PushPMStates ) ( void ); 37 | void ( *EV_PopPMStates ) ( void ); 38 | void ( *EV_SetSolidPlayers ) (int playernum); 39 | void ( *EV_SetTraceHull ) ( int hull ); 40 | void ( *EV_PlayerTrace ) ( float *start, float *end, int traceFlags, int ignore_pe, struct pmtrace_s *tr ); 41 | void ( *EV_WeaponAnimation ) ( int sequence, int body ); 42 | unsigned short ( *EV_PrecacheEvent ) ( int type, const char* psz ); 43 | void ( *EV_PlaybackEvent ) ( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); 44 | const char *( *EV_TraceTexture ) ( int ground, float *vstart, float *vend ); 45 | void ( *EV_StopAllSounds ) ( int entnum, int entchannel ); 46 | void ( *EV_KillEvents ) ( int entnum, const char *eventname ); 47 | } event_api_t; 48 | 49 | extern event_api_t eventapi; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/event_args.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_ARGSH ) 16 | #define EVENT_ARGSH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Event was invoked with stated origin 22 | #define FEVENT_ORIGIN ( 1<<0 ) 23 | 24 | // Event was invoked with stated angles 25 | #define FEVENT_ANGLES ( 1<<1 ) 26 | 27 | typedef struct event_args_s 28 | { 29 | int flags; 30 | 31 | // Transmitted 32 | int entindex; 33 | 34 | float origin[3]; 35 | float angles[3]; 36 | float velocity[3]; 37 | 38 | int ducking; 39 | 40 | float fparam1; 41 | float fparam2; 42 | 43 | int iparam1; 44 | int iparam2; 45 | 46 | int bparam1; 47 | int bparam2; 48 | } event_args_t; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/event_flags.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( EVENT_FLAGSH ) 16 | #define EVENT_FLAGSH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Skip local host for event send. 22 | #define FEV_NOTHOST (1<<0) 23 | 24 | // Send the event reliably. You must specify the origin and angles and use 25 | // PLAYBACK_EVENT_FULL for this to work correctly on the server for anything 26 | // that depends on the event origin/angles. I.e., the origin/angles are not 27 | // taken from the invoking edict for reliable events. 28 | #define FEV_RELIABLE (1<<1) 29 | 30 | // Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC 31 | // sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ). 32 | #define FEV_GLOBAL (1<<2) 33 | 34 | // If this client already has one of these events in its queue, just update the event instead of sending it as a duplicate 35 | // 36 | #define FEV_UPDATE (1<<3) 37 | 38 | // Only send to entity specified as the invoker 39 | #define FEV_HOSTONLY (1<<4) 40 | 41 | // Only send if the event was created on the server. 42 | #define FEV_SERVER (1<<5) 43 | 44 | // Only issue event client side ( from shared code ) 45 | #define FEV_CLIENT (1<<6) 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/hltv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/common/hltv.h -------------------------------------------------------------------------------- /reapi/include/cssdk/common/in_buttons.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef IN_BUTTONS_H 16 | #define IN_BUTTONS_H 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | #define IN_ATTACK (1 << 0) 22 | #define IN_JUMP (1 << 1) 23 | #define IN_DUCK (1 << 2) 24 | #define IN_FORWARD (1 << 3) 25 | #define IN_BACK (1 << 4) 26 | #define IN_USE (1 << 5) 27 | #define IN_CANCEL (1 << 6) 28 | #define IN_LEFT (1 << 7) 29 | #define IN_RIGHT (1 << 8) 30 | #define IN_MOVELEFT (1 << 9) 31 | #define IN_MOVERIGHT (1 << 10) 32 | #define IN_ATTACK2 (1 << 11) 33 | #define IN_RUN (1 << 12) 34 | #define IN_RELOAD (1 << 13) 35 | #define IN_ALT1 (1 << 14) 36 | #define IN_SCORE (1 << 15) // Used by client.dll for when scoreboard is held down 37 | 38 | #endif // IN_BUTTONS_H 39 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/ivoicetweak.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/common/ivoicetweak.h -------------------------------------------------------------------------------- /reapi/include/cssdk/common/kbutton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #ifndef KBUTTON_H 30 | #define KBUTTON_H 31 | #ifdef _WIN32 32 | #pragma once 33 | #endif 34 | 35 | 36 | /* <31b2a> ../common/kbutton.h:7 */ 37 | typedef struct kbutton_s 38 | { 39 | int down[2]; 40 | int state; 41 | } kbutton_t; 42 | 43 | 44 | #endif // KBUTTON_H 45 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/net_api.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/common/net_api.h -------------------------------------------------------------------------------- /reapi/include/cssdk/common/netadr.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // netadr.h 16 | #ifndef NETADR_H 17 | #define NETADR_H 18 | #ifdef _WIN32 19 | #pragma once 20 | #endif 21 | 22 | typedef enum 23 | { 24 | NA_UNUSED, 25 | NA_LOOPBACK, 26 | NA_BROADCAST, 27 | NA_IP, 28 | NA_IPX, 29 | NA_BROADCAST_IPX, 30 | } netadrtype_t; 31 | 32 | typedef struct netadr_s 33 | { 34 | netadrtype_t type; 35 | unsigned char ip[4]; 36 | unsigned char ipx[10]; 37 | unsigned short port; 38 | } netadr_t; 39 | 40 | #endif // NETADR_H 41 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/nowin.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/common/nowin.h -------------------------------------------------------------------------------- /reapi/include/cssdk/common/parsemsg.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1999, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | // 16 | // parsemsg.h 17 | // MDC - copying from cstrike\cl_dll so career-mode stuff can catch messages 18 | // in this dll. (and C++ifying it) 19 | // 20 | 21 | #ifndef PARSEMSG_H 22 | #define PARSEMSG_H 23 | 24 | #define ASSERT( x ) 25 | //-------------------------------------------------------------------------------------------------------------- 26 | void BEGIN_READ( void *buf, int size ); 27 | int READ_CHAR( void ); 28 | int READ_BYTE( void ); 29 | int READ_SHORT( void ); 30 | int READ_WORD( void ); 31 | int READ_LONG( void ); 32 | float READ_FLOAT( void ); 33 | char* READ_STRING( void ); 34 | float READ_COORD( void ); 35 | float READ_ANGLE( void ); 36 | float READ_HIRESANGLE( void ); 37 | int READ_OK( void ); 38 | 39 | //-------------------------------------------------------------------------------------------------------------- 40 | class BufferWriter 41 | { 42 | public: 43 | BufferWriter(); 44 | BufferWriter( unsigned char *buffer, int bufferLen ); 45 | void Init( unsigned char *buffer, int bufferLen ); 46 | 47 | void WriteByte( unsigned char data ); 48 | void WriteLong( int data ); 49 | void WriteString( const char *str ); 50 | 51 | bool HasOverflowed(); 52 | int GetSpaceUsed(); 53 | 54 | protected: 55 | unsigned char *m_buffer; 56 | int m_remaining; 57 | bool m_overflow; 58 | int m_overallLength; 59 | }; 60 | 61 | //-------------------------------------------------------------------------------------------------------------- 62 | 63 | #endif // PARSEMSG_H 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/particledef.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PARTICLEDEFH ) 16 | #define PARTICLEDEFH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef enum { 22 | pt_static, 23 | pt_grav, 24 | pt_slowgrav, 25 | pt_fire, 26 | pt_explode, 27 | pt_explode2, 28 | pt_blob, 29 | pt_blob2, 30 | pt_vox_slowgrav, 31 | pt_vox_grav, 32 | pt_clientcustom // Must have callback function specified 33 | } ptype_t; 34 | 35 | // !!! if this is changed, it must be changed in d_ifacea.h too !!! 36 | typedef struct particle_s 37 | { 38 | // driver-usable fields 39 | vec3_t org; 40 | short color; 41 | short packedColor; 42 | // drivers never touch the following fields 43 | struct particle_s *next; 44 | vec3_t vel; 45 | float ramp; 46 | float die; 47 | ptype_t type; 48 | void (*deathfunc)( struct particle_s *particle ); 49 | 50 | // for pt_clientcusttom, we'll call this function each frame 51 | void (*callback)( struct particle_s *particle, float frametime ); 52 | 53 | // For deathfunc, etc. 54 | unsigned char context; 55 | } particle_t; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/pmtrace.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( PMTRACEH ) 16 | #define PMTRACEH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | typedef struct 22 | { 23 | vec3_t normal; 24 | float dist; 25 | } pmplane_t; 26 | 27 | typedef struct pmtrace_s pmtrace_t; 28 | 29 | struct pmtrace_s 30 | { 31 | qboolean allsolid; // if true, plane is not valid 32 | qboolean startsolid; // if true, the initial point was in a solid area 33 | qboolean inopen, inwater; // End point is in empty space or in water 34 | float fraction; // time completed, 1.0 = didn't hit anything 35 | vec3_t endpos; // final position 36 | pmplane_t plane; // surface normal at impact 37 | int ent; // entity at impact 38 | vec3_t deltavelocity; // Change in player's velocity caused by impact. 39 | // Only run on server. 40 | int hitgroup; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/port.h: -------------------------------------------------------------------------------- 1 | // port.h: portability helper 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | 7 | #include "archtypes.h" // DAL 8 | 9 | #ifdef _WIN32 10 | 11 | // Insert your headers here 12 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 13 | #define WIN32_EXTRA_LEAN 14 | 15 | #include "winsani_in.h" 16 | #include 17 | #include "winsani_out.h" 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #else // _WIN32 24 | 25 | #include 26 | #include 27 | #include // exit() 28 | #include // strncpy() 29 | #include // tolower() 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | typedef unsigned char BYTE; 36 | 37 | typedef int32 LONG; 38 | //typedef uint32 ULONG; 39 | 40 | #ifndef ARCHTYPES_H 41 | typedef uint32 ULONG; 42 | #endif 43 | 44 | typedef void *HANDLE; 45 | 46 | #ifndef HMODULE 47 | typedef void *HMODULE; 48 | #endif 49 | 50 | typedef char * LPSTR; 51 | 52 | #define __cdecl 53 | 54 | 55 | #ifdef __linux__ 56 | typedef struct POINT_s 57 | { 58 | int x; 59 | int y; 60 | } POINT; 61 | typedef void *HINSTANCE; 62 | typedef void *HWND; 63 | typedef void *HDC; 64 | typedef void *HGLRC; 65 | 66 | typedef struct RECT_s 67 | { 68 | int left; 69 | int right; 70 | int top; 71 | int bottom; 72 | } RECT; 73 | #endif 74 | 75 | 76 | #ifdef __cplusplus 77 | 78 | //#undef FALSE 79 | //#undef TRUE 80 | 81 | #ifdef OSX 82 | //#else 83 | //const bool FALSE = false; 84 | //const bool TRUE = true; 85 | #endif 86 | #endif 87 | 88 | #ifndef NULL 89 | #ifdef __cplusplus 90 | #define NULL 0 91 | #else 92 | #define NULL ((void *)0) 93 | #endif 94 | #endif 95 | 96 | #ifdef __cplusplus 97 | inline int ioctlsocket( int d, int cmd, uint32 *argp ) { return ioctl( d, cmd, argp ); } 98 | inline int closesocket( int fd ) { return close( fd ); } 99 | inline char * GetCurrentDirectory( size_t size, char * buf ) { return getcwd( buf, size ); } 100 | inline int WSAGetLastError() { return errno; } 101 | 102 | inline void DebugBreak( void ) { exit( 1 ); } 103 | #endif 104 | 105 | extern char g_szEXEName[ 4096 ]; 106 | 107 | #define _snprintf snprintf 108 | 109 | #if defined(OSX) 110 | #define SO_ARCH_SUFFIX ".dylib" 111 | #else 112 | #if defined ( __x86_64__ ) 113 | #define SO_ARCH_SUFFIX "_amd64.so" 114 | #else 115 | #define SO_ARCH_SUFFIX ".so" 116 | #endif 117 | #endif 118 | #endif 119 | 120 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/qfont.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #if !defined( QFONTH ) 16 | #define QFONTH 17 | #ifdef _WIN32 18 | #pragma once 19 | #endif 20 | 21 | // Font stuff 22 | 23 | #define NUM_GLYPHS 256 24 | // does not exist: // #include "basetypes.h" 25 | 26 | typedef struct 27 | { 28 | short startoffset; 29 | short charwidth; 30 | } charinfo; 31 | 32 | typedef struct qfont_s 33 | { 34 | int width, height; 35 | int rowcount; 36 | int rowheight; 37 | charinfo fontinfo[ NUM_GLYPHS ]; 38 | unsigned char data[4]; 39 | } qfont_t; 40 | 41 | #endif // qfont.h 42 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/qlimits.h: -------------------------------------------------------------------------------- 1 | //========= Copyright (c) 1996-2002, Valve LLC, All rights reserved. ========== 2 | // 3 | // Purpose: 4 | // 5 | // $NoKeywords: $ 6 | //============================================================================= 7 | 8 | #ifndef QLIMITS_H 9 | #define QLIMITS_H 10 | 11 | #if defined( _WIN32 ) 12 | #pragma once 13 | #endif 14 | 15 | // DATA STRUCTURE INFO 16 | 17 | #define MAX_NUM_ARGVS 50 18 | 19 | // SYSTEM INFO 20 | #define MAX_QPATH 64 // max length of a game pathname 21 | #define MAX_OSPATH 260 // max length of a filesystem pathname 22 | 23 | #define ON_EPSILON 0.1 // point on plane side epsilon 24 | 25 | #define MAX_LIGHTSTYLE_INDEX_BITS 6 26 | #define MAX_LIGHTSTYLES (1< ../common/vmodes.h:40 */ 32 | typedef struct rect_s 33 | { 34 | int left, right, top, bottom; 35 | } wrect_t; 36 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/weaponinfo.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | 16 | #ifndef WEAPONINFO_H 17 | #define WEAPONINFO_H 18 | #ifdef _WIN32 19 | #pragma once 20 | #endif 21 | 22 | // Info about weapons player might have in his/her possession 23 | typedef struct weapon_data_s 24 | { 25 | int m_iId; 26 | int m_iClip; 27 | 28 | float m_flNextPrimaryAttack; 29 | float m_flNextSecondaryAttack; 30 | float m_flTimeWeaponIdle; 31 | 32 | int m_fInReload; 33 | int m_fInSpecialReload; 34 | float m_flNextReload; 35 | float m_flPumpTime; 36 | float m_fReloadTime; 37 | 38 | float m_fAimedDamage; 39 | float m_fNextAimBonus; 40 | int m_fInZoom; 41 | int m_iWeaponState; 42 | 43 | int iuser1; 44 | int iuser2; 45 | int iuser3; 46 | int iuser4; 47 | float fuser1; 48 | float fuser2; 49 | float fuser3; 50 | float fuser4; 51 | } weapon_data_t; 52 | 53 | #endif // WEAPONINFO_H 54 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/winsani_in.h: -------------------------------------------------------------------------------- 1 | #if _MSC_VER >= 1500 // MSVC++ 9.0 (Visual Studio 2008) 2 | #pragma push_macro("ARRAYSIZE") 3 | #ifdef ARRAYSIZE 4 | #undef ARRAYSIZE 5 | #endif 6 | #define HSPRITE WINDOWS_HSPRITE 7 | #endif 8 | -------------------------------------------------------------------------------- /reapi/include/cssdk/common/winsani_out.h: -------------------------------------------------------------------------------- 1 | #if _MSC_VER >= 1500 // MSVC++ 9.0 (Visual Studio 2008) 2 | #undef HSPRITE 3 | #pragma pop_macro("ARRAYSIZE") 4 | #endif 5 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/API/CSPlayerItem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | class CBasePlayerItem; 32 | class CCSPlayerItem: public CCSAnimating 33 | { 34 | DECLARE_CLASS_TYPES(CCSPlayerItem, CCSAnimating); 35 | public: 36 | CCSPlayerItem() 37 | { 38 | Q_memset(&m_ItemInfo, 0, sizeof(m_ItemInfo)); 39 | } 40 | 41 | virtual void SetItemInfo(ItemInfo *pInfo) = 0; 42 | virtual int GetItemInfo(ItemInfo *pInfo) = 0; 43 | 44 | CBasePlayerItem *BasePlayerItem() const; 45 | 46 | public: 47 | ItemInfo m_ItemInfo; 48 | }; 49 | 50 | // Inlines 51 | inline CBasePlayerItem *CCSPlayerItem::BasePlayerItem() const 52 | { 53 | return reinterpret_cast(this->m_pContainingEntity); 54 | } 55 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/airtank.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class CAirtank: public CGrenade 31 | { 32 | DECLARE_CLASS_TYPES(CAirtank, CGrenade); 33 | public: 34 | virtual void Spawn() = 0; 35 | virtual void Precache() = 0; 36 | virtual int Save(CSave &save) = 0; 37 | virtual int Restore(CRestore &restore) = 0; 38 | virtual void Killed(entvars_t *pevAttacker, int iGib) = 0; 39 | virtual int BloodColor() = 0; 40 | 41 | int GetState() const { return m_state; } 42 | private: 43 | int m_state; 44 | }; 45 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/csbot_dll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "../game_shared/GameEvent.h" 32 | #include "../game_shared/bot/bot_util.h" 33 | #include "../game_shared/bot/simple_state_machine.h" 34 | #include "../game_shared/steam_util.h" 35 | #include "../game_shared/counter.h" 36 | #include "../game_shared/bot/bot_manager.h" 37 | #include "../game_shared/bot/bot_constants.h" 38 | #include "../game_shared/bot/bot.h" 39 | #include "../game_shared/shared_util.h" 40 | #include "../game_shared/bot/bot_profile.h" 41 | 42 | #include "../game_shared/bot/improv.h" 43 | #include "../game_shared/bot/nav.h" 44 | #include "../game_shared/bot/nav_node.h" 45 | #include "../game_shared/bot/nav_area.h" 46 | #include "../game_shared/bot/nav_path.h" 47 | 48 | #include "../dlls/hostage/hostage.h" 49 | #include "../dlls/hostage/hostage_localnav.h" 50 | 51 | #include "../dlls/bot/cs_bot.h" 52 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/decals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | enum decal_e 31 | { 32 | DECAL_GUNSHOT1 = 0, 33 | DECAL_GUNSHOT2, 34 | DECAL_GUNSHOT3, 35 | DECAL_GUNSHOT4, 36 | DECAL_GUNSHOT5, 37 | DECAL_LAMBDA1, 38 | DECAL_LAMBDA2, 39 | DECAL_LAMBDA3, 40 | DECAL_LAMBDA4, 41 | DECAL_LAMBDA5, 42 | DECAL_LAMBDA6, 43 | DECAL_SCORCH1, 44 | DECAL_SCORCH2, 45 | DECAL_BLOOD1, 46 | DECAL_BLOOD2, 47 | DECAL_BLOOD3, 48 | DECAL_BLOOD4, 49 | DECAL_BLOOD5, 50 | DECAL_BLOOD6, 51 | DECAL_YBLOOD1, 52 | DECAL_YBLOOD2, 53 | DECAL_YBLOOD3, 54 | DECAL_YBLOOD4, 55 | DECAL_YBLOOD5, 56 | DECAL_YBLOOD6, 57 | DECAL_GLASSBREAK1, 58 | DECAL_GLASSBREAK2, 59 | DECAL_GLASSBREAK3, 60 | DECAL_BIGSHOT1, 61 | DECAL_BIGSHOT2, 62 | DECAL_BIGSHOT3, 63 | DECAL_BIGSHOT4, 64 | DECAL_BIGSHOT5, 65 | DECAL_SPIT1, 66 | DECAL_SPIT2, 67 | DECAL_BPROOF1, // Bulletproof glass decal 68 | DECAL_GARGSTOMP1, // Gargantua stomp crack 69 | DECAL_SMALLSCORCH1, // Small scorch mark 70 | DECAL_SMALLSCORCH2, // Small scorch mark 71 | DECAL_SMALLSCORCH3, // Small scorch mark 72 | DECAL_MOMMABIRTH, // Big momma birth splatter 73 | DECAL_MOMMASPLAT, 74 | }; 75 | 76 | typedef struct 77 | { 78 | char *name; 79 | int index; 80 | 81 | } DLL_DECALLIST; 82 | 83 | extern DLL_DECALLIST gDecals[42]; 84 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/explode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define SF_ENVEXPLOSION_NODAMAGE (1<<0) // when set, ENV_EXPLOSION will not actually inflict damage 31 | #define SF_ENVEXPLOSION_REPEATABLE (1<<1) // can this entity be refired? 32 | #define SF_ENVEXPLOSION_NOFIREBALL (1<<2) // don't draw the fireball 33 | #define SF_ENVEXPLOSION_NOSMOKE (1<<3) // don't draw the smoke 34 | #define SF_ENVEXPLOSION_NODECAL (1<<4) // don't make a scorch mark 35 | #define SF_ENVEXPLOSION_NOSPARKS (1<<5) // don't make a scorch mark 36 | 37 | class CShower: public CBaseEntity 38 | { 39 | DECLARE_CLASS_TYPES(CShower, CBaseEntity); 40 | public: 41 | virtual void Spawn() = 0; 42 | virtual int ObjectCaps() = 0; 43 | virtual void Think() = 0; 44 | virtual void Touch(CBaseEntity *pOther) = 0; 45 | }; 46 | 47 | class CEnvExplosion: public CBaseMonster 48 | { 49 | DECLARE_CLASS_TYPES(CEnvExplosion, CBaseMonster); 50 | public: 51 | virtual void Spawn() = 0; 52 | virtual void KeyValue(KeyValueData *pkvd) = 0; 53 | virtual int Save(CSave &save) = 0; 54 | virtual int Restore(CRestore &restore) = 0; 55 | virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; 56 | public: 57 | int m_iMagnitude; 58 | int m_spriteScale; 59 | }; 60 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/gib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | class CGib: public CBaseEntity 32 | { 33 | DECLARE_CLASS_TYPES(CGib, CBaseEntity); 34 | public: 35 | virtual int ObjectCaps() = 0; 36 | 37 | public: 38 | int m_bloodColor; 39 | int m_cBloodDecals; 40 | int m_material; 41 | float m_lifeTime; 42 | }; 43 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/h_battery.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class CRecharge: public CBaseToggle 31 | { 32 | DECLARE_CLASS_TYPES(CRecharge, CBaseToggle); 33 | public: 34 | virtual void Spawn() = 0; 35 | virtual void Precache() = 0; 36 | virtual void KeyValue(KeyValueData *pkvd) = 0; 37 | virtual int Save(CSave &save) = 0; 38 | virtual int Restore(CRestore &restore) = 0; 39 | virtual int ObjectCaps() = 0; 40 | virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; 41 | public: 42 | float m_flNextCharge; 43 | int m_iReactivate; 44 | int m_iJuice; 45 | int m_iOn; 46 | float m_flSoundTime; 47 | }; 48 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/healthkit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class CHealthKit: public CItem 31 | { 32 | DECLARE_CLASS_TYPES(CHealthKit, CItem); 33 | public: 34 | virtual void Spawn() = 0; 35 | virtual void Precache() = 0; 36 | virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; 37 | }; 38 | 39 | class CWallHealth: public CBaseToggle 40 | { 41 | DECLARE_CLASS_TYPES(CWallHealth, CBaseToggle); 42 | public: 43 | virtual void Spawn() = 0; 44 | virtual void Precache() = 0; 45 | virtual void KeyValue(KeyValueData *pkvd) = 0; 46 | virtual int Save(CSave &save) = 0; 47 | virtual int Restore(CRestore &restore) = 0; 48 | virtual int ObjectCaps() = 0; 49 | virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; 50 | public: 51 | float m_flNextCharge; 52 | int m_iReactivate; 53 | int m_iJuice; 54 | int m_iOn; 55 | float m_flSoundTime; 56 | }; 57 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/hostage/hostage_localnav.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define NODE_INVALID_EMPTY -1 31 | 32 | #define PATH_TRAVERSABLE_EMPTY 0 33 | #define PATH_TRAVERSABLE_SLOPE 1 34 | #define PATH_TRAVERSABLE_STEP 2 35 | #define PATH_TRAVERSABLE_STEPJUMPABLE 3 36 | 37 | typedef int node_index_t; 38 | 39 | typedef struct localnode_s 40 | { 41 | Vector vecLoc; 42 | int offsetX; 43 | int offsetY; 44 | byte bDepth; 45 | BOOL fSearched; 46 | node_index_t nindexParent; 47 | 48 | } localnode_t; 49 | 50 | class CLocalNav { 51 | private: 52 | CHostage *m_pOwner; 53 | edict_t *m_pTargetEnt; 54 | BOOL m_fTargetEntHit; 55 | localnode_t *m_nodeArr; 56 | node_index_t m_nindexAvailableNode; 57 | Vector m_vecStartingLoc; 58 | }; 59 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/lights.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define SF_LIGHT_START_OFF 1 31 | 32 | class CLight: public CPointEntity 33 | { 34 | DECLARE_CLASS_TYPES(CLight, CPointEntity); 35 | public: 36 | virtual void Spawn() = 0; 37 | virtual void Restart() = 0; 38 | virtual void KeyValue(KeyValueData *pkvd) = 0; 39 | virtual int Save(CSave &save) = 0; 40 | virtual int Restore(CRestore &restore) = 0; 41 | virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; 42 | private: 43 | int m_iStyle; 44 | int m_iszPattern; 45 | BOOL m_iStartedOff; 46 | }; 47 | 48 | class CEnvLight: public CLight 49 | { 50 | DECLARE_CLASS_TYPES(CEnvLight, CLight); 51 | public: 52 | virtual void Spawn() = 0; 53 | virtual void KeyValue(KeyValueData *pkvd) = 0; 54 | }; 55 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/mapinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | class CMapInfo: public CPointEntity 32 | { 33 | DECLARE_CLASS_TYPES(CMapInfo, CPointEntity); 34 | public: 35 | virtual void Spawn() = 0; 36 | virtual void KeyValue(KeyValueData *pkvd) = 0; 37 | virtual void UpdateOnRemove() = 0; 38 | 39 | public: 40 | InfoMapBuyParam m_iBuyingStatus; 41 | float m_flBombRadius; 42 | }; 43 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/monsterevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | typedef struct MonsterEvent_s 31 | { 32 | int event; 33 | char *options; 34 | 35 | } MonsterEvent_t; 36 | 37 | #define EVENT_SPECIFIC 0 38 | #define EVENT_SCRIPTED 1000 39 | #define EVENT_SHARED 2000 40 | #define EVENT_CLIENT 5000 41 | 42 | #define MONSTER_EVENT_BODYDROP_LIGHT 2001 43 | #define MONSTER_EVENT_BODYDROP_HEAVY 2002 44 | #define MONSTER_EVENT_SWISHSOUND 2010 45 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/mortar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class CFuncMortarField: public CBaseToggle 31 | { 32 | DECLARE_CLASS_TYPES(CFuncMortarField, CBaseToggle); 33 | public: 34 | virtual void Spawn() = 0; 35 | virtual void Precache() = 0; 36 | virtual void KeyValue(KeyValueData *pkvd) = 0; 37 | virtual int Save(CSave &save) = 0; 38 | virtual int Restore(CRestore &restore) = 0; 39 | 40 | // Bmodels don't go across transitions 41 | virtual int ObjectCaps() = 0; 42 | public: 43 | int m_iszXController; 44 | int m_iszYController; 45 | float m_flSpread; 46 | float m_flDelay; 47 | int m_iCount; 48 | int m_fControl; 49 | }; 50 | 51 | class CMortar: public CGrenade 52 | { 53 | DECLARE_CLASS_TYPES(CMortar, CGrenade); 54 | public: 55 | virtual void Spawn() = 0; 56 | virtual void Precache() = 0; 57 | public: 58 | int m_spriteTexture; 59 | }; 60 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/observer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define CAMERA_MODE_SPEC_ANYONE 0 31 | #define CAMERA_MODE_SPEC_ONLY_TEAM 1 32 | #define CAMERA_MODE_SPEC_ONLY_FRIST_PERSON 2 33 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/pathcorner.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class CPathCorner: public CPointEntity 31 | { 32 | DECLARE_CLASS_TYPES(CPathCorner, CPointEntity); 33 | public: 34 | virtual void Spawn() = 0; 35 | virtual void KeyValue(KeyValueData *pkvd) = 0; 36 | virtual int Save(CSave &save) = 0; 37 | virtual int Restore(CRestore &restore) = 0; 38 | virtual float GetDelay() = 0; 39 | private: 40 | float m_flWait; 41 | }; 42 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/revert_saved.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class CRevertSaved: public CPointEntity { 31 | public: 32 | virtual void KeyValue(KeyValueData *pkvd) = 0; 33 | virtual int Save(CSave &save) = 0; 34 | virtual int Restore(CRestore &restore) = 0; 35 | virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; 36 | public: 37 | float Duration() const { return pev->dmg_take; } 38 | float HoldTime() const { return pev->dmg_save; } 39 | float MessageTime() const { return m_messageTime; } 40 | float LoadTime() const { return m_loadTime; } 41 | 42 | void SetDuration(float duration) { pev->dmg_take = duration; } 43 | void SetHoldTime(float hold) { pev->dmg_save = hold; } 44 | void SetMessageTime(float time) { m_messageTime = time; } 45 | void SetLoadTime(float time) { m_loadTime = time; } 46 | public: 47 | float m_messageTime; 48 | float m_loadTime; 49 | }; 50 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/skill.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define SKILL_EASY 1 31 | #define SKILL_MEDIUM 2 32 | #define SKILL_HARD 3 33 | 34 | struct skilldata_t 35 | { 36 | int iSkillLevel; 37 | float plrDmg9MM; 38 | float plrDmg357; 39 | float plrDmgMP5; 40 | float plrDmgM203Grenade; 41 | float plrDmgBuckshot; 42 | float plrDmgCrossbowClient; 43 | float plrDmgRPG; 44 | float monDmg9MM; 45 | float monDmgMP5; 46 | float monDmg12MM; 47 | float suitchargerCapacity; 48 | float batteryCapacity; 49 | float healthchargerCapacity; 50 | float healthkitCapacity; 51 | }; 52 | 53 | extern skilldata_t gSkillData; 54 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/spectator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class CBaseSpectator: public CBaseEntity { 31 | public: 32 | virtual void Spawn(); 33 | }; 34 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/subs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | class CNullEntity: public CBaseEntity 32 | { 33 | DECLARE_CLASS_TYPES(CNullEntity, CBaseEntity); 34 | public: 35 | virtual void Spawn() = 0; 36 | }; 37 | 38 | class CBaseDMStart: public CPointEntity 39 | { 40 | DECLARE_CLASS_TYPES(CBaseDMStart, CPointEntity); 41 | public: 42 | virtual void KeyValue(KeyValueData *pkvd) = 0; 43 | virtual BOOL IsTriggered(CBaseEntity *pEntity) = 0; 44 | }; 45 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/unisignals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #ifndef UNISIGNALS_H 30 | #define UNISIGNALS_H 31 | #ifdef _WIN32 32 | #pragma once 33 | #endif 34 | 35 | class CUnifiedSignals 36 | { 37 | public: 38 | CUnifiedSignals() 39 | { 40 | m_flSignal = 0; 41 | m_flState = 0; 42 | } 43 | public: 44 | void Update() 45 | { 46 | m_flState = m_flSignal; 47 | m_flSignal = 0; 48 | } 49 | void Signal(int flags) { m_flSignal |= flags; } 50 | int GetSignal() const { return m_flSignal; } 51 | int GetState() const { return m_flState; } 52 | public: 53 | int m_flSignal; 54 | int m_flState; 55 | }; 56 | 57 | #endif // UNISIGNALS_H 58 | -------------------------------------------------------------------------------- /reapi/include/cssdk/dlls/vehicle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define VEHICLE_SPEED0_ACCELERATION 0.005000000000000000 31 | #define VEHICLE_SPEED1_ACCELERATION 0.002142857142857143 32 | #define VEHICLE_SPEED2_ACCELERATION 0.003333333333333334 33 | #define VEHICLE_SPEED3_ACCELERATION 0.004166666666666667 34 | #define VEHICLE_SPEED4_ACCELERATION 0.004000000000000000 35 | #define VEHICLE_SPEED5_ACCELERATION 0.003800000000000000 36 | #define VEHICLE_SPEED6_ACCELERATION 0.004500000000000000 37 | #define VEHICLE_SPEED7_ACCELERATION 0.004250000000000000 38 | #define VEHICLE_SPEED8_ACCELERATION 0.002666666666666667 39 | #define VEHICLE_SPEED9_ACCELERATION 0.002285714285714286 40 | #define VEHICLE_SPEED10_ACCELERATION 0.001875000000000000 41 | #define VEHICLE_SPEED11_ACCELERATION 0.001444444444444444 42 | #define VEHICLE_SPEED12_ACCELERATION 0.001200000000000000 43 | #define VEHICLE_SPEED13_ACCELERATION 0.000916666666666666 44 | 45 | #define VEHICLE_STARTPITCH 60 46 | #define VEHICLE_MAXPITCH 200 47 | #define VEHICLE_MAXSPEED 1500 48 | 49 | class CFuncVehicleControls: public CBaseEntity 50 | { 51 | DECLARE_CLASS_TYPES(CFuncVehicleControls, CBaseEntity); 52 | public: 53 | virtual void Spawn() = 0; 54 | virtual int ObjectCaps() = 0; 55 | }; 56 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/FlightRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #include "archtypes.h" 31 | 32 | class IRehldsFlightRecorder 33 | { 34 | public: 35 | virtual ~IRehldsFlightRecorder() { } 36 | 37 | virtual uint16 RegisterMessage(const char* module, const char *message, unsigned int version, bool inOut) = 0; 38 | 39 | virtual void StartMessage(uint16 msg, bool entrance) = 0; 40 | virtual void EndMessage(uint16 msg, bool entrance) = 0; 41 | 42 | virtual void WriteInt8(int8 v) = 0; 43 | virtual void WriteUInt8(uint8 v) = 0; 44 | 45 | virtual void WriteInt16(int16 v) = 0; 46 | virtual void WriteUInt16(uint16 v) = 0; 47 | 48 | virtual void WriteInt32(int32 v) = 0; 49 | virtual void WriteUInt32(uint32 v) = 0; 50 | 51 | virtual void WriteInt64(int64 v) = 0; 52 | virtual void WriteUInt64(uint64 v) = 0; 53 | 54 | virtual void WriteFloat(float v) = 0; 55 | virtual void WriteDouble(double v) = 0; 56 | 57 | virtual void WriteString(const char* s) = 0; 58 | 59 | virtual void WriteBuffer(const void* data ,unsigned int len) = 0; 60 | 61 | }; 62 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/archtypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */#ifndef ARCHTYPES_H 28 | #define ARCHTYPES_H 29 | 30 | #ifdef __x86_64__ 31 | #define X64BITS 32 | #endif 33 | 34 | #if defined( _WIN32 ) && (! defined( __MINGW32__ )) 35 | 36 | typedef __int8 int8; 37 | typedef unsigned __int8 uint8; 38 | typedef __int16 int16; 39 | typedef unsigned __int16 uint16; 40 | typedef __int32 int32; 41 | typedef unsigned __int32 uint32; 42 | typedef __int64 int64; 43 | typedef unsigned __int64 uint64; 44 | typedef __int32 intp; // intp is an integer that can accomodate a pointer 45 | typedef unsigned __int32 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *) 46 | 47 | #else /* _WIN32 */ 48 | typedef char int8; 49 | typedef unsigned char uint8; 50 | typedef short int16; 51 | typedef unsigned short uint16; 52 | typedef int int32; 53 | typedef unsigned int uint32; 54 | typedef long long int64; 55 | typedef unsigned long long uint64; 56 | #ifdef X64BITS 57 | typedef long long intp; 58 | typedef unsigned long long uintp; 59 | #else 60 | typedef int intp; 61 | typedef unsigned int uintp; 62 | #endif 63 | 64 | #endif /* else _WIN32 */ 65 | 66 | #endif /* ARCHTYPES_H */ 67 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/cmd_rehlds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #include "archtypes.h" 31 | 32 | typedef void(*xcommand_t)(void); 33 | typedef struct cmd_function_s 34 | { 35 | struct cmd_function_s *next; 36 | char *name; 37 | xcommand_t function; 38 | int flags; 39 | } cmd_function_t; 40 | 41 | typedef enum cmd_source_s 42 | { 43 | src_client = 0, // came in over a net connection as a clc_stringcmd. host_client will be valid during this state. 44 | src_command = 1, // from the command buffer. 45 | } cmd_source_t; 46 | 47 | #define FCMD_HUD_COMMAND BIT(0) 48 | #define FCMD_GAME_COMMAND BIT(1) 49 | #define FCMD_WRAPPER_COMMAND BIT(2) 50 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/common_rehlds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #include "const.h" 31 | #include "qlimits.h" 32 | 33 | #ifdef REHLDS_FIXES 34 | #define COM_TOKEN_LEN 2048 35 | #else 36 | #define COM_TOKEN_LEN 1024 37 | #endif 38 | 39 | // Don't allow overflow 40 | #define SIZEBUF_CHECK_OVERFLOW 0 41 | #define SIZEBUF_ALLOW_OVERFLOW BIT(0) 42 | #define SIZEBUF_OVERFLOWED BIT(1) 43 | 44 | #define MAX_NUM_ARGVS 50 45 | #define NUM_SAFE_ARGVS 7 46 | 47 | #define COM_COPY_CHUNK_SIZE 1024 48 | #define COM_MAX_CMD_LINE 256 49 | 50 | typedef struct sizebuf_s 51 | { 52 | const char *buffername; 53 | uint16 flags; 54 | byte *data; 55 | int maxsize; 56 | int cursize; 57 | } sizebuf_t; 58 | 59 | typedef struct downloadtime_s 60 | { 61 | qboolean bUsed; 62 | float fTime; 63 | int nBytesRemaining; 64 | } downloadtime_t; 65 | 66 | typedef struct incomingtransfer_s 67 | { 68 | qboolean doneregistering; 69 | int percent; 70 | qboolean downloadrequested; 71 | downloadtime_t rgStats[8]; 72 | int nCurStat; 73 | int nTotalSize; 74 | int nTotalToTransfer; 75 | int nRemainingToTransfer; 76 | float fLastStatusUpdate; 77 | qboolean custom; 78 | } incomingtransfer_t; 79 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/crc32c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 by Ronnie Sahlberg 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU Lesser General Public License as published by 5 | the Free Software Foundation; either version 2.1 of the License, or 6 | (at your option) any later version. 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public License 12 | along with this program; if not, see . 13 | */ 14 | #pragma once 15 | #include "archtypes.h" 16 | 17 | extern uint32 crc32c_t8_nosse(uint32 iCRC, uint8 u8); 18 | extern uint32 crc32c_t8_sse(uint32 iCRC, uint8 u8); 19 | extern uint32 crc32c_t_nosse(uint32 iCRC, const uint8 *buf, int len); 20 | extern uint32 crc32c_t_sse(uint32 iCRC, const uint8 *buf, unsigned int len); 21 | extern uint32 crc32c_t(uint32 iCRC, const uint8 *buf, unsigned int len); 22 | extern uint32 crc32c(const uint8 *buf, int len); 23 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/customentity.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef CUSTOMENTITY_H 16 | #define CUSTOMENTITY_H 17 | 18 | // Custom Entities 19 | 20 | // Start/End Entity is encoded as 12 bits of entity index, and 4 bits of attachment (4:12) 21 | #define BEAMENT_ENTITY(x) ((x)&0xFFF) 22 | #define BEAMENT_ATTACHMENT(x) (((x)>>12)&0xF) 23 | 24 | // Beam types, encoded as a byte 25 | enum 26 | { 27 | BEAM_POINTS = 0, 28 | BEAM_ENTPOINT, 29 | BEAM_ENTS, 30 | BEAM_HOSE, 31 | }; 32 | 33 | #define BEAM_FSINE 0x10 34 | #define BEAM_FSOLID 0x20 35 | #define BEAM_FSHADEIN 0x40 36 | #define BEAM_FSHADEOUT 0x80 37 | 38 | #endif //CUSTOMENTITY_H 39 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/d_local.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | typedef struct surfcache_s 32 | { 33 | struct surfcache_s *next; 34 | struct surfcache_s **owner; 35 | int lightadj[4]; 36 | int dlight; 37 | int size; 38 | unsigned width; 39 | unsigned height; 40 | float mipscale; 41 | struct texture_s *texture; 42 | unsigned char data[4]; 43 | } surfcache_t; 44 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/edict.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/engine/edict.h -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/keydefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/include/cssdk/engine/keydefs.h -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/pr_dlls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #pragma once 30 | 31 | #include "maintypes.h" 32 | #include "eiface.h" 33 | 34 | const int MAX_EXTENSION_DLL = 50; 35 | 36 | typedef struct functiontable_s 37 | { 38 | uint32 pFunction; 39 | char *pFunctionName; 40 | } functiontable_t; 41 | 42 | typedef struct extensiondll_s 43 | { 44 | void *lDLLHandle; 45 | functiontable_t *functionTable; 46 | int functionCount; 47 | } extensiondll_t; 48 | 49 | typedef void(*ENTITYINIT)(struct entvars_s *); 50 | typedef void(*DISPATCHFUNCTION)(struct entvars_s *, void *); 51 | typedef void(*FIELDIOFUNCTION)(SAVERESTOREDATA *, const char *, void *, TYPEDESCRIPTION *, int); 52 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/progs.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef PROGS_H 16 | #define PROGS_H 17 | 18 | #include "progdefs.h" 19 | 20 | // 16 simultaneous events, max 21 | #define MAX_EVENT_QUEUE 64 22 | 23 | #define DEFAULT_EVENT_RESENDS 1 24 | 25 | #include "event_flags.h" 26 | 27 | typedef struct event_info_s event_info_t; 28 | 29 | #include "event_args.h" 30 | 31 | struct event_info_s 32 | { 33 | unsigned short index; // 0 implies not in use 34 | 35 | short packet_index; // Use data from state info for entity in delta_packet . -1 implies separate info based on event 36 | // parameter signature 37 | short entity_index; // The edict this event is associated with 38 | 39 | float fire_time; // if non-zero, the time when the event should be fired ( fixed up on the client ) 40 | 41 | event_args_t args; 42 | 43 | // CLIENT ONLY 44 | int flags; // Reliable or not, etc. 45 | 46 | }; 47 | 48 | typedef struct event_state_s event_state_t; 49 | 50 | struct event_state_s 51 | { 52 | struct event_info_s ei[ MAX_EVENT_QUEUE ]; 53 | }; 54 | 55 | #if !defined( ENTITY_STATEH ) 56 | #include "entity_state.h" 57 | #endif 58 | 59 | #if !defined( EDICT_H ) 60 | #include "edict.h" 61 | #endif 62 | 63 | #define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (int)&(((t *)0)->m))) 64 | #define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area) 65 | 66 | //============================================================================ 67 | 68 | extern char *pr_strings; 69 | extern globalvars_t gGlobalVariables; 70 | 71 | //============================================================================ 72 | 73 | edict_t *ED_Alloc (void); 74 | void ED_Free (edict_t *ed); 75 | void ED_LoadFromFile (char *data); 76 | 77 | edict_t *EDICT_NUM(int n); 78 | int NUM_FOR_EDICT(const edict_t *e); 79 | 80 | #define PROG_TO_EDICT(e) ((edict_t *)((byte *)sv.edicts + e)) 81 | 82 | #endif // PROGS_H 83 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/shake.h: -------------------------------------------------------------------------------- 1 | /*** 2 | * 3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved. 4 | * 5 | * This product contains software technology licensed from Id 6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. 7 | * All Rights Reserved. 8 | * 9 | * Use, distribution, and modification of this source code and/or resulting 10 | * object code is restricted to non-commercial enhancements to products from 11 | * Valve LLC. All other use, distribution, or modification is prohibited 12 | * without written permission from Valve LLC. 13 | * 14 | ****/ 15 | #ifndef SHAKE_H 16 | #define SHAKE_H 17 | 18 | // Screen / View effects 19 | 20 | // screen shake 21 | extern int gmsgShake; 22 | 23 | // This structure is sent over the net to describe a screen shake event 24 | typedef struct 25 | { 26 | unsigned short amplitude; // FIXED 4.12 amount of shake 27 | unsigned short duration; // FIXED 4.12 seconds duration 28 | unsigned short frequency; // FIXED 8.8 noise frequency (low frequency is a jerk,high frequency is a rumble) 29 | } ScreenShake; 30 | 31 | extern void V_ApplyShake( float *origin, float *angles, float factor ); 32 | extern void V_CalcShake( void ); 33 | extern int V_ScreenShake( const char *pszName, int iSize, void *pbuf ); 34 | extern int V_ScreenFade( const char *pszName, int iSize, void *pbuf ); 35 | 36 | 37 | // Fade in/out 38 | extern int gmsgFade; 39 | 40 | #define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function 41 | #define FFADE_OUT 0x0001 // Fade out (not in) 42 | #define FFADE_MODULATE 0x0002 // Modulate (don't blend) 43 | #define FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received 44 | #define FFADE_LONGFADE 0x0008 // used to indicate the fade can be longer than 16 seconds (added for czero) 45 | 46 | 47 | // This structure is sent over the net to describe a screen fade event 48 | typedef struct 49 | { 50 | unsigned short duration; // FIXED 4.12 seconds duration 51 | unsigned short holdTime; // FIXED 4.12 seconds duration until reset (fade & hold) 52 | short fadeFlags; // flags 53 | byte r, g, b, a; // fade to color ( max alpha ) 54 | } ScreenFade; 55 | 56 | #endif // SHAKE_H 57 | 58 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/spritegn.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #ifndef SPRITEGN_H 30 | #define SPRITEGN_H 31 | #ifdef _WIN32 32 | #pragma once 33 | #endif 34 | 35 | #include "modelgen.h" 36 | #include "commonmacros.h" 37 | 38 | #define SPRITE_VERSION 2 // Half-Life sprites 39 | #define IDSPRITEHEADER MAKEID('I', 'D', 'S', 'P') // little-endian "IDSP" 40 | 41 | typedef enum spriteframetype_e 42 | { 43 | SPR_SINGLE = 0, 44 | SPR_GROUP, 45 | SPR_ANGLED 46 | } spriteframetype_t; 47 | 48 | typedef struct dsprite_s 49 | { 50 | int ident; 51 | int version; 52 | int type; 53 | int texFormat; 54 | float boundingradius; 55 | int width; 56 | int height; 57 | int numframes; 58 | float beamlength; 59 | synctype_t synctype; 60 | } dsprite_t; 61 | 62 | typedef struct dspriteframe_s 63 | { 64 | int origin[2]; 65 | int width; 66 | int height; 67 | } dspriteframe_t; 68 | 69 | typedef struct dspritegroup_s 70 | { 71 | int numframes; 72 | } dspritegroup_t; 73 | 74 | typedef struct dspriteinterval_s 75 | { 76 | float interval; 77 | } dspriteinterval_t; 78 | 79 | typedef struct dspriteframetype_s 80 | { 81 | spriteframetype_t type; 82 | } dspriteframetype_t; 83 | 84 | #endif // SPRITEGN_H 85 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/sys_shared.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #include "sys_shared.h" 29 | 30 | #if defined(__GNUC__) 31 | #include 32 | #endif 33 | 34 | #define SSE3_FLAG (1<<0) 35 | #define SSSE3_FLAG (1<<9) 36 | #define SSE4_1_FLAG (1<<19) 37 | #define SSE4_2_FLAG (1<<20) 38 | #define POPCNT_FLAG (1<<23) 39 | #define AVX_FLAG (1<<28) 40 | #define AVX2_FLAG (1<<5) 41 | 42 | cpuinfo_t cpuinfo; 43 | 44 | void Sys_CheckCpuInstructionsSupport(void) 45 | { 46 | unsigned int cpuid_data[4]; 47 | 48 | #if defined ASMLIB_H 49 | cpuid_ex((int *)cpuid_data, 1, 0); 50 | #elif defined(__GNUC__) 51 | __get_cpuid(0x1, &cpuid_data[0], &cpuid_data[1], &cpuid_data[2], &cpuid_data[3]); 52 | #else 53 | __cpuidex((int *)cpuid_data, 1, 0); 54 | #endif 55 | 56 | cpuinfo.sse3 = (cpuid_data[2] & SSE3_FLAG) ? 1 : 0; // ecx 57 | cpuinfo.ssse3 = (cpuid_data[2] & SSSE3_FLAG) ? 1 : 0; 58 | cpuinfo.sse4_1 = (cpuid_data[2] & SSE4_1_FLAG) ? 1 : 0; 59 | cpuinfo.sse4_2 = (cpuid_data[2] & SSE4_2_FLAG) ? 1 : 0; 60 | cpuinfo.popcnt = (cpuid_data[2] & POPCNT_FLAG) ? 1 : 0; 61 | cpuinfo.avx = (cpuid_data[2] & AVX_FLAG) ? 1 : 0; 62 | 63 | #if defined ASMLIB_H 64 | cpuid_ex((int *)cpuid_data, 7, 0); 65 | #elif defined(__GNUC__) 66 | __get_cpuid(0x7, &cpuid_data[0], &cpuid_data[1], &cpuid_data[2], &cpuid_data[3]); 67 | #else 68 | __cpuidex((int *)cpuid_data, 7, 0); 69 | #endif 70 | 71 | cpuinfo.avx2 = (cpuid_data[1] & AVX2_FLAG) ? 1 : 0; // ebx 72 | } -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/sys_shared.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #include 31 | 32 | typedef struct cpuinfo_s 33 | { 34 | uint8 sse3, ssse3, sse4_1, sse4_2, avx, avx2, popcnt; 35 | } cpuinfo_t; 36 | 37 | extern cpuinfo_t cpuinfo; 38 | 39 | void Sys_CheckCpuInstructionsSupport(void); 40 | -------------------------------------------------------------------------------- /reapi/include/cssdk/engine/userid_rehlds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #include "archtypes.h" 31 | 32 | // Authentication types 33 | enum AUTH_IDTYPE 34 | { 35 | AUTH_IDTYPE_UNKNOWN = 0, 36 | AUTH_IDTYPE_STEAM = 1, 37 | AUTH_IDTYPE_VALVE = 2, 38 | AUTH_IDTYPE_LOCAL = 3 39 | }; 40 | 41 | typedef struct USERID_s 42 | { 43 | int idtype; 44 | uint64 m_SteamID; 45 | unsigned int clientip; 46 | } USERID_t; 47 | -------------------------------------------------------------------------------- /reapi/include/cssdk/game_shared/bot/bot_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | // We'll define our own version of this, because everyone else does. 31 | // This needs to stay in sync with MAX_CLIENTS, but there's no header with the #define. 32 | #define BOT_MAX_CLIENTS 32 33 | 34 | // version number is MAJOR.MINOR 35 | #define BOT_VERSION_MAJOR 1 36 | #define BOT_VERSION_MINOR 50 37 | 38 | // Difficulty levels 39 | enum BotDifficultyType 40 | { 41 | BOT_EASY = 0, 42 | BOT_NORMAL, 43 | BOT_HARD, 44 | BOT_EXPERT, 45 | 46 | NUM_DIFFICULTY_LEVELS 47 | }; 48 | -------------------------------------------------------------------------------- /reapi/include/cssdk/game_shared/shared_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #ifndef _WIN32 31 | #include 32 | #include 33 | #endif 34 | 35 | // Simple utility function to allocate memory and duplicate a string 36 | inline char *CloneString(const char *str) 37 | { 38 | if (!str) 39 | { 40 | char *cloneStr = new char[1]; 41 | cloneStr[0] = '\0'; 42 | return cloneStr; 43 | } 44 | 45 | char *cloneStr = new char [strlen(str) + 1]; 46 | strcpy(cloneStr, str); 47 | return cloneStr; 48 | } 49 | 50 | // Simple utility function to allocate memory and duplicate a wide string 51 | inline wchar_t *CloneWString(const wchar_t *str) 52 | { 53 | if (!str) 54 | { 55 | wchar_t *cloneStr = new wchar_t[1]; 56 | cloneStr[0] = L'\0'; 57 | return cloneStr; 58 | } 59 | 60 | wchar_t *cloneStr = new wchar_t [wcslen(str) + 1]; 61 | wcscpy(cloneStr, str); 62 | return cloneStr; 63 | } 64 | -------------------------------------------------------------------------------- /reapi/include/cssdk/game_shared/simple_checksum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #ifndef SIMPLE_CHECKSUM_H 30 | #define SIMPLE_CHECKSUM_H 31 | #ifdef _WIN32 32 | #pragma once 33 | #endif 34 | 35 | // Compute a simple checksum for the given data. 36 | // Each byte in the data is multiplied by its position to track re-ordering changes 37 | inline unsigned int ComputeSimpleChecksum(const unsigned char *dataPointer, int dataLength) 38 | { 39 | unsigned int checksum = 0; 40 | for (int i = 1; i <= dataLength; i++) 41 | { 42 | checksum += (*dataPointer) * i; 43 | ++dataPointer; 44 | } 45 | 46 | return checksum; 47 | } 48 | 49 | #endif // SIMPLE_CHECKSUM_H 50 | -------------------------------------------------------------------------------- /reapi/include/cssdk/game_shared/steam_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | class SteamFile 31 | { 32 | public: 33 | SteamFile(const char *filename); 34 | ~SteamFile(); 35 | 36 | bool IsValid() const { return (m_fileData) ? true : false; } 37 | bool Read(void *data, int length); 38 | 39 | private: 40 | byte *m_fileData; 41 | int m_fileDataLength; 42 | 43 | byte *m_cursor; 44 | int m_bytesLeft; 45 | }; 46 | 47 | inline SteamFile::SteamFile(const char *filename) 48 | { 49 | m_fileData = (byte *)LOAD_FILE_FOR_ME(const_cast(filename), &m_fileDataLength); 50 | m_cursor = m_fileData; 51 | m_bytesLeft = m_fileDataLength; 52 | } 53 | 54 | inline SteamFile::~SteamFile() 55 | { 56 | if (m_fileData) 57 | { 58 | FREE_FILE(m_fileData); 59 | m_fileData = NULL; 60 | } 61 | } 62 | 63 | inline bool SteamFile::Read(void *data, int length) 64 | { 65 | if (length > m_bytesLeft || m_cursor == NULL || m_bytesLeft <= 0) 66 | return false; 67 | 68 | byte *readCursor = static_cast(data); 69 | for (int i = 0; i < length; ++i) 70 | { 71 | *readCursor++ = *m_cursor++; 72 | --m_bytesLeft; 73 | } 74 | 75 | return true; 76 | } 77 | -------------------------------------------------------------------------------- /reapi/include/cssdk/game_shared/voice_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #include "bitvec.h" 31 | 32 | // TODO: this should just be set to MAX_CLIENTS 33 | #define VOICE_MAX_PLAYERS 32 34 | #define VOICE_MAX_PLAYERS_DW ((VOICE_MAX_PLAYERS / 32) + !!(VOICE_MAX_PLAYERS & 31)) 35 | 36 | typedef CBitVec< VOICE_MAX_PLAYERS > CPlayerBitVec; 37 | -------------------------------------------------------------------------------- /reapi/include/cssdk/game_shared/voice_gamemgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define UPDATE_INTERVAL 0.3 31 | 32 | #include "voice_common.h" 33 | 34 | class CGameRules; 35 | class CBasePlayer; 36 | 37 | class IVoiceGameMgrHelper { 38 | public: 39 | virtual ~IVoiceGameMgrHelper() = 0; 40 | 41 | // Called each frame to determine which players are allowed to hear each other. This overrides 42 | // whatever squelch settings players have. 43 | virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pTalker) = 0; 44 | virtual void ResetCanHearPlayer(edict_t* pEdict) = 0; 45 | virtual void SetCanHearPlayer(CBasePlayer* pListener, CBasePlayer* pSender, bool bCanHear) = 0; 46 | virtual bool GetCanHearPlayer(CBasePlayer* pListener, CBasePlayer* pSender) = 0; 47 | }; 48 | 49 | // CVoiceGameMgr manages which clients can hear which other clients. 50 | class CVoiceGameMgr { 51 | public: 52 | virtual ~CVoiceGameMgr() {}; 53 | public: 54 | int m_msgPlayerVoiceMask; 55 | int m_msgRequestState; 56 | IVoiceGameMgrHelper *m_pHelper; 57 | int m_nMaxPlayers; 58 | double m_UpdateInterval; // How long since the last update. 59 | }; 60 | -------------------------------------------------------------------------------- /reapi/include/cssdk/pm_shared/pm_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define MAX_PHYSINFO_STRING 256 31 | -------------------------------------------------------------------------------- /reapi/include/cssdk/pm_shared/pm_materials.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | #define CTEXTURESMAX 1024 // max number of textures loaded 31 | #define CBTEXTURENAMEMAX 17 // only load first n chars of name 32 | 33 | #define CHAR_TEX_CONCRETE 'C' // texture types 34 | #define CHAR_TEX_METAL 'M' 35 | #define CHAR_TEX_DIRT 'D' 36 | #define CHAR_TEX_VENT 'V' 37 | #define CHAR_TEX_GRATE 'G' 38 | #define CHAR_TEX_TILE 'T' 39 | #define CHAR_TEX_SLOSH 'S' 40 | #define CHAR_TEX_WOOD 'W' 41 | #define CHAR_TEX_COMPUTER 'P' 42 | #define CHAR_TEX_GRASS 'X' 43 | #define CHAR_TEX_GLASS 'Y' 44 | #define CHAR_TEX_FLESH 'F' 45 | #define CHAR_TEX_SNOW 'N' 46 | -------------------------------------------------------------------------------- /reapi/include/cssdk/pm_shared/pm_movevars.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | #pragma once 29 | 30 | typedef struct movevars_s 31 | { 32 | float gravity; // Gravity for map 33 | float stopspeed; // Deceleration when not moving 34 | float maxspeed; // Max allowed speed 35 | float spectatormaxspeed; 36 | float accelerate; // Acceleration factor 37 | float airaccelerate; // Same for when in open air 38 | float wateraccelerate; // Same for when in water 39 | float friction; 40 | float edgefriction; // Extra friction near dropofs 41 | float waterfriction; // Less in water 42 | float entgravity; // 1.0 43 | float bounce; // Wall bounce value. 1.0 44 | float stepsize; // sv_stepsize; 45 | float maxvelocity; // maximum server velocity. 46 | float zmax; // Max z-buffer range (for GL) 47 | float waveHeight; // Water wave height (for GL) 48 | qboolean footsteps; // Play footstep sounds 49 | char skyName[32]; // Name of the sky map 50 | float rollangle; 51 | float rollspeed; 52 | float skycolor_r; // Sky color 53 | float skycolor_g; 54 | float skycolor_b; 55 | float skyvec_x; // Sky vector 56 | float skyvec_y; 57 | float skyvec_z; 58 | 59 | } movevars_t; 60 | -------------------------------------------------------------------------------- /reapi/include/cssdk/public/basetypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This program is free software; you can redistribute it and/or modify it 4 | * under the terms of the GNU General Public License as published by the 5 | * Free Software Foundation; either version 2 of the License, or (at 6 | * your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, but 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 | * General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software Foundation, 15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | * 17 | * In addition, as a special exception, the author gives permission to 18 | * link the code of this program with the Half-Life Game Engine ("HL 19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve, 20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all 21 | * respects for all of the code used other than the HL Engine and MODs 22 | * from Valve. If you modify this file, you may extend this exception 23 | * to your version of the file, but you are not obligated to do so. If 24 | * you do not wish to do so, delete this exception statement from your 25 | * version. 26 | * 27 | */ 28 | 29 | #ifndef BASETYPES_H 30 | #define BASETYPES_H 31 | #ifdef _WIN32 32 | #pragma once 33 | #endif 34 | 35 | #include "osconfig.h" 36 | #include "commonmacros.h" 37 | 38 | #include "mathlib.h" 39 | 40 | // For backward compatibilty only... 41 | #include "tier0/platform.h" 42 | 43 | // stdio.h 44 | #ifndef NULL 45 | #define NULL 0 46 | #endif 47 | 48 | // Pad a number so it lies on an N byte boundary. 49 | // So PAD_NUMBER(0,4) is 0 and PAD_NUMBER(1,4) is 4 50 | #define PAD_NUMBER(number, boundary) \ 51 | (((number) + ((boundary) - 1)) / (boundary)) * (boundary) 52 | 53 | #ifndef FALSE 54 | #define FALSE 0 55 | #define TRUE (!FALSE) 56 | #endif 57 | 58 | typedef int BOOL; 59 | typedef int qboolean; 60 | typedef unsigned long ULONG; 61 | typedef unsigned char BYTE; 62 | typedef unsigned char byte; 63 | typedef unsigned short word; 64 | 65 | typedef float vec_t; 66 | 67 | #ifndef UNUSED 68 | #define UNUSED(x) (x = x) // for pesky compiler / lint warnings 69 | #endif 70 | 71 | struct vrect_t 72 | { 73 | int x, y, width, height; 74 | vrect_t *pnext; 75 | }; 76 | 77 | #endif // BASETYPES_H 78 | -------------------------------------------------------------------------------- /reapi/include/cssdk/public/commonmacros.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMONMACROS_H 2 | #define COMMONMACROS_H 3 | #pragma once 4 | 5 | 6 | // ------------------------------------------------------- 7 | // 8 | // commonmacros.h 9 | // 10 | // This should contain ONLY general purpose macros that are 11 | // appropriate for use in engine/launcher/all tools 12 | // 13 | // ------------------------------------------------------- 14 | 15 | #include "osconfig.h" 16 | // Makes a 4-byte "packed ID" int out of 4 characters 17 | #define MAKEID(d,c,b,a) ( ((int)(a) << 24) | ((int)(b) << 16) | ((int)(c) << 8) | ((int)(d)) ) 18 | 19 | // Compares a string with a 4-byte packed ID constant 20 | #define STRING_MATCHES_ID( p, id ) ( (*((int *)(p)) == (id) ) ? true : false ) 21 | #define ID_TO_STRING( id, p ) ( (p)[3] = (((id)>>24) & 0xFF), (p)[2] = (((id)>>16) & 0xFF), (p)[1] = (((id)>>8) & 0xFF), (p)[0] = (((id)>>0) & 0xFF) ) 22 | 23 | #define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) 24 | 25 | // Keeps clutter down a bit, when using a float as a bit-vector 26 | #define SetBits(flBitVector, bits) ((flBitVector) = (int)(flBitVector) | (bits)) 27 | #define ClearBits(flBitVector, bits) ((flBitVector) = (int)(flBitVector) & ~(bits)) 28 | #define FBitSet(flBitVector, bit) ((int)(flBitVector) & (bit)) 29 | 30 | #endif // COMMONMACROS_H 31 | -------------------------------------------------------------------------------- /reapi/include/metamod/dllapi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef void (*FN_GAMEINIT)(); 4 | 5 | // Typedefs for these are provided in SDK engine/eiface.h, but I didn't 6 | // like the names (APIFUNCTION, APIFUNCTION2, NEW_DLL_FUNCTIONS_FN). 7 | typedef int (*GETENTITYAPI_FN)(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion); 8 | typedef int (*GETENTITYAPI2_FN)(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion); 9 | typedef int (*GETNEWDLLFUNCTIONS_FN)(NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion); 10 | 11 | C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion); 12 | C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion); 13 | C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *interfaceVersion); 14 | 15 | #ifdef METAMOD_CORE 16 | void compile_gamedll_callbacks(); 17 | #endif 18 | -------------------------------------------------------------------------------- /reapi/include/metamod/engine_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct enginefuncs_s; 4 | 5 | // Plugin's GetEngineFunctions, called by metamod. 6 | typedef int (*GET_ENGINE_FUNCTIONS_FN)(enginefuncs_s *pengfuncsFromEngine, int *interfaceVersion); 7 | 8 | // According to SDK engine/eiface.h: 9 | // ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 138 10 | #define ENGINE_INTERFACE_VERSION 138 11 | 12 | // Protect against other projects which use this include file but use the 13 | // normal enginefuncs_t type for their meta_engfuncs. 14 | #ifdef METAMOD_CORE 15 | #include "meta_eiface.h" // meta_enginefuncs_t 16 | extern meta_enginefuncs_t g_meta_engfuncs; 17 | 18 | void compile_engine_callbacks(); 19 | #else 20 | extern enginefuncs_t meta_engfuncs; 21 | #endif 22 | -------------------------------------------------------------------------------- /reapi/include/metamod/enginecallbacks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // This file is a wrapper around the SDK's enginecallback.h file. We need 4 | // this because we use a different type for the global object g_engfuncs, 5 | // which is still compatible with the enginefuncs_t that the SDK 6 | // uses. 7 | // This is only done for files that belong to Metamod, not other projects 8 | // like plugins that use this file, or others that include it, too. 9 | // Since we don't have a clean seperation of include files right now we 10 | // "hack" our way around that by using a flag METAMOD_CORE which is set 11 | // when compiling Metamod proper. 12 | 13 | #ifdef METAMOD_CORE 14 | #include "meta_eiface.h" // HL_enginefuncs_t 15 | 16 | // Use a #define to bend the enginefuncs_t type to our HL_enginefuncs_t 17 | // type instead as we now use that for the global object g_engfuncs. 18 | #define enginefuncs_t HL_enginefuncs_t 19 | #endif 20 | 21 | #include // ALERT, etc 22 | 23 | #ifdef METAMOD_CORE 24 | #undef enginefuncs_t 25 | #endif 26 | 27 | // Also, create some additional macros for engine callback functions, which 28 | // weren't in SDK dlls/enginecallbacks.h but probably should have been. 29 | #define GET_INFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer) 30 | #define INFOKEY_VALUE (*g_engfuncs.pfnInfoKeyValue) 31 | #define SET_CLIENT_KEYVALUE (*g_engfuncs.pfnSetClientKeyValue) 32 | #define REG_SVR_COMMAND (*g_engfuncs.pfnAddServerCommand) 33 | #define SERVER_PRINT (*g_engfuncs.pfnServerPrint) 34 | #define SET_SERVER_KEYVALUE (*g_engfuncs.pfnSetKeyValue) 35 | #define QUERY_CLIENT_CVAR_VALUE (*g_engfuncs.pfnQueryClientCvarValue) 36 | #define QUERY_CLIENT_CVAR_VALUE2 (*g_engfuncs.pfnQueryClientCvarValue2) 37 | -------------------------------------------------------------------------------- /reapi/include/metamod/h_export.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Our GiveFnptrsToDll, called by engine. 4 | typedef void (WINAPI *GIVE_ENGINE_FUNCTIONS_FN)(enginefuncs_t *pengfuncsFromEngine, globalvars_t *pGlobals); 5 | C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngine, globalvars_t *pGlobals); 6 | -------------------------------------------------------------------------------- /reapi/include/metamod/plinfo.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Flags for plugin to indicate when it can be be loaded/unloaded. 4 | // NOTE: order is crucial, as greater/less comparisons are made. 5 | enum PLUG_LOADTIME 6 | { 7 | PT_NEVER = 0, 8 | PT_STARTUP, // should only be loaded/unloaded at initial hlds execution 9 | PT_CHANGELEVEL, // can be loaded/unloaded between maps 10 | PT_ANYTIME, // can be loaded/unloaded at any time 11 | PT_ANYPAUSE, // can be loaded/unloaded at any time, and can be "paused" during a map 12 | }; 13 | 14 | // Flags to indicate why the plugin is being unloaded. 15 | enum PL_UNLOAD_REASON 16 | { 17 | PNL_NULL = 0, 18 | PNL_INI_DELETED, // was deleted from plugins.ini 19 | PNL_FILE_NEWER, // file on disk is newer than last load 20 | PNL_COMMAND, // requested by server/console command 21 | PNL_CMD_FORCED, // forced by server/console command 22 | PNL_DELAYED, // delayed from previous request; can't tell origin 23 | 24 | // only used for 'real_reason' on MPlugin::unload() 25 | PNL_PLUGIN, // requested by plugin function call 26 | PNL_PLG_FORCED, // forced by plugin function call 27 | PNL_RELOAD, // forced unload by reload() 28 | }; 29 | 30 | // Information plugin provides about itself. 31 | struct plugin_info_t 32 | { 33 | const char *ifvers; // meta_interface version 34 | const char *name; // full name of plugin 35 | const char *version; // version 36 | const char *date; // date 37 | const char *author; // author name/email 38 | const char *url; // URL 39 | const char *logtag; // log message prefix (unused right now) 40 | PLUG_LOADTIME loadable; // when loadable 41 | PLUG_LOADTIME unloadable; // when unloadable 42 | }; 43 | 44 | extern plugin_info_t Plugin_info; 45 | 46 | // Plugin identifier, passed to all Meta Utility Functions. 47 | typedef plugin_info_t *plid_t; 48 | #define PLID &Plugin_info 49 | -------------------------------------------------------------------------------- /reapi/include/reunion_api.h: -------------------------------------------------------------------------------- 1 | #ifndef REUNION_API_H 2 | #define REUNION_API_H 3 | 4 | #define REUNION_API_VERSION_MAJOR 1 5 | #define REUNION_API_VERSION_MINOR 4 6 | 7 | enum dp_authkind_e 8 | { 9 | DP_AUTH_NONE = 0, 10 | DP_AUTH_DPROTO = 1, 11 | DP_AUTH_STEAM = 2, 12 | DP_AUTH_STEAMEMU = 3, 13 | DP_AUTH_REVEMU = 4, 14 | DP_AUTH_OLDREVEMU = 5, 15 | DP_AUTH_HLTV = 6, 16 | DP_AUTH_SC2009 = 7, 17 | DP_AUTH_AVSMP = 8, 18 | DP_AUTH_SXEI = 9, 19 | DP_AUTH_REVEMU2013 = 10 20 | }; 21 | 22 | enum reu_authkey_kind 23 | { 24 | REU_AK_UNKNOWN = -1, 25 | REU_AK_STEAM, 26 | REU_AK_VOLUMEID, 27 | REU_AK_HDDSN, 28 | REU_AK_FILEID, 29 | REU_AK_SXEID, 30 | REU_AK_OTHER, 31 | REU_AK_MAX 32 | }; 33 | 34 | class IReunionApi 35 | { 36 | public: 37 | // NOTE: GetMajorVersion, GetMinorVersion have been since version 0.1.0.92c 38 | int version_major; 39 | int version_minor; 40 | 41 | enum 42 | { 43 | LONG_AUTHID_LEN = 16 44 | }; 45 | 46 | virtual int GetClientProtocol(int index) = 0; // index: 0-31 47 | virtual dp_authkind_e GetClientAuthtype(int index) = 0; // index: 0-31 48 | 49 | /* Deprecated */virtual size_t GetClientAuthdata(int index, void *data, int maxlen) = 0; // get auth data as binary. index: 0-31 50 | /* Deprecated */virtual const char *GetClientAuthdataString(int index, char *data, int maxlen) = 0; // get auth data as string. index: 0-31 51 | 52 | virtual int GetMajorVersion() = 0; 53 | virtual int GetMinorVersion() = 0; 54 | 55 | virtual void GetLongAuthId(int index, unsigned char(&authId)[LONG_AUTHID_LEN]) = 0; 56 | virtual reu_authkey_kind GetAuthKeyKind(int index) = 0; 57 | 58 | // index: 0-31 59 | virtual void SetConnectTime(int index, double time) = 0; 60 | virtual USERID_t* GetSerializedId(int index) const = 0; 61 | virtual USERID_t* GetStorageId(int index) const = 0; 62 | virtual uint64 GetDisplaySteamId(int index) const = 0; 63 | }; 64 | 65 | #endif // REUNION_API_H 66 | -------------------------------------------------------------------------------- /reapi/include/vtc_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | const char VOICETRANSCODER_VERSION[] = "2017 RC"; 6 | 7 | const size_t VOICETRANSCODER_API_VERSION_MAJOR = 3; 8 | const size_t VOICETRANSCODER_API_VERSION_MINOR = 0; 9 | 10 | template 11 | class IEvent { 12 | public: 13 | virtual ~IEvent() {} 14 | 15 | typedef void (*handler_t)(T_ARGS...); 16 | 17 | virtual void operator+=(handler_t callback) = 0; 18 | virtual void operator-=(handler_t callback) = 0; 19 | }; 20 | 21 | class IVoiceTranscoderAPI { 22 | public: 23 | virtual ~IVoiceTranscoderAPI() {} 24 | 25 | virtual size_t GetMajorVersion() = 0; 26 | virtual size_t GetMinorVersion() = 0; 27 | 28 | virtual bool IsClientSpeaking(size_t clientIndex) = 0; 29 | 30 | virtual IEvent& OnClientStartSpeak() = 0; 31 | virtual IEvent& OnClientStopSpeak() = 0; 32 | 33 | virtual void MuteClient(size_t clientIndex) = 0; 34 | virtual void UnmuteClient(size_t clientIndex) = 0; 35 | virtual bool IsClientMuted(size_t clientIndex) = 0; 36 | 37 | virtual void PlaySound(size_t receiverClientIndex, const char *soundFilePath) = 0; 38 | }; 39 | -------------------------------------------------------------------------------- /reapi/lib/linux32/libgcc_s.so.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/lib/linux32/libgcc_s.so.1 -------------------------------------------------------------------------------- /reapi/lib/linux32/libm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/lib/linux32/libm.so -------------------------------------------------------------------------------- /reapi/lib/linux32/librt.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/lib/linux32/librt.so -------------------------------------------------------------------------------- /reapi/lib/linux32/libstdc++.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rehlds/ReAPI/66f60961605bb379593b5ec7ffde6cf25c0e213c/reapi/lib/linux32/libstdc++.so.6 -------------------------------------------------------------------------------- /reapi/msvc/PostBuild.bat: -------------------------------------------------------------------------------- 1 | @echo OFF 2 | :: 3 | :: Post-build auto-deploy script 4 | :: Create and fill PublishPath.txt file with path to deployment folder 5 | :: I.e. PublishPath.txt should contain one line with a folder path 6 | :: Call it so: 7 | :: IF EXIST "$(ProjectDir)PostBuild.bat" (CALL "$(ProjectDir)PostBuild.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)") 8 | :: 9 | 10 | SET hlds=ServerStart_cs 11 | SET status=0 12 | 13 | SET targetDir=%~1 14 | SET targetName=%~2 15 | SET targetExt=%~3 16 | SET projectDir=%~4 17 | SET destination= 18 | 19 | IF EXIST "%hlds%.bat" ( 20 | set status=1 21 | ) 22 | echo "%projectDir%\PublishPath.txt" 23 | 24 | IF NOT EXIST "%projectDir%\PublishPath.txt" ( 25 | ECHO No deployment path specified. Create PublishPath.txt near PostBuild.bat with paths on separate lines for auto deployment. 26 | exit /B 0 27 | ) 28 | 29 | FOR /f "tokens=* delims= usebackq" %%a IN ("%projectDir%\PublishPath.txt") DO ( 30 | ECHO Deploying to: %%a 31 | IF NOT "%%a" == "" ( 32 | copy /Y "%targetDir%%targetName%%targetExt%" "%%a" 33 | 34 | IF "%status%" == "1" ( 35 | SET status=1 36 | ) 37 | 38 | IF NOT ERRORLEVEL 1 ( 39 | IF EXIST "%targetDir%%targetName%.pdb" ( 40 | copy /Y "%targetDir%%targetName%.pdb" "%%a" 41 | ) 42 | ) ELSE ( 43 | ECHO PostBuild.bat ^(27^) : warning : Can't copy '%targetName%%targetExt%' to deploy path '%%a' 44 | ) 45 | ) 46 | ) 47 | 48 | IF "%status%" == "2" ( 49 | start %hlds%.bat 50 | ) 51 | 52 | IF "%%a" == "" ( 53 | ECHO No deployment path specified. 54 | ) 55 | 56 | exit /B 0 -------------------------------------------------------------------------------- /reapi/msvc/reapi.def: -------------------------------------------------------------------------------- 1 | LIBRARY reapi_amxx 2 | EXPORTS 3 | GiveFnptrsToDll @1 4 | SECTIONS 5 | .data READ WRITE 6 | -------------------------------------------------------------------------------- /reapi/msvc/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ReVoice.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /reapi/src/amx_hook.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | CAmxxHookBase::CAmxxHookBase(AMX *amx, const char *funcname, int forwardIndex, int index) : 4 | m_fwdindex(forwardIndex), 5 | m_index(index), 6 | m_state(FSTATE_ENABLED), 7 | m_amx(amx) 8 | { 9 | Q_strlcpy(m_CallbackName, funcname); 10 | } 11 | 12 | CAmxxHookBase::~CAmxxHookBase() 13 | { 14 | if (m_fwdindex != -1) 15 | { 16 | g_amxxapi.UnregisterSPForward(m_fwdindex); 17 | m_fwdindex = -1; 18 | } 19 | } 20 | 21 | void CAmxxHookBase::Error(int error, const char *fmt, ...) 22 | { 23 | va_list argptr; 24 | static char string[1024]; 25 | va_start(argptr, fmt); 26 | vsprintf(string, fmt, argptr); 27 | va_end(argptr); 28 | 29 | auto scriptName = g_amxxapi.GetAmxScriptName(g_amxxapi.FindAmxScriptByAmx(m_amx)); 30 | if (scriptName) 31 | { 32 | if ((scriptName = strrchr(scriptName, CORRECT_PATH_SEPARATOR))) 33 | scriptName++; 34 | } 35 | 36 | g_amxxapi.Log("Run time error %d (plugin \"%s\") (forward \"%s\")", error, scriptName, m_CallbackName); 37 | g_amxxapi.Log("%s", string); 38 | } 39 | -------------------------------------------------------------------------------- /reapi/src/amx_hook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum fwdstate 4 | { 5 | FSTATE_INVALID = 0, 6 | FSTATE_ENABLED, 7 | FSTATE_PAUSED, 8 | FSTATE_STOPPED 9 | }; 10 | 11 | class CAmxxHookBase 12 | { 13 | public: 14 | ~CAmxxHookBase(); 15 | CAmxxHookBase(AMX *amx, const char *funcname, int forwardIndex, int index); 16 | 17 | int GetFwdIndex() const { return m_fwdindex; } 18 | int GetIndex() const { return m_index; } 19 | fwdstate GetState() const { return m_state; } 20 | AMX *GetAmx() const { return m_amx; } 21 | const char *GetCallbackName() const { return m_CallbackName; } 22 | 23 | void SetState(fwdstate st) { m_state = st; } 24 | void Error(int error, const char *fmt, ...); 25 | 26 | private: 27 | int m_fwdindex, m_index; 28 | char m_CallbackName[64]; 29 | fwdstate m_state; 30 | AMX *m_amx; 31 | }; 32 | -------------------------------------------------------------------------------- /reapi/src/api_config.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | CAPI_Config api_cfg; 4 | 5 | CAPI_Config::CAPI_Config() : m_api_rehlds(false), m_api_regame(false), m_api_vtc(false), m_api_reunion(false) 6 | { 7 | 8 | } 9 | 10 | void CAPI_Config::FailedReGameDllAPI() 11 | { 12 | m_api_regame = false; 13 | } 14 | 15 | void CAPI_Config::Init() 16 | { 17 | m_api_rehlds = RehldsApi_Init(); 18 | m_api_regame = RegamedllApi_Init(); 19 | m_api_vtc = VTC_Api_Init(); 20 | m_api_reunion = ReunionApi_Init(); 21 | m_api_rechecker = RecheckerApi_Init(); 22 | 23 | if (m_api_regame) { 24 | g_ReGameHookchains->InstallGameRules()->registerHook(&InstallGameRules); 25 | } 26 | } 27 | 28 | void CAPI_Config::ServerDeactivate() const 29 | { 30 | if (m_api_regame) { 31 | g_pGameRules = nullptr; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /reapi/src/api_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // reapi version 4 | #include "reapi_version.inc" 5 | 6 | class CAPI_Config { 7 | public: 8 | CAPI_Config(); 9 | void Init(); 10 | void FailedReGameDllAPI(); 11 | 12 | bool hasReHLDS() const { return m_api_rehlds; } 13 | bool hasReGameDLL() const { return m_api_regame; } 14 | bool hasVTC() const { return m_api_vtc; } 15 | bool hasReunion() const { return m_api_reunion; } 16 | bool hasRechecker() const { return m_api_rechecker; } 17 | 18 | void ServerDeactivate() const; 19 | 20 | private: 21 | // to provide API functions 22 | bool m_api_rehlds; // some useful functions 23 | bool m_api_regame; // some useful functions #2 24 | 25 | // future plans? 26 | bool m_api_vtc; // for gag 27 | bool m_api_reunion; // for information about authorization client 28 | 29 | //bool m_api_revoice; // for gag #2 30 | bool m_api_rechecker; // for detection when checking and adding few files 31 | }; 32 | 33 | extern CAPI_Config api_cfg; 34 | -------------------------------------------------------------------------------- /reapi/src/h_export.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | enginefuncs_t g_engfuncs; 4 | globalvars_t *gpGlobals; 5 | 6 | // Receive engine function table from engine. 7 | // This appears to be the _first_ DLL routine called by the engine, so we 8 | // do some setup operations here. 9 | C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pengfuncsFromEngine, globalvars_t *pGlobals) 10 | { 11 | memcpy(&g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t)); 12 | gpGlobals = pGlobals; 13 | } 14 | -------------------------------------------------------------------------------- /reapi/src/hook_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | CHookManager g_hookManager; 4 | 5 | int CHookManager::addHandler(AMX *amx, int func, const char *funcname, int forward, bool post) const 6 | { 7 | auto hook = m_hooklist.getHookSafe(func); 8 | 9 | if (!hook->post.size() && !hook->pre.size()) 10 | { 11 | // API hookchain 12 | hook->registerHookchain(); 13 | } 14 | 15 | auto& dest = post ? hook->post : hook->pre; 16 | int i = func * MAX_HOOK_FORWARDS + dest.size() + 1; 17 | int index = post ? -i : i; // use unsigned ids for post hooks 18 | 19 | dest.push_back(new CAmxxHookBase(amx, funcname, forward, index)); 20 | return index; 21 | } 22 | 23 | void CHookManager::Clear() const 24 | { 25 | m_hooklist.clear(); 26 | } 27 | 28 | hook_t *CHookManager::getHook(size_t func) const 29 | { 30 | return m_hooklist.getHookSafe(func); 31 | } 32 | 33 | CAmxxHookBase *CHookManager::getAmxxHook(cell handle) const 34 | { 35 | bool post = handle < 0; 36 | 37 | if (post) 38 | handle = ~handle; 39 | else 40 | handle--; 41 | 42 | const size_t func = handle / MAX_HOOK_FORWARDS; 43 | const size_t id = handle & (MAX_HOOK_FORWARDS - 1); 44 | auto hook = m_hooklist.getHookSafe(func); 45 | 46 | if (hook) 47 | { 48 | auto& forwards = post ? hook->post : hook->pre; 49 | if (id < forwards.size()) 50 | return forwards[id]; 51 | } 52 | 53 | return nullptr; 54 | } 55 | -------------------------------------------------------------------------------- /reapi/src/hook_manager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "amx_hook.h" 4 | #include "hook_list.h" 5 | 6 | class CHookManager 7 | { 8 | public: 9 | void Clear() const; 10 | cell addHandler(AMX *amx, int func, const char *funcname, int forward, bool post) const; 11 | hook_t *getHook(size_t func) const; 12 | CAmxxHookBase *getAmxxHook(cell hook) const; 13 | 14 | hook_t *getHookFast(size_t func) const { 15 | return m_hooklist[func]; 16 | } 17 | 18 | private: 19 | hooklist_t m_hooklist; 20 | }; 21 | 22 | extern CHookManager g_hookManager; 23 | -------------------------------------------------------------------------------- /reapi/src/hook_message_manager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // Class managing hooks for game messages 6 | class MessageHookManager 7 | { 8 | public: 9 | // Adds a hook for a game message 10 | cell addHook(AMX *amx, int msg_id, const char *funcname, bool post); 11 | 12 | // Removes a hook with the given handle 13 | bool removeHook(AMX *amx, cell handle); 14 | 15 | // Clears all hooks 16 | void Clear(); 17 | 18 | // Get the AMXX hook with the given handle 19 | CAmxxHookBase *getAmxxHook(cell handle); 20 | 21 | private: 22 | class MessageHook 23 | { 24 | public: 25 | // Clears all hooks associated with this message 26 | void clear() 27 | { 28 | if (post.size() || pre.size()) { 29 | for (CAmxxHookBase *h : post) 30 | delete h; 31 | post.clear(); 32 | 33 | for (CAmxxHookBase *h : pre) 34 | delete h; 35 | pre.clear(); 36 | 37 | // Unregister the message hook 38 | if (g_RehldsMessageManager) 39 | g_RehldsMessageManager->unregisterHook(id, RoutineMessageCallbacks); 40 | } 41 | } 42 | 43 | int id; 44 | std::vector pre, post; 45 | }; 46 | 47 | // Dispatches the callbacks for the message hooks 48 | void DispatchCallbacks(IVoidHookChain *chain, IMessage *message); 49 | 50 | // Routine function for dispatching message callbacks 51 | static void RoutineMessageCallbacks(IVoidHookChain *chain, IMessage *message); 52 | 53 | // Getter the message hook by ID 54 | MessageHook *getHook(size_t id); 55 | 56 | // Array of message hooks 57 | std::array hooks; 58 | }; 59 | 60 | // Global instance of the message hook manager 61 | extern MessageHookManager g_messageHookManager; 62 | 63 | // Pointer to the message context within an active hook 64 | extern IMessage *g_activeMessageContext; 65 | -------------------------------------------------------------------------------- /reapi/src/main.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern char g_szMapName[32]; 4 | extern playermove_t* g_pMove; 5 | extern int gmsgSendAudio; 6 | extern int gmsgStatusIcon; 7 | extern int gmsgArmorType; 8 | extern int gmsgItemStatus; 9 | extern int gmsgBarTime; 10 | extern int gmsgBarTime2; 11 | 12 | void OnAmxxAttach(); 13 | bool OnMetaAttach(); 14 | void OnMetaDetach(); 15 | 16 | void OnFreeEntPrivateData(edict_t *pEdict); 17 | void ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); 18 | void ServerDeactivate_Post(); 19 | int DispatchSpawn(edict_t* pEntity); 20 | void ResetGlobalState(); 21 | void KeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); 22 | 23 | CGameRules *InstallGameRules(IReGameHook_InstallGameRules *chain); 24 | -------------------------------------------------------------------------------- /reapi/src/meta_api.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | #include "appversion.h" 3 | 4 | meta_globals_t *gpMetaGlobals; 5 | gamedll_funcs_t *gpGamedllFuncs; 6 | mutil_funcs_t *gpMetaUtilFuncs; 7 | enginefuncs_t *g_pengfuncsTable; 8 | 9 | plugin_info_t Plugin_info = 10 | { 11 | META_INTERFACE_VERSION, // ifvers 12 | "ReAPI", // name 13 | APP_VERSION, // version 14 | APP_COMMIT_DATE, // date 15 | "Asmodai & s1lent", // author 16 | "https://github.com/s1lentq/reapi/", // url 17 | "ReAPI", // logtag, all caps please 18 | PT_ANYTIME, // (when) loadable 19 | PT_NEVER, // (when) unloadable 20 | }; 21 | 22 | C_DLLEXPORT int Meta_Query(char *interfaceVersion, plugin_info_t **plinfo, mutil_funcs_t *pMetaUtilFuncs) 23 | { 24 | *plinfo = &Plugin_info; 25 | gpMetaUtilFuncs = pMetaUtilFuncs; 26 | return TRUE; 27 | } 28 | 29 | // Must provide at least one of these.. 30 | META_FUNCTIONS gMetaFunctionTable = 31 | { 32 | NULL, // pfnGetEntityAPI HL SDK; called before game DLL 33 | NULL, // pfnGetEntityAPI_Post META; called after game DLL 34 | GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL 35 | GetEntityAPI2_Post, // pfnGetEntityAPI2_Post META; called after game DLL 36 | GetNewDLLFunctions, // pfnGetNewDLLFunctions HL SDK2; called before game DLL 37 | NULL, // pfnGetNewDLLFunctions_Post META; called after game DLL 38 | NULL, // pfnGetEngineFunctions META; called before HL engine 39 | NULL, // pfnGetEngineFunctions_Post META; called after HL engine 40 | }; 41 | 42 | C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) 43 | { 44 | gpMetaGlobals = pMGlobals; 45 | gpGamedllFuncs = pGamedllFuncs; 46 | 47 | if (!OnMetaAttach()) 48 | { 49 | return FALSE; 50 | } 51 | 52 | GET_HOOK_TABLES(PLID, &g_pengfuncsTable, nullptr, nullptr); 53 | memcpy(pFunctionTable, &gMetaFunctionTable, sizeof(META_FUNCTIONS)); 54 | return TRUE; 55 | } 56 | 57 | C_DLLEXPORT int Meta_Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reason) 58 | { 59 | OnMetaDetach(); 60 | return TRUE; 61 | } 62 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_rechecker_api.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | IRecheckerApi *g_RecheckerApi; 4 | IRecheckerHookchains *g_RecheckerHookchains; 5 | const RecheckerFuncs_t *g_RecheckerFuncs; 6 | 7 | bool RecheckerApi_Init() 8 | { 9 | if (!g_RehldsApi) 10 | return false; 11 | 12 | g_RecheckerApi = (IRecheckerApi *)g_RehldsApi->GetFuncs()->GetPluginApi("rechecker"); 13 | 14 | if (!g_RecheckerApi) 15 | return false; 16 | 17 | if (g_RecheckerApi->GetMajorVersion() != RECHECKER_API_VERSION_MAJOR) 18 | { 19 | UTIL_ServerPrint("[%s]: Rechecker API major version mismatch; expected %d, real %d\n", Plugin_info.logtag, RECHECKER_API_VERSION_MAJOR, g_RecheckerApi->GetMajorVersion()); 20 | 21 | // need to notify that it is necessary to update the Rechecker. 22 | if (g_RecheckerApi->GetMajorVersion() < RECHECKER_API_VERSION_MAJOR) 23 | { 24 | UTIL_ServerPrint("[%s]: Please update the Rechecker up to a major version API >= %d\n", Plugin_info.logtag, RECHECKER_API_VERSION_MAJOR); 25 | } 26 | 27 | // need to notify that it is necessary to update the module. 28 | else if (g_RecheckerApi->GetMajorVersion() > RECHECKER_API_VERSION_MAJOR) 29 | { 30 | UTIL_ServerPrint("[%s]: Please update the %s up to a major version API >= %d\n", Plugin_info.logtag, Plugin_info.logtag, g_RecheckerApi->GetMajorVersion()); 31 | } 32 | 33 | return false; 34 | } 35 | 36 | if (g_RecheckerApi->GetMinorVersion() < RECHECKER_API_VERSION_MINOR) 37 | { 38 | UTIL_ServerPrint("[%s]: Rechecker API minor version mismatch; expected at least %d, real %d\n", Plugin_info.logtag, RECHECKER_API_VERSION_MINOR, g_RecheckerApi->GetMinorVersion()); 39 | UTIL_ServerPrint("[%s]: Please update the Rechecker up to a minor version API >= %d\n", Plugin_info.logtag, RECHECKER_API_VERSION_MINOR); 40 | return false; 41 | } 42 | 43 | g_RecheckerFuncs = g_RecheckerApi->GetFuncs(); 44 | g_RecheckerHookchains = g_RecheckerApi->GetHookchains(); 45 | 46 | return true; 47 | } 48 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_rechecker_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern IRecheckerApi *g_RecheckerApi; 4 | extern IRecheckerHookchains *g_RecheckerHookchains; 5 | extern const RecheckerFuncs_t *g_RecheckerFuncs; 6 | 7 | extern bool RecheckerApi_Init(); 8 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_regamedll_api.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | IReGameApi *g_ReGameApi; 4 | const ReGameFuncs_t *g_ReGameFuncs; 5 | IReGameHookchains *g_ReGameHookchains; 6 | CGameRules *g_pGameRules = nullptr; 7 | 8 | bool RegamedllApi_Init() 9 | { 10 | const char *szGameDLLModule = GET_GAME_INFO(PLID, GINFO_DLL_FULLPATH); 11 | if (!szGameDLLModule) 12 | return false; 13 | 14 | CSysModule *gameModule = Sys_GetModuleHandle(szGameDLLModule); 15 | if (!gameModule) 16 | return false; 17 | 18 | CreateInterfaceFn ifaceFactory = Sys_GetFactory(gameModule); 19 | if (!ifaceFactory) 20 | return false; 21 | 22 | int retCode = 0; 23 | g_ReGameApi = (IReGameApi *)ifaceFactory(VRE_GAMEDLL_API_VERSION, &retCode); 24 | if (!g_ReGameApi) 25 | { 26 | return false; 27 | } 28 | 29 | int majorVersion = g_ReGameApi->GetMajorVersion(); 30 | int minorVersion = g_ReGameApi->GetMinorVersion(); 31 | 32 | if (majorVersion != REGAMEDLL_API_VERSION_MAJOR) 33 | { 34 | UTIL_ServerPrint("[%s]: ReGameDLL API major version mismatch; expected %d, real %d\n", Plugin_info.logtag, REGAMEDLL_API_VERSION_MAJOR, majorVersion); 35 | 36 | // need to notify that it is necessary to update the ReGameDLL. 37 | if (majorVersion < REGAMEDLL_API_VERSION_MAJOR) 38 | { 39 | UTIL_ServerPrint("[%s]: Please update the ReGameDLL up to a major version API >= %d\n", Plugin_info.logtag, REGAMEDLL_API_VERSION_MAJOR); 40 | } 41 | 42 | // need to notify that it is necessary to update the module. 43 | else if (majorVersion > REGAMEDLL_API_VERSION_MAJOR) 44 | { 45 | UTIL_ServerPrint("[%s]: Please update the %s up to a major version API >= %d\n", Plugin_info.logtag, Plugin_info.logtag, majorVersion); 46 | } 47 | 48 | return false; 49 | } 50 | 51 | if (minorVersion < REGAMEDLL_API_VERSION_MINOR) 52 | { 53 | UTIL_ServerPrint("[%s]: ReGameDLL API minor version mismatch; expected at least %d, real %d\n", Plugin_info.logtag, REGAMEDLL_API_VERSION_MINOR, minorVersion); 54 | UTIL_ServerPrint("[%s]: Please update the ReGameDLL up to a minor version API >= %d\n", Plugin_info.logtag, REGAMEDLL_API_VERSION_MINOR); 55 | return false; 56 | } 57 | 58 | g_ReGameFuncs = g_ReGameApi->GetFuncs(); 59 | g_ReGameHookchains = g_ReGameApi->GetHookchains(); 60 | 61 | // Safe check CCSEntity API interface version 62 | if (!g_ReGameApi->BGetICSEntity(CSENTITY_API_INTERFACE_VERSION)) 63 | { 64 | UTIL_ServerPrint("[%s]: Interface CCSEntity API version '%s' not found.\n", Plugin_info.logtag, CSENTITY_API_INTERFACE_VERSION); 65 | 66 | if (g_ReGameApi->BGetICSEntity("CSENTITY_API_INTERFACE_VERSION002")) 67 | UTIL_ServerPrint("[%s]: Please update ReGameDLL to the latest version.\n", Plugin_info.logtag); 68 | else 69 | UTIL_ServerPrint("[%s]: Please update ReAPI to the latest version.\n", Plugin_info.logtag); 70 | 71 | return false; 72 | } 73 | 74 | return true; 75 | } 76 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_regamedll_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern IReGameApi *g_ReGameApi; 4 | extern const ReGameFuncs_t *g_ReGameFuncs; 5 | extern IReGameHookchains *g_ReGameHookchains; 6 | extern CGameRules *g_pGameRules; 7 | 8 | extern bool RegamedllApi_Init(); 9 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_rehlds_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern IRehldsApi* g_RehldsApi; 4 | extern const RehldsFuncs_t* g_RehldsFuncs; 5 | extern IRehldsServerData* g_RehldsData; 6 | extern IRehldsHookchains* g_RehldsHookchains; 7 | extern IRehldsServerStatic* g_RehldsSvs; 8 | extern IMessageManager* g_RehldsMessageManager; 9 | 10 | extern bool RehldsApi_Init(); -------------------------------------------------------------------------------- /reapi/src/mods/mod_reunion_api.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | IReunionApi* g_ReunionApi; 4 | 5 | bool ReunionApi_Init() 6 | { 7 | if (!g_RehldsApi) 8 | return false; 9 | 10 | g_ReunionApi = (IReunionApi *)g_RehldsApi->GetFuncs()->GetPluginApi("reunion"); 11 | 12 | if (!g_ReunionApi) 13 | return false; 14 | 15 | if (g_ReunionApi->version_major != REUNION_API_VERSION_MAJOR) 16 | { 17 | UTIL_ServerPrint("[%s]: Reunion API major version mismatch; expected %d, real %d\n", Plugin_info.logtag, REUNION_API_VERSION_MAJOR, g_ReunionApi->version_major); 18 | 19 | // need to notify that it is necessary to update the Reunion. 20 | if (g_ReunionApi->version_major < REUNION_API_VERSION_MAJOR) 21 | { 22 | UTIL_ServerPrint("[%s]: Please update the Reunion up to a major version API >= %d\n", Plugin_info.logtag, REUNION_API_VERSION_MAJOR); 23 | } 24 | 25 | // need to notify that it is necessary to update the module. 26 | else if (g_ReunionApi->version_major > REUNION_API_VERSION_MAJOR) 27 | { 28 | UTIL_ServerPrint("[%s]: Please update the %s up to a major version API >= %d\n", Plugin_info.logtag, Plugin_info.logtag, g_ReunionApi->version_major); 29 | } 30 | 31 | return false; 32 | } 33 | 34 | if (g_ReunionApi->version_minor < REUNION_API_VERSION_MINOR) 35 | { 36 | UTIL_ServerPrint("[%s]: Reunion API minor version mismatch; expected at least %d, real %d\n", Plugin_info.logtag, REUNION_API_VERSION_MINOR, g_ReunionApi->version_minor); 37 | UTIL_ServerPrint("[%s]: Please update the Reunion up to a minor version API >= %d\n", Plugin_info.logtag, REUNION_API_VERSION_MINOR); 38 | return false; 39 | } 40 | 41 | return true; 42 | } 43 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_reunion_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern IReunionApi* g_ReunionApi; 4 | 5 | extern bool ReunionApi_Init(); 6 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_vtc_api.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | IVoiceTranscoderAPI *g_pVoiceTranscoderApi; 4 | 5 | bool VTC_Api_Init() 6 | { 7 | if (!g_RehldsApi) 8 | return false; 9 | 10 | g_pVoiceTranscoderApi = (IVoiceTranscoderAPI *)g_RehldsApi->GetFuncs()->GetPluginApi("VoiceTranscoder"); 11 | 12 | if (!g_pVoiceTranscoderApi) 13 | return false; 14 | 15 | size_t majorVersion = g_pVoiceTranscoderApi->GetMajorVersion(); 16 | size_t minorVersion = g_pVoiceTranscoderApi->GetMinorVersion(); 17 | 18 | if (majorVersion != VOICETRANSCODER_API_VERSION_MAJOR) 19 | { 20 | UTIL_ServerPrint("[%s]: VTC API major version mismatch; expected %d, real %d\n", Plugin_info.logtag, VOICETRANSCODER_API_VERSION_MAJOR, majorVersion); 21 | 22 | // need to notify that it is necessary to update the VTC. 23 | if (majorVersion < VOICETRANSCODER_API_VERSION_MAJOR) 24 | { 25 | UTIL_ServerPrint("[%s]: Please update the VTC up to a major version API >= %d\n", Plugin_info.logtag, VOICETRANSCODER_API_VERSION_MAJOR); 26 | } 27 | 28 | // need to notify that it is necessary to update the module. 29 | else if (majorVersion > VOICETRANSCODER_API_VERSION_MAJOR) 30 | { 31 | UTIL_ServerPrint("[%s]: Please update the %s up to a major version API >= %d\n", Plugin_info.logtag, Plugin_info.logtag, majorVersion); 32 | } 33 | 34 | return false; 35 | } 36 | 37 | if (minorVersion < VOICETRANSCODER_API_VERSION_MINOR) 38 | { 39 | UTIL_ServerPrint("[%s]: VTC API minor version mismatch; expected at least %d, real %d\n", Plugin_info.logtag, VOICETRANSCODER_API_VERSION_MINOR, minorVersion); 40 | UTIL_ServerPrint("[%s]: Please update the VTC up to a minor version API >= %d\n", Plugin_info.logtag, VOICETRANSCODER_API_VERSION_MINOR); 41 | return false; 42 | } 43 | 44 | g_pVoiceTranscoderApi->OnClientStartSpeak() += OnClientStartSpeak; 45 | g_pVoiceTranscoderApi->OnClientStopSpeak() += OnClientStopSpeak; 46 | 47 | return true; 48 | } 49 | -------------------------------------------------------------------------------- /reapi/src/mods/mod_vtc_api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | extern IVoiceTranscoderAPI *g_pVoiceTranscoderApi; 4 | 5 | extern bool VTC_Api_Init(); 6 | -------------------------------------------------------------------------------- /reapi/src/mods/queryfile_handler.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | CQueryFileManager g_queryFileManager; 4 | 5 | void CQueryFileManager::Clear() 6 | { 7 | for (auto query : m_hooklist) { 8 | delete query; 9 | } 10 | 11 | m_hooklist.clear(); 12 | } 13 | 14 | int CQueryFileManager::Add(AMX *amx, const char *filename, const char *funcname, ResourceType_e flag, uint32 hash) 15 | { 16 | auto handler = new CQueryFileHandler(amx, funcname); 17 | m_hooklist.push_back(handler); 18 | g_RecheckerFuncs->AddQueryFile(filename, flag, hash, &QueryFileHandler_Callback, handler->GetUniqueID()); 19 | return handler->GetAmxxID(); 20 | } 21 | 22 | bool CQueryFileManager::Remove(int index) 23 | { 24 | auto iter = m_hooklist.begin(); 25 | while (iter != m_hooklist.end()) 26 | { 27 | if ((*iter)->GetAmxxID() == index) { 28 | delete (*iter); 29 | iter = m_hooklist.erase(iter); 30 | return true; 31 | } 32 | else 33 | iter++; 34 | } 35 | 36 | return false; 37 | } 38 | 39 | void CQueryFileManager::FireCallback(IGameClient *pClient, uint32 hash, int uniqueId) 40 | { 41 | for (auto query : m_hooklist) 42 | { 43 | if (query->GetUniqueID() != uniqueId) { 44 | continue; 45 | } 46 | 47 | if (g_RecheckerFuncs->GetResource()->GetPrevHash() == hash) { 48 | hash = 0; 49 | } 50 | 51 | g_amxxapi.ExecuteForward(query->GetAmxxID(), pClient->GetId() + 1, hash); 52 | } 53 | } 54 | 55 | CQueryFileManager::CQueryFileHandler::CQueryFileHandler(AMX *amx, const char *funcname) 56 | { 57 | m_amxId = g_amxxapi.RegisterSPForwardByName(amx, funcname, FP_CELL, FP_CELL, FP_DONE); 58 | m_uniqueId = MAKE_REQUESTID(PLID); 59 | } 60 | 61 | CQueryFileManager::CQueryFileHandler::~CQueryFileHandler() 62 | { 63 | if (m_amxId != -1) { 64 | g_amxxapi.UnregisterSPForward(m_amxId); 65 | } 66 | 67 | g_RecheckerFuncs->RemoveQueryFile(m_uniqueId); 68 | } 69 | 70 | void QueryFileHandler_Callback(IGameClient *pClient, uint32 hash, int uniqueId) 71 | { 72 | g_queryFileManager.FireCallback(pClient, hash, uniqueId); 73 | } 74 | -------------------------------------------------------------------------------- /reapi/src/mods/queryfile_handler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CQueryFileManager 4 | { 5 | public: 6 | int Add(AMX *amx, const char *filename, const char *funcname, ResourceType_e flag, uint32 hash); 7 | void Clear(); 8 | bool Remove(int index); 9 | void FireCallback(IGameClient *pClient, uint32 hash, int uniqueId); 10 | 11 | private: 12 | class CQueryFileHandler 13 | { 14 | public: 15 | CQueryFileHandler(AMX *amx, const char *funcname); 16 | ~CQueryFileHandler(); 17 | 18 | int GetAmxxID() const { return m_amxId; }; 19 | int GetUniqueID() const { return m_uniqueId; }; 20 | 21 | private: 22 | int m_amxId; 23 | int m_uniqueId; 24 | }; 25 | 26 | std::vector m_hooklist; 27 | }; 28 | 29 | extern CQueryFileManager g_queryFileManager; 30 | 31 | void QueryFileHandler_Callback(IGameClient *pClient, uint32 hash, int uniqueId); 32 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void RegisterNatives_Common(); 4 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_hookchains.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PARAMS_REQUIRE(x) if (params[0] != x * sizeof(cell)) { AMXX_LogError(amx, AMX_ERR_NATIVE, "Invalid parameters count in %s", __FUNCTION__); return nullptr; } 4 | #define NATIVE_MEMBER_REQUIRE(a,x) if (!api_cfg.has##x()) { AMXX_LogError(amx, AMX_ERR_NATIVE, "Member (%s) is not available, required %s", memberlist[a]->member_name, #x); return 0; } 5 | 6 | void RegisterNatives_HookChains(); 7 | 8 | template 9 | class CTempAnyData 10 | { 11 | public: 12 | T *Alloc() 13 | { 14 | m_current = (m_current + 1) % BUF_MAX; 15 | return m_data[m_current]; 16 | } 17 | 18 | private: 19 | size_t m_current = 0; 20 | T m_data[BUF_MAX][BUF_SIZE]; 21 | }; 22 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_hookmessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void RegisterNatives_HookMessage(); 4 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_members.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void RegisterNatives_Members(); 4 | 5 | void *get_pdata_custom(CBaseEntity *pEntity, cell member); 6 | cell set_member(AMX *amx, void* pdata, const member_t *member, cell* value, size_t element); 7 | cell get_member(AMX *amx, void* pdata, const member_t *member, cell* dest, size_t element, size_t length = 0); 8 | 9 | bool isTypeReturnable(MType type); 10 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_misc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum GiveType 4 | { 5 | GT_APPEND, // Just give item 6 | GT_REPLACE, // Give the item and remove all other weapons from the slot 7 | GT_DROP_AND_REPLACE // Give the item and drop all other weapons from the slot 8 | }; 9 | 10 | enum WpnInfo 11 | { 12 | WI_ID, 13 | WI_COST, 14 | WI_CLIP_COST, 15 | WI_BUY_CLIP_SIZE, 16 | WI_GUN_CLIP_SIZE, 17 | WI_MAX_ROUNDS, 18 | WI_AMMO_TYPE, 19 | WI_AMMO_NAME, 20 | WI_NAME, 21 | WI_SLOT, 22 | }; 23 | 24 | void RegisterNatives_Misc(); 25 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_rechecker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "queryfile_handler.h" 4 | 5 | void RegisterNatives_Rechecker(); 6 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_reunion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define MAX_STEAMIDSALTLEN 64 4 | 5 | void RegisterNatives_Reunion(); 6 | -------------------------------------------------------------------------------- /reapi/src/natives/natives_vtc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void RegisterNatives_VTC(); 4 | -------------------------------------------------------------------------------- /reapi/src/platform.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #undef DLLEXPORT 4 | #ifdef _WIN32 5 | #define DLLEXPORT __declspec(dllexport) 6 | #define NOINLINE __declspec(noinline) 7 | #define snprintf _snprintf 8 | #else 9 | #define DLLEXPORT __attribute__((visibility("default"))) 10 | #define NOINLINE __attribute__((noinline)) 11 | #define WINAPI /* */ 12 | #endif 13 | 14 | #ifndef _MSC_VER 15 | #define likely(x) __builtin_expect(!!(x), 1) 16 | #define unlikely(x) __builtin_expect(!!(x), 0) 17 | #else 18 | #define likely(x) (x) 19 | #define unlikely(x) (x) 20 | #endif 21 | -------------------------------------------------------------------------------- /reapi/src/precompiled.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | -------------------------------------------------------------------------------- /reapi/src/precompiled.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // C 4 | #include // for strncpy(), etc 5 | #include 6 | #include 7 | #include 8 | 9 | // C++ 10 | #include // std::vector 11 | #include // std::list 12 | 13 | // platform defs 14 | #include "platform.h" 15 | 16 | // cssdk 17 | #include 18 | #include 19 | 20 | // rewrite on own custom preprocessor definitions INDEXENT and ENTINDEX from cbase.h 21 | #include "type_conversion.h" 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | // metamod SDK 28 | #include 29 | 30 | // regamedll API 31 | #include 32 | #include "mod_regamedll_api.h" 33 | #include 34 | #include 35 | 36 | // rehlds API 37 | #include 38 | #include "mod_rehlds_api.h" 39 | 40 | // VTC API 41 | #include 42 | #include "mod_vtc_api.h" 43 | 44 | // Reunion API 45 | #include 46 | #include "mod_reunion_api.h" 47 | 48 | // rechecker API 49 | #include 50 | #include "mod_rechecker_api.h" 51 | 52 | // AmxModX API 53 | #include "amxxmodule.h" 54 | 55 | #include "info.h" 56 | #include "com_client.h" 57 | 58 | // reapi main 59 | #include "main.h" 60 | #include "api_config.h" 61 | #include "hook_manager.h" 62 | #include "hook_message_manager.h" 63 | #include "hook_callback.h" 64 | #include "entity_callback_dispatcher.h" 65 | #include "member_list.h" 66 | 67 | // natives 68 | #include "natives_hookchains.h" 69 | #include "natives_hookmessage.h" 70 | #include "natives_members.h" 71 | #include "natives_misc.h" 72 | #include "natives_common.h" 73 | #include "natives_helper.h" 74 | 75 | // addons 76 | #include "natives_vtc.h" 77 | #include "natives_reunion.h" 78 | #include "natives_rechecker.h" 79 | 80 | #include "reapi_utils.h" 81 | -------------------------------------------------------------------------------- /reapi/src/sdk_util.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | 3 | void NORETURN UTIL_SysError(const char *fmt, ...) 4 | { 5 | va_list argptr; 6 | char string[8192]; 7 | 8 | va_start(argptr, fmt); 9 | vsnprintf(string, sizeof(string), fmt, argptr); 10 | va_end(argptr); 11 | 12 | printf("%s\n", string); 13 | 14 | //TerminateProcess(GetCurrentProcess(), 1); 15 | 16 | volatile int *null = 0; 17 | *null = 0; 18 | exit(-1); 19 | } 20 | 21 | char *UTIL_VarArgs(char *format, ...) 22 | { 23 | va_list argptr; 24 | static char string[1024]; 25 | 26 | va_start(argptr, format); 27 | vsprintf(string, format, argptr); 28 | va_end(argptr); 29 | 30 | return string; 31 | } 32 | 33 | void UTIL_LogPrintf(const char *fmt, ...) 34 | { 35 | va_list argptr; 36 | char string[1024]; 37 | 38 | va_start(argptr, fmt); 39 | vsprintf(string, fmt, argptr); 40 | va_end(argptr); 41 | 42 | ALERT(at_logged, "%s", string); 43 | } 44 | 45 | void UTIL_ServerPrint(const char *fmt, ...) 46 | { 47 | va_list argptr; 48 | char string[1024]; 49 | 50 | va_start(argptr, fmt); 51 | vsprintf(string, fmt, argptr); 52 | va_end(argptr); 53 | 54 | SERVER_PRINT(string); 55 | } 56 | -------------------------------------------------------------------------------- /reapi/version/glibc_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | main() 4 | { 5 | files=($@) 6 | 7 | declare -A threshold_version 8 | threshold_version[CXXABI]="1.3.5" 9 | threshold_version[GLIBCXX]="3.4.15" 10 | threshold_version[GLIBC]="2.11" 11 | 12 | for k in "${!threshold_version[@]}"; do 13 | for f in "${files[@]}" 14 | do 15 | : 16 | version=$(readelf -sV $f | sed -n 's/.*@'$k'_//p' | sort -u -V | tail -1 | cut -d ' ' -f 1) 17 | 18 | # version no present - skipped 19 | if [[ -z "$version" ]]; then 20 | version="UND" 21 | # version is private - skipped 22 | elif [ "$version" = "PRIVATE" ]; then 23 | version="PRV" 24 | # ensure numeric 25 | elif [[ $version =~ ^([0-9]+\.){0,2}(\*|[0-9]+)$ ]]; then 26 | check_version_greater $version ${threshold_version[$k]} 27 | if [[ $? -eq 1 ]]; then 28 | echo -e "\033[0;31mAssertion failed:\033[0m Binary \033[0;32m${f}\033[0m has ${k}_\033[0;33m$version\033[0m greater than max version ${k}_\033[0;33m${threshold_version[$k]}\033[0m" 29 | exit -1 30 | fi 31 | fi 32 | done 33 | 34 | if [[ "$version" = "PRV" || "$version" = "UND" ]]; then 35 | echo -e "[\033[0;90mSKIP\033[0m] \033[0;33m${version}\033[0m < ${k}_\033[0;33m${threshold_version[$k]}\033[0m" 36 | else 37 | echo -e "[\033[0;32mOK\033[0m] \033[0;33m${version}\033[0m < ${k}_\033[0;33m${threshold_version[$k]}\033[0m" 38 | fi 39 | done 40 | } 41 | 42 | check_version_greater() 43 | { 44 | if [[ -z "$1" || $1 == $2 ]]; then 45 | return 0 46 | fi 47 | 48 | local IFS=. 49 | local i ver1=($1) ver2=($2) 50 | 51 | # fill empty fields in ver1 with zeros 52 | for ((i = ${#ver1[@]}; i < ${#ver2[@]}; i++)) 53 | do 54 | ver1[i]=0 55 | done 56 | 57 | for ((i = 0; i < ${#ver1[@]}; i++)) 58 | do 59 | if [[ -z ${ver2[i]} ]] 60 | then 61 | # fill empty fields in ver2 with zeros 62 | ver2[i]=0 63 | fi 64 | 65 | if ((10#${ver1[i]} > 10#${ver2[i]})) 66 | then 67 | return 1 68 | fi 69 | 70 | if ((10#${ver1[i]} < 10#${ver2[i]})) 71 | then 72 | break 73 | fi 74 | done 75 | 76 | return 0 77 | } 78 | 79 | # Initialize 80 | main $* 81 | 82 | # Exit normally 83 | exit 0 84 | -------------------------------------------------------------------------------- /reapi/version/msvc/version.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /reapi/version/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version declaration dependency file 3 | * 4 | */ 5 | 6 | #pragma once 7 | 8 | #define VERSION_MAJOR 5 9 | #define VERSION_MINOR 29 10 | #define VERSION_MAINTENANCE 0 11 | -------------------------------------------------------------------------------- /version_script.lds: -------------------------------------------------------------------------------- 1 | REAPI_ABI_1.0 { 2 | global: 3 | *; 4 | local: 5 | _Zn*; 6 | _Zd*; 7 | 8 | extern "C++" { 9 | regfunc::*; 10 | *lambda*; 11 | _callVoidForward*; 12 | _callForward*; 13 | *std::*; 14 | *__cxxabi*::*; 15 | *__gnu_cxx::*; 16 | __cxa_*; 17 | _txnal_*; 18 | __dynamic_cast; 19 | __gxx_personality_*; 20 | __gcclibcxx_demangle_callback; 21 | *_libm_*; 22 | *_intel_*; 23 | }; 24 | }; 25 | --------------------------------------------------------------------------------