Thread: Server reset
View Single Post
  #5  
Old 08-13-2013, 05:29 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
FTP won't anymore in general, but won't work for this anyway since the accounts folder is protected from writing by scripts.

The best solution assuming you can't just get Stefan to wipe the accounts folder (which you probably don't want anyway since you lose rights, comments, online time, etc.):

Quote:
Originally Posted by cbk1994 View Post
PHP Code:
function resetAll() {
  
temp.folder.loadFolder("accounts/*", true);
  
  for (
temp.file : folder) {
    if (!
file.ends(".txt")) {
      continue;
    }
    
    
file = file.substring(0, file.length() - 4); // remove extension
    
temp.tokens = file.tokenize("/"); // split between slashes
    
    
sendtorc("/reset" SPC removeEscapesFromFileName(tokens[tokens.size() - 1]));
  }
} 
I imagine something like this would work, but I've never tried anything like it. No rights should be needed; loadFolder works with no read rights as far as I know.
The NPC-server will actually need reset rights (not sure if I missed that or if npc-server rights hadn't yet been implemented when I wrote that post). I also fixed a couple of errors in the script but I might have missed more, make sure to test before using. I wrote that four years ago so I'm not confident it will behave appropriately with pc:## or Graal## accounts, but this approach is probably the best way to do a reset.
__________________
Reply With Quote