Commit Graph

1402 Commits

Author SHA1 Message Date
Malifox
ec7aadc431
Fix crash when selecting a vote item that contains a format specifier (#2323)
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
Co-authored-by: Malifox <78408070+Maliwolf@users.noreply.github.com>
2025-05-30 00:10:51 -07:00
caxanga334
f7e51b6110
Fix NULL Crash on ReferenceToIndex (#2311)
Some checks are pending
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang, clang++, ubuntu-latest, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang-14, clang++-14, ubuntu-22.04, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (msvc, windows-latest, win) (push) Waiting to run
hl2sdk-mock tests / mock (push) Waiting to run
2025-04-25 17:52:44 +00:00
Corey D
a35e22c76e
Add extension methods for clearing netprop & datamaps cache (#1943)
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-8, clang++-8, ubuntu-20.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
2025-04-07 15:26:09 +02:00
Nicholas Hastings
30da01763d
Fix ClientPrefs pointer string formatting (#2307)
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-8, clang++-8, ubuntu-20.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 pointer to string marshaling in ClientPrefs for x64

* Fix other cases where pointers were formatted with %x

* Fix warnings in ClientPrefs IsAuthIdConnected
2025-03-31 21:21:54 +00:00
Benoist
2382453d50
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>
2025-02-20 00:51:38 +00:00
Nicholas Hastings
6cd5bf87d8
Fix regression in DescribePlayer (%N / %L) for players not yet having entities (#2260)
* Define a constant for ENTREF_MASK

* Fix regression in DescribePlayer for players that don't yet have entities
2025-02-13 23:04:38 +00:00
Malifox
25faf18760
Make finding the sv_lan ConVar a static operation (#2258)
Co-authored-by: Malifox <78408070+Maliwolf@users.noreply.github.com>
2025-02-10 15:47:11 +00:00
F1F88
b5e077c6f7
Fix formatting error when left-aligned and width is less than the number of characters (#2221) (#2255) 2025-02-04 01:37:31 +00:00
Headline
9a03d1227f
Attempt reparse on stat failures and return BAD_HANDLE on error (#2253) 2025-01-30 21:10:31 -08:00
Nicholas Hastings
24679be81a
fix: Allow entity references for clients with L and N format specifiers (#2244) 2025-01-16 00:57:46 +00:00
peace-maker
a8c91db585
Add "EnableLineDebugging" core.cfg option (#2240)
Allow extensions to register a debug break handler in the SourcePawn VM.

Enable line debugging support in the VM before any plugin is loaded through a core.cfg option.
2025-01-07 00:38:55 +01:00
A1m`
a44cfe134a
Allow sending panels to SourceTV client via settings (#2239)
* Allow sending panels to SourceTV client via settings

* Revert "Allow sending panels to SourceTV client via settings"

This reverts commit 93bb5ebda0.

* Allow menu to be sent to sourcetv client

* Remove IsFakeClient check

Let the plugin decide who to send the menu to
2024-12-30 20:16:25 +00:00
Kit o' Rifty
34e9605519
Add IntMap methodmap (#2018)
* Add new IntHashMap and IntMap natives

This is a continuation of #579.

[HashMap] Adds new IntHashMap and IntMap natives.

This patch makes the following changes
  * Refactors StringHashMap to a generic HashMap template
  * Adds the IntHashMap class
  * Adds new IntMap natives
  * Adds IntMap tests to the tries test suite

[HashMap] Reverted rename of CharsAndLength

[HashMap] Use more descriptive template names

[HashMap] Removed old-style natives

[HashMap] Removed IntHash class

[HashMap] Reverted some search & replace errors

Co-authored-by: Geoffrey McRae <geoff@hostfission.com>

* Fix spelling mistake + include

* Fix tries test

* Update tests with clone + ContainsKey

---------

Co-authored-by: Geoffrey McRae <geoff@hostfission.com>
Co-authored-by: Nicholas Hastings <nshastings@gmail.com>
2024-10-31 23:35:41 +00:00
Nick Hastings
80dfa1cc77 Add Clone to Handle methodmap 2024-10-19 13:20:20 -04:00
Nick Hastings
4cc214e1a6 Revert "Merge branch '👺'"
This reverts commit b7feeef350, reversing
changes made to b18c8cbfd6.
2024-07-27 10:17:57 -04:00
Nick Hastings
b7feeef350 Merge branch '👺' 2024-07-27 01:01:49 -04:00
bottiger1
b6d98c762c
fix parsing crash (#2173) 2024-06-09 17:13:32 +00:00
Benoist
11d3cf94f7
Add GetFilePermissions (#2177)
Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
2024-06-08 14:17:50 +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
Benoist
4e73713fab
Fix rare crash with logs (#2161)
* Fix rare crash with logs

* Nullcheck instead

* Update smn_filesystem.cpp

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
2024-05-24 13:10:24 +02: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
ojlanders
e60c672485
Add OnServerHibernationUpdate forward (closes #1483) (#2151)
* Add OnServerHibernationUpdate forward (closes #1483)

* Clarify hibernation state

* make it 2 forwards instead of 1

---------

Co-authored-by: Odin Landers <ojl9576@rit.edu>
2024-05-07 01:44:56 +00:00
rtldg
908ffdb523
make RenameFile() on Windows also replace the file (#2060)
* make RenameFile() on Windows also replace the file

* Add MOVEFILE_COPY_ALLOWED to MoveFileExA
2024-05-05 22:20:46 +00:00
Adrian-Stefan Mares
343f64f6b7
Fix IsClientSourceTV in L4D2 with a custom tv_name (#2143) 2024-04-29 00:17:10 +01:00
Oliver John Hitchcock
f9ad35badf
Stop EntRefToEntIndex returning garbage if a bad parameter is passed (#1323)
* Stop EntRefToEntIndex returning garbage if a bad parameter is passed

Seen multiple bad usage of this function that works only because whatever was passed in was returned as it wasnt an entity reference.
This code should have worked and would be expected to have returned something invalid but instead the the input was returned which allowed the code to work when really it is bad code.
See for one such case https://discordapp.com/channels/335290997317697536/335290997317697536/736518488314871868

* Update documentation of EntRefToEntIndex

Added the error text saying what shall be returned when a invalid parameter is passed.

* Validate entity index instead of just returning INVALID_EHANDLE_INDEX

Not sure if it needs this much validation but this just mirrors how IsValidEntity works, so the entity index returned should be valid else INVALID_EHANDLE_INDEX is returned.

* EntRefToEntIndex improve doc comments to better represent functionality

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2024-04-25 23:19:04 +00:00
Adrian-Stefan Mares
af93d819c6
Handle INVALID_FUNCTION mismatches at plugin boundaries, redux (#2136) 2024-04-19 21:56:48 -04:00
ojlanders
6cac489fce
Prevent recursion in sm_ServerCommandEx (fixes #967) (#2133)
* Prevent recursion in sm_ServerCommandEx (fixes #967)

* Update core/smn_console.cpp to fix style

Co-authored-by: Erin <asherkin@limetech.io>

---------

Co-authored-by: Odin Landers <ojl9576@rit.edu>
Co-authored-by: Erin <asherkin@limetech.io>
2024-04-18 11:42:37 +00:00
Peak
5c507cc35c
Implement File.Size (#2131)
* Implement file size method for already open files

* Switch from fseek/ftell to fileno/fstat size reading
2024-04-13 18:14:52 +00:00
CookieCat
8dcbe14ea0
Throw an error when attempting to remove worldspawn in RemoveEntity/RemoveEdict (#2104)
* Check for worldspawn in RemoveEntity and RemoveEdict

* A little more info
2024-02-20 16:14:00 +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
Nick Hastings
d981e252d2 Fix regression that breaks loading on mcv, blade, and csgo (fixes #2082) 2023-11-20 09:23:02 -05:00
Nick Hastings
e6a04abc9e Remove unused var 2023-11-20 09:21:00 -05:00
David Anderson
7bfd5e521e Update SourcePawn.
This updates float.inc and smn_float.cpp to compensate for alias
removal.
2023-11-03 17:46:48 -10: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
XeroX
62754333cd
Increase lastMap buffer (#2062)
Fixes #2061
2023-10-17 12:31:04 +02:00
Mikusch
29694ec13b
Add block parameter to various ArrayList functions (#1656)
* Add block parameter to FindString

* Add block parameter for GetString & GetArray

* Fix buffer overflow issues

* Fix wrong return

* Add size parameter to SetArrayString
2023-09-27 16:05:43 +02:00
Mikusch
1e8db957bf
Add more functions to ArrayStack (#2019)
* Add more functions to ArrayStack

* Make formatting consistent with other functions

* Don't remove the element for TopArray

* Replace 4 with sizeof(cell_t)
2023-09-27 15:43:04 +02:00
Nick Hastings
4c376cbcb7 Update PLAPI version for NormalSHook signature change (MAXPLAYERS increase) 2023-07-27 08:15:02 -04:00
Corey D
5addaffa56
Add ParseTime (strptime) native (#1697)
* Add GetTimeStamp (strptime) native

* Fix description

* Fix typos

* Fix issues

* Rewrite ParseTime

* Fix docstrings

* Fix ParseTime

* Clarify docs
2023-07-04 13:42:45 +02:00
Erin
f40ae82df4
Clear sm_nextmap so we don't get stuck in a loop (#1545)
* Pure C++ solution

* Pure SourcePawn solution
2023-07-03 20:48:01 +02:00
Corey D
426c1a090f
Fix CommandListener ignoring Plugin_Handled (#1819) 2023-04-19 16:44:34 +02:00
Corey D
50b4ad4e11
Make KeyValues.Rewind traversal-stack clearing optional (#1993) 2023-04-17 13:10:02 +01:00
Corey D
bc6e920213
Improve HasEntProp performance (#1908) 2023-03-29 21:40:30 -07:00
Mikusch
5539484f92
Add support for float modulo operator (#1953) 2023-03-19 16:19:42 +00:00
Nicholas Hastings
30a2160839
Fix gamedata library search order in some cases. (#1914) 2023-01-29 20:24:34 +00:00
Nicholas Hastings
b0799d3336
Move menu sound selection from core config to gamedata. (#1896) 2022-12-29 04:10:51 +00:00
nosoop
2130c60fd9
Implement raw entity handle accessors (#1830)
* Implement raw entity handle accessors

* Fix FromPseudoAddress calls on 64-bit

* fixup: Remove unnecessary ent deref

* fixup: Correct param index in thrown error
2022-12-29 03:57:47 +00:00
Nicholas Hastings
ecb707e38d
Add support for other engine binaries in game configs (#1414). (#1626)
* Add support for other engine binaries in game configs (#1414).

* Add engine bin path for CRC bin lookup and filter out addons from GAMEBIN.

* MAX_PATH -> PLATFORM_MAX_PATH.

* Fix library lookup on Linux.

Before this, there was a bad assumption that, like on Windows, POSIX module
handle pointers were within the module's address space (and thus usable
with dladdr). That's not true!

Instead, to get a usable address on all platforms, we'll do a lookup of the
CreateInterface function that exists in all modules. This also has the
(arguable) benefit of further locking this implementation to modules owned
by the game.

To get a valid address inside the module now on both p
2022-12-28 22:58:30 +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
zer0.k
ef7d3abefd
Add missing null pointer check to protobuf messages (#1883) 2022-12-20 21:50:57 +00:00