1. Post #281
    Hey guys,

    saw that a lot of you ain't checking against Invalid SteamID's. This should be the FIRST check. For example it keeps people out after Garry's Mod updates, very useful for ban systems.

    if SteamID == "STEAM_ID_UNKNOWN" then return {false, "SteamID Error."}; end
    if SteamID == "STEAM_ID_PENDING" then return {false, "SteamID Error."}; end
    
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Useful Useful x 2 (list)

  2. Post #282
    likes men
    Python1320's Avatar
    May 2007
    1,717 Posts
    Join 'Python1320' P:XXXX - STEAM_ID_UNKNOWN - 91.152.XXX.XXX:27005

    Unfortunately this happens too often (like right now after the latest engine update).
    You can't rely on gatekeeper alone since the SteamID can break for whatever reason.
    It's better to use gatekeeper as the first line of defense and then use the game hooks as a complement.
    Reply With Quote Edit / Delete Reply Finland Show Events Informative Informative x 1 (list)

  3. Post #283
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    I'll get to fixing this ASAP.

    I've got classes today so I'll try to get a fix out in about 4-5 hours.

    I'm also gonna look into making gatekeeper a little more tweakable with convars so that the plugin won't have to be recompiled in the future.

  4. Post #284
    Gold Member
    slayer3032's Avatar
    November 2007
    3,447 Posts
    Have you conquered your fear of linux or will I have to bug Chrisaster for it?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 2 (list)

  5. Post #285
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    All set. You can find the latest build here: http://code.google.com/p/gmodmodules...e/detail?r=158

    Valve bumped up the network protocol from 17 to 18 for who knows what reason.

    To solve this issue in the future, I introduced some new changes.

    Features of interest are two new convars:
    gk_force_protocol_enable - Enables forcing the network protocol.
    gk_force_protocol - Forces handling of a specific network protocol.

    The idea is that when the network protocol gets bumped up again, you simply set gk_force_protocol to 17 or 18 to handle the old method. This should work, but this assumes that the authentication doesn't change between protocol changes.

    Additionally you can set the convar from lua with gatekeeper.ForceProtocol( number ). This will enable forcing, and set the forced protocol. You can disable forcing by passing in nil.

    Have you conquered your fear of linux or will I have to bug Chrisaster for it?
    Nope. Bug Chrisaster or ComWalk.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Friendly Friendly x 2 (list)

  6. Post #286
    likes men
    Python1320's Avatar
    May 2007
    1,717 Posts
    Updated my compiled version: http://g.iriz.org/~srcds/modules/
    It should work but use at your own risk. Just testing it on my server and seems to work fine, but I guarantee nothing as usual.

    12:33 - Python1320: !l local sid=me:SteamID() hook.Add('PlayerPasswordAuth',1,function(u,p,s,i) if s:find(sid,1,true) then return {false,"GG, banned yourself moron"} end end)
    ] disconnect
    ] connect g.iriz.org
    Connecting to g.iriz.org...
    GG, banned yourself moron
    ] retry
    Commencing connection retry to g.iriz.org
    Connecting to g.iriz.org...
    GG, banned yourself moron
    Reply With Quote Edit / Delete Reply Finland Show Events Friendly Friendly x 2 (list)

  7. Post #287
    likes men
    Python1320's Avatar
    May 2007
    1,717 Posts
    --snip--

    (Removed VoiDeD's convar stuff and it stopped crashing)

    Stubbed the gatekeeper.ForceProtocol on voided's update to remain compatible with custom scripts, it just won't do anything, yet. This means the next protocol update will break it again, but I'm sure someone has managed to fix the convar problem by then.

    EDIT: Official fix: http://gmodmodules.googlecode.com/sv...eper_linux.dll

  8. Post #288
    Gold Member
    slayer3032's Avatar
    November 2007
    3,447 Posts
    Reply With Quote Edit / Delete Reply Linux United States Show Events Funny Funny x 2 (list)

  9. Post #289
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,264 Posts
    crashing related code
    I am having the same issue - if a player joins with an id that is not on my whitelist, the server crashes. PlayerPasswordAuth always gives STEAM_ID_UNKNOWN but doesn't crash so I tried the regular PlayerAuthed hook.

    require("gatekeeper")	
    		hook.Add("PlayerAuthed", "TestKicker", function (user, stid)
    			if !MyTable[stid] then
    				gatekeeper.Drop(user:UserID(), "No access")
    			end
    		end)
    

    Any ideas?

  10. Post #290
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    I am having the same issue - if a player joins with an id that is not on my whitelist, the server crashes. PlayerPasswordAuth always gives STEAM_ID_INVALID but doesn't crash so I tried the regular PlayerAuthed hook.

    require("gatekeeper")	
    		hook.Add("PlayerAuthed", "TestKicker", function (user, stid)
    			if !MyTable[stid] then
    				gatekeeper.Drop(user:UserID(), "No access")
    			end
    		end)
    

    Any ideas?
    Can you paste the code you're using for the PlayerPasswordAuth hook? If it's the same as Killer_Steel's then the issue is that you're using gatekeeper.Drop instead of returning a table.

  11. Post #291
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,264 Posts
    I used the following PlayedPasswordAuth hook

    require("gatekeeper")   
                    hook.Add("PlayerPasswordAuth", "ClosedBetaKicker", function (user, pass, steam, ip)
                            if !nonDB.ClosedBetaIDs[steam] then
                                    return {false, "This is a Closed Beta. Sorry."}
                            end
                    end)
    

    This didn't crash, but 'steam' was always STEAM_ID_UNKNOWN, so I couldn't use it.

    Using the code from above crashes the server when somebody that isn't whitelisted joins.

  12. Post #292
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    I used the following PlayedPasswordAuth hook

    require("gatekeeper")   
                    hook.Add("PlayerPasswordAuth", "ClosedBetaKicker", function (user, pass, steam, ip)
                            if !nonDB.ClosedBetaIDs[steam] then
                                    return {false, "This is a Closed Beta. Sorry."}
                            end
                    end)
    

    This didn't crash, but 'steam' was always STEAM_ID_UNKNOWN, so I couldn't use it.

    Using the code from above crashes the server when somebody that isn't whitelisted joins.
    Are you running the latest version of gatekeeper?

  13. Post #293
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,264 Posts
    Yes, got the build from Sep 16, 2011 (4.35).

  14. Post #294
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    Yes, got the build from Sep 16, 2011 (4.35).
    The only other reason I can think of is that your server is out-of-date.

  15. Post #295
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,264 Posts
    What exactly are you referring to? The cause of the crashing or the steamids being STEAM_ID_UNKNOWN?

  16. Post #296
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    What exactly are you referring to? The cause of the crashing or the steamids being STEAM_ID_UNKNOWN?
    The STEAM_ID_UNKNOWN thing.

    Are you using Linux or Windows?

  17. Post #297
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,264 Posts
    Windows.

  18. Post #298
    MoronYard
    _nonSENSE's Avatar
    May 2010
    1,264 Posts
    Gatekeeper crashes my dedicated server (windows) on startup since last patch whenever I 'require' it. The other server which is not updated is working fine.

    Code:
    Illegal termination of worker thread! Threads must negotiate an end to the thread before the CThread object is destroyed.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Agree Agree x 1 (list)

  19. Post #299
    Gold Member
    Simple_sa's Avatar
    July 2009
    97 Posts
    Gatekeeper crashes my dedicated server (windows) on startup since last patch whenever I 'require' it. The other server which is not updated is working fine.

    Code:
    Illegal termination of worker thread! Threads must negotiate an end to the thread before the CThread object is destroyed.
    Same here.

    Getting: You crashed in gmsv_gatekeeper.dll with the failure INVALID_POINTER_READ_c0000005_gmsv_gatekeeper.dll! Unknown

    Only got it after I updated my server with ''OB Dedicated Server' version 135'

  20. Post #300
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    Same here.

    Getting: You crashed in gmsv_gatekeeper.dll with the failure INVALID_POINTER_READ_c0000005_gmsv_gatekeeper.dll! Unknown

    Only got it after I updated my server with ''OB Dedicated Server' version 135'
    Make sure you are using the latest binary first. If that doesn't fix it, PM me the crash dump.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  21. Post #301
    Gold Member

    May 2011
    17 Posts
    Loading gatekeeper module... Illegal termination of worker thread! Threads must negotiate an end to the thread before the CThread object is destroyed.

    It prints that in console and crashes when I try to start my server.

    It's windows and it's gatekeeper 4.35.

    This happend after updating the server.
    Reply With Quote Edit / Delete Reply Windows 7 Denmark Show Events Agree Agree x 1 (list)

  22. Post #302
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    Loading gatekeeper module... Illegal termination of worker thread! Threads must negotiate an end to the thread before the CThread object is destroyed.

    It prints that in console and crashes when I try to start my server.

    It's windows and it's gatekeeper 4.35.

    This happend after updating the server.
    http://gmodmodules.googlecode.com/sv...gatekeeper.dll

    Use this binary instead. The version on the downloads page ("4.35") is outdated.

  23. Post #303
    Gold Member

    May 2011
    17 Posts
    http://gmodmodules.googlecode.com/sv...gatekeeper.dll

    Use this binary instead. The version on the downloads page ("4.35") is outdated.
    Works, thank you :)

  24. Post #304
    agmike's Avatar
    September 2010
    120 Posts
    TF2 engine update broke this again.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 1 (list)

  25. Post #305
    I am not sure if it's broken or not. Something isn't ran it might have to do with this. STEAMID is still displayed and the moduel loads. Would be nice if you could investigate on this.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Agree Agree x 1 (list)

  26. Post #306
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    The Windows signature broke, so the hook wasn't being called. I've updated the mask to fix it and also reduce the chance of it happening again.

    http://code.google.com/p/gmodmodules...e/detail?r=167
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 1 (list)

  27. Post #307
    agmike's Avatar
    September 2010
    120 Posts
    Thanks for fast response as always Azu
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Informative Informative x 3Artistic Artistic x 1Dumb Dumb x 1 (list)

  28. Post #308
    Stonna's Avatar
    September 2011
    144 Posts
    That would be Chrisaster, he's less Asian and more active then Azu.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 8 (list)

  29. Post #309
    agmike's Avatar
    September 2010
    120 Posts
    My bad, I saw the anime avatar and didn't read the name.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 4Dumb Dumb x 1 (list)

  30. Post #310
    Gold Member
    BlackAwps's Avatar
    July 2011
    763 Posts
    I made a simplified version of gatekeeper that doesn't use any sigscans.

    http://code.google.com/p/blackawps-g...sv_fuckoff.dll

    require("fuckoff")
    
    -- fuckoff.Drop( ply:EntIndex(), "Some reason" )
    
    -- Don't rely on this hook for a valid steamid
    hook.Add( "ClientConnect", "fuckoff1", function( name, steamid, ip, index )
      print( "ClientConnect", name, steamid, ip, index )
      --return false -- Deny connection
    end )
    
    -- You can rely on this hook for a valid steamid
    hook.Add( "SteamIDValidated", "fuckoff2", function( name, steamid, index )
      print(  "SteamIDValidated", name, steamid, index )
      return "Fuck off " .. name
    end )

    Never used the password field and I got a little tired of getting the update every so often for gatekeeper.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 5Funny Funny x 3 (list)

  31. Post #311
    We Are No Idiots
    Aide's Avatar
    March 2010
    4,644 Posts
    I'm digging the name.

    Im curious what index is, explain sir.

  32. Post #312
    Source update has broke this.

    Edit: See below post (or use the convars to set it to 18).
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  33. Post #313
    gatekeeper.ForceProtocol(18)
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Informative Informative x 2Agree Agree x 1 (list)

  34. Post #314
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    I've added support for protocol 19, but you can stick with forcing the protocol to 18 if you don't want to update.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Friendly Friendly x 1Winner Winner x 1 (list)

  35. Post #315
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    gatekeeper.ForceProtocol(18)
    That's a useful stopgap I added a few fixes ago. Just keep in mind when something important actually changes in the structure of the appticket, forcing the protocol won't work.

    Regardless, it should be safe to always have it forcing protocol 18, because any change in the appticket format is going to require an entire module update anyway.

  36. Post #316
    Gold Member
    Killer_Steel's Avatar
    October 2007
    1,362 Posts
    Update to my problem!

    It's still crashing, but with new code!

    Gatekeeper 4.61, and here's the code.

    require("gatekeeper")
    
    hook.Add("PlayerPasswordAuth", "Dropem", function(nam, pas, stem, ip)
    
    	print(Format("User: '%s' Pass: '%s' SteamID: '%s'", name, pass, stem))
    
    	local bl = {"STEAM_0:0:15520816"}
    
    	if table.HasValue(bl, tostring(stem)) then
    		return {false, "Testin still."}
    	elseif (nam == "Steel") then
    		return {false, "Testin."}
    	end
    
    end)

    Crashes with a memory error about a restricted address being 'read'. I really don't understand why it's doing this now, it's either returned a Lua error or crashed ever since I started using this module.

    Should I be using gatekeeper.ForceProtocol(18)?

  37. Post #317
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    Update to my problem!

    It's still crashing, but with new code!

    Gatekeeper 4.61, and here's the code.

    require("gatekeeper")
    
    hook.Add("PlayerPasswordAuth", "Dropem", function(nam, pas, stem, ip)
    
    	print(Format("User: '%s' Pass: '%s' SteamID: '%s'", name, pass, stem))
    
    	local bl = {"STEAM_0:0:15520816"}
    
    	if table.HasValue(bl, tostring(stem)) then
    		return {false, "Testin still."}
    	elseif (nam == "Steel") then
    		return {false, "Testin."}
    	end
    
    end)

    Crashes with a memory error about a restricted address being 'read'. I really don't understand why it's doing this now, it's either returned a Lua error or crashed ever since I started using this module.

    Should I be using gatekeeper.ForceProtocol(18)?
    4.61? Do you mean the SVN version? If so, can you upload the crash dump somewhere?

  38. Post #318
    Gold Member
    Killer_Steel's Avatar
    October 2007
    1,362 Posts
    I got this one through code.google.com, but it wasn't with SVN. I'll upload the crash dump, but I haven't got ample access to the server computer at the moment.
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Dumb Dumb x 1 (list)

  39. Post #319
    IS AWESOME@@@@@@@@@@

    January 2009
    968 Posts
    I got this one through code.google.com, but it wasn't with SVN. I'll upload the crash dump, but I haven't got ample access to the server computer at the moment.
    Just to make sure, you got it from here and not the downloads section right?

  40. Post #320
    Gold Member
    Killer_Steel's Avatar
    October 2007
    1,362 Posts
    Downloads section. Is that an outdated module?
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Dumb Dumb x 1 (list)