From fafba7f5a6a1bb0b24f252c89c3fb18fe8f80e7c Mon Sep 17 00:00:00 2001 From: jomo Date: Sat, 12 Jul 2014 03:08:01 +0200 Subject: [PATCH] show online users by UUID; add quotes info to readme --- README.md | 4 ++++ chatgroups.py | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae70136..92c2e19 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,10 @@ If you want the server to load a file (*module*) on startup, add it to the `modu Never use tabs! Use 2 spaces to indent. +## Quotes +Always use double-quotes! +Only use single-quotes when the string contains double-quotes that would need to be escaped. + ## Comments Comments are good! Please comment everything that's non-obious or makes it easier to understand diff --git a/chatgroups.py b/chatgroups.py index 7975d79..103061b 100644 --- a/chatgroups.py +++ b/chatgroups.py @@ -1,5 +1,6 @@ #pylint: disable=F0401 from helpers import * +from java.utils.UUID import fromString as juuid import simplejson as json chatgroups_filename = "plugins/redstoner-utils.py.dir/files/chatgroups.json" @@ -30,9 +31,11 @@ def onChatgroupCommand(sender, args): group = groups[str(sender.getUniqueId())] msg(sender, "&aCurrent chatgroup: %s" % group) users = [] - for user, ugroup in groups.iteritems(): + for uid, ugroup in groups.iteritems(): if ugroup == group: - users += [user] + usr = server.getPlayer(juuid(uid)) + if usr: + users.append(usr.getDisplayName()) msg(sender, "&aUsers in this group:") msg(sender, "&a%s" % ", ".join(users)) else: