Commit Graph

748 Commits

Author SHA1 Message Date
Asher Baker
5ea096e61e
Support reading legacy sendprop arrays (#1550)
This rounds out the work started in #1548 to complete support for
reading the older SendPropArray type array netprops, along with bringing
SDKTools' GameRule netprop code in sync with core to add string array
support.

There aren't many SendPropArray type props around but this opens up a
few interesting opportunities for plugin developers, particularly in
L4D2 with manipulation of the EMS HUD.

Tested reading the `m_vCPPositions` array in TF2, and reading/writing
the `m_szScriptedHUDStringSet` EMS HUD netprop in L4D2. Closes #1386.
2021-08-23 21:21:11 +01:00
Asher Baker
296deb95e6
Return array type info with FindSendPropInfo (#1548) 2021-08-01 19:44:18 +01:00
Maxim Telezhenko
b3672916de
Reduce code size for strict dependencies on mapchooser (#1528) 2021-07-22 14:37:43 +02:00
Asher Baker
6a2ac9800b
Track the creating plugin for convars (#1537)
Similar to the recent work for commands, track and expose the creating
plugin for convars. The first plugin to register a given cvar becomes
the owner until that plugin is unloaded. If a plugin attempts to
register a convar that was already registered and the originally
registering plugin has been unloaded, that plugin becomes the owner.
This isn't quite as nice as the way commands shift "ownership" as
plugins are unloaded, but we don't have a sane data structure currently
to implement that, and it seemed like a lot of unnecessary work as there
shouldn't really be multiple plugins with conflicting cvars.

Closes #1492
2021-07-18 17:19:27 +01:00
Asher Baker
7f2fdf3fe1 Add OnMapInit forward and deprecate OnLevelInit
The change in behaviour to the OnLevelInit forward params isn't obvious
when compiling a plugin, deprecate it to make it a lot more obvious that
something has changed.

Some plugins rely just on the timing of OnLevelInit rather than doing
anything with the entity lump, for these plugins offer a new OnMapInit
forward that is implemented in core rather than sdkhooks. If / when we
offer a new entity lump manipulation API in the future this'll be the
forward where it can be used to make changes.
2021-07-17 20:52:51 +01:00
Asher Baker
70c9a6528a Remove entity lump manipulation from OnLevelInit
Newer Source engine versions now use a dynamically allocated buffer for
the map entity lump, and some maps have over 16MB of entity data - far
larger than our 2MB limit.

There is no sane way we can currently handle this, so just remove the
functionality from the forward until a more comprehensive API can be
designed.

Fixes #1470
2021-07-17 20:52:51 +01:00
Adam Short
5aedb73aae
sdktools: Rename SetCollisionGroup to SetEntityCollisionGroup (#1513)
Better aligns the with other natives - makes more sense.
2021-07-10 13:10:26 -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
Einyux
823b55c22a
sdkhooks: Allow overriding SDKHook_Think (#1397)
* Allow to block Think()

* Update SDKHookCB comment
2021-07-10 12:42:17 -07:00
Accelerator
b0563a493c
Update GeoIP2 extension to new GeoLite2 .mmdb database format (#1245)
* Add support for Maxmind GeoIP2 database files (#913).

* Copy/paste error.

* Mark GeoipCode3 as deprecated.

* Fix build when compiling with AMBuild.

* Replace loose libmaxminddb files with submodule.

* Fix Linux build.

* One more hack for submodule.

* Actually fix Linux build.

* GeoIP2 extension to sourcemod

* Update basevotes

When a player leaves during a voteban, he will be banned anyway. Also added a cvar with a ban time setting.

* Update basevotes.sp

* Update AMBuilder

* ke::AString to std::string

* Update extension.cpp

* Update AMBuilder

* Added coordination natives

Added GeoipLatitude, GeoipLongitude, GeoipDistance natives.

* Create osdefs.h

* Update maxminddb_config.h

* Update extension.cpp

* Update extension.cpp

* Added automatic search for database file

* Fix automatic search for database file

* Update extension.cpp

* Update geoip.inc

* .gitmodules revert

* Update geoip.inc

* Update libmaxminddb to version 1.5.2

* Update extension.cpp

* Check language in the DB

* Removed langCount variable

* Determination of the client's language

* Update geoip.inc

* Update geoip.inc

* Update extension.cpp

* Update geoip.inc

* Update extension.cpp

* space instead of tab in .inc

* Update extension.cpp

* Update geoip.inc

* Optimizing length measurement region code

* Update package script to fetch the new GeoLite2 database

This package is the last CC-BY-SA licensed GeoLite2-City database extracted from https://src.fedoraproject.org/rpms/geolite2 from december 2019.

This doubles the download size for SM packages, but it's what we have to deal with atm :(

* Fix potentially returning uninitialized memory in GeoipRegionCode

If the lookup failed, we'd copy back whatever is on the stack in the ccode buffer.

Co-authored-by: Nick Hastings <nshastings@gmail.com>
Co-authored-by: Headline <michaelwflaherty@me.com>
Co-authored-by: Accelerator74 <dmitry@447751-accele74.tmweb.ru>
Co-authored-by: Peace-Maker <peace-maker@wcfan.de>
2021-06-30 13:01:12 +02:00
Vladimir
f603b7aec3
Add StringToInt64() and Int64ToString() natives (#1511) 2021-06-28 21:51:49 +01:00
Adam Short
a9d3cf4574
sdktools: Add SetCollisionGroup native (#1461) (#1507)
* Add SetCollisionGroup native

* Add newline to end of file

* Fix gamedata locations

* Remove extra spaces

* Fix gamedata formatting

* Add Windows signature for CS:GO

* Fix native doc comment

* Revert formatting change

* Change references of client -> entity

* Moved CallWrapper into method

* typofix

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2021-06-24 15:04:10 -07:00
Natanel Shitrit
d73f4e7eca
Documentation corrections and additions (#1498)
* Added `@error` documentation for every function that's missing it.
* Changed tabs to spaces (text alignment)
2021-06-24 15:45:01 +01:00
Sebastian K
8075ce8371
Add FlagBitsToString - Converts a bit string to a string of flag characters (#377)
* Add new method - Converts a bit string to a string of flag characters

* New syntax

* Set tags

* Fix tags

* Change method name

* Remove for - set null only once
2021-06-17 13:44:50 +02: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
66d932c79f Revert "Update sourcemod.inc"
This reverts commit dbaa470e074fb3716ff4b467f6148c90b50d4220.
2021-05-24 14:30:16 -07:00
Vladimir
7be2f50a98 Update sourcemod.inc
Typo
2021-05-24 14:30:16 -07:00
Vladimir
c874703136 Add HookPluginUnload() and UnhookPluginUnload() functions 2021-05-24 14:30:16 -07:00
Impact
e6129ab2d9
Update FindEntityByClassname docs (#1491)
Makes it a little bit clearer that `startEnt` isn't just an index to start searching from and that passing an invalid one can throw an error
2021-05-21 09:45:42 +01:00
Impact
4a43ac1bdd
entities.inc: Clarify EntIndexToEntRef / EntRefToEntIndex errors (#1370) 2021-05-20 16:07:11 -07:00
Natanel Shitrit
6b7fd8c3dc
clientprefs: Add defines for Cookie name and description max length (#1463) 2021-05-20 15:52:52 -07:00
yourmnbbn
2b1cc43355
Correct documentation in adt_trie.inc (#1465) 2021-04-04 15:11:30 -07:00
Vladimir
5a72644486
Add ConVar.GetDescription() method (#1449)
* Add ConVar.GetDescription() method

Issue #1432

* Update basecommands.sp

Add prints description of ConVar

* Revert "Update basecommands.sp"

This reverts commit ad485069a837f602bdeeeb50f9e02452b3860ecd.

* Remove GetConVarDescription() function
2021-03-21 15:10:17 +01:00
Deathreus
46c54f829c
core: Call ConVarQueryFinished on client disconnect (#1384)
* Execute ConVarQueryFinished if client disconnects

So people passing handles to the extra data can close them, adds a new return value to check if this happened

* Update based on suggestion

Co-authored-by: Asher Baker <asherkin@limetech.io>

* Update based on notes

* Normalize

* Pass along cookie handle instead of invalid

Co-authored-by: Asher Baker <asherkin@limetech.io>
2021-03-15 12:44:03 -07: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
Arron Vinyard
70b6e96f95 Fix documentation constant reference 2021-03-07 13:45:16 +01:00
Impact
a615c139e6
Update note about non-existing SQL_MoreResults (#1416) 2021-01-14 14:50:15 +00:00
kidfearless
e59fd9de96 Fix missed old syntax parameter in menus 2020-12-13 20:12:07 +01:00
Loïc
6c4079cb94 Fix error description
As coded in aae7161273/core/logic/smn_players.cpp (L1405), its a "client not in game", not "client not connected".
2020-12-13 20:10:11 +01:00
Einyux
a191a907e9
Add new trie native: ContainsKey() (#1390) 2020-11-30 20:51:47 -08:00
Arron Vinyard
0caa349f6a
Update cookie funcs to return newdecl Cookie (#1379) 2020-11-07 13:16:29 -08:00
Mikusch
eef96da641
tf2: Add TFCond_PowerupModeDominant (#1361)
* Add TFCond_PowerupMode_Dominant

* comma

* Consistency
2020-10-02 17:33:57 -07:00
Scags
589d6df75d
gamedata: implement GetMemSig (#1345) 2020-10-02 16:40:13 -07:00
Accelerator74
1b86c8564d
sdktools_voice: implement ClientSpeaking forwards (#1247)
* Update basevotes

When a player leaves during a voteban, he will be banned anyway. Also added a cvar with a ban time setting.

* Update basevotes.sp

* Added VoiceHook functions

* Update extension.h

* Update extension.h

* Code optimization

* Added support for more engines

* Invalidate timers

* Fixes

* Update extension.cpp

* Update voice.cpp

* correct Forward event type to ET_Ignore.

* sdktools_voice: de-implement IsClientSpeaking

* sdktools_voice: Add notice/unbind IsClientSpeaking

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-08-18 06:02:34 -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
BotoX
7bab9cc344
sdkhooks: add OnEntitySpawned fwd. (#1078)
* Add OnEntitySpawned to SDKHooks.

* nitpicking

* Add CapabilityProvider SDKHook_OnEntitySpawned

* (unrelated) nits

* nit relocation

* unqualified relocation - my mistake.

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-08-06 20:01:07 -07:00
Kruzya
bb25b03884
Fix parameter name in SQL_SetCharset documentation (#1329) 2020-08-03 11:22:30 +01: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
Impact
a065773b6d
Update OnLibraryAdded and OnLibraryRemoved docs (#1303)
`OnLibraryAdded` and `OnLibraryRemoved` are called whether or not a optional dependency exists
2020-07-09 10:09:59 +01:00
Miikka Ylätalo
4e0ae0cb5e
Change int[] to any[] for data r/w functions (#1221) 2020-07-09 10:09:13 +01: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
nosoop
69ae224938
testing: Add stock AssertStrEq (#1185)
* Add AssertStrEq to testing include

* Remove unnecessary last param
2020-07-08 19:18:39 -07:00
Nicholas Hastings
b364bf8b06
Merge pull request #1102 from nosoop/sf11
TF2: Add new condition from Scream Fortress XI
2020-06-29 09:01:59 -04:00
42
3164af7e34
Fix TFResourceNames using array based enum struct (#1154) 2020-06-28 01:34:59 +00:00
Deathreus
13621a1274
Add an array operations to CDataPack (#1219) 2020-05-08 15:23:48 -07:00
Vladimir
3696a4cd9e
Correct parameter detail in OnEntityDestroyed (#1237) 2020-05-08 15:08:34 -07:00
Scags
44615b7ade
Prevent uncessary re-tagging for address functions (#1250) 2020-05-08 14:54:01 -07:00
42
881cbcd45d
Add new TF2 Holiday Soldier (#1257) 2020-05-06 23:00:24 +00:00
Loïc
d42c304a55
Bump version for non-VCS builds (#1243) 2020-04-27 15:50:03 +01:00