Raised This Month: $90 Target: $400
 22% 

SourceBans 1.5.0 BETA game plugin


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Old 02-07-2013 , 11:15   SourceBans 1.5.0 BETA game plugin
#1

Welcome
to the SourceBans 1.5 game plugin!

Since rewriting both the game plugin and web panel for SourceBans 2.0 was too big of an undertaking, considering we have a small development team, I opted to first rewrite the game plugin for the current release. This version consists of 3 plugins:

Core Plugin
This plugin is mandatory and handles the connection to the database, as well as loading of the configuration file. It provides natives for third party plugins to retrieve configuration values and query the database. If the database connection is lost, it will reconnect the next time a query is executed.

Admins Plugin
Based off of the collection of SQL admin plugins that come with SourceMod, it provides commands and natives to add/delete admins and groups from within the game server. It has full support for command/group overrides, group immunity might be enabled later or with SourceBans 2.0. If you don't want to use the admins part of SourceBans, simply don't install this plugin

Bans Plugin
Integrates with SourceMod's banning system (supporting BanClient / BanIdentity / RemoveBan) and stores bans in a local database for 5 minutes, instead of using Valve's banning system. This database also stores bans temporarily in case your MySQL server goes down. Lastly, the ban length menu is configurable to show specific options to different admin groups.

Commands
HTML Code:
<!-- Reload config and ban reason menu options -->
sb_reload

<!-- Add/remove admins and groups -->
sb_addadmin <name> <authtype> <identity> [password] [group1] ... [group N]
sb_deladmin <authtype> <identity>
sb_addgroup <name> <flags> [immunity]
sb_delgroup <name>
sb_setadmingroups <authtype> <identity> [group1] ... [group N]

<!-- Ban/unban Steam IDs and IP addresses -->
sm_ban <#userid|name> <minutes|0> [reason]
sm_banip <ip|#userid|name> <time> [reason]
sm_addban <time> <steamid> [reason]
sm_unban <steamid|ip>
Forwards and natives
(Full documentation is in the include file)
Code:
forward void SB_OnConnect(Database db); forward void SB_OnReload(); native void SB_Connect(); native bool SB_Escape(const char[] string, char[] buffer, int maxlength, int &written = 0); native void SB_Execute(const char[] query, DBPriority prio = DBPrio_Normal); native void SB_GetConfigString(const char[] key, char[] buffer, int maxlength); native any SB_GetConfigValue(const char[] key); native void SB_Init(); native void SB_Query(SQLQueryCallback callback, const char[] query, any data = 0, DBPriority prio = DBPrio_Normal); native void SB_Reload(); native int SB_GetAdminId(int client); native void SB_AddAdmin(int client, const char[] name, const char[] authtype, const char[] identity, const char[] password = "", const char[] groups = ""); native void SB_DeleteAdmin(int client, const char[] authtype, const char[] identity); native void SB_AddGroup(int client, const char[] name, const char[] flags, int immunity = 0); native void SB_DeleteGroup(int client, const char[] name); native void SB_SetAdminGroups(int client, const char[] authtype, const char[] identity, const char[] groups = ""); native void SB_ReportPlayer(int client, int target, const char[] reason);

Beta
Although I have tested it a lot, I can't be certain everything works correctly, so I wouldn't recommend running it on a production server yet. I'm especially interested in:
  • If the server ID is correctly detected
  • If admin and group permissions are retrieved correctly from the database
  • If bans are stored properly, even from third party plugins
  • If the local bans database works correctly
  • Any other problems or errors

Changes
Some notable differences from the previous plugin:
  • configs/sourcebans/sourcebans.cfg is now configs/sourcebans.cfg
  • Inside sourcebans.cfg, instead of a "ServerID" option, there is now a "ServerIP" option, which you should only need if your game server is behind NAT (a router/firewall) or if -ip is not set on startup.
  • If there is no "sourcebans" section inside configs/databases.cfg, it will use the "default" section instead
  • The sm_rehash command has been removed, since it had the same functionality as the sm_reloadadmins command that's provided by SourceMod.
  • There is no option yet to backup admins to config files in case the database connection is lost. Since SourceMod already has an admin cache, this should only be a problem if you restart the game server.

Thanks for all the help in advance!
Attached Files
File Type: zip sourcebans-1.5.0-dev.zip (85.5 KB, 229 views)
__________________

Last edited by DJ Tsunami; 02-22-2016 at 08:53.
DJ Tsunami is offline
ocwoody
AlliedModders Donor
Join Date: Nov 2010
Location: huh
Old 02-07-2013 , 16:31   Re: SourceBans 1.5.0 BETA game plugin
#2

Awesome! Nice Job!
ocwoody is offline
ecca
Sexy Santa
Join Date: Jan 2011
Old 02-07-2013 , 17:31   Re: SourceBans 1.5.0 BETA game plugin
#3

Wow great, been looking forward to this
__________________
ecca is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-07-2013 , 18:50   Re: SourceBans 1.5.0 BETA game plugin
#4

Cool!

I'd like to request that a parameter be added to SB_SubmitBan to specify whether it should be a Steam ID ban or an IP ban (or both).
__________________
Dr. McKay is offline
Horsedick
AlliedModders Donor
Join Date: Sep 2011
Old 02-07-2013 , 20:17   Re: SourceBans 1.5.0 BETA game plugin
#5

nice, not sure I'm going to test but I'll watch it. I've had to edit the previous SB plugin to not over write some other config files as I use them for backups so I'll have to study the source and see what all it changes or messes with including what I may need to alter.
Horsedick is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-08-2013 , 00:50   Re: SourceBans 1.5.0 BETA game plugin
#6

:ooooooooooo

Tsunami++

Last edited by psychonic; 02-08-2013 at 00:50.
psychonic is offline
IcEWoLF
Senior Member
Join Date: Jul 2007
Old 02-08-2013 , 02:49   Re: SourceBans 1.5.0 BETA game plugin
#7

Very nice!
I'll make a test server and start testing out this new plugin!
__________________
The 47 Ronin Gaming - http://www.47r-squad.com


IcEWoLF is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Old 02-08-2013 , 11:44   Re: SourceBans 1.5.0 BETA game plugin
#8

Quote:
Originally Posted by Dr. McKay View Post
I'd like to request that a parameter be added to SB_SubmitBan to specify whether it should be a Steam ID ban or an IP ban (or both).
SB_SubmitBan merely submits a player to the database so admins can review whether the player should be banned (the same as the "Submit a ban" page on the current webpanel). If you want to actually ban a player, Steam ID or IP address you have BanClient and BanIdentity.

Also, it's currently not a priority to add a "both" ban type. Maybe in the future
__________________
DJ Tsunami is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-08-2013 , 12:55   Re: SourceBans 1.5.0 BETA game plugin
#9

Quote:
Originally Posted by DJ Tsunami View Post
SB_SubmitBan merely submits a player to the database so admins can review whether the player should be banned (the same as the "Submit a ban" page on the current webpanel). If you want to actually ban a player, Steam ID or IP address you have BanClient and BanIdentity.

Also, it's currently not a priority to add a "both" ban type. Maybe in the future
That makes sense, and that makes this even more awesome.
__________________
Dr. McKay is offline
daleGEND
AlliedModders Donor
Join Date: Feb 2005
Location: USA
Old 02-08-2013 , 14:39   Re: SourceBans 1.5.0 BETA game plugin
#10

Hi Tsunami,

Wanted to play around with this on my test server. Should I have this run off a new SourceBans database or can I use my current 1.4 database? Thanks bud! Also I shot you a PM about a possible UI development project if you're interested in my help.
__________________
Bor3d Gaming - A Mature Online Gaming Community

Feel free to add me on STEAM as well: https://steamcommunity.com/id/b0r3d
daleGEND is offline
Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:32.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode