Fixed bugs that now allows multiple sessions to connect through the same player to different characters. Still lots of bugs and inconsistencies, the permissions of superusers don't quite transfer sometimes, for example.

This commit is contained in:
Griatch 2013-02-04 22:02:04 +01:00
parent 3aa122c41a
commit a84b4f24fc
4 changed files with 23 additions and 15 deletions

View file

@ -1555,7 +1555,7 @@ class CmdExamine(ObjManipCommand):
"""
key = "@examine"
aliases = ["@ex","ex", "exam", "examine"]
locks = "cmd:perm(examine) or perm(Builders)"
locks = "cmd:perm(examine) or perm(Players)"#Builders)"
help_category = "Building"
arg_regex = r"(/\w+?(\s|$))|\s|$"
@ -1615,6 +1615,7 @@ class CmdExamine(ObjManipCommand):
headers = {"name":"\n{wName/key{n: {c%s{n (%s)",
"aliases":"\n{wAliases{n: %s",
"player":"\n{wPlayer{n: {c%s{n",
"sessid":" {wsessid{n: {c%s{n",
"playerperms":"\n{wPlayer Perms{n: %s",
"typeclass":"\n{wTypeclass{n: %s (%s)",
"location":"\n{wLocation{n: %s (#%s)",
@ -1630,6 +1631,7 @@ class CmdExamine(ObjManipCommand):
headers_noansi = {"name":"\nName/key: %s (%s)",
"aliases":"\nAliases: %s",
"player":"\nPlayer: %s",
"sessid":" sessid: %s)",
"playerperms":"\nPlayer Perms: %s",
"typeclass":"\nTypeclass: %s%s",
"location":"\nLocation: %s (#%s)",
@ -1659,6 +1661,10 @@ class CmdExamine(ObjManipCommand):
elif not perms:
perms = ["<None>"]
string += headers["playerperms"] % (", ".join(perms))
if hasattr(obj, "sessid"):
string += headers["sessid"] % obj.sessid
elif hasattr(obj, "sessions"):
string += headers["sessid"] % (",".join(sess.sessid for sess in obj.sessions))
string += headers["typeclass"] % (obj.typeclass.typename, obj.typeclass_path)
if hasattr(obj, "location") and obj.location:
@ -1733,13 +1739,16 @@ class CmdExamine(ObjManipCommand):
if not self.args:
# If no arguments are provided, examine the invoker's location.
obj = caller.location
if not obj.access(caller, 'examine'):
#If we don't have special info access, just look at the object instead.
caller.execute_cmd('look %s' % obj.name)
return
# using callback for printing result whenever function returns.
get_and_merge_cmdsets(obj).addCallback(get_cmdset_callback)
if hasattr(caller, "location"):
obj = caller.location
if not obj.access(caller, 'examine'):
#If we don't have special info access, just look at the object instead.
caller.execute_cmd('look %s' % obj.name)
return
# using callback for printing result whenever function returns.
get_and_merge_cmdsets(obj).addCallback(get_cmdset_callback)
else:
caller.msg("You need to supply a target to examine.")
return
# we have given a specific target object