Commit Graph

834 Commits

Author SHA1 Message Date
Nick Hastings
a01529b210 Add new GiveNamedItem param for CS:GO. 2018-12-06 20:18:21 -05:00
Ruben Gonzalez
d79c5e0dfa Switch CS:GO Clantag set/get to use netprops + offset over sig + offset. (#922)
* Switch CS:GO Clantag set/get to use netprops + offset over sig+offset.

* Make sure the new functions are defined before using them...

* Fix offset name

* Fix incorrectly dereferencing.
2018-11-09 07:13:17 -05:00
Kyle Sanderson
cb8d92edeb
SDKHooks: Reset global hookid when unhooking in SH. (#916)
Fixes https://github.com/alliedmodders/sourcemod/issues/912
2018-10-28 11:06:57 -07:00
Asher Baker
a1271ec3a8
Handle NULLs in SDKCall string return (Fixes #874) (#906)
`SDKCall` has existing semantics that a `-1` retval indicates null, so use that and writes an empty string to the buffer.

Consumers can tell the difference between `""` and `NULL` by checking if the return value is `0` or `-1`.
2018-10-11 00:18:03 +01:00
SlidyBat
3add38f665 Add additional TraceRay natives (#885)
* More TR natives

* Fix small typo

* Fix another typo

* Fix TR_AllSolid description

* Change Disp to Displacement

* Reorder params in TR_GetSurfaceName

* Fix TR_GetSurfaceName

* Another fix for TR_GetSurfaceName -_-

* Change if block to switch

* Make handle first param in TR_GetSurfaceName

* Reorder TR_GetStartPosition params

* Make TranslatePartitionFlags static

* Change tabs used for formatting to spaces

* Change inline comment style to be consistent with rest of file
2018-10-07 14:15:54 -07:00
Michael Flaherty
a9ca1a2fd6
NPOTB: Clarify preprocessor logic (#900) 2018-10-05 04:22:29 -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
Michael Flaherty
22b43e3869 Fix regression in vstk size (#894)
* Fix regression in vstk size

* Fix macro comment mistake

* More macro comment removals
2018-10-04 08:08:29 -04:00
Michael Flaherty
fc14e37d0f Fix CS_TerminateRound calls & detour (#893) 2018-10-03 22:50:31 -04: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
Ruben Gonzalez
75193e9ee9
Add new weapons to CSWeaponID enum. (#869) 2018-09-12 10:13:39 -04:00
SlidyBat
144fb907f1 Add new Traceray natives (#754) 2018-08-13 23:02:12 +01:00
Michael Flaherty
aaac0b9eb2 Individualize NameHashSet Hashing & Revisit #709 (#740)
* Make mac/win lookups lowercase'd

* Revert #709 & 81042cc

* Adjust HashPolicy implementation across sourcemod

Basically, in order to implement our own (actual) hash policy in
`PluginSys.h`, we needed to remove the blanket implementation of `hash`
that was used before. Now, each policy must implement `hash` along with
`matches` in order to be used with `NameHashSet`. While this does force
us to change every implementation of policies across the entirety of
sourcemod, it allows core to use flexible implementations of `hash`.

* Remove logic duplication

* Improve lowercase checks
2018-07-10 17:38:40 -04:00
Nick Hastings
a9c9da1066 Update SDKTools sound functionality for hl2sdk-csgo changes. 2018-07-07 08:57:00 -04:00
Michael Flaherty
b9b6832a11 Streamline ConfDb loading proceedure (#791)
* Create DatabaseConfBuilder & remove locking
* Remove all refcounting

This is part 1/n in regards to this PR's rework
* Move db conf lookup out of RunThreadPart
* Return default configuration for failed lookups
* RefPtr members & stop leaks
* fix uint comparison warning
2018-06-19 09:35:37 -07:00
peace-maker
6fcb411fe4 MySQL: Support multiple result sets in prepared queries (#825)
Prepared statements can return multiple result sets since MySQL 5.5. That can happen when calling stored procedures using `CALL x();`.

This change removes the previous caching of result bindings, since the number of fields in a result can differ from result set to result set. This could potentially have a negative impact on prepared statements always only returning one result set, since the result binding buffers are recreated everytime the statement is executed instead of once. That difference should be negligible.

Fixes #823.
2018-06-05 18:33:33 +01:00
peace-maker
9cc518e408 Fix MySQL extension build using vs2015 (#824)
MySQL defines its own timespec_t. Official mysql builds are built using VS2013, so you still need to compile the client library yourself to be able to link it, but this change makes the dbi extension compatible with future versions already.
2018-06-05 09:29:11 -04:00
Ruben Gonzalez
d430bd2f5c
Fix CompileRegex not actually setting a valid error code. (#775)
Fix CompileRegex not actually setting a valid error code.
2018-05-28 13:59:43 -04:00
Nick Hastings
b0e7bab980 Merge branch 'master' of https://github.com/alliedmodders/sourcemod 2018-03-28 21:11:14 -04:00
Nick Hastings
9b8d28de56 Allow -1/null for attacker and inflictor for OTD (bug 6494). 2018-03-28 21:10:32 -04:00
Michael Flaherty
5611ec54a2 Migrate extensions to common AMTL string funcs (#785) 2018-03-25 13:00:53 -07:00
Michael Flaherty
118d6dc9b1 Improve error message for EmitSound (#787)
Improve some error messages in sdktools.
2018-03-20 19:42:43 -06:00
Nicholas Hastings
08fe840bfd Probably fix Windows build. 2018-03-20 17:25:48 -04:00
peace-maker
be6a930e82 Update SQLite to version 3.22.0 (#783)
This includes numerous bug fixes, optimizations and new features from releases over the past 5 years.

http://sqlite.org/chronology.html
2018-03-19 19:09:12 -04:00
Ruben Gonzalez
5ac3390656
Add new regex natives. (#767)
Add new regex natives to get multiple/all matches.
2018-02-15 15:31:24 -05:00
Byte
1706fdfed9 Fix typo and update CSGOBadList (#738)
* Fix typo

* Update CSGOBadList
2017-12-28 18:43:49 -05:00
Scott Ehlert
fa7d8757dc Rebuild 64-bit Linux libpcre with -Wa,-mrelax-relocations=no 2017-12-20 03:50:12 -06:00
Scott Ehlert
3c7978153b Rebuild 64-bit Linux libpcre with -fPIC. 2017-12-20 03:15:57 -06:00
Scott Ehlert
7cb3d4d8ff Fix Linux and macOS builds. 2017-12-20 02:13:56 -06:00
Scott Ehlert
e27f8fba1a Hopefully fix Windows build. 2017-12-20 02:04:05 -06:00
Scott Ehlert
ce1a4dcac0
64-bit support for CSGO on Linux and macOS (#705) 2017-12-20 01:56:23 -06:00
Ruben Gonzalez
8e6ca1ce09 Revert "Make CS:GO specific natives exist only on CS:GO"
This reverts commit 687db96b38.
2017-11-27 12:58:24 -05:00
Ruben Gonzalez
7507672895
Merge pull request #701 from alliedmodders/csgo-hashmap
CStrike extension changes for CS:GO
2017-11-03 19:48:55 -04:00
Nicholas Hastings
95afe72307
Separate out DOI build. (#718) 2017-11-03 15:45:16 -04:00
Nicholas Hastings
3a1bb177fc Fix TF2IgnitePlayer not working after game update (fixes #713). 2017-10-28 16:17:21 -04:00
Ruben Gonzalez
b6a2f72e95
Merge branch 'master' into csgo-hashmap 2017-10-27 18:57:28 -04:00
Ruben Gonzalez
6085afbaae Fix comment info 2017-10-27 18:55:02 -04:00
Kyle Sanderson
2658636377 Fix unsigned compiler warning. 2017-10-27 18:53:49 -04:00
JRiipinen
8807939a14 Update TF2_IsPlayerInCondition (#712)
* Update TF2_IsPlayerInCondition

* Update conditions too
2017-10-27 07:02:38 -04:00
Nicholas Hastings
5cf6a0c875 Fix MakeBleed native call (add damage custom param).. 2017-10-22 10:48:27 -04:00
Michael Flaherty
4f54df65e9 Switch C header & Fix warnings (#702) 2017-10-15 10:32:01 +01:00
Kyle Sanderson
65bf85fcbe (Re-)Add support for gcc and clang3.9, 4.0, and 5.0. 2017-10-09 16:53:19 -07:00
Kyle Sanderson
30f061e818 Fix unsigned comparison warnings (-Werror + GCC5) from CS:GO fixes. 2017-10-09 13:00:52 -07:00
Ruben Gonzalez
687db96b38 Make CS:GO specific natives exist only on CS:GO 2017-10-04 18:20:06 -04:00
Ruben Gonzalez
588e88c7ee Fix build error. 2017-10-04 14:42:07 -04:00
Scott Ehlert
bbdecceb4b Switch to AMBuild 2.1 API. (#694) 2017-10-02 07:18:57 -05:00
Kyle Sanderson
5d234bb9d6 Fix OnPlayerRunCmd crashing with invalid CUserCmd ptr. (#693) 2017-09-23 23:27:32 -07:00
Ruben Gonzalez
8c8af88cee Add additional native, fix include file. 2017-09-19 12:37:11 -04:00
Ruben Gonzalez
1f3b14367d Add new native to get enum value based on item definition index. 2017-09-09 23:27:32 -04:00
Ruben Gonzalez
3d461ecea1 Add support for CreateIitemEntityByName for CS:GO 2017-09-08 08:37:28 -04:00
Ruben Gonzalez
a341a0e85c Use implemented function to get weapon name. 2017-09-03 19:31:23 -04:00
Ruben Gonzalez
d8f0484327 Make IsValidWeaponID check weapon info on CS:S 2017-09-03 19:30:35 -04:00
Ruben Gonzalez
453e9da7c5 Intial CS:Go changes and slight changes for CS:S WeaponID related function. 2017-09-03 09:19:12 -04:00
Ruben Gonzalez
0e7a3b0173 Use keyvalue to get weapon price, change void * to appropriate class names. 2017-08-28 10:17:12 -04:00
Ruben Gonzalez
22033c21f2 Fix CS_GetWeaponPrice returning incorrect weapon prices. 2017-08-25 10:26:28 -04:00
Ruben Gonzalez
5f9d571e12 Fix trying to use signature function for WeaponIDToAlias on linux. 2017-08-21 15:00:22 -04:00
Ruben Gonzalez
f7d3e44b19 Fix CS:S build 2017-08-21 10:48:54 -04:00
Ruben Gonzalez
a01e9e510c Fix using Q_strcpy instead of Q_strncpy 2017-08-21 10:35:58 -04:00
Ruben Gonzalez
3eb297bee1 Fix cstrike extension natives/forwards due to update 2017-08-21 10:28:59 -04:00
Ruben Gonzalez
cbb5c6d740 Fix Handle buy call 2017-08-18 15:24:17 -04:00
Ruben Gonzalez
955a29a4aa Fix HandleCommand_Buy_Internal param order. 2017-08-18 15:06:20 -04:00
Asher Baker
902cae595b Include function name in cstrike ext error messages 2017-08-18 13:00:50 +01:00
Nicholas Hastings
29d1187434 Cache created entities by reference instead of index in SDKHooks (#634)
Fixes #663.
2017-07-06 13:33:34 -04:00
Ruben Gonzalez
2f0272f864 Use the same weapon drop function in CS:GO as in CS:S 2017-06-12 08:39:27 -04:00
peace-maker
1351df4260 Add OnPlayerRunCmdPost forward (#591)
* Add OnPlayerRunCmdPost forward

Allow plugins to catch the values that are actually used by the game
after some eventual changes by other plugins.

* Add |const| qualifier to arrays in OnPlayerRunCmdPost forward
2017-05-09 15:16:05 +01:00
peace-maker
0961e5dde3 Fix crash when accessing gamerules during mapchange (#593)
If the gamerules proxy entity doesn't exist, don't try to generate the
reference for it.
2017-03-11 08:54:38 -08:00
Ruben Gonzalez
89c4be525b Ignore replay and sourcetv in @spec targeting. (#595) 2017-03-11 16:12:43 +00:00
Benoist3012
08238a8036 Add FireEntityOutput native. (#587)
* AcceptEntityOutput native

* define fix

* MSVC fix and renamed native

* Added requested changes.

* tab/space fix
2017-02-15 19:29:43 -05:00
Nicholas Hastings
04055c411e Fix startup crash on CS:GO caused by PR #514 2017-02-06 08:25:51 -05:00
WildCard65
90b3df1181 Add 2 CSGO gamerules netprops to CSGO blocklist if FollowCSGOServerGuidelines is enabled. (#514)
* Add m_bIsValveDS and m_bIsQuestEligible

* Fix compile
2017-02-04 08:18:58 -05:00
WildCard65
fd399b9b4b Fix memory leak in Regex extension. (#572)
* Fix memory leak in Regex extension.

"x" is never deleted when compile fails.

* Handle handle allocation failures.

Handle allocation failures also result in memory leaks.

* Fix typo.
2017-01-11 21:25:46 -05:00
Nicholas Hastings
ad3588d0aa Use newer MM:S api for Ep1/Original engine. (#548)
* Use newer MM:S api for Ep1/Original engine.

* Remove doubled FILENAME_1_6_EP1 define.
2017-01-11 21:25:00 -05:00
Nicholas Hastings
47d22a3051 Allow CStrike ext to load on CS:GO "mods".
They theoretically cannot have any binary changes since there is no
real SDK, so it should be compatible.
2016-12-25 08:31:39 -05:00
Nicholas Hastings
70d81430f8 Add support for more SQLite database open options. (#565)
* Add support for in-memory SQLite databases.

* Add support for opening SQLite databases via file URI.
2016-12-04 11:23:08 -05:00
peace-maker
151834a948 Fix case of not calling OnMapTimeLeftChanged in CS:GO (#563)
Round end reasons in CS:GO are +1 from the ones in CS:S. The
CSRoundEnd_GameStart reason for when the OnMapTimeLeftChanged forward
should be called should be one higher than in CS:S.
2016-12-01 17:09:48 -08:00
Nicholas Hastings
152a86f6f4 Fix CS:GO OnGetWeaponPrice forward on Linux. 2016-11-29 11:05:39 -05:00
Nicholas Hastings
c4487b74ee Semi-tested fix for CS:GO GetWeaponPrice on Linux. 2016-11-29 10:42:05 -05:00
peace-maker
47eb7d60e5 Fix use-after-free crash in SQLite extension (#481)
When the server crashed and the process got terminated, the SqDriver
instance was killed first (e.g. by atexit). SqDatabase tries to access
SqDriver in its destructor.
This patch tells SqDatabase to not use anything from SqDriver anymore
after SqDriver got destroyed.

Next to that, the clientprefs extension relied on the IDatabase pointer
being valid to get the driver pointer. Cache the pointer, so the dbi
system still knows the IDBThreadOperation belonged to the now gone
driver, even after the database object is gone.
2016-10-03 16:31:17 +01:00
Asher Baker
47dd2870d9 Merge pull request #476 from alliedmodders/query-format
Implement an auto-escaping Format native for SQL query construction
2016-10-03 16:20:01 +01:00
Nicholas Hastings
94383d995d Fix building of MySQL DBI extension on VS 2015+. 2016-08-18 14:20:37 -04:00
Nicholas Hastings
cb7eeef014 Remove TFHoliday_SpyVsEngyWar - no longer exists. 2016-07-08 15:44:49 -04:00
peace-maker
f425236bac Increase topmenu display buffer size (#520)
The buffer for menu options was 64 chars. That limit can easily be
reached by some utf8 string which would get truncated. Double the buffer
size to 128 chars.
2016-06-20 16:03:54 +01:00
Nicholas Hastings
f12924458f Merge branch 'vs2015' 2016-06-11 12:14:12 -04:00
Nicholas Hastings
0f96a28cca Use VSERVERTOOLS003 in Nuclear Dawn if server has it available. 2016-06-08 12:32:20 -04:00
Nicholas Hastings
e3d7a047bd Fixed varint sendprops being treated improperly in CS:GO. 2016-06-05 11:03:18 -04:00
Nicholas Hastings
31928e6282 Fix late/incorrect calls to TR_GetEntityIndex potentially causing crash. (#513) 2016-05-21 14:44:00 -04:00
Nicholas Hastings
5edc46c994 Don't enable FileExists hook (SendFile forward) on TF2 servers with Replay. (#512)
It will crash. See PR #493 for details.
2016-05-19 19:11:28 -04:00
Kyle Sanderson
57c6e09fcf Merge pull request #493 from alliedmodders/tfreplaycrash
Only hook IBaseFileSystem::FileExists if we're also hooking INetChannel
2016-05-19 15:23:05 -07:00
Nicholas Hastings
40f2512317 Remove support for Source 1 Dota 2. (#496) 2016-04-26 23:18:47 -04:00
Nicholas Hastings
416abd81a1 Add support for compiling with VS2015. 2016-03-30 08:56:27 -04:00
akowald
283bdad552 Makes sending the change the default behavior with the GameRules_Set* natives. 2016-03-25 00:43:39 -04:00
Kyle Sanderson
8924a9744e Only hook IBaseFileSystem::FileExists if we're also hooking INetChannel::SendFile or INetChannel::ProcessPacket.
This works around a TF Replay SourceHook crash that Johns was seeing when using 1.8.
SourceHook is not thread-safe at the time of this writing.
2016-03-20 14:07:08 -07:00
Nicholas Hastings
b65de29c92 Add initial version of safety checks for CS:GO to attempt to avoid user GSLT bans. 2016-03-02 15:25:01 -05:00
Ruben Gonzalez
803c6b0a82 Update TerminateRound detour comment's 2016-02-18 11:15:39 -05:00
Asher Baker
7c3bcc9c25 Add missing buffer size check to SQLite QuoteString impl 2016-02-15 14:19:11 +00:00
akowald
7fbc9869bd Fix for crashes related to the GameRules_Set* natives. 2016-02-03 16:20:31 -05:00
Kristian Klausen
4cba1925fd Allow plugins to suppress entity outputs (fix 5515). 2015-12-30 17:51:57 +01:00
Nicholas Hastings
7fbcb81916 Merge pull request #456 from alliedmodders/canbeautobalanced
Add support for hooking CanBeAutobalanced to SDKHooks.
2015-12-29 15:56:24 -05:00
Kyle Sanderson
2812f227b7 Change SDKHooks CanBeAutoBalanced to only MRES_SUPERCEDE if the return changes. 2015-12-29 12:44:03 -08:00
Nicholas Hastings
23f9a1a524 Typo fix fix. 2015-12-22 16:18:53 -05:00