Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-30-2016, 03:59 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Lightbulb Max loop limit question

Been a while!

Anywho, tasked with finding a way to trace a players account from email.
This is to find offline players rather than just online, e.g. helping to recover lost accounts where the player has lost access to the email account but still knows the email address that was used to identify etc.

I seem to have hit an issue with what I assume are limits imposed by the internals of Graal, my method of getting a list of all the accounts ever used to check against was looping through the player houses folder:

PHP Code:
function onCreated(){
  
this.maxlooplimit 15000;
  echo(
this.maxlooplimit); //Echos 15000
  
LookFor("[email protected]"1);
}

//Params:
// st - string  - Either IP or Email.
// sw - integer - 0 for IP, 1 for Email.
function LookFor(st,sw){
  
temp.0;
  
temp.0;
  
temp.list = new[0];
  
temp.fold = new[15000];
  
temp.fold.loadfolder("levels/houses/players/*Graal*"false);
  echo(
"Looking for "@st@" in "@fold.size()@" houses");
  
temp.fold[10123] = "test";
  echo(
fold[10123]);
  for(
temp.temp.fold){
    
temp.acc temp.i.tokenize("_")[1];
    
//Skip PC accs, since they haven't identified.
    
if(acc.substring(05) != "Graal") continue;
    
temp.= new TServerPlayer(@acc);
    if(
sw){
      
//Look for Email
      
if(st.lower() == p.client.email.lower()){
        echo(
"Found player: "@acc);
        
temp.1;
        break;
      }
    }else{
      
//Look for IP
    
}
  }
  if(!
temp.f) echo("Unable to locate player.");
  
temp.p.destroy();

This is the RC output, any ideas?

The script of NPC Gund_Lookup has been updated by Gund
15000
Looking for [email protected] in 10000 houses
Unable to locate player.
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
 

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 08:28 AM.


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