Commit Graph

504 Commits

Author SHA1 Message Date
David Anderson
6928d21bcf Fix crash in FrameIterator. 2021-07-16 18:33:10 -07:00
nosoop
387b85406e
logic: Add ability to skip mprotect with StoreToAddress (#1523)
* Implement StoreToAddress param to optionally set memory page permissions

* Update comment
2021-07-10 12:45:00 -07:00
Asher Baker
82c51dbe75
Fix sm_dump_admcache with command group overrides (#1519) 2021-07-01 22:19:50 +01:00
Vladimir
f603b7aec3
Add StringToInt64() and Int64ToString() natives (#1511) 2021-06-28 21:51:49 +01:00
nosoop
d01c72f79b
Update CGameConfig members to use std::string instead of fixed-size char arrays (#1495) 2021-06-03 11:27:16 -05:00
Vladimir
8f73e5e5a1 Update PluginSys.cpp 2021-05-24 14:30:16 -07:00
Vladimir
62142197c1 Add OnNotifyPluginUnloaded forward 2021-05-24 14:30:16 -07:00
Vladimir
ff43e60831 Revert "Add HookPluginUnload() and UnhookPluginUnload() functions"
This reverts commit 2c2d219f3f07d31ba84aa88acfae353c82e75dec.
2021-05-24 14:30:16 -07:00
Vladimir
6b9037790a Revert "Update smn_core.cpp"
This reverts commit ec8b9e1d51b91ca7dd56a4b63bdb732fe944dcee.
2021-05-24 14:30:16 -07:00
Vladimir
babc6abc64 Revert "Update PluginSys.cpp"
This reverts commit dd10098844562112c4b57e97da6b20e4cf4ff30b.
2021-05-24 14:30:16 -07:00
Vladimir
499f7160a4 Update PluginSys.cpp
Fix not passing Plugin Handle
2021-05-24 14:30:16 -07:00
Vladimir
7aca0cc77f Update smn_core.cpp
Fix parameter number
2021-05-24 14:30:16 -07:00
Vladimir
c874703136 Add HookPluginUnload() and UnhookPluginUnload() functions 2021-05-24 14:30:16 -07:00
peace-maker
845c20ad93
Start using Github Actions (#1488)
* Start using Github Actions

Build on windows and linux. Cannot build for macos,
since the builders only support xcode 10+ which dropped
x86 support.

* Build sourcepawn tooling as separate package

Upload build artifacts containing only spcomp and the includes.
This adds a new `--scripting-only` flag to configure.py which skips
everything and goes straight to building spcomp and packaging the
include folder with it.

* Only run the workflows for the master branch

* Split common operations into PackageHelpers file

Don't duplicate the code for packaging releases for the tooling-only packages. Instead use a common `PackageHelpers` class which provides the functionality common to both packages.

This replaces the explicit list of files to package with a directory scan, so we don't have to list them all.

The pgsql sql-init-scripts were missing from the release package before, so they were added here as well. Three scripts from the testsuite were missing from the explicit list (mapdisplayname, floats, findmap), so they're now included.

* Fix Python 2 compatibility

os.scandir is Python 3 only.
2021-05-09 01:46:08 +02:00
Vladimir
e552466886
core: Call SetGlobalTarget in PrintToConsole (#1448)
Issue #1443
2021-03-20 22:24:06 -07:00
Corey D
65043baf5d
gamedata: Add support for hexadecimal offsets (#1426)
* Allow hexadecimal and octal offsets

* Fix typo

* Allow hexadecimal input in Addresses "read" and "offset" values

Co-authored-by: Peace-Maker <peace-maker@wcfan.de>
2021-03-15 12:46:04 -07:00
Peace-Maker
3c30f7b971 Fix crash when creating threads with Thread_AutoRelease
Setting the Thread_AutoRelease flag (default when using IThreader::MakeThread) caused a use-after-free after running the thread body.
2021-03-11 09:48:39 +01:00
BotoX
1a11d92fd9
core: Add client id to MultiTargetFilter forward (#1070)
* Added client id to MultiTargetFilter forward.

* Add CapabilityProvider for MultiTargetFilter client param
2021-03-08 10:04:11 -08:00
peace-maker
6ea1e39ee4
core/sm: Harden plugin loading path requirements (#1437)
* Harden plugin loading path requirements

Restrict loading of plugins to the `sourcemod/plugins` folder and require the `.smx` file extension.

Symlinks inside the `plugins` folder are fine.

This behavior was abused as part of justCTF 2020 in the PainterHell challenge by cypis. Thank you!

* Restrict extension loading to extensions folder

* Add NULL file extension check in LoadExtension

hi @KyleS
2021-03-07 14:33:33 -08:00
Deathreus
f9633a5f6f
Universalize a single call to srand() on map init (#1422) 2021-03-07 04:54:27 -08:00
Peace-Maker
ba8753836e Cleanly remove all hooks on extension unload
Allows to e.g. reload sdktools during runtime without crashing. Useful for fast development cycles.
2020-12-16 15:52:48 +01:00
Einyux
a191a907e9
Add new trie native: ContainsKey() (#1390) 2020-11-30 20:51:47 -08:00
Asher Baker
6a4364d404
Update credits (#1367) 2020-10-16 21:41:21 +01:00
David Anderson
e0d9dfb68e
sourcepawn: uplift FakeNative to DynamicNative. (#1338)
This removes calls to CreateFakeNative.
2020-10-02 16:42:31 -07:00
Scags
589d6df75d
gamedata: implement GetMemSig (#1345) 2020-10-02 16:40:13 -07:00
Scags
6fd9d1ce11
gamedata: automate reparsing on load (#1348)
* Add sm_reload_gamedata

* Remove redundant cast

* Automate gamedata reparsing

* Update GameConfigs.cpp

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-10-02 16:25:27 -07:00
Headline
ef36604666
datapack: remove legacy cache (#1357) 2020-10-02 16:04:30 -07:00
David Anderson
785c6aa1cf Update to AMBuild 2.2.
This is a pretty big diff because SourceMod had lots of multi-arch
workarounds that can now go away. I've also changed 'x64' to 'x86_64' in
many places since this is how AMBuild normalizes it, and it's far too
late to pick the shorter string, so we might as well suck it up.

The --target-archs parameter has been replaced with --targets. It works
the same way.

The default behavior for SDK inclusion is now "present" instead of
"all" since this lowers the burden of storing many SDKs. Official builds
will still be made with --sdks=all.
2020-08-18 23:09:43 -07:00
BotoX
6f21138489
menusys: add MenuShufflePerClient native (#1073)
* Implement per-client randomized menus with MenuShufflePerClient native.

* Add MenuSetClientMapping native.

* fix remaining issues

* fix build issues from rebase

* Update MenuStyle_Base.cpp

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-08-06 20:31:00 -07:00
peace-maker
510bd261f8
core: Add Insurgency support for amd64 Windows (#1295)
* Add basic Insurgency support on Windows x64

This allows SourceMod to load on x64 Insurgency. There are still a lot of variable truncation warnings that have to be dealt with.

* Fix 32bit builds

* Compile MySQL extension as well

The hack for __iob_func being removed from the core runtime, but required by the old mysql we're building against can be simplified a lot due to the `_ReturnAddress` intrinsic available since MSVC 2015.

* Don't include the offset we want to extract in the signature
2020-08-06 19:53:06 -07:00
Headline
5fa25e70ad
trie: implement clone() method (#852)
* Add Clone() for StringMap

* Fix for std::string addition

* trie: broken return key.

* clonetrie: correct handle leakage.

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-07-14 20:11:23 -07:00
Headline
2653a450fc
handlesys: Output allocation timestamp during panic (#1110)
* Track Handle creation time

* Move ConVar operations outside of loop

* We support bee's here

* Catch windows awfulness

* Prevent Character Truncation

* Add timestamp info to memory leak dump

* Remove last line and adjust new leak dump output

* KyleS fixes

* Fixed width output

* Create invalid parameter failure redirection helper

* Fix rebase regression

* Update sm_invalidparamhandler.h

* Update HandleSys.cpp

* Update HandleSys.cpp

* Update HandleSys.cpp

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-07-09 18:21:45 -07:00
Ҝℴţأķ
611bad4036
ArrayStack: add Clone method (#1304)
* Provide ArrayStack.Clone method

* Clean definition for old syntax.

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-07-08 20:59:17 -07:00
Headline
832519ab64
Prevent multiple calls to SDK_OnAllLoaded (#1293) 2020-06-21 23:32:11 -07:00
Headline
4e2806c951
Notify plugin reloads on next frame (#1292) 2020-06-21 23:31:52 -07:00
David Anderson
3b386379dd
Use more STL for vector insertion/removal. (#1284) 2020-06-13 15:57:02 -07:00
David Anderson
80acff8d7d Replace ke::LinkedList with std::list. 2020-05-31 23:19:41 -07:00
David Anderson
5d94f0bea8 Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
David Anderson
979e410efc Update AMTL, replace ke::Deque with std::deque. 2020-05-30 12:44:02 -07:00
David Anderson
b725196a26 Replace AString with std::string. 2020-05-20 17:57:18 -07:00
David Anderson
301bafa3f5 Replace more Move/Forward with STL variants. 2020-05-19 12:56:28 -07:00
David Anderson
7d7253c9cc Update AMTL; replace AutoPtr/UniquePtr with STL. 2020-05-18 18:19:16 -07:00
David Anderson
c2df49ee33 Rename ke::Lambda to ke::Function. 2020-05-17 12:33:52 -07:00
David Anderson
a253e175bb Replace all uses of AMTL threads with STL threads.
This also rewrites the work loop for threaded queries. It has been
simplified significantly.
2020-05-16 22:35:56 -07:00
David Anderson
f76cb94511 Pare down ThreadSupport and remove ancient thread code.
This patch removes almost all of the existing platform-specific
ThreadSupport code, as well as code derived from it. It is now
implemented on top of C++11 threads and is much simpler.

This is the first inclusion of STL in SourceMod. Mac and Windows are
allowed to dynamically link to their respective implementations. On
Linux, libstdc++ is statically linked, except in the cases where it was
already dynamically linked (csgo, blade).

IEventSignal has been retained because sourcemod-curl-extension relies
on it. As written, it is impossible to use as a condition variable,
because the caller does not have access to the underlying mutex. There
is no way to make this API safe or non-racy, so extensions relying on
it should switch to C++11 threads.

ThreadWorker is now pared down and does not interact or inherit from
BaseWorker in any way. Basic functionality has been tested. Since it is
not used anywhere in SourceMod, or seemingly in any repository on
GitHub, it's unclear whether it should even exist. But it has been
tested in this patch.

This change bumps the minimum macOS version to OS X 10.7, and the
minimum C++ standard level to C++14.
2020-05-13 00:35:29 -07:00
Deathreus
13621a1274
Add an array operations to CDataPack (#1219) 2020-05-08 15:23:48 -07:00
peace-maker
5597fc56d3
Fix crash when ArrayList runs out of memory (#1235)
The allocation size was still updated to the bigger size even if memory allocation failed. Trying to write to the supposedly available new space would overflow the heap and crash. Fixes #1233
2020-04-30 17:59:54 +01:00
Andrew
d044b13ce4
datapack: free all elements on clear (#1251)
* Fixed memory leak

When a pack was cleared or destroyed the String and Raw types could cause memory leaks. This happens when "position" is sitting at the end of the vector and can never get past the "if (pos >= elements.length())" statement. This means there is a memory leak in any plugin that clears/destroys a pack with strings and doesn't set the position to length-1 or less beforehand.

* datapack: Fix delete op on CDataPackType::Raw.

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-04-27 18:09:13 -07:00
Kruzya
8746b2fd7f Adjust CanAdminTarget to support multiple Group Immunity IDs (#1147) 2019-12-23 10:45:36 -08:00
David Anderson
d6e518838f
Merge pull request #1053 from nosoop/remote-ext-filename-check
Check short name for remote extensions
2019-11-12 11:45:02 +09:00