General > Developers Corner
CheckPassword hook for reserve slots
Megiddo:
The best solution to this is to set the extra slots to be invisible and instruct your VIPs how to join in those cases (through console).
JamminR:
--- Quote from: LostAlien on July 20, 2013, 11:35:29 AM ---CheckPassword hook is run at the same time as gatekeeper's hook is
--- End quote ---
The Lua hook is, yes, and is server-side.
The actual gatekeeper code is binary, running before the server connection allows client to start doing stuff.
With gatekeeper, player connects, gatekeeper binary intercepts - checks against lua controlled server side script "can player connect?" and then does whatever (allows/drops mid stream), allowing player to start downloading resources or connecting if the binary gets 'yes' response.
With PlayerCheckPassword, I'm pretty sure there is no interception, other than the split second before the player object has fully initialized on the server.
I might be wrong, but, I think all it does is, after the player has joined server, downloaded resources, synced snapshot, it then checks to see if they're allowed.
After the fact it's too late of what he'd want.
Eccid:
Ok, I got it working, for the most part. The hook apparently gets the users 64bit steam id, so I had to convert it before it would work, and apparently the built in gmod one doesn't work right. It now blocks anyone from joining who doesn't have access to reserve as soon as they click the join server button. The only issue is that it only allows for admins to join on reserve and not donators as well. You can see in what I posted, I added allowed_groups and get the same result, admins can join but not donators. So, any further help would be appreciated.
Pastebin
Update: It must have been a fluke because donators have been joining on reserve just fine. Should I move this to a different section?
Storm:
This problem has been an issue for me too. Do I just add the bit of code at the end of the slots.lua that you did or is there something else I need to do?
Eccid:
--- Quote from: Storm on August 24, 2013, 04:32:13 AM ---This problem has been an issue for me too. Do I just add the bit of code at the end of the slots.lua that you did or is there something else I need to do?
--- End quote ---
Sorry it took so long to respond, I haven't been on the ulysses site in a bit. Replace your slots.lua with this one.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version