GameConnection::onConnectRequest

Author Topic: GameConnection::onConnectRequest  (Read 1902 times)

So i'm having a little issue with this function for obvious reasons.  The authentication proccess is found in this function.  What I'm trying to do is create a "reserved list" for people on it to be able to join even when the server is full.  The only way to do this is by adding on to this function.  for example:

Code: [Select]
package reserve
{
   function GameConnection::onConnectRequest(%this)
   {
       Parent::onConectRequest(%this);
   }
};
activatePackage(reserve);

So obviously I would put more in the function than just executing the parent, but it dosen't matter.  Once saved and executed and you try to enter the server, you get an authentication failed message on joining the server.

Is there any work around this or is there another function that I can use that dosen't include the authentication process.

I'm not in a place where I can test this now, but I have a suggestion for how to do the reserved list.

If bl id is on reserved list, increase max players by one.  Then, if a player leaves and the max players is higher that it was originally, decrease it by one.

okay well first of all you have a typo
Quote
Parent::onConnectRequest(%this);

Thank you, I was just typing fast and that's how it came out.  Still dosen't work with the correct spelling.

@Trader- That was my origonal idea.  I think i'm going to have multiple ways of doing it and letting the user have the option to which method they want.

1. increase maxplayers when a reserve wants in (then decrease when someone leaves

2. randomly kick a nonadmin and nonreserve player in the server to allow them in.

3. Just let them in and be over the max (ie...13/12)

Suggestions are nice, but I still need help on finding a work around.

well there may be more variables passed to the connect request, so maybe try this

Code: [Select]
package reserve
{
   function GameConnection::onConnectRequest(%this,%a,%b,%c,%d)
   {
       echo(%this TAB %a TAB %b TAB %c TAB %d);
       Parent::onConectRequest(%this,%a,%b,%c,%d);
   }
};
activatePackage(reserve);

Code: [Select]
package reserve
{
   function GameConnection::onConnectRequest(%this,%a,%b,%c,%d)
   {
       echo(%this TAB %a TAB %b TAB %c TAB %d);
       Parent::onConnectRequest(%this,%a,%b,%c,%d);
   }
};
activatePackage(reserve);

Ok using this, the variables are as follows:
  • %this = client
  • %a = LAN Name
  • %b = Net Name
  • %c = Clan Tag
  • %d = Other Clan Tag
The rest were "unknown" displayed as ^

alright, sorry I just got it working. With this code:

Code: [Select]
package reserve
{
   function GameConnection::onConnectRequest(%this,%lanname,%netname,%clantag1,%clantag2)
   {
echo("CONNECT REQUEST");
Parent::onConnectRequest(%this,%lanname,%netname,%clantag1,%clantag2);
   }
};
activatePackage(reserve);

Thanks Zor, I shall continue writing my reserved slots script and maybe release it soon.

I think MrWallet has a Reserved Slot script. Maybe ask him, see whether he'll tell you how he did it?

That's alright.  I'm almost done scripting it now... Just adding the final touches :)