Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Get IP's on Login (https://forums.graalonline.com/forums/showthread.php?t=70250)

KuJi 11-21-2006 12:36 AM

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*

Yen 11-21-2006 12:38 AM

Zodiac's version owns yours.

Skyld 11-21-2006 12:38 AM

Your actionserverside is awfully open-ended.

KuJi 11-21-2006 12:41 AM

Quote:

Originally Posted by Yen (Post 1245320)
Zodiac's version owns yours.

=( How is yours done?

Quote:

Originally Posted by Skyld (Post 1245321)
Your actionserverside is awfully open-ended.

Made it in like 15 seconds.. literally. GX uses a different version I guess.. kinda

Admins 11-21-2006 03:11 AM

There should not be any ip-tracking on playerworlds, there are reasons why the ip of the player is not available to scripts -> privacy. It is a nice example of using the http functionality, but please disable it.

KuJi 11-21-2006 03:33 AM

Quote:

Originally Posted by Stefan (Post 1245372)
There should not be any ip-tracking on playerworlds, there are reasons why the ip of the player is not available to scripts -> privacy. It is a nice example of using the http functionality, but please disable it.

Hm, thanks and I mainly want to use it for jails.

IP is accessible by staff anyway, it's just for security of account sharing (tracking) etc.

zokemon 11-21-2006 05:37 AM

Quote:

Originally Posted by Yen (Post 1245320)
Zodiac's version owns yours.

Because you guys get privaliged scripts!
No fair !pissed!

KuJi 11-21-2006 05:52 AM

Quote:

Originally Posted by zokemon (Post 1245441)
Because you guys get privaliged scripts!
No fair !pissed!

Very interesting - if what he told me is true - and kind of stupid if found out too =/


All times are GMT +2. The time now is 11:58 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.