Another ULX Source Bans Module

https://garrysmods.org/download/15331/button.png

This was originally a modified version of FunDK’s release from way back 0.1.7a http://forum.facepunch.com/showthread.php?t=1311847
I’ve done lots to it since.

Features:

  • All the usual ban stuff that goes in to the sourcebans database, so you can share bans across all of your servers.
  • Check if players are sharing the game, and ban the game lender at the same time.
  • Unban from in-game XGUI
  • Edit bans from in-game XGUI
  • Automatic reconnection to mysql server if it fails.
  • Announce to your admins how many bans a player has when they join the server. (does nothing if they don’t have any bans)
  • Vote SBan

Limitations:

  • The XGUI currently only shows active bans, bans that have expired are not shown.
  • I haven’t added the edit information to bans, you won’t see who made an edit to a ban in the XGUI.
  • Family sharing requires the steamapi to be up, running, and stable. You may get spammed with errors in the server console when steam doesn’t behave.

Requirements:

  • SourceBans 1.4.11
  • tmysql4
  • ULX 3.70

Installation:

  • Install tmysql4
  • Unzip the garrysmod folder to your /garrysmod/ folder and overwrite any files if it asks.
  • Get an API key if you want to use the family sharing features. http://steamcommunity.com/dev/apikey
  • Configure the addon from garrysmod/addons/ulx/lua/ulx/modules/sban.lua all the settings are at the top of the file.
  • Make sure you add ulx_sban_serverid with the correct server id to your server.cfg
  • Ban people.

GitHub:

Download:
Latest from GitHub

1.0
Added option to override default ulx ban.
Remove all existing sban files when upgrading to this version.
Restore ulx/xgui/settings/server.lua with original ulx version.

0.9
0.7
0.5
0.3
0.2
0.1

  • Can you stick this on GitHub?
  • Do we have to add all admins to the database manually?

I’ll add a github at some point, just a little busy atm.

It is advisable to add all admins to your sourcebans website, because it lets you selectively assign/unassign admins to each server/group of servers from the website, otherwise you can just set “removeFromGroup” to false and admins won’t be removed from the server if they’re missing from the website.

(and yeah, adding admins is a manual thing.)

Edit: actually, if an admin bans someone on the server and the admin doesn’t exist on the website, it might cause issues… I’ll just add something to this in case that happens.

Accidentally left in some code that looked up a custom database table I had on my servers, which obviously wouldn’t work for anyone else…

Updated to 0.3 now.

Do we still set the groups up in the server and just make a group named the same thing on sourcebans?

EDIT: Answered my own question by testing. Can you make it so I can exclude a group from the auto demote? I run TF2 servers also, and would like to be able to keep my rank on there with out making a new group.

Yep, set up your groups on the server and assign permissions there, then create the groups with the same name on sourcebans.

Could you please check my second question above please? I would love to use this along with my TF2 admins.

Exclude demoting groups with certain names only? or all groups?

Specific groups. If I did all, then I could not have vips auto demote :smiley:

Done, download the latest from github.
Just add the group names the same way as the admin groups are shown.

Thanks man!

Its not banning people. Watch video

(Edit out the video)

I followed the

Installation:

  • Install mysqloo! http://forum.facepunch.com/showthread.php?t=1357773
  • Unzip the ulx folder to your /addons/ folder and overwrite any files if it asks.
  • Get an API key if you want to use the family sharing features. http://steamcommunity.com/dev/apikey
  • Configure the addon from /addons/ulx/lua/ulx/modules/sban.lua all the settings are at the top of the file.
  • Make sure you add ulx_sban_serverid with the correct server id to your server.cfg
  • Ban people

How its setup in sban.lua (The Fake stuff is in place of the real stuff)


CreateConVar("ulx_sban_serverid", "1", FCVAR_NONE, "Sets the SBAN ServerID for the Source Bans ULX module")

-- Config section
-- Add ulx_sban_serverid to your server.cfg

local SBAN_PREFIX			= "sb_"						--Prefix don't change if you don't know what you are doing
local SBAN_WEBSITE			= "rcted.com/sourceban"	--Source Bans Website

local SBANDATABASE_HOSTNAME	= "00.00.000.000"			-- Database IP/Host
local SBANDATABASE_HOSTPORT	= 3306					--Database Port (Default mysql port 3306)
local SBANDATABASE_DATABASE	= "Fake"			--Database Database/Schema
local SBANDATABASE_USERNAME	= "Fake"			--Database Username
local SBANDATABASE_PASSWORD	= "Fake"	--Database Password
local database_sban = mysqloo.connect(SBANDATABASE_HOSTNAME, SBANDATABASE_USERNAME, SBANDATABASE_PASSWORD, SBANDATABASE_DATABASE, SBANDATABASE_HOSTPORT)

local APIKey				= "Fake"	-- See http://steamcommunity.com/dev/apikey
local removeFromGroup		= true			-- Remove users from server groups if they don't exist in the sourcebans database
local checkSharing			= true			-- Check if players are borrowing the game, !!!! THIS REQUIRES AN API KEY !!!!!
local banLender				= true			-- Ban the lender of the game as well if the player gets banned?
local announceBanCount		= true			-- Announce to admins if players have bans on record.
local announceLender		= true			-- Announce to admins if players are borrowing gmod.
local banRetrieveLimit		= 150			-- Amount of bans to retrieve in XGUI.
local banListRefreshTime	= 119			-- Seconds between refreshing the banlist in XGUI, in case the bans change from outside of the server.

-- Table of groups who will get sharing/ban count notifications when players join.
-- Follow the format below to add more groups, make sure to add a comma if it isn't the last entry.

local adminTable = {
	["superadmin"] = true,
	["admin"] = true,
	["cofounder"] = true,
	["founder"] = true,
	["adminvip"] = true
}


-- This table excludes named groups from being removed, even if the option is turned on.
-- Format is the same as the admin table above.
local excludedGroups = {
	["donor"] = true,
	["e2Abuse"] = true,
	["member"] = true,
	["donorabuse"] = true
}

How it looks in my server.cfg file



sv_allowcslua 0

ulx_sban_serverid 1

sv_downloadurl "Fake"

There should be an error in the server console, can you get it? Also, your video shows your private details, you might want to change passwords and api key

forgot about the video & editing out the info thanks…

ill look in console soon

[editline]17th April 2015[/editline]

Here is some of the errors im getting…
Also some of my admin are getting set as members you can see below


12:34:06 [SBAN][ERROR] SELECT a.user as admin, b.aid, b.bid, b.sid, b.name, b.reason, b.authid, b.created, b.ends FROM sb_bans b INNER JOIN sb_admins a ON b.aid = a.aid WHERE b.RemoveType is null ORDER BY b.created DESC LIMIT 150

12:34:06 [SBAN][Init] Mysql successfully connected

12:34:07 "|RG| Spektor<3><STEAM_0:1:49672119><>" entered the game

12:34:07 [ULX] |RG| Spektor removed all access rights from |RG| Spektor

12:34:09 [ULX] (Console) added Spektor to group member


12:40:03 [SBAN][ERROR] Lost connection to MySQL server during query

12:40:03 [SBAN][ERROR] SELECT a.user as admin, b.aid, b.bid, b.sid, b.name, b.reason, b.authid, b.created, b.ends FROM sb_bans b INNER JOIN sb_admins a ON b.aid = a.aid WHERE b.RemoveType is null ORDER BY b.created DESC LIMIT 150

[editline]17th April 2015[/editline]

i think i know the reason… ill reply in a few

Can you show more of the console log? What does it say when the server loads up? Does it connect to the database at all?

I’m trying to add a user group to all web admin, server group admin & server group… its not letting me how do i do so?

nevermind

still having issue with it… can you add me to steam?

link me your steam

Hi; great useful addon, thank you. Although, I am getting an error:
Lua Error: [ERROR] addons/ulx/lua/ulx/modules/sh/sban_menu.lua:16: queueFunctionCall received a bad function

  1. error - [C]:-1
  2. queueFunctionCall - addons/ulib/lua/ulib/shared/util.lua:395
  3. call - addons/ulx/lua/ulx/modules/sh/sban_menu.lua:16
  4. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
  5. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
  6. Run - lua/includes/modules/concommand.lua:54
  7. unknown - addons/ulib/lua/ulib/shared/commands.lua:1310
  8. unknown - lua/includes/modules/concommand.lua:54

I’ve set up the database correctly, checkSharing is false, overwrote the ulx server file(only one that asked to be overwritten).

I think the only way that can happen is if there’s an error in the sban.lua file which stops it from loading…

can you check if there’s any errors during server start?