Commit Graph

1236 Commits

Author SHA1 Message Date
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
wanted241
5177cfdf97
Fix unnecessary ConCommand cache misses (#1256) 2020-05-08 15:28:45 -07:00
Deathreus
13621a1274
Add an array operations to CDataPack (#1219) 2020-05-08 15:23:48 -07:00
Loïc
30a4032067
Fix timelimit not correct for Black Mesa (#1262)
* Fix timelimit not correct for Black Mesa

Black Mesa is particular and use timelimit in seconds instead of minutes

* Update TimerSys.cpp

* Update TimerSys.cpp

* Update TimerSys.cpp

* Update TimerSys.cpp
2020-05-06 22:59:43 +00: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
Asher Baker
6465bd83a4 Update for latest Blade Symphony SDK 2020-03-11 22:36:25 +00:00
Asher Baker
ecad8f25a8
Revert "csgo: enable SayText + raise msg limits (#1118)" (#1209)
This reverts commit 4a8e0799bd.
2020-03-08 13:27:13 +00:00
Kyle Sanderson
22eeb2f3a5
DarkM: build-fix for engine msg caching (#1195)
* DarkM: build-fix for engine msg caching

* style + promote ptr casting to uintptr_t.

* sync type to uintptr_t in pm.h

* return of the uint32_t

* update header.

* oh, right, unsigned int...
2020-03-03 07:13:03 -08:00
BotoX
cc6059a4b7
engine: Implement message buffering. (#1071)
* Avoid losing console messages.
Buffers up to 16k bytes of SVC_Print if buffer would overflow, then sends chunks every frame.
Sends up to 2048 bytes per frame and does not split messages.

* UNTESTED! Switch to ke::LinkedList<ke::AString> for PrintfBuffer.
Switch from OnGameFrame to FramAction.
Fix compiling on Episode1 by essentially disabling the feature.

* UNTESTED! Cleanup on disconnect, passthrough for >= 2048 msgs

* try reference for CPlayer.

* fix

* remove m_PrintfStop

* remove m_PrintfStop

* ensure empty queue when netchan drops

* flip to serials.

* serials

* style

* Update PlayerManager.cpp

* lift consts to header.

* remove local const references

* ep1 static const

* flip to queue - fix serial on resched.

* Update PlayerManager.h

* Update PlayerManager.cpp

* Update PlayerManager.h

* am-deque.h

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-02-27 16:21:31 -08:00
GAMMACASE
4a8e0799bd
csgo: enable SayText + raise msg limits (#1118)
Rised limits for SayText and HintText protobuffs in csgo, also switched from TextMsg to SayText in csgo.
2020-02-26 16:31:50 -08:00
Michael
8a5d0a58e4
Fix unnecessary ConVar cache misses (#1177)
Fixes #1166
2020-02-11 00:39:19 -08:00
peace-maker
739c07ca9b
Fix heap corruption in CUtlVector destructor (#1165) 2020-02-08 15:36:21 -08:00
bottiger1
9d978f5581 Correct GetSteamAccountID validation parameter (#1158).
Correctly forward the validated parameter within CPlayer::GetSteamAccountID.
2020-01-14 14:43:07 -08:00
Kruzya
8746b2fd7f Adjust CanAdminTarget to support multiple Group Immunity IDs (#1147) 2019-12-23 10:45:36 -08:00
Nicholas Hastings
1000d419fc Throw configuration error on unsupported compilers (#1029) 2019-11-15 16:40:39 -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
Headline
00b7ac5a39
Add bounds check for userid reset on disconnect (#1108) 2019-10-30 17:17:53 -07:00
Asher Baker
7a42d6b564 Fix build with latest hl2sdk-csgo 2019-09-02 21:45:04 +01:00
hydrogen-mvm
22635d8d35 Add File.Flush methodmap (#1056)
This allows us to do FileHandle.Flush() instead of FlushFile(FileHandle) and maintain consistency in always using methodmaps for file I/O operations.
2019-07-31 22:18:07 +00:00
nosoop
5293815bf6 Check other filename sources on remote extensions 2019-07-29 04:00:18 -07:00
MartLegion
e47c1a840a Pad plugin ID based on the total plugin count (#1027)
Closes #994
2019-06-17 01:06:03 +01:00
Nicholas Hastings
14227c04b8
Fix matchmaking_ds bin not being found for gamedata (#1006). (#1028) 2019-06-01 14:30:22 -04:00
JoinedSenses
352f078b07 Add Cookie methodmap (#1012) 2019-05-30 18:27:14 -07:00
JoinedSenses
4f3c3175e6 Create GlobalForward & PrivateForward methodmaps (#1004) 2019-05-29 14:17:42 -07:00
Headline
28036966a6
Fix Miscellaneous Regressions and UBs (#1022) 2019-05-28 18:04:08 -07:00
JoinedSenses
26462f2848 Add Sort and SortCustom to ArrayList methodmap (#1003) 2019-05-09 18:44:31 +01:00
komashchenko
8031e42bda pb: Add natives to work with 64 bit values (#943)
* Add natives to work with 64 bit Protobuf values

* Fix linux build

* FIX alignment requirements

* FIX alignment requirements V2

* Remove legacy API

* Inattention
2019-03-04 09:06:43 -08:00
Michael Flaherty
b7e252dfd6
Prevent FrameIterator OOB Errors (#949) 2019-01-13 13:36:35 -08:00
Nicholas Hastings
a2246af121
Unify map lookup logic across tf2esque engines. (fixes #927) (#931) 2019-01-07 18:17:28 -05:00
OkyHp
b88e0d7875 Add getter for Event.BroadcastDisabled (#946)
In a pre-hook, the hook param is not reliable if multiple plugins have hooked the same event.
2019-01-03 19:42:42 +00:00
David Anderson
470486ba7e
Don't double-format in ReplyToCommand. (#932) 2018-12-12 23:30:27 -08:00
Nick Hastings
9a4fe1c475 Fix signed/unsigned compare on Windows. 2018-12-12 20:02:23 -05:00
peace-maker
f0aec6b0b6 Fix typo in fallback to "default" maplists section (#923)
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.
2018-11-13 16:32:18 +00:00
peace-maker
1b795a70b0 Add GameData methodmap (#766) 2018-10-11 20:27:56 -07:00
Kruzya
ccfd2ffe38 Added sm_reload_databases (#773)
Added command sm_reload_databases for refreshing "registered" Databases Configurations cache.

Closes #772
2018-10-11 17:36:52 +01:00
Asher Baker
c1d235a59c
Use natural sorting for map lists (Fixes #892) (#907)
This produces consistently better results, especially for games such as L4D(2).
2018-10-11 15:20:10 +01:00
Asher Baker
a659896f8a Revert "Use natural sorting for map lists (Fixes #892)"
This reverts commit a4e169aa8f.
2018-10-11 00:04:46 +01:00
Asher Baker
a4e169aa8f Use natural sorting for map lists (Fixes #892) 2018-10-11 00:03:34 +01:00
Asher Baker
7dd733cf46
Improve CreateNative failure message (#903)
This confuses everyone.
2018-10-10 13:35:17 +01:00
Michael Flaherty
34e91fbd81 Restore SQL_CheckConfig Behavior (#873)
* 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.
2018-10-07 14:08:11 -07:00
Asher Baker
1ca4517f46 Revert "Remove arch loops from build scripts. (#889)"
This reverts commit 7ed329c11f.
2018-10-04 17:59:40 +00:00
David Anderson
7ed329c11f
Remove arch loops from build scripts. (#889)
This simplifies non-sdk build scripts by removing their loops over SM.archs. Instead the top-level
build script will re-evaluate them for each architecture.
2018-09-30 09:59:28 -07:00
Asher Baker
ba8b42ef1b
Burninate IDataPack (#864)
This doesn't break any extensions NOT using IDataPack, and we do not know of any that are.

* The extension storage utility of this interface has been broken for the last 9 months, with ISourceMod::CreateDataPack being disabled.
* The plugin interop utility of this interface (its stated purpose) has been broken for the last 11+ years, with ISourceMod::GetDataPackHandleType being disabled.

I imagine it only survived the first cleanup 11 years ago because CSS:DM was using it internally, which it has now been migrated away from.

Compiled all the included extensions without changes (API compat), and loaded extensions build pre-change without issue (ABI compat).
2018-08-13 23:03:48 +01:00
Michael Flaherty
a65c215217 Fix DataPack Overwrite Regression (#862)
Some tests passed with the implementation prior to this commit, but those were edge cases. Good older behavior is now fully restored
2018-08-11 13:31:33 +01:00
Michael Flaherty
7068c3e865
Fix LogStackTrace Anomaly (#863) 2018-07-31 04:17:36 -07:00
Kyle Sanderson
255b9323cc
Flip sm_debug_connect to "1" (#860) 2018-07-27 22:02:31 -07:00
Kyle Sanderson
72acca4b9e
Fix DataPack memory leak regression from #848. (#850)
* Fix memory leak regression from https://github.com/alliedmodders/sourcemod/pull/848.
2018-07-16 08:34:49 -07:00