Ulysses Stuff > Releases
Sourcebans & ULX/ULib
Arhenox:
Almost everything is working ok, except Sourcebans XD
After map change - there's no problem, but after few minutes I get "[SourceBans.lua] The server has lost connection to the database. Retrying..." error, then when I try to ban someone - bans don't get saved in database. Recently I've changed my hosting provider, but their MySQL settings are exactly the same (although I didn't get this error before). I've added some notifymessage functions to the script, so it would notify me if there were any problems with DB, but they're not showing in the server console (additionaly - message in BanOnSuccess function doesn't show up too, so it's not being called). Any ideas?
------------------------
Edit: Everything is working OK right now, I've added checking is database connected and if not, database:connect(); :)
Rhapsody:
--- Quote from: Mors Quaedam on December 10, 2012, 12:18:37 PM ---Okay, I've done a crapload of fixes (as you also forgot the gatekeeper), but !sban won't put bans onto the SourceBans database.
Dat empty banlist:
Anyway, I've found the working gatekeeper lua for gmod 13. Place it in srcds/orangebox/garrysmod/lua/includes/modules:
--- Code: ---gatekeeper={}
local spawning={}
gameevent.Listen("player_connect")
gameevent.Listen("player_disconnect")
function gatekeeper.Drop(userid, reason)
game.ConsoleCommand(string.format("kickid %d %s\n",userid,reason:gsub(';|\n','')))
end
function gatekeeper.GetNumClients()
local active=#player.GetAll()
return {spawning=#spawning, active=active, total=#spawning+active}
end
function gatekeeper.GetUserByAddress(addr)
for k,v in pairs(player.GetAll()) do
if(v:IPAddress()==addr) then
return v:UserID()
end
end
end
hook.Add("player_connect", "GateKeeper", function(data)
local ret=hook.Call("PlayerPasswordAuth", GAMEMODE, data.name, "", data.networkid, data.address)
print(ret)
if(type(ret)=="string") then
gatekeeper.Drop(data.userid, ret)
return
elseif(type(ret)=="boolean") then
if(ret) then
gatekeeper.Drop(data.userid, "Bad Password")
return
end
end
table.insert(spawning, data.userid)
end)
hook.Add("player_disconnect", "GateKeeper", function(data)
for k,v in pairs(spawning) do
if(data.userid==v) then
table.remove(spawning, k)
break
end
end
end)
hook.Add("PlayerInitialSpawn", "GateKeeper", function(ply)
for k,v in pairs(spawning) do
if(ply:UserID()==v) then
table.remove(spawning, k)
break
end
end
end)
function gatekeeper.DropAllClients(reason)
for k,v in pairs(spawning) do
gatekeeper.Drop(v, reason)
end
for k,v in pairs(player.GetAll()) do
gatekeeper.Drop(v, reason)
end
end
--- End code ---
--- End quote ---
This may seem like quite a bump, but I've used the code from this post to add gatekeeper, and it's working perfectly. However, one of the things that I've noticed, regardless as to whether gatekeeper is installed or not, is that Sourcebans fails to report the name of the person who banned the player, and instead says CONSOLE. Is there anything I can do to fix this?
Xer0n:
I did your "second" option to incorporate everything into one command, but ULX seems to be relying solely on Sourcebans and not writing anything to banned_users.cfg and the "listid" function & banlist in ULX are empty when blocking.
I fear that if the bans aren't being written to ULX when a blocked user joins, should the website go down all of the bans will be exempt and be a security risk.
When I was on evolve and a user joined that was source banned it would write that steamid into the server preventing them from even connecting and getting to "Sending Client Info.." on the first connect until the ban was removed.
Also when I click on the 'SourceBans' tab in ULX, it shows a bunch of steamid's.. I don't know what this is showing me. Is it everyone banned on this server?
Stickly Man!:
--- Quote from: Xer0n on May 28, 2014, 01:31:50 AM ---Also when I click on the 'SourceBans' tab in ULX, it shows a bunch of steamid's.. I don't know what this is showing me. Is it everyone banned on this server?
--- End quote ---
ULX does not natively support SourceBans- what that is referring to is bans that are stored in the Source Engine (banned_users.cfg, via banid command). ULX currently uses these bans in conjuction with data from data/ulib/bans.txt to store bans- any bans that show up in that menu are bans that don't have any data from the bans.txt file.
Xer0n:
Ok, my only concern is that we run 8 GMod servers and when we ban a user from one, they keep trying to connect to other servers. They never actually get "source banned" according to the ULX Ban Menu. It gets pretty annoying when sourcebans has to keep blocking.
Evolve would write the ban into the engine, and on it's 5 minute checkup it would remove any that don't exist as active on sourcebans.. maybe I'm just used to that.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version