Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   deletefile()? (https://forums.graalonline.com/forums/showthread.php?t=73577)

zokemon 04-20-2007 02:38 PM

deletefile()?
 
It seems to be having problems deleting file(s) on the serverside.
The npc server has rights to them and I can successfully loadlines and savelines to/from the file(s) in question. I'm thinking maybe Stefan forgot to add support for this function when he added the npcserver rights security patch?

Anyone else experiencing such problems with this function?

Novo 04-20-2007 03:28 PM

On Zodiac Dev, it works Ã* mervaille.
[ may not have security patch, however ]

killerogue 04-20-2007 06:38 PM

Instead of using load and savelines I would suggest load and save Vars. I'm not exactly sure if that would give you a different result but just something to try in case.

xXziroXx 04-20-2007 07:54 PM

Quote:

Originally Posted by killerogue (Post 1301423)
Instead of using load and savelines I would suggest load and save Vars. I'm not exactly sure if that would give you a different result but just something to try in case.

Dude, were you just trying to give Zero advise? A USELESS advise even so? Tsk, tsk, shame on you.

Chandler 04-20-2007 08:37 PM

HTML Code:

  for (temp.levelData: this.toDelete)
  {
    if ((timevar2 - temp.levelData[1]) >= temp.levelData[2])
    {
      temp.filePath = "world/gsanddungeon/";
      temp.levelList.loadFolder("levels/" @ temp.filePath @ "*", 0);
      for (temp.currentLevel: temp.levelList)
      {
        if (temp.currentLevel.substring(12, 1) == temp.levelData[0])
        {
          echo("Deleted Level:" SPC temp.currentLevel);
          deleteFile(temp.currentLevel);
        }
      }
       
      //v_dungeons-cz3.nw
      this.toDelete.delete(this.toDelete.indices(temp.levelData)); 
    }
  }

Yes, I have a problem with this! It should be deleting files, although it doesn't.

Novo 04-20-2007 08:54 PM

Quote:

Originally Posted by xXziroXx (Post 1301433)
Dude, were you just trying to give Zero advise? A USELESS advise even so? Tsk, tsk, shame on you.

Hrm -- Maybe not quite.

I have been using loadVars and saveVars... But for some reason -- a while back -- when I used loadlines, the files that were saved using this didn't appear instantly onto the File Browser. With saveVars, it does. He may be onto something. I figured that saveVars called savelines; they may be two independent functions.

Zero -- Have you tried deleting it after you called /refreshfilelist ?

Rapidwolve 04-20-2007 09:16 PM

Quote:

Originally Posted by killerogue (Post 1301423)
Instead of using load and savelines I would suggest load and save Vars. I'm not exactly sure if that would give you a different result but just something to try in case.

loadLines() and saveLines() are much diffrent then loadVars() and saveVars()

killerogue 04-20-2007 09:23 PM

Quote:

Originally Posted by xXziroXx (Post 1301433)
Dude, were you just trying to give Zero advise? A USELESS advise even so? Tsk, tsk, shame on you.

He asked for opinions/advice. There's no need for you to jump down my throat because I'm trying to be helpful to him.

What's your issue?

Chandler 04-20-2007 11:30 PM

Quote:

Originally Posted by killerogue (Post 1301452)
He asked for opinions/advice. There's no need for you to jump down my throat because I'm trying to be helpful to him.

What's your issue?

It's because he's threatened.

zokemon 04-20-2007 11:36 PM

Well I agree this is right that loadvars/savevars may not have the file browser update issue as loadlines/savelines does but that isn't the concern here. I simply pointed out that loadlines/savelines works for the sake that we know the npc server has rights to modify the files. But if it makes you all happy, loadvars and savevars works as well :)

I usually don't even mind about the problem with savelines not displaying the file in the file browser...Hey, it still exists ^_^

EDIT:
Oh, forgot you post Novo.
I didn't do exactly that but I have tried it with files that are visible in the file borwser as well as files that aren't.

Quote:

Originally Posted by Chandler (Post 1301480)
It's because he's threatened.

I think Ziro was just joking around actually o_o

Chandler 04-20-2007 11:44 PM

Quote:

Originally Posted by zokemon (Post 1301481)
I think Ziro was just joking around actually o_o

I think not.

Novo 04-21-2007 01:29 AM

If it didn't work, my suggestion would be to use the RC command:

/reloadscriptlibs

Tell us if the problem persists.

xXziroXx 04-21-2007 01:51 AM

Quote:

Originally Posted by Chandler (Post 1301480)
It's because he's threatened.

Why would I be threatened by someone I've helped to learn GS2? I was pointing out that instead of replying to Zero's question, he told him to use savevars instead of savelines, when it wasn't what Zero asked.

killerogue 04-21-2007 02:04 AM

'Twas a suggestion my dear man, a suggestion.

xXziroXx 04-21-2007 02:35 AM

Quote:

Originally Posted by killerogue (Post 1301513)
'Twas a suggestion my dear man, a suggestion.

Then come with better suggestions.

killerogue 04-21-2007 02:36 AM

Quote:

Originally Posted by xXziroXx (Post 1301521)
Then come with better suggestions.

ufirst

zokemon 04-21-2007 03:23 AM

Can you guys please just drop it...
Stan I thank you for the suggestion (even if it wasn't what I needed) and I appoligize for what Ziro said.
Ziro, thank you for trying to be my friend and defend me but you don't need to attack other people.

(Trying to say that the best way without coming out as a **** to either of my friends)

xXziroXx 04-21-2007 03:33 AM

Quote:

Originally Posted by killerogue (Post 1301522)
ufirst

Alright, I will.

Zero, in what folder is the files you are trying to delete? Because, deletefile() can't delete files in levels/ or any sub folders to it.

zokemon 04-21-2007 03:36 AM

Quote:

Originally Posted by xXziroXx (Post 1301540)
Alright, I will.

Zero, in what folder is the files you are trying to delete? Because, deletefile() can't delete files in levels/ or any sub folders to it.

Oh really?
Well that is most likely the problem then. Bjorn made it levels/administration/
Sadly, he isn't online to fix that :(

killerogue 04-21-2007 04:00 AM

Quote:

Originally Posted by xXziroXx (Post 1301540)
Alright, I will.

Zero, in what folder is the files you are trying to delete? Because, deletefile() can't delete files in levels/ or any sub folders to it.

Isn't there a function to access and delete files in the levels structure tho? I coulda sworn I saw one....

Quote:

Originally Posted by zokemon (Post 1301530)
Can you guys please just drop it...
Stan I thank you for the suggestion (even if it wasn't what I needed) and I appoligize for what Ziro said.
Ziro, thank you for trying to be my friend and defend me but you don't need to attack other people.

(Trying to say that the best way without coming out as a **** to either of my friends)

<3 :P But Ziro and I are friends as well.

Inverness 04-21-2007 07:04 AM

The function not being able to delete files within the levels/ folder is a nice security measure.

However, it should be a serveroption if it isn't already.

Also, the fact that this function was implemented before the NPCServer rights were indicates that the security measure is obsolete.

Chandler 04-21-2007 08:28 AM

Quote:

Originally Posted by xXziroXx (Post 1301521)
Then come with better suggestions.

I'll remember that next time you ask for assistance.

xXziroXx 04-21-2007 08:34 AM

Quote:

Originally Posted by Chandler (Post 1301584)
I'll remember that next time you ask for assistance.

You do that.

Chandler 04-21-2007 08:35 AM

Quote:

Originally Posted by xXziroXx (Post 1301585)
You do that.

I shall.

xXziroXx 04-21-2007 09:16 AM

Quote:

Originally Posted by Chandler (Post 1301586)
I shall.

Good.

Inverness 04-21-2007 02:32 PM

Argue over AIM if you must, stop spamming the thread with your asinine remarks.

Kristi 04-22-2007 06:07 PM

Stop derailing the thread.
Someone already mentioned if it was in the levels folder, this file.

May we see the line you are using to delete it? :)

zokemon 04-25-2007 10:13 AM

Quote:

Originally Posted by Kristi (Post 1301908)
Stop derailing the thread.
Someone already mentioned if it was in the levels folder, this file.

May we see the line you are using to delete it? :)

Well, I tried it in a completely different script on my own server (where I can control what folder the file is in) and this proved to be true. You can't delete files from the levels/ folder. Thanks!

xXziroXx 04-25-2007 10:20 AM

Quote:

Originally Posted by zokemon (Post 1302937)
Well, I tried it in a completely different script on my own server (where I can control what folder the file is in) and this proved to be true. You can't delete files from the levels/ folder. Thanks!

You can now.. kinda.

http://forums.graalonline.com/forums...ad.php?t=73587

zokemon 04-25-2007 10:53 AM

Quote:

Originally Posted by xXziroXx (Post 1302938)

Ahh, looks like my work on GK did wonders!

Inverness 04-25-2007 11:29 PM

Quote:

Originally Posted by zokemon (Post 1302941)
Ahh, looks like my work on GK did wonders!

You seem to mention your working on GK alot. But I'm sure I did too when I first worked there...

Chandler 04-26-2007 12:03 AM

because we're tuff guys rite!!
o_o;;

zokemon 04-26-2007 03:27 AM

Quote:

Originally Posted by Inverness (Post 1303084)
You seem to mention your working on GK alot. But I'm sure I did too when I first worked there...

I'm sure you did too, but you don't now! ^_^

Inverness 04-26-2007 05:38 PM

Quote:

Originally Posted by zokemon (Post 1303157)
I'm sure you did too, but you don't now! ^_^

I got over it.
There were more important things to consider. However, I do wonder what happened to my half-finished levels for the Zormite Castle. HINT HINT

Chandler 04-26-2007 05:40 PM

OH I MADE THE CURRENT ONES :D
I even did the tiles for them
SCRIPTER FOR LIFE

Inverness 04-26-2007 05:42 PM

Quote:

Originally Posted by Chandler (Post 1303302)
OH I MADE THE CURRENT ONES :D
I even did the tiles for them
SCRIPTER FOR LIFE

It would help if you used quotes so people know exactly who you're responding to. And if you are responding to me, I remember that I had designed a long hallway with 3 areas branching off on each side, and all areas were usually a platform surrounded by a large amount of water.


All times are GMT +2. The time now is 10:55 PM.

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