Commit Graph

1091 Commits

Author SHA1 Message Date
Corey D
fb0144900f Add ArrayStack.Clear native (#1676) 2023-08-30 22:08:45 +02:00
Mikusch
542b7673d6 Add LookupEntityAttachment & GetEntityAttachment natives (#1653)
Using the virtual `CBaseAnimating::GetAttachment(int, matrix3x4_t &)` was a deliberate choice because virtual offsets are generally easier to maintain than signatures. The `matrix3x4_t` is converted to world position and world angles internally.
Some of the other overloads are also inlined on a few games, making this the best choice.

Since this call can only be used on classes inheriting `CBaseAnimating`, we check if the `DT_BaseAnimating` SendTable exists on the entity, throwing a native error if it doesn't.
This safeguard could be greatly improved with a call to `CBaseEntity::GetBaseAnimating`, but would require more gamedata (maybe something to consider for the future?)
2023-08-30 22:08:45 +02:00
Corey D
cc1c02e3de Fix ArrayList return types (#1679)
ArrayList.SetString and ArrayList.SetArray both have int return types but their methodmap natives use void.
2023-08-30 22:08:45 +02:00
Headline
85b8e09e8a Prevent enum shadowing & pin sourcemod for build fixes (#1661) 2023-08-30 22:08:45 +02:00
Benoist
8c001872a8 sdktools: Add EntityCollisionRulesChanged & SetEntityOwner natives (#1620)
* Add EntityCollisionRulesChanged & SetEntityOwner natives

* fix win build, and unpushed changes

* Fixed bad world loop

* Requested changes + csgo offsets

* small copy paste mistake

* Strip the debug log lines

* Tiny clean up in comments

* line

* <dvander> try again

* sdktools: add default Param for owner.

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2023-08-30 22:08:45 +02:00
Peace-Maker
3c0f700a6b Import DHooks + Dynamic Detouring
This is the latest DHooks version from 1314f2d1b4
2023-08-30 22:08:45 +02:00
Nick Hastings
b064366169 Disable Reserved Slots plugin on Contagion.
(It doesn't have sv_visiblemaxplayers).
2023-08-30 22:08:45 +02:00
FortyTwoFortyTwo
62f08a31fc Fix compiling with tf2_stocks 2023-08-30 22:08:45 +02:00
David Anderson
377888276e 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.
2023-08-30 22:08:45 +02:00
Nick Hastings
bb6e6fd3b6 Reorder SDKCallType enum for better compatibility with existing plugins. 2023-08-30 22:08:45 +02:00
dragokas
0449342bb0 Exposed SDKCall_Server call type to use CBaseServer methods 2023-08-30 22:08:45 +02:00
Vladimir
255f5ea745 Add OnClientLanguageChanged() forward (#1597) 2023-08-30 22:08:45 +02:00
Nick Hastings
88bdbf4866 Add support for other Steam ID formats to admin-sql-threaded (#1520). 2023-08-30 22:08:45 +02:00
Charles
daa1a4df14 Removed incorrect parameter RemoveChangeHook desc 2023-08-30 22:08:45 +02:00
Charles
4e2ace9d2f Removed incorrect parameter in description 2023-08-30 22:08:45 +02:00
Corey D
ee722d778f Use words instead of quotes for better clarity
As suggested by sneak-it
2023-08-30 22:08:45 +02:00
Corey D
e82f0acdb8 Missed Database.Escape 2023-08-30 22:08:45 +02:00
Corey D
383cd81be6 Clarify SQL_EscapeString usage
It's hard to see the difference between 2 single-quotes and 1 double-quote unless you highlight it.
2023-08-30 22:08:45 +02:00
GAMMACASE
8ae3be7185 Fix CS_OnCSWeaponDrop after latest CSGO update (21/10/21) (#1602) 2023-08-30 22:08:45 +02:00
Nick Hastings
55382e0a0f Add option to not bypass hooks with TakeDamage and DropWeapon natives. 2023-08-30 22:08:45 +02:00
naydef
02e2659ba5 Update float.inc (#1591) 2023-08-30 22:08:44 +02:00
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
Vladimir
f4ff2ad45a Add missing return values in plugins 2021-08-21 14:11:20 -07: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
Vladimir
54364d213d
Fix output hooks when caller/activator are flipped (#1411)
Co-authored-by: Asher Baker <asherkin@limetech.io>
2021-07-17 15:30:09 +01:00
XeroX
4d6b9895d3
Use display name for currentmap chat trigger (#1512)
This increases the buffer for the map to be consistent with the other calls to GetCurrentMap. Also `currentmap` now uses the map's display name similar how `nextmap` uses it.
2021-07-17 11:46:22 +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
FlaminSarge
0d956b229f
Update basetriggers ShowFriendlyFire to use the same chat text visibility system as ShowTimeLeft (#1494)
This system is a bit sketchy but I didn't want to rework the entire thing. (If this were to be reworked, it should probably use ReplyToCommand for a lot of this).

This also allows the server to call ff and get a result.
2021-06-24 15:45:56 +01: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