July 02, 2007

Ask an FMS Guru #28: How can I get (in the server side, main.asc) the IP of client requesting connect?

Something quick, fast and easy here. Almost falls in line with the RTFM mantra actually. But I'm not one to just say that, so here's some direction hopefully.

The question: How can I get (in the server side, main.asc) the IP of client requesting connect?

The answer:

There's a property of the client object called "ip". Grab that.

Here's a direct link to the docs actually. But here's the code copied and pasted from there:

application.onConnect = function(newClient, name){
if (newClient.ip == "127.0.0.1"){
// Insert code here.
} else {
// Insert code here.
}
};

Posted by Graeme at July 2, 2007 10:38 AM
 



Comments