Commit Graph
6937 Commits
Author SHA1 Message Date
Vladimir babc6abc64 Revert "Update PluginSys.cpp"
This reverts commit dd10098844562112c4b57e97da6b20e4cf4ff30b.
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 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
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
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
Vauff 47c050d5b6 Update TerminateRound signature for CS:GO windows (#1486) 2021-04-29 01:24:26 -07:00
peace-maker 1fbe5e1daa A2S_Rules fix: Only change host_rules_show if patching was successful (#1459)
If lookup of the patch location failed, don't turn on responding to A2S_Rules queries. Otherwise we'll see the log getting spammed with too large packet sizes again. #1447
2021-04-19 09:33:36 +02:00
yourmnbbn 2b1cc43355 Correct documentation in adt_trie.inc (#1465) 2021-04-04 15:11:30 -07:00
Arthurdead 62cb6a0458 Add sdk'less sample_ext and update -std to 14 (#1456) 2021-03-29 22:12:45 +01:00
Arron Vinyard ca1dcc9bed Correct spelling in sample_ext build script (#1454)
I have optimizaied the spelling
2021-03-24 21:05:14 +01: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
Vladimir e552466886 core: Call SetGlobalTarget in PrintToConsole (#1448)
Issue #1443
2021-03-20 22:24:06 -07:00
Corey DandPeace-Maker 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 <[email protected]>
2021-03-15 12:46:04 -07:00
DeathreusandAsher Baker 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 <[email protected]>

* Update based on notes

* Normalize

* Pass along cookie handle instead of invalid

Co-authored-by: Asher Baker <[email protected]>
2021-03-15 12:44:03 -07:00
steph 4dd5ab7576 Prevent duplicate map changes in randomcycle.sp (#1428) 2021-03-14 01:02:42 -08:00
MartLegion ee27a48714 Update clientprefstest.sp to newdecls (#1442) 2021-03-13 23:41:36 -08:00
peace-makerandErik Minekus e5342afe2a Add PostgreSQL database driver (#32)
* Add PostgreSQL DBI extension

Bug #3849
This adds a postgresql database driver called "pgsql".
The ambuild script changes could be very wrong ;)

* Add pgsql support to clientprefs

This was originally made by Lyfe in bug 3849! Thanks for that.
PostgreSQL supports the 'IF NOT EXISTS' clause when creating tables
since version 9.1, so i've switched to use that.

* Added pgsql support to sql-admin-manager

* Add --pgsql-path to ambuild configure

* More ambuild fixes

* Compile libpq with ambuild

* Try to generate postgres configs

* Add dummy config file

* More ambuild fixes

* Get errorcode and readable error in preparequery

No need to stop getting the errorCode, if the error string should be
retrieved. Just return both!

* Fix indentation in AMBuilderPGSQL

* Try to patch and configure postgres through ambuild

* Revert "Try to patch and configure postgres through ambuild"

This reverts commit 68dfc82b8eb0ce11f621af67ec247b5f47e4a189.

* Update to use PostgreSQL 9.4

* Move postgres preparation into seperate script

Fetching, preparing and configuring of the postgresql sourcecode
is done in a seperate prepare_postgresql.sh script now.

People can use this script for their manual builds,
if they don't want to use checkout-deps.sh.

* Add patch to configure.in again

Remove the version check for autoconf in postgres 9.4 too.

* Nit: Support older objdirs for hasPgSql ambuild option

* Update to use PostgreSQL 9.4.6

* Use newer AMTL and PGSQL 9.6

* Fix threaded queries

When running the thread part of a query, it already gets the atomic
lock. Don't try to get it twice in that case.

Use a seperate lock to protect access to the lastInsertID and
lastAffectedRows variables.

* Fix SetCharacterSet racing with threaded queries

Same fix like in the mysql driver.

* Use ke::AutoLock for lastInsertID mutex

* Fix fetching one more row than available

Don't try to access a row that doesn't exist when iterating rows.

* Improve sanity checks on column access

Don't call libpq functions with out of bounds column indices.

* Let QuoteString return false if quoting failed

* Fix build for x64 support changes and update to PGSQL 9.6.9

* Fix linux build

* Fix building of connection options string

snprintf doesn't support overlapping buffers.

* Update to PostgreSQL 9.6.15

* Fix crash after freeing first IQuery object

* Fix code crunch

* Fix memory leak, cleanup

* Nuke MSVC project and Makefile

* Remove unsupported numeric error codes

* Use STL threads

* Add prebuilt libpq for Linux and Windows

* Restore and fix version.rc file

* Add PostgreSQL build instructions

* Add prebuilt libpq for Mac

* Add win64 libpq build

This is version 9.6.15 since that's what I still had laying around.

* Fix buildscript

* Fix x64 build on linux and mac

Co-authored-by: Erik Minekus <[email protected]>
2021-03-11 11:21:51 +01: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
Headline 99c39b1d57 Update IPlugin reference on cmd hook removal (#1439) 2021-03-10 15:21:57 -08:00
ae485c3115 Add A2S_Rules fix for CS:GO to CStrike extension. (#614)
* Add A2S_Rules fix for CS:GO to CStrike extension.

* Dont force set the cvar. Add checks before patching.

* Remove incorrect and useless check.

* Remove checking value as it is in the signature.

* Update build script changes to AMBuild 2.1 API to fix build.

* Fix bad check and ConVarRef being resolved too early.

* Whoops. This line is kinda important. Got nuked when refactoring.

* Remove unused variable.

* Updatet gamedata.

* Switch to "Addresses" gamedata lookup

* Add linux64 gamedata

* Fix mac build

Co-authored-by: Ruben Gonzalez <[email protected]>
Co-authored-by: Peace-Maker <[email protected]>
2021-03-08 22:42:32 +00:00
Scags 6c2be9bdcc Add sm_dump_datamaps_xml (#1409) 2021-03-08 14:28:43 -08: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
Loïc 52c4d08e15 Improve logging on map/generic votes (#1362) 2021-03-08 05:02:20 -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 5bc48b2ab3 Prefer python3 over python(2) in checkout-deps (#1424)
* Prefer python3 over python(2) in checkout-deps

We require Python 3 and don't want to accidentally use Python 2 if both are available.

* Use python3 in travis build

* Install python3-pip package on travis trusty image

* Fix pip detection in checkout-deps.sh
2021-03-07 13:50:15 +01:00
Arron Vinyard 70b6e96f95 Fix documentation constant reference 2021-03-07 13:45:16 +01:00
Peace-Maker 91a1fd074b Fix sql injection in sql-admin-manager plugin
This bug was found as part of justCTF 2020 in the PainterHell challenge by cypis. Thank you!

Admins with the root flag could inject their own queries towards the admin database connection.

The sql-admin-manager plugin is disabled by default.
2021-02-02 11:20:02 +01:00
Impact a615c139e6 Update note about non-existing SQL_MoreResults (#1416) 2021-01-14 14:50:15 +00:00
komashchenko 978fa6b252 Fix detour HandleCommand_Buy_Internal (#1406) 2020-12-18 12:10:10 +00:00
c0rp3n 24f90449ad [CS:GO] Remove control chars from gamedata 2020-12-16 16:17:14 +01: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
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 https://github.com/alliedmodders/sourcemod/blob/aae71612731eaa6771067a31f3a7ad34bdb0df28/core/logic/smn_players.cpp#L1405, its a "client not in game", not "client not connected".
2020-12-13 20:10:11 +01:00
Natanel Shitrit c2b806563e Update 'CScore' offset for CS:GO (#1394) 2020-12-04 17:13:10 +00:00
Vauff 15d912df38 Update TerminateRound signature for CS:GO linux (#1392) 2020-12-04 00:10:51 +00: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
Headline 1cd0efad41 NPOTB: Fix no SDK target exception (#1359) 2020-11-07 13:14:58 -08:00
Mustafa Enes AKDENİZ 9d49bbfaf0 Fixed unauthorized menu usages (#1374)
* Fixed unauthorized menu usages

Let's say we have kick flag but don't have admin menu flag.
When we type !kick, menu opens with a back button, when we click back button, we go parent menu without admin menu flag

* Update ban.sp
2020-11-05 11:34:00 +01:00
Peace-Maker 3eb2cd2971 Remove verbose hl2sdk-X not found warning
None of the available usage options have any use for such a warning.
2020-10-28 20:55:00 +01:00
Nicholas Hastings 8e7d41ec02 Add NULL check to GetEntPropString return. (#1376)
This can be NULL for non-interned strings that don't have a value set.
2020-10-27 18:51:12 -04:00
Mustafa Enes AKDENİZ 94ea925152 Improvements on !admin menu flags (#1364)
* Improvements on !admin menu flags

Lets say we have override the sm_unmute command and changed it to ADMFLAG_CUSTOM1.
Then create an admin, we gived our admin ADMFLAG_Chat flag, admin can't use sm_unmute command cause it doesnt have access to this command.
But if admin go into "!admin" menu then, he will able to run sm_unmute on "player command" menus

* removed unauthorized menu items

* Deleted Whitespace and ITEMDRAW_DEFAULT
2020-10-24 23:52:35 +00:00
Nicholas Hastings 18d93ff677 Sendprop string fixes (#1372)
* Fix reading SendProp non-interned strings.

* Make Get/SetEntPropString for SendProps use same macros as other funcs.
2020-10-23 11:26:54 +00:00
David Anderson d48cf93a94 Fix builder.target usage. 2020-10-22 23:41:01 -07:00