* 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
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.
* 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
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.
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
* 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>
When lookup of a more specialized entry in the maplists.cfg failed, it wouldn't fallback to the "default" section, but just try to parse the same section again.
* Change lookup strategy for SQL_CheckConfig
* Ensure db conf lookup failures default to ..default
* Revert "Ensure db conf lookup failures default to ..default"
This reverts commit 03dc703daeeeadaa134e2160bf2c7cd812402758.