Commit Graph

530 Commits

Author SHA1 Message Date
nosoop
6c5a3fdaf2
entitylump: Output separator as spaces instead of tabs (#1873)
On NMRiH and possibly other games that use the Maphacks system,
entries that are modified using that system are rendered with tab
characters stripped out - see CNMRiHMapHackManager::GetEntDataString.

That results in there being no separators at all between keys and
values, as Maphacks receives the serialized string from Entity Lump
Manager.

This commit changes the key / value separator character to use
spaces instead.

This discovery upsets me greatly.

Fixes #1833.
2022-12-05 13:14:54 +01:00
Corey D
5d391fda07
Add SMCParser.ParseString (#1817) 2022-12-02 16:55:08 +01:00
nosoop
34c8220e5d
Ensure gameconfig file uniqueness when reading master.games (#1859)
The extended gameconfig format reads the master gameconf file twice;
once each for the base engine and actual engine.  The file list
isn't checked for duplicates, so 'common.games.txt' is loaded in
twice, resulting in any 'common' file values potentially overriding
values listed under '#default' in other files due to
bShouldBeReadingDefault.  This happens in the case when matching
game versions by CRC (such as public game branches).

Required for #1857.
2022-11-25 16:47:11 +00:00
nosoop
855ece1d3b
entitylump: Fix behavior of append (#1836)
This change ensures that the iterator values used by `std::distance`
is correct.  Having the emplace within leads to the possibility of
`m_Entities.begin()` being invalidated due to reallocations.
2022-09-20 16:24:08 +02:00
Vauff
568da23c96
Allow gamedata to use vscript binary (#1826) 2022-09-20 09:46:03 +02:00
nosoop
21740d9a26
Add functions for working with entity lumps (#1673) 2022-09-05 15:44:58 -07:00
Vladimir
3100e23b87
Add support for gamedata lookups from soundemittersystem library (#1787)
* Add `soundemittersystem` library to game config signatures

* Remove `GAMEBIN` by `soundemittersystem` module load
2022-08-04 16:32:26 +02:00
Corey D
9321229321
Add GetClientOriginalLanguage (#1810)
Creates a native which will return the language the client connected with.
2022-07-28 18:10:51 -07:00
Deathreus
37c2a83523
Add a PluginIterator methodmap (#1779)
* Add a PluginIterator methodmap

* Follow convention

* Update sourcemod.inc

* Turn method ReadPlugin into property Plugin

* Requested change

* Update sourcemod.inc

* Curse you VSC

* Follow behavior of other iterators instead of the natives

* Fix a stray space

* Implement a hacked CPluginIterator

* Oops

Copy paste go brr

* Revert a change made before the custom impl
2022-06-24 11:46:03 +02:00
Headline
c570150318
Lift raw pointers out of DatabaseConfBuilder (#1637)
* Lift raw pointers out of DatabaseConfBuilder

* Maybe: not
2022-05-24 11:41:15 +02:00
James Dickens
9df93b0708
Fix Int64ToString producing incorrect output (#1723) 2022-03-04 03:03:35 -08:00
peace-maker
f7c54e9027
Fix silent error on large ArrayList startsize (#1705)
If there isn't enough memory to resize the ArrayList to the startsize on construction, throw an error instead of ignoring the OOM.

Fixes #1551
2022-01-31 22:07:32 +01:00
Corey D
c471e41dc7
Add ArrayStack.Clear native (#1676) 2022-01-22 03:26:21 -08:00
David Anderson
351ac171d2 Merge branch 'fix-menu-vote-handler' 2021-12-09 18:13:30 -08:00
David Anderson
96c74651db Fix vote menu handler to work with direct arrays. 2021-12-09 18:10:35 -08:00
Adrián
4e4c2a7bb0
menusys: Correct GetMenuExitBackButton returncode (#1646) 2021-11-20 16:52:40 -08:00
peace-maker
1c30b88069
Cache copy of library on first symbol/signature lookup (#1642)
Always perform signature searches on an unaltered copy of the binary. This avoids signature mismatches if the same function is detoured twice and thus the first bytes of the function were replaced by the detour.
2021-11-18 17:55:32 +01:00
David Anderson
31f6c0cb18 Dedent some menu code for readability. 2021-11-17 18:19:40 -08:00
Adrián
18f9d65938
Fix translations getting truncated prematurely (#1640) 2021-11-16 16:09:30 +00:00
Nick Hastings
f229badbfc Fix server binary name for CRC lookups. 2021-11-01 13:04:23 -04:00
Nick Hastings
9a6866d14a Invert CRC to match most popular implementations. 2021-11-01 13:04:23 -04:00
David Anderson
94ff26bdf1
Fix error return of FormatNativeString. (#1613) 2021-10-26 22:31:58 -07:00
David Anderson
2a06680252 Update to the new SourcePawn compiler.
This imports the brand new SourcePawn compiler. The new compiler is much
faster to compile and generates significantly improved code around
array generation and array access.

There are a number of compatibility changes in the new compiler. Most of
these are due to improved type checking and error detection. The full
list of notes can be found here:

https://github.com/alliedmodders/sourcepawn/blob/master/docs/upgrading-1.11.md

Additionally, .smx files generated by the new compiler will NOT load on
earlier versions of SourceMod, including earlier versions of 1.11. Old
plugins will continue to load as normal.
2021-10-26 17:45:48 -10:00
David Anderson
cab60f7385 Bump handle limit to 1MB.
This bumps the handle bits to 20 and reduces the serial/cookie bits to
12. A warning is emitted if a single owner creates more than 100k
handles.

Tested on mock srcds with sm_dump_handles.
2021-10-26 07:05:34 -10:00
Nick Hastings
636161e183 Mark unloaded extensions as not fully loaded (fixes #1574). 2021-10-24 08:52:32 -05:00
Asher Baker
c6917296d3
Fix out of bounds write in CDataPack::Write*Array (#1554)
WriteCellArray and WriteFloatArray were allocating N+1 slots, but due to
a copy-paste error were writing N+2 slots. Much later in the process the
CRT would catch this and cause a crash - this was pretty painful to
debug but thankfully running SRCDS in CRT debug mode caught it much
sooner in CDataPack::RemoveItem.
2021-07-28 22:19:16 +01:00
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