Made WHO display Player info, not Character info to un-privileged users, and give more info to privileged users. Resolves #518.
This commit is contained in:
parent
fb8cf41b4e
commit
169d0a78f8
1 changed files with 11 additions and 7 deletions
|
|
@ -378,9 +378,11 @@ class CmdWho(MuxPlayerCommand):
|
||||||
|
|
||||||
nplayers = (SESSIONS.player_count())
|
nplayers = (SESSIONS.player_count())
|
||||||
if show_session_data:
|
if show_session_data:
|
||||||
|
# privileged info
|
||||||
table = prettytable.PrettyTable(["{wPlayer Name",
|
table = prettytable.PrettyTable(["{wPlayer Name",
|
||||||
"{wOn for",
|
"{wOn for",
|
||||||
"{wIdle",
|
"{wIdle",
|
||||||
|
"{wPuppeting",
|
||||||
"{wRoom",
|
"{wRoom",
|
||||||
"{wCmds",
|
"{wCmds",
|
||||||
"{wProtocol",
|
"{wProtocol",
|
||||||
|
|
@ -389,25 +391,27 @@ class CmdWho(MuxPlayerCommand):
|
||||||
if not session.logged_in: continue
|
if not session.logged_in: continue
|
||||||
delta_cmd = time.time() - session.cmd_last_visible
|
delta_cmd = time.time() - session.cmd_last_visible
|
||||||
delta_conn = time.time() - session.conn_time
|
delta_conn = time.time() - session.conn_time
|
||||||
plr_pobject = session.get_puppet()
|
player = session.get_player()
|
||||||
plr_pobject = plr_pobject or session.get_player()
|
puppet = session.get_puppet()
|
||||||
table.add_row([utils.crop(plr_pobject.name, width=25),
|
location = puppet.location.key if puppet else "None"
|
||||||
|
table.add_row([utils.crop(player.name, width=25),
|
||||||
utils.time_format(delta_conn, 0),
|
utils.time_format(delta_conn, 0),
|
||||||
utils.time_format(delta_cmd, 1),
|
utils.time_format(delta_cmd, 1),
|
||||||
hasattr(plr_pobject, "location") and plr_pobject.location and plr_pobject.location.key or "None",
|
utils.crop(puppet.key if puppet else "None", width=25),
|
||||||
|
utils.crop(location, width=25),
|
||||||
session.cmd_total,
|
session.cmd_total,
|
||||||
session.protocol_key,
|
session.protocol_key,
|
||||||
isinstance(session.address, tuple) and session.address[0] or session.address])
|
isinstance(session.address, tuple) and session.address[0] or session.address])
|
||||||
else:
|
else:
|
||||||
|
# unprivileged
|
||||||
table = prettytable.PrettyTable(["{wPlayer name", "{wOn for", "{wIdle"])
|
table = prettytable.PrettyTable(["{wPlayer name", "{wOn for", "{wIdle"])
|
||||||
for session in session_list:
|
for session in session_list:
|
||||||
if not session.logged_in:
|
if not session.logged_in:
|
||||||
continue
|
continue
|
||||||
delta_cmd = time.time() - session.cmd_last_visible
|
delta_cmd = time.time() - session.cmd_last_visible
|
||||||
delta_conn = time.time() - session.conn_time
|
delta_conn = time.time() - session.conn_time
|
||||||
plr_pobject = session.get_puppet()
|
player = session.get_player()
|
||||||
plr_pobject = plr_pobject or session.get_player()
|
table.add_row([utils.crop(player.key, width=25),
|
||||||
table.add_row([utils.crop(plr_pobject.name, width=25),
|
|
||||||
utils.time_format(delta_conn, 0),
|
utils.time_format(delta_conn, 0),
|
||||||
utils.time_format(delta_cmd, 1)])
|
utils.time_format(delta_cmd, 1)])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue