AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SourceBans / SourceBans++ (https://forums.alliedmods.net/forumdisplay.php?f=152)
-   -   SourceBans 1.5.0 BETA game plugin (https://forums.alliedmods.net/showthread.php?t=207840)

DJ Tsunami 02-07-2013 11:15

SourceBans 1.5.0 BETA game plugin
 
2 Attachment(s)
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!

ocwoody 02-07-2013 16:31

Re: SourceBans 1.5.0 BETA game plugin
 
Awesome! Nice Job!

ecca 02-07-2013 17:31

Re: SourceBans 1.5.0 BETA game plugin
 
Wow great, been looking forward to this :)

Dr. McKay 02-07-2013 18:50

Re: SourceBans 1.5.0 BETA game plugin
 
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).

Horsedick 02-07-2013 20:17

Re: SourceBans 1.5.0 BETA game plugin
 
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.

psychonic 02-08-2013 00:50

Re: SourceBans 1.5.0 BETA game plugin
 
:ooooooooooo

Tsunami++

IcEWoLF 02-08-2013 02:49

Re: SourceBans 1.5.0 BETA game plugin
 
Very nice!
I'll make a test server and start testing out this new plugin!

DJ Tsunami 02-08-2013 11:44

Re: SourceBans 1.5.0 BETA game plugin
 
Quote:

Originally Posted by Dr. McKay (Post 1889638)
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 :)

Dr. McKay 02-08-2013 12:55

Re: SourceBans 1.5.0 BETA game plugin
 
Quote:

Originally Posted by DJ Tsunami (Post 1890162)
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.

daleGEND 02-08-2013 14:39

Re: SourceBans 1.5.0 BETA game plugin
 
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.


All times are GMT -4. The time now is 21:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.