Reject connection before map load

TyrsisTyrsis Join Date: 2002-11-15 Member: 8804Members
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

  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    http://wiki.unknownworlds.com/ns2/Lua/Libraries/Event/Hook

    This wiki indicates there is a ConnectRequested event that fires. Not sure if that could be used for this purpose.
  • TyrsisTyrsis Join Date: 2002-11-15 Member: 8804Members
    This is a client side event:

    /**
    * This is called if the user tries to join a server through the
    * Steam UI.
    */
    local function OnConnectRequested(address, password)
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    edited April 2013
    hmm, wish the wiki was updated. k i'll dig in the lua files and see what i can find.

    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.
  • TyrsisTyrsis Join Date: 2002-11-15 Member: 8804Members
    I already have looked. Nothing really gets passed to the server until map load is completed. OnClientConnected is hit only after that. But if you spot anything, that's cool, but I'm assuming because no one has been able to do it, it doesn't exist yet.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    Hmm, so ClientConnect does fire prior to ClientConnected? Seems broken. The only other thing you could do is find a function that gets fired prior to being fully connected that is also not 'local' and hook it (read: not event).

    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.
  • TyrsisTyrsis Join Date: 2002-11-15 Member: 8804Members
    This is what I've been hunting for, but kind of gave up as there doesn't appear to be a way. It looks like the client connects to the server and then immediately goes into map load before even passing the steamid. What should happen is the client connects with their steam id before being told they can go into map load / precache.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    RIght. I hear you. I'm ramming my face into a problem of my own with WebRequest event. Good luck, maybe they'll adjust the functionality for you.
Sign In or Register to comment.