show online users by UUID; add quotes info to readme

This commit is contained in:
jomo
2014-07-12 03:08:01 +02:00
parent b8b86be805
commit fafba7f5a6
2 changed files with 9 additions and 2 deletions

View File

@@ -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

View File

@@ -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: