Thread: Graal Shop Pro
View Single Post
  #22  
Old 06-25-2015, 07:40 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by scriptless View Post
Sorry for the bump but I noticed when I try and save the gani nothing happens.

I can still set my gani online,restarting the client and it doesn't show anymore, but the file seems to be nowhere. Not online, nor on my computer. Both mac and windows. Any help would be awesome. I would love to be able to edit ganis online, or save them offline and upload them at least using my mac.

Edit:
I managed to change the line that saves the file to call a triggeraction and saved the lines serverside. This allowed me to save the gani online. Which accomplishes what I need. Would be cool if I could get it to save locally tho. But this definitely helps me alot. Thanks FP4.

Here is what I did,

PHP Code:
function onActionServerside() {
  
// save to server maybe
  
if ( params[0] == "savegani" ) {
    echo(
params[2SPC "uploaded or updated!");
    
temp.lines params[1];
    
temp.lines.savelines(params[2], 0);
  }

And editing:

PHP Code:
  // Save File
  
temp.lines.savelines(this.filename0); 
to the following, using ASDFG so I could ctr+f to it since its on like line 3,700 something.

PHP Code:
  // Save File
  // ASDFG
  
triggerserver("gui"this.name"savegani"temp.linesthis.filename);
  
//temp.lines.savelines(this.filename, 0); 
I also noticed the NPC Server needed rights to the file.

After posting in the wrong thread, I figured I'd share this in the right one!

I changed it so that when saving (and uploading the gani), it checks if the gani already exists on the server, and if it does, overwrites it. Otherwise, it defaults to the file path provided by the client.

Just replace the onActionServerside block with this code:

PHP Code:
function onActionServerside() {
  
// save to server
  
if ( params[0] == "savegani" ) {
    echo(
params[2SPC "updated!");
    
temp.lines params[1];

    
temp.fileName extractFileName(params[2]);
    
temp.fileList findFiles(format("levels/%s"temp.fileName), true);
    
temp.filePath temp.fileList.size() == params[2] : temp.fileList[0];
    
temp.lines.savelines(temp.filePath0);
  }

__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote