changed cmdset_default -> cmdset_character and changed the class names to match. Added migrations to properly update default-set cmdset_stores to the new positions (objects created from custom types are not migrated, these should see errors and need to re-point their imports to the new defaults)
This commit is contained in:
parent
c152202082
commit
a6544f2848
15 changed files with 193 additions and 81 deletions
|
|
@ -377,47 +377,6 @@ class CmdSay(MuxCommand):
|
|||
speech)
|
||||
caller.location.msg_contents(emit_string,
|
||||
exclude=caller)
|
||||
class CmdSessions(MuxCommand):
|
||||
"""
|
||||
check connected session(s)
|
||||
|
||||
Usage:
|
||||
@sessions
|
||||
|
||||
Lists the sessions currently connected to your account.
|
||||
|
||||
"""
|
||||
key = "@sessions"
|
||||
locks = "cmd:all()"
|
||||
help_category = "General"
|
||||
|
||||
def func(self):
|
||||
"Implement function"
|
||||
|
||||
# make sure we work on the player, not on the character
|
||||
player = self.caller
|
||||
if hasattr(player, "player"):
|
||||
player = player.player
|
||||
|
||||
sessions = player.get_all_sessions()
|
||||
|
||||
table = [["sessid"], ["host"], ["character"], ["location"]]
|
||||
for sess in sorted(sessions, key=lambda x:x.sessid):
|
||||
sessid = sess.sessid
|
||||
char = player.get_puppet(sessid)
|
||||
table[0].append(str(sess.sessid))
|
||||
table[1].append(str(sess.address[0]))
|
||||
table[2].append(char and str(char) or "None")
|
||||
table[3].append(char and str(char.location) or "N/A")
|
||||
ftable = utils.format_table(table, 5)
|
||||
string = ""
|
||||
for ir, row in enumerate(ftable):
|
||||
if ir == 0:
|
||||
string += "\n" + "{w%s{n" % ("".join(row))
|
||||
else:
|
||||
string += "\n" + "".join(row)
|
||||
self.msg(string)
|
||||
|
||||
|
||||
class CmdPose(MuxCommand):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue