Commit Graph

937 Commits

Author SHA1 Message Date
Lxeon
092ea91f0d fix geoip chi not return chinese translation (#2335)
Some checks failed
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang, clang++, ubuntu-latest, linux) (push) Has been cancelled
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang-14, clang++-14, ubuntu-22.04, linux) (push) Has been cancelled
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (msvc, windows-latest, win) (push) Has been cancelled
hl2sdk-mock tests / mock (push) Has been cancelled
SourcePawn scripting / build (ubuntu-latest, linux) (push) Has been cancelled
SourcePawn scripting / build (windows-latest, win) (push) Has been cancelled
* fix geoip chi and zho not return chinese translation

* optimize code logic: chi and zho as the final return

* code optimization

(cherry picked from commit 5c1a5e35b9)
2025-10-03 16:17:24 -04:00
FlaminSarge
8b476330ed Add TFHoliday_Summer (#2350)
Valve has updated this holiday this year to use 2025 dates (2025-07-16 to 2025-09-16) so semi-relevant to add

(cherry picked from commit 512e7c37c1)
2025-10-03 16:17:07 -04:00
Benoist
fc4d88f7db Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268)
* Initial attempt at compiling against tf2_sdk2013

* compilation fix for css

* Switch to AMTL platform arch defines

* Add CBasePlayer forward decl for dods and hl2dm as well

* Update hl2sdk-manifests

* Add dods to CI

* Actually include am-platform.h

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
Co-authored-by: Nicholas Hastings <nshastings@gmail.com>
(cherry picked from commit 2382453d50)
2025-02-19 22:03:08 -05:00
Benoist
b4cb8789fa Fix dhooks regression (#2249)
Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
(cherry picked from commit f6737a4760)
2025-02-17 15:36:44 -05:00
MrD4rk5oul
e3ce2692ee Correction for sourcemod use the new teleportation check gamedata registry from now on. (#2235)
* - Fixes for OnPlayerTeleport hook for linux and linux64 systems
  - Changed signature call of `CanPlayerTeleport` for linux/linux64 to current used name
  - Applied fix at detour class CanPlayerBeTeleported to use standard parameter proceedings for linux

* Created a new registry for Teleportation Checking, marking the old one obsolete for older Sourcemod versions.

* Correction for sourcemod use the correct registry from now on.

(cherry picked from commit 3cd6ce9bb0)
2024-12-31 09:43:07 -05:00
MrD4rk5oul
8489e2e65a Fixes for OnPlayerTeleport hook for linux and linux64 systems (#2234)
* - Fixes for OnPlayerTeleport hook for linux and linux64 systems
  - Changed signature call of `CanPlayerTeleport` for linux/linux64 to current used name
  - Applied fix at detour class CanPlayerBeTeleported to use standard parameter proceedings for linux

* Created a new registry for Teleportation Checking, marking the old one obsolete for older Sourcemod versions.

(cherry picked from commit 52211de8e9)
2024-12-31 09:42:59 -05:00
Nicholas Hastings
db8bb68be6 Revert "- Fixes for OnPlayerTeleport hook for linux and linux64 systems (#2214)"
This reverts commit e015172bf9.
2024-11-02 21:50:38 -04:00
MrD4rk5oul
e015172bf9 - Fixes for OnPlayerTeleport hook for linux and linux64 systems (#2214)
- Changed signature call of `CanPlayerTeleport` for linux/linux64 to current used name
  - Applied fix at detour class CanPlayerBeTeleported to use standard parameter proceedings for linux

(cherry picked from commit 29bff12b23)
2024-11-02 11:41:19 -04:00
Benoist
6b6dbc6c06
Dhooks safetyhook (#2205)
* remove libudis86

* switch to safetyhook

* Don't leak memory

* fix issue with the trampoline

* Add x86_64 detour support (windows)

* Allow to differentiate platforms

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
2024-10-20 16:45:19 +00:00
Benoist
4e15a92984
Add x64 Windows support to DHooks (#2154)
* Add x64 Windows support

* undo changes of hook.cpp

* undo changes of hook.h

* undo changes of extension.cpp

* undo changes of listeners.cpp

* undo changes of signatures.cpp

* fix dhooks on x86

* Fix-up dhooks buildscript

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
2024-09-10 23:26:30 +00:00
bottiger1
5edfa79543
Fix more sdktools crash on 64 bits (#2152)
* fix sdktools crash on 64 bits

* remove other 32bit-isms from sdktools

* Swap sizeof(intptr_t) for sizeof(void *)

---------

Co-authored-by: Nick Hastings <nshastings@gmail.com>
2024-06-09 17:17:29 +00:00
Benoist
7df2f8e045
Reconcile the concept of Edict & Networkable across the codebase (#1903)
* Reconcile the concept of Edict & Networkable across the codebase

* There's no need to check this, it's done elsewhere. Also could be null (segfault)

* This was never needed

* Pseudo review changes

Re-added removed null checks, and added new ones.

Changed the error messages in Get/SetProp natives to better reflect reality.

* Don't change the behaviour of GetEntityNetClass

* Overload IGameHelpers::FindServerClass

* Make error messages more accurate

* Fix a dev comment

* Rename FindServerClass

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
2024-06-01 14:07:55 +00:00
1mpulse
9f3584a056
fix VDECODE_FLAG_ALLOWNOTINGAME flag (#2000)
Corrects the check for the VDECODE_FLAG_ALLOWNOTINGAME flag
2024-06-01 13:57:07 +00:00
Benoist
e07c120cab
CDetour safetyhook (#2162)
* Add safetyhook, remove libudis86

Co-authored-by: bottiger1 <55270538+bottiger1@users.noreply.github.com>

* Add modified CDetour

Co-authored-by: bottiger1 <55270538+bottiger1@users.noreply.github.com>

* Add CDetour [Safetyhook] to build script

* Re-enable loader/core/corelogic, and fix new C++20 error

* Reenable all extensions (except dhooks)

* Make cstrike compile against new CDetour

* Remove unused variable in sdktools output?

* Make sdktools compile against new cdetour

* Downgrade to C++17

* remove auto

* fix compilation on linux

* Re-enable dhooks

* Re-authorise old compilers

* Fix invalid downgrade of std::optional

* readd libudis86 for dhooks only

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
Co-authored-by: bottiger1 <55270538+bottiger1@users.noreply.github.com>
2024-05-21 01:53:44 +00:00
Kaela
e3734803f0
sdkhooks: retain vtable hook until level end (#2094)
* Band-aid for Bulk SDKHooks performance impact on linux

Platform specific changes.

* Oops forgot about header

* Simplified/improved LevelShutdown code
2024-05-18 12:30:20 +01:00
Kit o' Rifty
f08f1ef0d6
Fix passing variant_t parameters + fix codegen stack on Win64 (#2117)
* Fix 64-bit JIT not allocating stack space for params on stack
Fix wrong cond check for passing objects by value

* Fix wrong FireOutput detour proto on win64
2024-05-05 21:17:59 +00:00
bottiger1
5cb2d68fd7
AcceptEntityInput 64bit fix (#2149)
* Fix AcceptEntityInput on 64 bit by using struct from SDK instead of pointer math.

* Fix from Malifox. Not sure what it does but it is supposedly related to the AcceptEntityInput crash.

* Fix episode1 and darkm sdk paths
2024-05-05 20:06:06 +00:00
Alienmario
7d78c141e7
Fix SDKHooks IEntityListener (#2138) 2024-04-21 19:21:47 +00:00
Peak
06dcb991e8
Allow topmenu config file to sort with subcategories (#1757) 2024-02-18 11:46:48 +01:00
Nicholas Hastings
b42e5ac922
Convert AMBuild scripts to use hl2sdk-manifests (#2096)
* Add hl2sdk-manifests submodule

* Update AMBuild scripts to utilize hl2sdk-manifests

* Add build*/ to .gitignore
2023-12-18 23:15:44 +00:00
David Anderson
060c832f89 Update SourcePawn.
This brings in a few breaking changes.

One, INVALID_FUNCTION is now 0 instead of -1. This is long overdue.
Plugins should transparently work except in two cases:

  1. Third-party extensions that have a hardcoded test for -1 will no
     longer work. A new API has been provided for this,
     GetFunctionByIdOrNull.
  2. If a plugin "framework" uses INVALID_FUNCTION anywhere in its
     exported API, then all plugins using that framework need to be
     recompiled together, so they agree on the value of
     INVALID_FUNCTION.

Hopefully the damage here is minimal. The core plugin version has been
bumped to 7 to try and limit conflicts.

Second, braceless functions are no longer supported. There wasn't really
any way around this and it's better to bite the bullet now. This affects
source compatibility, but not binary compatibility.

Third, the "using" keyword is no longer implemented. SourceMod now has a
Handle methodmap again. Plugins compiled against this new methodmap will
require a "Handle.~Handle" native, which 1.12 now provides.
2023-11-02 18:38:30 -10:00
David Anderson
ae4e043c3e Enable C++17. 2023-10-21 19:02:51 -04:00
hydrogen-mvm
a20eb08dc6
Fix replay workaround not triggering (#2033) 2023-07-29 20:53:17 +00:00
bottiger1
5f827089d3
Fix mismatched memory release in regex clearmatch (#2005)
subject is created with strdup which should be freed with C free and not C++ delete
2023-06-12 22:34:57 +02:00
Vauff
2e1235a585
A2S_Rules fix: Move MTU patch value to gamedata (#1829)
* A2S_Rules fix: Move MTU patch value to gamedata and increase it

* Revert MTU value back to 5k
2023-04-19 15:28:40 +00:00
Forgetest
8e0039aaec
[DHooks] Fix NaN return when superceding pre-detour (#1967)
* Update hook.cpp

* Update hook.cpp
2023-03-31 18:19:04 +02:00
Michael
a28c3cac9b
cstrike.csgo: Add native to retrieve loadout slot of weapon (#1241)
* Add native to retrieve loadout slot of weapon

* Mention the native is for CS:GO only

---------

Co-authored-by: Peace-Maker <peace-maker@wcfan.de>
2023-03-29 21:27:45 -07:00
Corey D
c5087d7a39
database: flip to recursive_mutex to allow nested locks (#1937)
* Fix crash from db locking

* Change db lock to use recursive_mutex
2023-03-29 20:03:03 -07:00
sappho
178658912e
fix mismatched delete [] in regex extension (#1941)
* fix mismatched delete []

* strdup needs to be free'd, not deleted
2023-03-27 15:50:31 +02:00
Nicholas Hastings
6bd49ff415
Protect against server crash when DHooks cannot load from SDKHooks not being loaded. (#1930) 2023-02-09 00:10:14 +00:00
Nicholas Hastings
cd6886319c
Fix crash with IgniteEntity on MCV (#1924)
* Fix crash with IgniteEntity on MCV.

* Formatting.
2023-02-04 16:09:46 +00:00
rtldg
d57d7e7401
Enable math functions in sqlite (#1886) 2023-01-29 17:30:15 +00:00
Nick Hastings
d5a26adc49 Regression fix for CS:GO GivePlayerItem.
Regressed in https://github.com/alliedmodders/sourcemod/pull/1887
2023-01-20 10:09:22 -05:00
Nicholas Hastings
8922ed0c5d
Add TE_WriteEnt and TE_ReadEnt natives to SDKTools. (#1905) 2023-01-14 14:48:05 +00:00
Rain
51bba0b894
Fix incorrect behaviour in SDKHooks_DropWeapon's "bypassHooks" parameter (#1877) 2022-12-27 19:31:02 +00:00
Nicholas Hastings
775d4f04f2
Add missing set of CBaseEntity::Teleport param on newer games (#1894)
* Add setting of missing CBaseEntity::Teleport param on newer games

* Rearrange SOURCE_ENGINE defines of games between Portal 2 and CS:GO.
2022-12-27 19:29:22 +00:00
peace-maker
4320d7b17a
Get sdktools and sdkhooks/dhooks to load on hl2sdk-mock (#1892)
* Build SDKTools for hl2sdk-mock

* Fix loading of extensions using advanced naming scheme for hl2sdk-mock

* Fix error on missing sv_visiblemaxplayers convar

* Build SDKHooks for hl2sdk-mock

* Fix x86_64 SourcePawn VM filename

* SDKHooks: Ignore missing IEntityListeners list in hl2sdk-mock
2022-12-22 18:39:12 +01:00
TrueProfesional
174bf307a2
Add weapon_bayonet to the list of blocked knives (#1758) 2022-12-20 22:17:22 +00:00
Nicholas Hastings
b77e8c50ac
Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
peace-maker
aab8c6ac9f
Fix SDKHook_[Use|Spawn|GetMaxHealth] callback result value handling (#1872)
* Fix SDKHook_Use callback result handling

The returned result of the last callback in the list was used instead
of the highest value. This differs from the behavior of the other hooks.

* Fix SDKHook_Spawn callback result handling

The returned result of the last callback in the list was used instead
of the highest value. This differs from the behavior of the other hooks.

* Fix SDKHook_GetMaxHealth callback result handling

The returned result of the last callback in the list was used instead
of the highest value. This differs from the behavior of the other hooks.
The returned health is only changed if no other plugin wants to block the callback.
2022-12-04 12:12:42 +01:00
vanz666
8538233985
Expose custom sdktools trace types from hl2sdk (#1822)
* Update trnatives.cpp

* Update sdktools_trace.inc

* Update trnatives.cpp
2022-12-02 14:11:05 +01:00
Maxim Telezhenko
764e38a58f
Fix DHooks jit code stack memory alignment (#1849) 2022-10-26 20:41:40 +02:00
Spirrwell
e34e9b9869
Split PVKII into its own engine branch (#1847)
* Initial PVKII branch support

* Change PVKII code to 23, DOTA uses 22 in MM

* Bunch more SE_PVKII preprocessor that was missed

* Add some missing SOURCE_ENGINE_PVKII cases

* Update PVKII FireOutput signature for Linux

* Update checkout-deps with 'pvkii'

* Fix FireOutput signature for PVKII, accidentally used one from newer build

* Change PVKII code to 10, and bump others by 1

* Only check against SE_SDK2013 here, like Metamod

* More SE_PVKII preprocessor cleanup
2022-10-24 19:27:32 +00:00
Accelerator
e5ebd65176
Exposed SDKCall_Engine call type to use CVEngineServer methods (#1648)
* Update vdecoder.h

* Update vcaller.cpp

* Update sdktools.inc
2022-07-26 22:14:49 +02:00
42
625c7a98f2
Fix support for SDKCall returning non-networked entity (#1797) 2022-07-08 14:33:43 +00:00
Mikusch
278998f7d0
SDKTools: Add explode parameter to ForcePlayerSuicide native (#1782)
* Expose CommitSuicide params

* A single space

* Validate param count

* Set force param to true by default
2022-07-07 14:14:50 +02:00
peace-maker
5e3a189642
Log a notice if the geoip database gets too old (#1791)
Since we ship an ancient version of the database, help server operators keep track of the database version.
2022-06-30 08:22:51 +02:00
peace-maker
7b89f5fab3
Update SQLite library to 3.38.5 (#1792)
Bring in the changes of the last four years of SQLite development.

Fixes #1728
Fixes #1592
2022-06-30 08:22:28 +02:00
peace-maker
9121472061 DHooks: Error on argument passflags for detours (#1773)
The passflags are only supported by SourceHook for virtual hooks and are ignored for detours with DynamicDetours. This caused confusion, so throw an error when trying to set e.g. the DHookPass_ByRef flag on detour arguments.
2022-06-24 10:00:02 -04:00
peace-maker
54fd778830 DHooks: Fix changing of byref vector parameters (#1772)
We always created a new vector object instead of changing the passed in vector directly. This works for the function being called using our changed values - but the caller doesn't see the changed values if it's passing a vector by reference.

Only create a new vector if there isn't one being passed in and set the values directly in the passed in vector otherwise.
2022-06-24 10:00:01 -04:00