/** Prefix table for standard attribute names */
PTAB ptab_attrib;
-/** Attribute flags */
-PRIV attr_privs[] = {
+/** Attribute flags for setting */
+PRIV attr_privs_set[] = {
+ {"no_command", '$', AF_NOPROG, AF_NOPROG},
+ {"no_inherit", 'i', AF_PRIVATE, AF_PRIVATE},
+ {"private", 'i', AF_PRIVATE, AF_PRIVATE},
+ {"no_clone", 'c', AF_NOCOPY, AF_NOCOPY},
+ {"privilege", 'w', AF_PRIVILEGE, AF_PRIVILEGE},
+ {"visual", 'v', AF_VISUAL, AF_VISUAL},
+ {"mortal_dark", 'm', AF_MDARK, AF_MDARK},
+ {"hidden", 'm', AF_MDARK, AF_MDARK},
+ {"regexp", 'R', AF_REGEXP, AF_REGEXP},
+ {"case", 'C', AF_CASE, AF_CASE},
+ {"locked", '+', AF_LOCKED, AF_LOCKED},
+ {"safe", 'S', AF_SAFE, AF_SAFE},
+ {"prefixmatch", '\0', AF_PREFIXMATCH, AF_PREFIXMATCH},
+ {"veiled", 'V', AF_VEILED, AF_VEILED},
+ {"debug", 'b', AF_DEBUG, AF_DEBUG},
+ {"public", 'p', AF_PUBLIC, AF_PUBLIC},
+ {"nearby", 'n', AF_NEARBY, AF_NEARBY},
+ {"amhear", 'M', AF_MHEAR, AF_MHEAR},
+ {"aahear", 'A', AF_AHEAR, AF_AHEAR},
+ {NULL, '\0', 0, 0}
+};
+
+/** Attribute flags for viewing */
+PRIV attr_privs_view[] = {
{"no_command", '$', AF_NOPROG, AF_NOPROG},
{"no_inherit", 'i', AF_PRIVATE, AF_PRIVATE},
{"pow_inherit", 't', AF_POWINHERIT, AF_POWINHERIT},
return;
}
if (strcasecmp(perms, "none")) {
- flags = string_to_privs(attr_privs, perms, 0);
+ flags = string_to_privs(attr_privs_set, perms, 0);
if (!flags) {
notify(player, T("I don't understand those permissions."));
return;
}
notify_format(player, T("%s -- Attribute permissions now: %s"), name,
- privs_to_string(attr_privs, flags));
+ privs_to_string(attr_privs_view, flags));
}
}
notify_format(player, "Attribute: %s", ap == catchall ? "Default Attribute" : AL_NAME(ap));
notify_format(player,
- " Flags: %s", privs_to_string(attr_privs, AL_FLAGS(ap)));
+ " Flags: %s", privs_to_string(attr_privs_view,
+ AL_FLAGS(ap)));
notify_format(player, " Creator: %s", unparse_dbref(AL_CREATOR(ap)));
/* Now Locks */
if(!(AL_RLock(ap) == TRUE_BOOLEXP))
*/
StrTree atr_names;
/** Table of attribute flags. */
-extern PRIV attr_privs[];
+extern PRIV attr_privs_set[];
+extern PRIV attr_privs_view[];
dbref atr_on_obj = NOTHING;
/** A flag to show if we're in the middle of a @wipe (this changes
string_to_atrflag(dbref player, char const *p)
{
int f;
- f = string_to_privs(attr_privs, p, 0);
+ f = string_to_privs(attr_privs_set, p, 0);
if (!f)
return -1;
if (!Admin(player) && (f & AF_MDARK))
{
int f;
*setbits = *clrbits = 0;
- f = string_to_privsets(attr_privs, p, setbits, clrbits);
+ f = string_to_privsets(attr_privs_set, p, setbits, clrbits);
if (f <= 0)
return -1;
if (!Prived(player) && ((*setbits & AF_MDARK) || (*clrbits & AF_MDARK)))
const char *
atrflag_to_string(int mask)
{
- return privs_to_string(attr_privs, mask);
+ return privs_to_string(attr_privs_view, mask);
}
/** Utility define for atr_add and can_create_attr */
}
}
-extern PRIV attr_privs[];
+extern PRIV attr_privs_view[];
void
db_read_attrs(FILE * f, dbref i, int count)
strcpy(name, tmp);
db_read_this_labeled_dbref(f, "owner", &owner);
db_read_this_labeled_string(f, "flags", &tmp);
- flags = string_to_privs(attr_privs, tmp, 0);
+ flags = string_to_privs(attr_privs_view, tmp, 0);
db_read_this_labeled_number(f, "derefs", &derefs);
if(HAS_COBRADBFLAG(indb_flags,DBF_NEW_ATR_LOCK)) {
#pragma warning( disable : 4761) /* NJG: disable warning re conversion */
#endif
-extern PRIV attr_privs[];
+extern PRIV attr_privs_view[];
static lock_type get_locktype(char *str);
extern struct db_stat_info *get_stats(dbref owner);
static int lattr_helper(dbref player, dbref thing, dbref parent, char const *pattern,
safe_str("#-1", buff, bp);
return;
}
- safe_str(privs_to_letters(attr_privs, AL_FLAGS(a)), buff, bp);
+ safe_str(privs_to_letters(attr_privs_view, AL_FLAGS(a)), buff, bp);
if (atr_sub_branch(a))
safe_chr('`', buff, bp);
} else {
safe_str("#-1", buff, bp);
return;
}
- safe_str(privs_to_string(attr_privs, AL_FLAGS(a)), buff, bp);
+ safe_str(privs_to_string(attr_privs_view, AL_FLAGS(a)), buff, bp);
} else {
/* Object flags, visible to all */
safe_str(bits_to_string("FLAG", Flags(thing), executor, thing), buff, bp);
const char *pattern, const char *prefix, int skipdef);
void decompile_locks(dbref player, dbref thing, const char *name, int skipdef);
-extern PRIV attr_privs[];
+extern PRIV attr_privs_view[];
static void
look_exits(dbref player, dbref loc, const char *exit_name)
if (EX_PUBLIC_ATTRIBS &&
!strcmp(AL_NAME(atr), "DESCRIBE") && !strcmp(pattern, "*"))
return 0;
- strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr)));
+ strcpy(fbuf, privs_to_letters(attr_privs_view, AL_FLAGS(atr)));
if (atr_sub_branch(atr))
strcat(fbuf, "`");
if (AF_Veiled(atr)) {
if (EX_PUBLIC_ATTRIBS &&
!strcmp(AL_NAME(atr), "DESCRIBE") && !strcmp(pattern, "*"))
return 0;
- strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr)));
+ strcpy(fbuf, privs_to_letters(attr_privs_view, AL_FLAGS(atr)));
if (atr_sub_branch(atr))
strcat(fbuf, "`");
r = safe_atr_value(atr);
/* Are we different? If so, do as usual */
int npmflags = AL_FLAGS(ptr) & (~AF_PREFIXMATCH);
if (AL_FLAGS(atr) != AL_FLAGS(ptr) && AL_FLAGS(atr) != npmflags)
- privs = privs_to_string(attr_privs, AL_FLAGS(atr));
+ privs = privs_to_string(attr_privs_view, AL_FLAGS(atr));
} else {
- privs = privs_to_string(attr_privs, AL_FLAGS(atr));
+ privs = privs_to_string(attr_privs_view, AL_FLAGS(atr));
}
if (privs && *privs)
notify_format(player, "@set %s/%s=%s", dh->name, AL_NAME(atr), privs);
char const *pattern, ATTR *atr, void *args);
void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive);
int pay_quota(dbref, int);
-extern PRIV attr_privs[];
+extern PRIV attr_privs_view[];
/** A generic function to generate a formatted string. The
* return value is a statically allocated buffer.
notify_format(player, "%s%s [#%d%s]%s %s",
ANSI_HILITE, AL_NAME(atr),
Owner(AL_CREATOR(atr)),
- privs_to_letters(attr_privs, AL_FLAGS(atr)),
+ privs_to_letters(attr_privs_view, AL_FLAGS(atr)),
ANSI_NORMAL, tbuf1);
return found;
}