gmsv_gatekeeper - Lua controlled server authentication
453 replies, posted
Managed to fix it for the latest update with windows.
[url]https://code.google.com/p/blackawps-glua-modules/source/browse/trunk/gmsv_gatekeeper/bin/gmsv_gatekeeper_win32.dll?spec=svn135&r=135[/url]
[img]http://puu.sh/1qAKg[/img]
[editline]15th November 2012[/editline]
Just a side note.. gatekeeper.Drop seems to be broken, and I can't for the life of me fix it. Seems the windows vtable is significantly different from linux now.
Thanks, the update fixed the crash!
[QUOTE=BlackAwps;38466182]Managed to fix it for the latest update with windows.
[url]https://code.google.com/p/blackawps-glua-modules/source/browse/trunk/gmsv_gatekeeper/bin/gmsv_gatekeeper_win32.dll?spec=svn135&r=135[/url]
[img]http://puu.sh/1qAKg[/img]
[editline]15th November 2012[/editline]
Just a side note.. gatekeeper.Drop seems to be broken, and I can't for the life of me fix it. Seems the windows vtable is significantly different from linux now.[/QUOTE]
You can always use their NetChannel:
[url]https://code.google.com/p/mfsinc/source/browse/trunk/VC/gmsv_sourcenetinfo_win32/gmsv_sourcenetinfo_win32/main.cpp[/url]
[lua]
ply:GetNetChannel():Shutdown("Custom message here")
[/lua]
For some reason the GetUserByAddress function seems to crash the server whenever ran if a player is on the server.
Crash Dump: [URL]http://puu.sh/1rOkc[/URL]
I wish there was a function to return a table of connecting players and not just how many are connecting.
I hope gatekeeper.Drop is fixed in the near future, makes sourcebans lua a little more informative.
For now you can just use kickid
Untested:
[lua]
function gatekeeper.Drop(uid, reason)
game.ConsoleCommand(string.format("kickid %d %s\n", uid, reason))
end
[/lua]
You can also use sourcenetinfo's Shutdown which is afaik the same as gatekeeper.Drop as stated by mfsinc.
Linux version is here: [url]http://g.iriz.uk.to/~srcds/modules/gm13/bin/[/url]
No, the gatekeeper there does not work, yet.
[lua]
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)
[/lua]
I call it.. FateKeeper(or fakekeeper)
A pure lua gatekeeper, no more whining to garry.
Tested, it works.
[editline]21st November 2012[/editline]
[lua]
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
[/lua]
Almost forgot this guy!
bump, is there any progress on this?
where can I find a linux version taht works?
[QUOTE=john2012;39180775]where can I find a linux version taht works?[/QUOTE]
Think you'd have to ask BlackAwps nicely, or someone else that compiles for linux to help you, if the latest revision of gatekeeper on his Svn doesn't work for linux.
For now, as a substitute, why not use FateKeeper/Fakekeeper/Fake Gatekeeper?
If you only need the hook you can use mine: [url]http://g.iriz.uk.to/~srcds/modules/gm13/bin/[/url]
[B]GATEKEEPER.DROP DOES NOT WORK[/B]
[QUOTE=Python1320;39193550][B]GATEKEEPER.DROP DOES NOT WORK[/B][/QUOTE]
yeah I figured that one out last night
Last Version of Gatekeeper are giving Unknow SteamID: STEAM_ID_UNKNOWN
So fix for STEAM_ID_UNKNOW Yet?
Gatekeeper is now obsolete.
[url]http://facepunch.com/showthread.php?t=1247035&p=39677862&viewfull=1#post39677862[/url]
[QUOTE=BlackAwps;39724311]Gatekeeper is now obsolete.
[url]http://facepunch.com/showthread.php?t=1247035&p=39677862&viewfull=1#post39677862[/url][/QUOTE]
But this feature is LIVE? Working on Steam Version?
It is now.
The new hook CheckPassword added in the game has dumb arguments. 0(always 0 for some reason), IP, Password, Name.
I assume 0 is suppose to be SteamID but it only returns 0 all the time.
[QUOTE=TOMASAS;39725024]The new hook CheckPassword added in the game has dumb arguments. 0(always 0 for some reason), IP, Password, Name.
I assume 0 is suppose to be SteamID but it only returns 0 all the time.[/QUOTE]
make a bugreport
[QUOTE=TOMASAS;39725024]The new hook CheckPassword added in the game has dumb arguments. 0(always 0 for some reason), IP, Password, Name.
I assume 0 is suppose to be SteamID but it only returns 0 all the time.[/QUOTE]
Name, Password, Ip serv password are working fine, just the SteamID are 0 to me too.
[editline]26th February 2013[/editline]
And the Workshop Collection are not working are CRASHING my Srcds, and the GMA folder not mounting the .gma files...
[QUOTE=TOMASAS;39725024]The new hook CheckPassword added in the game has dumb arguments. 0(always 0 for some reason), IP, Password, Name.
I assume 0 is suppose to be SteamID but it only returns 0 all the time.[/QUOTE]
Are you testing on a listen server
[QUOTE=Banana Lord.;39727769]Are you testing on a listen server[/QUOTE]
ON SRCDS
[QUOTE=nexbr;39727786]ON SRCDS[/QUOTE]
Okay, no need to yell, you didn't say that before.
[QUOTE=Banana Lord.;39727793]Okay, no need to yell, you didn't say that before.[/QUOTE]
I'm not yelling, is because the right is SRCDS no srcds
Oh, I just thought you were since you said "[b]ON[/b]", my bad!
[QUOTE=Banana Lord.;39728039]Oh, I just thought you were since you said "[b]ON[/b]", my bad![/QUOTE]
Sorry pal, Caps was on on the "ON". my bad.
[editline]26th February 2013[/editline]
Anyway we can fix it? or just carry on the next update on the next 100 years?
[QUOTE=nexbr;39728060]Sorry pal, Caps was on on the "ON". my bad.
[editline]26th February 2013[/editline]
Anyway we can fix it? or just carry on the next update on the next 100 years?[/QUOTE]
Theres a new hook for this, just fixed in the newest update, i just wrote this page to explain it:
[url]http://gmodwiki.net/Lua/Hooks/Base/CheckPassword[/url]
Anyone got a fixed up version of this? This allows for custom messages instead of just "Bad Password"
Sorry, you need to Log In to post a reply to this thread.