show online users by UUID; add quotes info to readme
This commit is contained in:
@@ -140,6 +140,10 @@ If you want the server to load a file (*module*) on startup, add it to the `modu
|
|||||||
Never use tabs!
|
Never use tabs!
|
||||||
Use 2 spaces to indent.
|
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
|
||||||
Comments are good!
|
Comments are good!
|
||||||
Please comment everything that's non-obious or makes it easier to understand
|
Please comment everything that's non-obious or makes it easier to understand
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pylint: disable=F0401
|
#pylint: disable=F0401
|
||||||
from helpers import *
|
from helpers import *
|
||||||
|
from java.utils.UUID import fromString as juuid
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
|
|
||||||
chatgroups_filename = "plugins/redstoner-utils.py.dir/files/chatgroups.json"
|
chatgroups_filename = "plugins/redstoner-utils.py.dir/files/chatgroups.json"
|
||||||
@@ -30,9 +31,11 @@ def onChatgroupCommand(sender, args):
|
|||||||
group = groups[str(sender.getUniqueId())]
|
group = groups[str(sender.getUniqueId())]
|
||||||
msg(sender, "&aCurrent chatgroup: %s" % group)
|
msg(sender, "&aCurrent chatgroup: %s" % group)
|
||||||
users = []
|
users = []
|
||||||
for user, ugroup in groups.iteritems():
|
for uid, ugroup in groups.iteritems():
|
||||||
if ugroup == group:
|
if ugroup == group:
|
||||||
users += [user]
|
usr = server.getPlayer(juuid(uid))
|
||||||
|
if usr:
|
||||||
|
users.append(usr.getDisplayName())
|
||||||
msg(sender, "&aUsers in this group:")
|
msg(sender, "&aUsers in this group:")
|
||||||
msg(sender, "&a%s" % ", ".join(users))
|
msg(sender, "&a%s" % ", ".join(users))
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user