Commit Graph

1089 Commits

Author SHA1 Message Date
peace-maker
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 <tsunami@tsunami-productions.nl>
2021-03-11 11:21:51 +01: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
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
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
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
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
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
David Anderson
6e2c5a66b3 Remove use of the Dep API.
This is going away.
2020-08-24 20:48:57 -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
eyal282
4a4b9ce7f0
cookies: Align output with sm_help (#977)
* Update clientprefs.sp

* Update clientprefs.sp

* Update clientprefs.sp

* Update clientprefs.sp

* Update clientprefs.sp

* Update clientprefs.sp

* Create natives.sp

* Delete natives.sp
2020-07-08 20:38:35 -07:00
stickz
100f1e56ca
mapchooser: Add option for persistent map storage (#1183)
* Add option for persistent previous map storage

* Fix spacer

* Recall previous maps before CreateNextVote()

* Remove MAPCHOOSER_TXT define

* nits and bits

* Update mapchooser.sp

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-07-08 19:56:26 -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
stickz
287628bfee
mapchooser: Clear map history on limit change (#1197)
This commit fixes a bug where if the value of `sm_mapvote_exclude` is reduced, the change may not take effect right away.
2020-07-08 18:36:50 -07:00
Erik Minekus
47514c7708
Do not require quotes around message in sm_psay (#1300) 2020-07-01 18:58:20 +01: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
Accelerator74
2d971a9fb7
Prevent voteban evading & add ban length cvar (#1249) 2020-06-13 16:00:44 -07:00
Deathreus
13621a1274
Add an array operations to CDataPack (#1219) 2020-05-08 15:23:48 -07:00
Arron Vinyard
5ed2f79217
Replace GetCmdArgs with args param (#1229) 2020-05-08 15:09:44 -07:00
Vladimir
3696a4cd9e
Correct parameter detail in OnEntityDestroyed (#1237) 2020-05-08 15:08:34 -07:00
Arron Vinyard
8259bd316a
Alert players of map history console output (#1242) 2020-05-08 15:04:57 -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
thewavelength
25462071df
Make GetStringTableData native binary-safe (#1232)
Replace StringToLocalUTF8 with LocalToString and memcpy to make this binary compatible and update the documentation.
2020-04-14 17:51:39 +01:00
Tom
7f239bb931
Prevent clients from spamming global chat using sm_nominate (#1217) 2020-03-21 17:24:45 +00:00
Asher Baker
ece447182f
Fix basecomm failing to load on games without sv_alltalk (#1212) 2020-03-11 21:24:16 -07:00
Asher Baker
d59edc5d0a
Use GetCmdArgInt(Ex) in base plugins (#1203) 2020-03-04 22:07:00 +00:00
Headline
604942f0e7
Add helper stocks for getting numerical command arguments (#1194) 2020-03-04 13:17:10 -08:00
Arthurdead
bcd5e40842
sdktools: expose additional tr sdk capabilities (#1145)
* add the rest of the trace enumerate funcs

* fix ident
2020-02-26 16:19:55 -08:00
stickz
68e45f3583
mapchooser: Replace existing map entry from exclusion list (#1184) 2020-02-26 15:59:35 -08:00
Arron Vinyard
a1ed47be87
IsServerProcessing: improve grammar / present|correctness. (#1188)
Wording of comment was a bit off.
2020-02-26 15:54:19 -08:00
Ҝờţأķ
ded3867605
regex: add/document missing offset param (#1175)
* Regex Little Changes

* Prevented to triple and double call `strlen`.
* More informative message on `if (offset >= len)`.
* Add missing parametr in navite `MatchRegex`.

* Regex Little Changes v2

* Using `strdup` instead `strcpy`.
* Replaced NULL to nullptr.
* Removed note about MatchOffset.

Co-Authored-By: Headline <headline@users.noreply.github.com>

* Removed padding.

Co-Authored-By: Headline <headline@users.noreply.github.com>

* Removed more padding.

Co-Authored-By: Headline <headline@users.noreply.github.com>

Co-authored-by: Headline <michaelwflaherty@me.com>
2020-02-26 15:52:04 -08:00
David Anderson
2b6833f65d
Merge pull request #1167 from Scags/teleport-defaulted
Add default values to TeleportEntity
2020-02-26 13:17:45 -08:00
MartLegion
cd37354634
Change sm_beacon to use game-specific team colors (#1187)
Added game color config & specific settings for L4D/L4D2

Created the following keys:

"Team1Color"	"75,255,75,255"
"Team2Color"	"255,75,75,255"
"Team3Color"	"75,75,255,255"
"Team4Color"	"255,128,0,255"
"TeamUnknownColor"	"255,255,255,255"

Added a specific setting for L4D/L4D2 game:

"Team2Color"	"75,75,255,255"
"Team3Color"	"255,75,75,255"
2020-02-23 14:03:00 +00:00
Bara
1534f8749b
NPOTB: Clarify forward declarations in sdhooks.inc (#1152) 2020-02-08 17:35:40 -08:00
proobs
4ea85a9291 Add new CSWeaponID knives (#1126) 2020-02-08 17:28:38 -08:00
thorgot
452338dc11
Fix incorrect nomination response (#1161) 2020-02-06 22:53:59 -08:00
sneak-it
b6a6387f16
Prevent basecommands from printing to disconnected clients (#1138) 2020-02-06 22:32:16 -08:00
proobs
4a8c869b7e
Update Forward Creation to Newer GlobalForward Methodmap (#1143) 2020-02-06 22:27:44 -08:00
Deathreus
48ed38a8c1
Fix documentation in some DataPack methods (#1164) 2020-02-06 22:05:32 -08:00
naydef
fba71ed24d
Deprecate IsSoundPrecached (#1172)
Fix #1170
2020-02-06 10:33:44 -08:00
Scags
625650c160
Add default values to TeleportEntity 2020-02-01 02:53:59 -06:00
Impact
9f4c6c61d9 Add comment about common.phrases to FindTarget (#1155)
* Add note about common.phrases

* Update helpers.inc

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2020-01-14 15:00:27 -08:00
Erik Minekus
664b352559 Fix Documentation Typo in functions.inc (#1156) 2020-01-12 12:23:08 -08:00
Impact
26422fd425 Fix typo in clientprefs plugin description (#1142) 2019-12-14 16:12:14 -08:00
Einyux
2a9deb6a64 Add missing const to origin parameters (#1079) 2019-11-13 00:33:00 -08:00
42
351e406f85 Fix ArrayStack.Pop documentation (#1099) 2019-11-13 00:26:36 -08:00
hydrogen-mvm
9e39f18230 Fix OpenFile files.inc example (#1120)
"rb" = binary file for *reading* (not writing, that would be "wb").
2019-11-11 16:24:12 -08:00
Bara
23e1c0b71e Add slot define for healthshot/shield and tablet (#1114) 2019-11-04 12:36:17 +00:00
Bara
273f058da9 Add classic knife to CSWeaponID (#1111) 2019-10-31 13:50:29 -07:00
Headline
c6f751bb67
Return DBDriver instead of Handle in DBI (#1109) 2019-10-31 01:53:50 -07:00
nosoop
06d327e76c Reverted addition of TF_CUSTOM_GENERIC_BOMB 2019-10-16 17:10:57 -07:00
nosoop
2e28b036f8 Add new condition and custom damage type from Scream Fortress XI 2019-10-16 00:13:41 -07:00
nosoop
024ae2b9ed Use map display name for admin map chooser menu (#1097) 2019-10-07 19:15:36 +01:00
Einyux
e02e6bcb4f Add TR_GetHitBoxIndex() native (#1085)
Fixes #1080
2019-09-17 21:24:36 +01:00
David Anderson
c7392aeded Fully convert dynamicmenu to transitional enum structs. (#1082) 2019-09-15 14:02:46 -07:00
42
207584818f Add RequestFrameCallback optional data param (#1068) 2019-09-02 14:00:22 -07:00
RumbleFrog
ab5f00b65b Correct FrameIterator retval regression (#1066) 2019-08-26 19:26:51 -07:00
JoinedSenses
b8fd7db58d Create menu if multiple nom matches found (#983)
This change checks the nomination against the map arraylist. If the nomination matches multiple results, those results are then added to a menu to allow the client to select available maps. The maps added to the menu go against the same checks as the normal nomination menu and wont allow nomination of disabled maps.

Example image of /nominate jump_b
https://i.imgur.com/ZdzB0gk.png

If reply source is console, menus wont be generated and it will attempt to nominate as normal.
2019-08-01 13:48:10 +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
hydrogen-mvm
fb9b284bcf Correct malformed Regex documentation (#1055) 2019-07-31 10:48:46 -07:00
42
199802150b Update TF2_IgnitePlayer to support setting duration of fire (#1038)
Related to #713
2019-07-05 22:37:25 +01:00
Batfoxkid
cf0a49881e TFCond Descriptions (#1005)
This is mainly for API (https://sm.alliedmods.net/new-api/tf2/TFCond) to show description of the condition.
2019-06-01 15:43:06 +01:00
JoinedSenses
527a998740 Fix whitespace regression from #1012 (#1026) 2019-05-30 20:11:43 -07: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
JoinedSenses
81dc80fbd1 Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
Bara
9c55eed549 Add Shield and Bumpmine to cstrike.inc (#991) 2019-05-24 06:03:42 -07:00
Loïc
6addc5c8dd Fix wrong formatting to "Vote Delay Minutes" when delay above 60s (#1009)
Fixes #1007
2019-05-13 00:20:47 +01:00
JoinedSenses
2e72fc115d Fix malformed documentation indentation in Array.FindValue (#1002)
Modified indention for uniformity
2019-05-09 16:56:17 -07:00
JoinedSenses
26462f2848 Add Sort and SortCustom to ArrayList methodmap (#1003) 2019-05-09 18:44:31 +01:00
iNilo
e1648ba8f9 Add missing semicolon to profiler.inc (#996) 2019-05-03 02:11:03 -07:00
404UNF
ae00144e84 Add new custom kill identifier for TF2 (#972) 2019-04-22 22:53:31 +01:00
Playa
59baaf1123 Fix param order in CancelClientMenu documentation (#982) 2019-04-22 20:33:27 +01:00
⭐ B3none
8f0527487f SQL-Admin-Manager: style clean-up (#974)
* Switched to sizeof instead of hard-coding for loop size

* Switched back to pre-increment.

* Dynamically pad variables
2019-04-06 11:47:21 -07:00
TheRandomLabs
f4b9dfb2e7 Fix misspelling of "runoff" in mapchooser (#973) 2019-03-23 18:21:54 -07: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
Ҝờţأķ
7f9ceaac06 basevotes: Fix buffer size for workshop obtained levels. (#956) 2019-03-03 15:00:24 -08:00
Bara
d105ce778d
Add missing semicolon
Otherwise you'll get this error:
regex.inc(182) : error 001: expected token: ";", but found "<newline>"

[Example with latest sourcemod (1.10.6383) version](https://travis-ci.org/Bara/TroubleinTerroristTown/jobs/495529570#L640)
2019-02-19 17:21:17 +01:00
Ross Bemrose
45fb26d282 Change MultiTargetFilter to a typeset that allows ArrayList as its second argument. (#955) 2019-02-03 13:27:26 -08:00
Bara
3e454db2d8 Add snowball to CSWeaponID (#936) 2019-01-05 14:56:07 -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
Nick Hastings
821251b176 Fix BfRead.BytesLeft not being able to be optional. (fixes #945). 2019-01-01 15:34:26 -05:00
Deathreus
1b3599c189 Bump non-critical versioning to 1.10 (#939) 2018-12-27 21:02:14 -05:00
David Anderson
faa10f52a8 Move dynamicmenu.sp enum structs to transitional syntax. 2018-12-16 18:49:36 -08:00