Commit Graph

21 Commits

Author SHA1 Message Date
Rain
f9ec38103a
Use auth strings when banning from menu
When an admin initiates a ban from a BaseBans GUI menu, track players by
their AuthId (SteamID) instead of userid, so that the admin is able to
target players who disconnect after that menu was constructed.

If the target player is still connected, use their userid to ban the
same as before this commit.

If the target has disconnected, write a ban using their stored AuthId
value, as with "sm_addban".

This commit also revertss the `(admin==0)` check from PrepareBan that
was mistakenly added by bf7212889b,
because it would prevent banning from server/RCON (client index 0).
2023-10-15 19:56:51 +03:00
Rain
bf7212889b Fix invalid client index in Basebans menu
Fix #1768

The `sm_admin`-triggered Menu flow for banning players is caching client
indices inside the basebans.sp `PlayerInfo` struct, and can then
incorrectly use them in the menu callback without checking for the
related client's UserId validity. This leads to bug #1768 occurring when
the ban target player disconnects from the server before the banning
admin could complete the banmenu UI flow.

Since the related menu callbacks can't rely on the cached client index,
I have removed the basebans.sp `PlayerInfo.banTarget` member entirely,
in favor of the `PlayerInfo.banTarget`, and instead call
`GetClientOfUserId(...)` to get & validate the target client index where
necessary. The `PrepareBan(...)` function has been refactored to take a
ban target UserId (instead of the target client index) accordingly.
2023-05-11 23:56:40 +03:00
Michael Flaherty
c8f3035cb0
Introduce enum structs to core sm plugins 2018-12-15 13:51:03 -08:00
Kyle Sanderson
d0bf26135c
Collection of plugin cleanups (#777)
* Fix rockthevote not clearing g_Voted on fakeclients.

* remove g_RTVAllowed in rockthevote as it's unused.

* Fix basebans using the wrong forward for configs.

* Prevent sm_addban from banning an immune steam adminid.

* Sprinkle in IsChatTrigger checks to plugins with plaintext chat hooks.

* fixup g_Voted[client] in OnClientDisconnect
2018-07-12 11:16:18 -07:00
ErikMinekus
fb2117137e Update basebans and SQL admins plugins for transitional syntax (#484) 2016-04-27 09:34:22 -04:00
David Anderson
61bf7de101 Revert adminmenu API changes. 2014-12-12 10:10:46 -08:00
David Anderson
cb4fdf1aa9 Update plugins for new syntax. 2014-11-30 18:57:38 -08:00
David Anderson
f020b5682e Port KeyValues to the transitional syntax. 2014-11-08 15:54:40 -08:00
David Anderson
b97335ccb0 Port TopMenus to transitional syntax. 2014-10-30 19:20:33 -07:00
Nicholas Hastings
a3336b1dcf Fix typo causing compile error strcmp -> strncmp 2014-10-08 18:02:05 -07:00
Nicholas Hastings
d76f62b863 Allow Steam IDs in Steam3 format for sm_addban 2014-10-08 17:29:56 -07:00
David Anderson
ad376ff0b8 Introduce a typedef keyword. 2014-08-03 21:51:34 -07:00
Asher Baker
eab6ac748f Improved error reporting in basebans custom reasons loading. 2014-07-30 16:30:01 +01:00
SystematicMania
10f878d8c7 Fix regressions in b2f7d97b1ea7 and update plugins for OnClientSayCommand changes (bug 5986, r=psychonic). 2014-02-28 10:38:36 -05:00
Matthias Kollek
fd9e657196 Add support for customizing ban reasons in basebans.sp (bug 5762, r=psychonic). 2013-08-28 13:17:17 -04:00
Erik Minekus
bcc1c2e658 Fixed typos in some usage replies (bug 4552, r=dvander). 2010-08-02 09:44:49 -04:00
Nicholas Hastings
ba76506773 Fixed inaccurate description for sm_unban (bug 4245, r=dvander) 2010-03-09 18:41:25 -05:00
Liam
9075aecb18 Updated basebans.sp to support L4D and allow future expansion of the STEAM_ identifier. (bug 3567 r=dvander) 2009-01-15 12:08:33 -05:00
Matt Woodrow
eaccf6f90b Fixed amb1918 - Ban menu should compare userids, not client indexes
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402436
2008-08-07 23:16:16 +00:00
David Anderson
62047b6d0d fixed amb1645 - command help typo
--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402107
2008-04-29 15:14:50 +00:00
Scott Ehlert
251cced1f8 Spring Cleaning, Part Ichi (1)
Various minor things done to project files
Updated sample extension project file and updated makefile to the new unified version (more changes likely on the way)
Updated regex project file and makefile

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401971
2008-03-30 07:00:22 +00:00