diff options
author | jomo <github@jomo.tv> | 2014-07-12 03:08:01 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2014-07-12 03:08:01 +0200 |
commit | fafba7f5a6a1bb0b24f252c89c3fb18fe8f80e7c (patch) | |
tree | aa6e6d94cd2f0c939a18561e95114b357061f03b | |
parent | b8b86be805d13bb891974ef39b86efd042aad25a (diff) |
show online users by UUID; add quotes info to readme
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | chatgroups.py | 7 |
2 files changed, 9 insertions, 2 deletions
@@ -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: |