Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-28-2007, 05:10 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
retrieving and updating stuff in serveroptions

I'm just wondering if there was a possible way of retrieving (and possibly updating) a list of all player accounts in the "staff=" and staffguilds "staffguilds=" in the serveroptions from a script - either wNPC or just a regular script on the serverside.


And since I'm on the topic of serveroptions, howcome in the "profilevars=", you can't use arrays to display stuff like doing:

Health=playerstats[1],MP=playerstats[2]

I think it's wasteful to create single player flags for each type of profile variables, when you can just create one player flag as an array and use the indexes to display the type of variables to be shown in the player's profile.
Reply With Quote
  #2  
Old 09-28-2007, 05: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
profilevars looks at variables as strings, that's why. It would have to tokenize the string to do it like an array.
__________________
Do it with a DON!
Reply With Quote
  #3  
Old 09-28-2007, 05:41 AM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
Quote:
Originally Posted by zokemon View Post
profilevars looks at variables as strings, that's why. It would have to tokenize the string to do it like an array.
that makes sense now, but what about updating stuff and pulling information from serveroptions?
Reply With Quote
  #4  
Old 09-28-2007, 07:48 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
I wish you could... Seems like this is planned as a possible update for the future though. I would love to be able to have stafftools auto add based on rc access. You could then just give rights to the tool based on folder rights.
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 09-28-2007, 07:55 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by zokemon View Post
I wish you could... Seems like this is planned as a possible update for the future though. I would love to be able to have stafftools auto add based on rc access. You could then just give rights to the tool based on folder rights.
There is already the player.hasright() function for checking folder rights, and player.hasrightflag(str rightname) function for checking if they have normal rights (where rightname is from the following list: warptoxy, warptoplayer, warpplayers, updatelevel, disconnectplayers, viewattributes, setownattributes, resetattributes, adminmessage, changerights, banplayers, changecomments, changestaffaccounts, setserverflags, changeoptions, changefolderconfig, changefolderrights, NPC-Control).
__________________
Skyld
Reply With Quote
  #6  
Old 09-28-2007, 08:12 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
Quote:
Originally Posted by Skyld View Post
There is already the player.hasright() function for checking folder rights, and player.hasrightflag(str rightname) function for checking if they have normal rights (where rightname is from the following list: warptoxy, warptoplayer, warpplayers, updatelevel, disconnectplayers, viewattributes, setownattributes, resetattributes, adminmessage, changerights, banplayers, changecomments, changestaffaccounts, setserverflags, changeoptions, changefolderconfig, changefolderrights, NPC-Control).
Yeah I know that, that's why I said that
__________________
Do it with a DON!
Reply With Quote
  #7  
Old 09-28-2007, 09:56 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
There used to be a way to do a: load/savelines("serveroptions.txt");

Obviously, that posed a credible security threat. It hasn't been allowed since the NPC Server rights have been added (server does not allow NPC Server to have rights to serveroptions.txt).

If you want to check for if a person is staff, an easy thing to do is just make sure every staff member has warptoxy and just check for that right (AKA: What Skyld said).
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #8  
Old 09-28-2007, 10:21 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
serveroptions.<varname>

staffarray = serveroptions.staff.tokenize(",");

PHP Code:
function onActionPlayerOnline() {
  if ((
player.account in serveroptions.staff.tokenize(",")) || (player.account in serveroptions.norcstaff.tokenize(","))) {
    
clientr.staff true;
  }

serveroptions. is accessible serverside only, don't like that fact too much.
__________________
Reply With Quote
  #9  
Old 09-29-2007, 12:05 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Inverness View Post
serveroptions. is accessible serverside only, don't like that fact too much.
Yeah, since I believe it's read-only, that doesn't make much sense. It's not like it would be some sort of security flaw to have it readable clientside.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #10  
Old 09-29-2007, 04:36 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
Quote:
Originally Posted by Inverness View Post
serveroptions.<varname>

staffarray = serveroptions.staff.tokenize(",");

PHP Code:
function onActionPlayerOnline() {
  if ((
player.account in serveroptions.staff.tokenize(",")) || (player.account in serveroptions.norcstaff.tokenize(","))) {
    
clientr.staff true;
  }

serveroptions. is accessible serverside only, don't like that fact too much.
Ahh, didn't notice that was added.
__________________
Do it with a DON!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:25 PM.


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