Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   retrieving and updating stuff in serveroptions (https://forums.graalonline.com/forums/showthread.php?t=76963)

Cherrykao 09-28-2007 05:10 AM

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.

zokemon 09-28-2007 05:37 AM

profilevars looks at variables as strings, that's why. It would have to tokenize the string to do it like an array.

Cherrykao 09-28-2007 05:41 AM

Quote:

Originally Posted by zokemon (Post 1349909)
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?

zokemon 09-28-2007 07:48 PM

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.

Skyld 09-28-2007 07:55 PM

Quote:

Originally Posted by zokemon (Post 1349955)
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).

zokemon 09-28-2007 08:12 PM

Quote:

Originally Posted by Skyld (Post 1349956)
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 ;)

napo_p2p 09-28-2007 09:56 PM

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).

Inverness 09-28-2007 10:21 PM

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.

coreys 09-29-2007 12:05 AM

Quote:

Originally Posted by Inverness (Post 1349970)
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.

zokemon 09-29-2007 04:36 AM

Quote:

Originally Posted by Inverness (Post 1349970)
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. :cool:


All times are GMT +2. The time now is 11:18 AM.

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