Author Topic: On Client Connection  (Read 1860 times)

I'm having a bit of trouble getting started on a mod. Could somebody direct me towards a mod that uses checks something when a player connects to a server?

Server sided:

package clientJoin
{
     function gameConnection::autoAdminCheck(%client)
     {
          %p = parent::autoAdminCheck(%client);

          //logic

          return %p;
     }
};
activatePackage(clientJoin);

Ok, so the best way to do it is the admincheck? I was looking around and that's pretty much all I saw. Wasn't sure if I was right though. Thanks for the help

autoadmincheck is not when he joins

use onconnectrequest

autoadmincheck is not when he joins

use onconnectrequest

Autoadmincheck is when a user joins. Onconnectrequest is a user sending a request to the server, before the user actually joins.

Autoadmincheck is when a user joins. Onconnectrequest is a user sending a request to the server, before the user actually joins.
autoadmincheck has to be called from sonething else because it isnt an engine callback
what function is it called from?

autoadmincheck has to be called from sonething else because it isnt an engine callback
what function is it called from?
I believe that it's called by the engine.

autoadmincheck has to be called from sonething else because it isnt an engine callback
what function is it called from?
Isn't there GameConnection::onConnectionAccepted?
If there is that's probably it.

It isn't a big deal to use autoAdminCheck. It is a lot simpler with just 1 parameter, But onConnectRequest comes before and has a few more parameters that send the ip, local name, etc. It all depends on what info you are looking for.

It isn't a big deal to use autoAdminCheck. It is a lot simpler with just 1 parameter, But onConnectRequest comes before and has a few more parameters that send the ip, local name, etc. It all depends on what info you are looking for.
onconnectrequest is called before authentication, I think

i think the only way is autoadmincheck because i assume that the OnConnectAccepted is not traceable or shown because of data that is parsed to the server like name, ID, IP, and other information that badspot wouldn't allow you kids to have

I have an unrelated question but it doesn't deserve it's own thread. If a function returns a 0 or a 1 does if(!function(%var) work the same as if(function(%var) == 0)?

I have an unrelated question but it doesn't deserve it's own thread. If a function returns a 0 or a 1 does if(!function(%var) work the same as if(function(%var) == 0)?
yes


i think the only way is autoadmincheck because i assume that the OnConnectAccepted is not traceable or shown because of data that is parsed to the server like name, ID, IP, and other information that badspot wouldn't allow you kids to have
You're on the right path to what's correct, but you're not quite correct. The *connect* functions don't actually have IDs or names assigned yet so it may be useless in a lot of a cases. The admin check is the first function called after the ID and name are assigned.