Added a warning to @delete command if trying to delete CHARACTER_DEFAULT_HOME (Limbo by default).
This commit is contained in:
parent
4c83d3e7a1
commit
4bd3be334d
2 changed files with 10 additions and 7 deletions
|
|
@ -538,6 +538,8 @@ class CmdDestroy(MuxCommand):
|
||||||
if not obj:
|
if not obj:
|
||||||
self.caller.msg(" (Objects to destroy must either be local or specified with a unique dbref.)")
|
self.caller.msg(" (Objects to destroy must either be local or specified with a unique dbref.)")
|
||||||
return ""
|
return ""
|
||||||
|
if not "override" in self.switches and obj.dbid == int(settings.CHARACTER_DEFAULT_HOME):
|
||||||
|
return "\nYou are trying to delete CHARACTER_DEFAULT_HOME. If you want to do this, use the /override switch."
|
||||||
objname = obj.name
|
objname = obj.name
|
||||||
if not obj.access(caller, 'delete'):
|
if not obj.access(caller, 'delete'):
|
||||||
return "\nYou don't have permission to delete %s." % objname
|
return "\nYou don't have permission to delete %s." % objname
|
||||||
|
|
@ -1537,6 +1539,7 @@ class CmdExamine(ObjManipCommand):
|
||||||
aliases = ["@ex","ex", "exam", "examine"]
|
aliases = ["@ex","ex", "exam", "examine"]
|
||||||
locks = "cmd:perm(examine) or perm(Builders)"
|
locks = "cmd:perm(examine) or perm(Builders)"
|
||||||
help_category = "Building"
|
help_category = "Building"
|
||||||
|
arg_regex = r"\s.*?|$"
|
||||||
|
|
||||||
player_mode = False
|
player_mode = False
|
||||||
|
|
||||||
|
|
@ -1601,7 +1604,7 @@ class CmdExamine(ObjManipCommand):
|
||||||
"perms":"\n{wPermissions{n: %s",
|
"perms":"\n{wPermissions{n: %s",
|
||||||
"locks":"\n{wLocks{n:",
|
"locks":"\n{wLocks{n:",
|
||||||
"cmdset":"\n{wCurrent Cmdset(s){n:\n %s",
|
"cmdset":"\n{wCurrent Cmdset(s){n:\n %s",
|
||||||
"cmdset_avail":"\n{wActual commands available to %s (incl. lock-checks, external cmds etc){n:\n %s",
|
"cmdset_avail":"\n{wCommands available to %s (all cmdsets + exits and external cmds){n:\n %s",
|
||||||
"scripts":"\n{wScripts{n:\n %s",
|
"scripts":"\n{wScripts{n:\n %s",
|
||||||
"exits":"\n{wExits{n: ",
|
"exits":"\n{wExits{n: ",
|
||||||
"characters":"\n{wCharacters{n: ",
|
"characters":"\n{wCharacters{n: ",
|
||||||
|
|
@ -1616,7 +1619,7 @@ class CmdExamine(ObjManipCommand):
|
||||||
"perms":"\nPermissions: %s",
|
"perms":"\nPermissions: %s",
|
||||||
"locks":"\nLocks:",
|
"locks":"\nLocks:",
|
||||||
"cmdset":"\nCurrent Cmdset(s):\n %s",
|
"cmdset":"\nCurrent Cmdset(s):\n %s",
|
||||||
"cmdset_avail":"\nActual commands available to %s (incl. lock-checks, external cmds, etc):\n %s",
|
"cmdset_avail":"\nCommands available to %s (all cmdsets + exits and external cmds):\n %s",
|
||||||
"scripts":"\nScripts:\n %s",
|
"scripts":"\nScripts:\n %s",
|
||||||
"exits":"\nExits: ",
|
"exits":"\nExits: ",
|
||||||
"characters":"\nCharacters: ",
|
"characters":"\nCharacters: ",
|
||||||
|
|
@ -1653,12 +1656,12 @@ class CmdExamine(ObjManipCommand):
|
||||||
|
|
||||||
if not (len(obj.cmdset.all()) == 1 and obj.cmdset.current.key == "Empty"):
|
if not (len(obj.cmdset.all()) == 1 and obj.cmdset.current.key == "Empty"):
|
||||||
# list the current cmdsets
|
# list the current cmdsets
|
||||||
cmdsetstr = "\n".join([utils.fill(cmdset, indent=2) for cmdset in str(obj.cmdset).split("\n")])
|
all_cmdsets = obj.cmdset.all() + (obj.player and obj.player.cmdset.all() or [])
|
||||||
string += headers["cmdset"] % cmdsetstr
|
all_cmdsets.sort(key=lambda x:x.priority, reverse=True)
|
||||||
|
string += headers["cmdset"] % ("\n ".join("%s (prio %s)" % (cmdset.path, cmdset.priority) for cmdset in all_cmdsets))
|
||||||
|
#cmdsetstr = "\n".join([utils.fill(cmdset, indent=2) for cmdset in str(obj.cmdset).split("\n")])
|
||||||
|
|
||||||
# list the actually available commands
|
# list the actually available commands
|
||||||
#from src.commands.cmdhandler import get_and_merge_cmdsets
|
|
||||||
#avail_cmdset = get_and_merge_cmdsets(obj)
|
|
||||||
avail_cmdset = sorted([cmd.key for cmd in avail_cmdset if cmd.access(obj, "cmd")])
|
avail_cmdset = sorted([cmd.key for cmd in avail_cmdset if cmd.access(obj, "cmd")])
|
||||||
|
|
||||||
cmdsetstr = utils.fill(", ".join(avail_cmdset), indent=2)
|
cmdsetstr = utils.fill(", ".join(avail_cmdset), indent=2)
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ DEFAULT_NCLIENTS = 1
|
||||||
# time between each 'tick', in seconds, if not set on command
|
# time between each 'tick', in seconds, if not set on command
|
||||||
# line. All launched clients will be called upon to possibly do an
|
# line. All launched clients will be called upon to possibly do an
|
||||||
# action with this frequency.
|
# action with this frequency.
|
||||||
DEFAULT_TIMESTEP = 2
|
DEFAULT_TIMESTEP = 5
|
||||||
# Port to use, if not specified on command line
|
# Port to use, if not specified on command line
|
||||||
DEFAULT_PORT = settings.TELNET_PORTS[0]
|
DEFAULT_PORT = settings.TELNET_PORTS[0]
|
||||||
# chance of an action happening, per timestep. This helps to
|
# chance of an action happening, per timestep. This helps to
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue