Graal Forums

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

MrOmega 03-09-2011 05:14 AM

fileexist() question
 
On clientside, does fileexist() only check the client's folder and not if the server has the file?

ffcmike 03-09-2011 05:18 AM

Yes.

MrOmega 03-09-2011 05:23 AM

Next question is how could I manually add a file from the server to the graal directory.

ffcmike 03-09-2011 05:28 AM

If you mean specifically download a file into /graal/ I don't think it's possible, otherwise fileupdate("filename"); would download a file to it's relevant folder.

MrOmega 03-09-2011 05:29 AM

ok thank you

MattKan 03-09-2011 06:19 AM

Quote:

Originally Posted by ffcmike (Post 1635360)
If you mean specifically download a file into /graal/ I don't think it's possible, otherwise fileupdate("filename"); would download a file to it's relevant folder.

So let's say someone overwrote pics1.png.

Could I make it

PHP Code:

//#CLIENTSIDE
function onPlayerLogin()
{
 
fileupdate("pics1.png");


To fix the file?

To make it fix the file everyone

ffcmike 03-09-2011 06:22 AM

Quote:

Originally Posted by MattKan (Post 1635369)
So let's say someone overwrote pics1.png.

Could I make it

PHP Code:

//#CLIENTSIDE
function onPlayerLogin()
{
 
fileupdate("pics1.png");


To fix the file?

To make it fix the file everyone

Depends on whether the function compares the modification time of the file on your client with the file on the server in order to re-download or if it forces it, but if it does force the download it wouldn't be a good idea to have pics1.png being downloaded every single login.
You'd probably want to be comparing against a pre determined modification time of the original pics1.png beforehand.

MrOmega 03-09-2011 06:29 AM

Well with the wiki being down I need ask what is the variable or function that returns if any file is downloading currently. I want to suspend my script until the download finishes...

fowlplay4 03-09-2011 06:41 AM

Instead of using script I'm pretty sure you can configure a gupd package, and set the flag to use checksums.

See:
http://wiki.graal.net/index.php/Crea...pdate_Packages

Quote:

Originally Posted by MrOmega (Post 1635373)
Well with the wiki being down I need ask what is the variable or function that returns if any file is downloading currently. I want to suspend my script until the download finishes...

Worked just fine for me. I would recommend using "/scripthelp download" to try and find it. I found:

isdownloadingfiles() - returns boolean - checks if Graal is currently downloading or requesting files from the server

MrOmega 03-09-2011 06:47 AM

It's not a set list of files to download unfortunately, and when I try to go on the wiki I get redirected to a miss-formatted graalonline home page

fowlplay4 03-09-2011 04:26 PM

Quote:

Originally Posted by MrOmega (Post 1635378)
It's not a set list of files to download unfortunately, and when I try to go on the wiki I get redirected to a miss-formatted graalonline home page

Try adding 194.5.30.21 wiki.graal.net to your HOSTS file.

MrOmega 03-09-2011 04:42 PM

Quote:

Originally Posted by fowlplay4 (Post 1635421)
Try adding 194.5.30.21 wiki.graal.net to your HOSTS file.

Ah fixed, thanks


All times are GMT +2. The time now is 01:44 PM.

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