View Single Post
  #1  
Old 11-21-2006, 12:36 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Get IP's on Login

Nifty tool I made.

PHP Code:
function onActionServerSide(temp.ip)
{
  
temp.toks temp.ip.tokenize(".");

  for (
temp.var: temp.toks)
  {
    if (
int(temp.var) != temp.var)
    {
      
savelog2("playerips.txt"format("%s has used an illegal ip of %s"player.accountparams[1]));
        
      return 
true;
    }
  }

  if (
temp.toks.size() == 4)
  {
    
clientr.ip temp.ip;
    
// savelog2("playerips.txt", format("%s has logged on with the ip of %s", player.account, clientr.ip)); // Good if you wan't to log people's ips as they logon - Text file may get huge in about 15 minutes though lol. Advised to log only some people at a time instead of the server =p. (or use a DB and put each account in it like acc_KuJi=1.2.3.4,2.3.4.1,3.4.5.1 etc.
  
}
}

//#CLIENTSIDE
function onCreated()
{
  
temp.server = {"www.graalx.us"80"/gdb/getip.php"};
  
temp.cmd    requesthttp(temp.server[0], temp.server[1], temp.server[2]);

  
catchevent(temp.cmd"onReceiveData""onGetIP");
}

function 
onGetIP(data)
{
  
triggerserver("gui"this.namedata.fulldata);

You can leave the server as is, I have enough bandwidth I assume lol ;D.

When you first logon it will get your IP and update it to a clientr. string incase you don't have RC or want to do player checks etc

*Edited for Skyld*

Last edited by KuJi; 11-21-2006 at 09:10 AM..
Reply With Quote