Fixed the behaviour of some build commands to match that in wiki build tutorial.

This commit is contained in:
Griatch 2010-08-31 17:31:48 +00:00
parent 96be66828c
commit 03cc4970d0
2 changed files with 14 additions and 7 deletions

View file

@ -587,6 +587,7 @@ class CmdPerm(MuxCommand):
or those defined on the <object>/<player> argument. or those defined on the <object>/<player> argument.
""" """
key = "@perm" key = "@perm"
aliases = "@setperm"
permissions = "cmd:perm" permissions = "cmd:perm"
help_category = "Admin" help_category = "Admin"
@ -600,7 +601,9 @@ class CmdPerm(MuxCommand):
if not self.args: if not self.args:
if "list" not in switches: if "list" not in switches:
caller.msg("Usage: @setperm[/switch] [player = permission]") string = "Usage: @setperm[/switch] [object = permission]\n"
string +=" @setperm[/switch] [*player = permission]"
caller.msg(string)
return return
else: else:
#just print all available permissions #just print all available permissions
@ -648,8 +651,12 @@ class CmdPerm(MuxCommand):
# As an extra check, we warn the user if they customize the # As an extra check, we warn the user if they customize the
# permission string (which is okay, and is used by the lock system) # permission string (which is okay, and is used by the lock system)
permissions = obj.permissions permissions = obj.permissions
permissions.append(rhs) if rhs in permissions:
obj.permissions = permissions string = "Permission '%s' is already defined on %s." % (rhs, obj.name)
string = "Permission '%s' given to %s." % (rhs, obj.name) else:
permissions.append(rhs)
obj.permissions = permissions
string = "Permission '%s' given to %s." % (rhs, obj.name)
obj.msg("%s granted you the permission '%s'." % (caller.name, rhs))
caller.msg(string) caller.msg(string)
obj.msg("%s granted you the permission '%s'." % (caller.name, rhs))

View file

@ -460,7 +460,7 @@ class TypedObject(SharedMemoryModel):
def permissions_set(self, value): def permissions_set(self, value):
"Setter. Allows for self.name = value. Stores as a comma-separated string." "Setter. Allows for self.name = value. Stores as a comma-separated string."
if is_iter(value): if is_iter(value):
value = ",".join([str(val).strip().lower() for val in value]) value = ",".join([str(val).strip() for val in value])
self.db_permissions = value self.db_permissions = value
self.save() self.save()
#@permissions.deleter #@permissions.deleter