View Single Post
  #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