Aw check right all

From ActiveWiki
Jump to: navigation, search



Minimum requirements
Added in version 4.1


int aw_check_right_all (char *str)

Description

Checks if everyone would be granted rights by the provided string.

Callback

None (returns immediately)

Notes

This method requires that a bot instance has been created. It does not matter to which universe or world it is connected.

Arguments

str
String containing a rights list.

The provided string must be formatted according the rules for rights lists:

0    ... tourists
any# ... citizen number
-    ... exclusion sign
#~#  ... citizen range
*    ... everyone
, blank  ... delimiters

For example, "1~2300,-512~1024" would grant rights to citizen number in the range between 1 to 2300, but will deny rights to citizen numbers in the range between 512 to 1024.

Argument attributes

None

Return values

1
If everyone would be granted rights by the rights string.
0
Not granted rights. It is also returned if no instance has been created.

Returned attributes

None

Usage

Check for rights.

#define RIGHTS "* 1~2300,-512~1024"

aw_create ("", 0, NULL);

if (aw_check_right_all (RIGHTS))
  printf ("Everone has rights assigned\n");
else
  printf ("Restricted rights are assigned\n");

See also