Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 11-21-2006, 12:38 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Zodiac's version owns yours.
Reply With Quote
  #3  
Old 11-21-2006, 12:38 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Your actionserverside is awfully open-ended.
__________________
Skyld
Reply With Quote
  #4  
Old 11-21-2006, 12:41 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
Quote:
Originally Posted by Yen View Post
Zodiac's version owns yours.
=( How is yours done?

Quote:
Originally Posted by Skyld View Post
Your actionserverside is awfully open-ended.
Made it in like 15 seconds.. literally. GX uses a different version I guess.. kinda
Reply With Quote
  #5  
Old 11-21-2006, 03:11 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #6  
Old 11-21-2006, 03:33 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
Quote:
Originally Posted by Stefan View Post
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.
Reply With Quote
  #7  
Old 11-21-2006, 05:37 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Yen View Post
Zodiac's version owns yours.
Because you guys get privaliged scripts!
No fair
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 11-21-2006, 05:52 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
Quote:
Originally Posted by zokemon View Post
Because you guys get privaliged scripts!
No fair
Very interesting - if what he told me is true - and kind of stupid if found out too =/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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