Reject connection before map load
Can you guys give mods the ability to reject a client connecting before the client starts loading the map. Maybe some sort of exchange between client and server that can be overridden by mods so that a proper reserve slot mod can be created without having to implement workarounds that don't work very well (setting passwords doesn't happen fast enough and a lot of the time lots of players will need to be kicked needlessly). I'm sure this has been suggested before, but I'm sure it's as frustrating for players as it is for admins.
Comments
This wiki indicates there is a ConnectRequested event that fires. Not sure if that could be used for this purpose.
/**
* This is called if the user tries to join a server through the
* Steam UI.
*/
local function OnConnectRequested(address, password)
Im guessing maybe reserve slot is using ClientConnected but not ClientConnect, which has the following comment:
/**
* Called when a player first connects to the server. Passes client index.
*/
This could work.
That is located in Gamerules.lua.
I had to do this when I wrote a music addon in WoW, i hooked ReloadUI() because it loaded the script differently than first load so I created a reference to the original function, created a new ReloadUI with my own code, then called the original reference afterward. Issue is here is that almost everything is declared local, which is fine, but would be out of scope for this method.