Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Feature request
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-29-2008, 08:59 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
hasscriptaccess()

hasscriptaccess(filepath, readonly) - returns true if the file at the given filepath can be accessed with the various load/save functions such as loadlines(). readonly is a bool that is true if you only want to check if the file can be read regardless of if you can write to it.


Example:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  if (
hasscriptaccess("Graal.exe"1))
    echo(
"I have script access to Graal.exe");
  else
    echo(
"I do not have script access to Graal.exe");

Would echo "I do not have script access to Graal.exe".

PHP Code:
//#CLIENTSIDE
function onCreated() {
  if (
hasscriptaccess("scriptfiles/" servername "/newfile.nw"1))
    echo(
"I have script access to newfile.nw");
  else
    echo(
"I do not have script access to newfile.nw");

Would echo "I have script access to newfile.nw".

Of course on the clientside the second parameter would only check if the file was read-only or not.

The function should also be supported serverside which would basically return the (npcserver)'s hasfolderright() to the file with respect to r and rw depending on the second parameter.

What do you think, could you implement this function Stefan? Really would like it for my global client/server file browser I'm making (which is required for my scripted level editor) as well as a few other things.
__________________
Do it with a DON!
Reply With Quote
  #2  
Old 04-30-2008, 01:15 AM
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
This would be nice, though I can't think of many uses besides a file browser type thing.
__________________
Reply With Quote
  #3  
Old 04-30-2008, 06:37 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I can't imagine it taking very much time to implement into the new client .
__________________
Do it with a DON!
Reply With Quote
  #4  
Old 06-30-2008, 11:56 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Will this be added?
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 07-02-2008, 06:37 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Ok added something, although it's not exactly identical:
getScriptAccessFile(filename, dowrite) returns the file that will be modified when using the specified filename: when the file extension is not allowed then it will return an empty string, otherwise either the filename (if it was including a path name and it's allowed to access) or a filename starting with scriptfiles or scriptfiles/servername.

This will work with the next update of the npcserver and the next client version.
Reply With Quote
  #6  
Old 07-14-2008, 07:22 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Perfect, just what I needed! Thank you!
__________________
Do it with a DON!
Reply With Quote
  #7  
Old 07-17-2008, 07:19 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Umm, is the npcserver gonna be updated anywhere? Almost everywhere I've tried the function doesn't exist.
__________________
Do it with a DON!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:22 PM.


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