• global ban support?
    4 replies, posted
Hello, I am part of a CSS community that is big in CSS and currently use a global bans system for all our servers. We recently took a crack at gmod and got a pretty decent TTT server up and are thinking about expanding. One problem, bans saving serverside, sucks, and easially hackable. I was wondering if there is something that will enable gmod to be able to be on our global bans. Our global bans site is, steamgamers.com/banned. We use sourcemod and ULX.
Sourcebans can ban on any source game.
I'm guessing it's using a MySQL database? Connect to it with one of the gmod mysql modules, get the bans table and possibly insert it into a table for later use. Then use gatekeeper to check to see if they are banned? I have a pretty good global ban system that I made myself and could post some code when I get on my good computer. [url]http://blackopsservers.com/bans[/url] Aha, seems I have some of the files on my laptop. Here's some code snipets you will have to modify for yourself. Get the bans table using tmysql [lua] hook.Add( "Initialize", "GetTheBansPlease", function() tmysql.query( "SELECT * FROM global_bans", function( tab, succ, error ) if !succ then SQL:ErrorPrint( error ) elseif tab then ServerLog( "[MySQL]: Got Banlist!" ) for k,v in ipairs( tab ) do if v.server == SQL.ServerName or v.server == "all" then table.insert( G_BANS_TABLE, { steamid=v.steamid, name=v.name, length=tonumber( v.length ), reason=v.reason, server=v.server } ) end end end end, 1) end )[/lua] Check if the steamid is banned [lua] function DoBanCheck( steamid ) -- I use this function in gatekeeper for k,v in ipairs( G_BANS_TABLE ) do if v.steamid and v.length then if v.steamid == steamid then if v.length == 0 the ServerLog( "Perma-Banned user ("..steamid..") attempted to connect" ) return { false, "You are perma-banned from this server." } elseif tonumber( v.length ) > os.time() then --If the ban is still in place local timeleft = TimeLeftOnBan( v.length - os.time() ) --Time left on ban just formats the os.time() into a nice readable format for the user ServerLog( "Banned user ("..steamid..") attempted to connect. " .. timeleft ) return { false, "You are banned for " .. timeleft } end end end end return true end [/lua] It's hard to tell though if your ban system works similar to mine, but I hope this helps.
[quote]One problem, bans saving serverside, sucks, and easially hackable. [/quote] Having a web front makes your ban system a whole load more vulnerable. Unless you're a careful coder, of course.
[url]http://easyban.net/[/url] works fine for me. Pro account gives you full unlimited global ban servers, and subusers. For $5 a month, it's worth it in my humble opinion.
Sorry, you need to Log In to post a reply to this thread.