ModeratorGui
ModeratorGui
A simple plug-in to allow your server operators/moderators to report whatever they do. Supports reporting issues with players, bans, unbans, promotions and demotions.
Every type is color-coded. Issues are yellow, bans dark red, unbans dark green, promotions green and demotions red.
This plug-in runs a very basic HTTP server, only files in the plugins/ModeratorGui/web folder are accessible. To access the web GUI, you connect to port 8273, you have to enter the password specified in config.yml.
A list of ranks can be specified to limit what can be entered when reporting promotions or demotions.
The plugin will try to match usernames to players that have once joined the server with the in-game commands. Ranks will also be matched.
The Web GUI can be modified to your desire, but is limited to how the web server works.
If you find any bugs or issues, or if you have suggestions, please comment explaining the issue or suggestion.
A preview of the WebGui:
Permissions
permissions: moderatorgui: default: op description: Command for full rights children: moderatorgui.command: true moderatorgui.command.admin: true moderatorgui.issue: true moderatorgui.ban: true moderatorgui.unban: true moderatorgui.promote: true moderatorgui.demote: true moderatorgui.review: true moderatorgui.viewreported: true moderatorgui.viewopenissues: true moderatorgui.export: true moderatorgui.import: true moderatorgui.uninstall: true moderatorgui.setpass: true moderatorgui.command: description: Allows using the plugin commands moderatorgui.command.admin: description: Allows using the admin commands moderatorgui.issue: description: Allows reporting issues with players moderatorgui.ban: description: Allows reporting banning a player moderatorgui.unban: description: Allows reporting unbanning a player moderatorgui.promote: description: Allows reporting promotions moderatorgui.demote: description: Allows reporting demotions moderatorgui.review: description: Allows reviewing reports moderatorgui.viewreported: description: "Allows seeing an issue when it's reported" moderatorgui.viewopenissues: description: Allows seeing wether a person has open issues moderatorgui.export: description: Allows exporting all reports to a binary file moderatorgui.import: description: Allows importing all reports from a binary file moderatorgui.uninstall: description: Allows deleting the database moderatorgui.setpass: description: Allows setting a password to be used on the webgui
Commands
/report help
- Displays /report sub-commands
/report issue <playername> <issue>
- Reports an issue
/report ban <playername> <reason>
- Reports banning a player
/report unban <playername> <reason>
- Reports unbanning a player
/report promote <playername> <oldrank> <newrank> <reason>
- Reports promoting a player
/report promote <playername> <oldrank> <newrank> <reason>
- Reports demoting a player
/review help
- Displays /review sub-commands
/review [page]
- Displays a page of reports
/review by <playername> [page]
- Displays a page of reports reported by a playername
/review target <playername> [page]
- Displays a page of reports that were reported about a player
/review close I:<id> [I:<id> [...]]
- Closes a report of a certain type, currently only supported type is I
for issue, can support multiple reports at once.
/moderatorgui
- Displays /moderatorgui sub-commands (Aliases: /modgui, /mg)
/moderatorgui help
- Displays /moderatorgui sub-commands
/moderatorgui setpass <password>
- Sets a password linked to your name for the WebGui, the password is hashed. HOWEVER, the password will be visible in the console when you run the command.
/moderatorgui export
- Exports the database into a binary file called data.bin in the plugin folder
/moderatorgui import
- Imports a data.bin binary file that was created with ModeratorGui into the database, clearing the database beforehand. WARNING: this cannot be undone
/moderatorgui uninstall
- Deletes the database and disables the plugin. Will not delete the plugin jar. WARNING: this cannot be undone
Config variables
The configuration has 2 sections where variables are used, the messages section and the perform section. Here is a list of the variables:
%id%
- The id of the report
%target%
- The name of the reported player
%reporter%
- The name of the reporting player
%reason%
- The reason of the report/action
%date%
- The date of the report, using the standard ModGui date format
%oldrank%
- Only used for promotions and demotions, the old rank of the player
%newrank%
- Only used for promotions and demotions, the new rank of the player
Web requests for custom web-pages
All requests start with /GENERATED/
(case-sensitive)
/GENERATED/LOGIN/username/password
- Returns a session that will be used for other requests followed by a list of available ranks sepperated by "/", or
"invalid"
if the supplied password was incorrect. The password has to be an SHA-256 encrypted string. /GENERATED/LIST/session/request_flags
- Returns a global list of reports, limited to a maximum of 500 results
/GENERATED/REPORTER/session/request_flags/username/
- Returns a list of reports where the reporter is username, limited to a maximum of 500 results
/GENERATED/REPORTED/session/request_flags/username/
- Returns a list of reports where the person being reported is username, limited to a maximum of 500 results
/GENERATED/REPORT/session/request_flags/reported/reason/previousRank/newRank//
- Creates a new report, created by the user bound to the session.
previousRank
andnewRank
can be empty if it is not required.
Every mention of request_flags
has to be replaced with a type filter. i
for issues, b
for bans, u
for unbans, p
for promotions and d
for demotions. If you want to get all types you can leave it blank or send ibupd
, this means that if any of the above flags are found it will find from all the supplied types. Do note that there are times that only one flag can be set.
Returned lists are in JSON format, a typical list would look like this (only displaying one of each type of report), newest reports are displayed first, the current reports are in no particular order.
[ { type: "issue", close: false, reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He was being stupid" }, { type: "ban", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He wanted to get banned" }, { type: "unban", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He wanted to get unbanned" }, { type: "promote", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He wanted to get promoted", prev: "default", new: "admin" }, { type: "demote", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He was falsely promoted", prev: "admin", new: "default" } ]
When a request is made with an invalid session, a 403 - Forbidden error will be supplied. When the server encounters an error, a stack trace is printed to the console and a 500 - Internal Server Error will be supplied.
Planned features
- None currently
Hi There, Im getting this error when my Staff type /report issue [Player] <Issue> It says on screen An Internal error occurred when trying to perform this command. The report still comes through on the Web client. Id just like to know why Java is getting a Null pointer exception error, What is it supposed to do, That it cannot find? Could you possibly help me figure this out. Here is the error, (Sorry about the message being huge)
2012-07-30 14:06:57 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing command 'report' in plugin ModeratorGui v1.3 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:479) at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:821) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764) at net.minecraft.serverhook.NetServerHandlerProxy.a(NetServerHandlerProxy.java:141) at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34) at net.minecraft.server.NetworkManager.b(NetworkManager.java:229) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) at net.minecraft.serverhook.NetServerHandlerProxy.a(NetServerHandlerProxy.java:83) at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:567) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:459) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.NullPointerException at me.heldplayer.ModeratorGui.ModeratorGui.performCommands(ModeratorGui.java:156) at me.heldplayer.ModeratorGui.ReportCommand.onCommand(ReportCommand.java:78) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 14 more ======
Regards FactionCraft UK
With the php interface could you rework the plugin so that it stores data to remote a mysql server, and the php interface comes with config to easily setup on remote a website aswel?
That way the plugin itself can have its own http server disabled and gives server owners a bit more flexibility.
Also maybe by default support for dynamicban commands to be picked up?, as it uses different ban commands.
@heldplayer
Okay, I found two tools to edit an SQL Lite DB. One would allow me to add fields to the table, but would add them to the beginning with a Column ID of 0, the second would add them to the table with a column ID of 5. Neither worked when I tried to run it in ModeratorGUI. The second recreated the entire table, and made it 13KB larger.. Is ModeratorGUI expecting it to have a certain Column ID? or be in a certain order in the database?
Uploaded a new version, the changes this version brings:
Fixed report-time displaying to always be formatted using the issue format
Added config options to perform commands when a report is made
@zedadiaswick
I had hoped this wouldn't happen, but hey!
I haven't really worked with SQLite but I hope this will work. You will need to add a new column name called 'is_closed' of type boolean to the mgui_issues table. If you cannot add rows to the table you will have to transfer all the data to a copy of the table, delete to mgui_issues table and recreate it.
Sorry for the inconvenience, and I should have posted a tutorial about this when updating for SQLite users.
As to the yellow report messages, this is an error on my side. Everything is formatted to the issue format at report time. I'll fix this for the next version.
Am getting internal errors whenever I report an issue, or do a /review. I am assuming this is to do with my SQLite db not being updated properly; but to be honest I don't really know how to update it myself. Never messed with SQLite db files before.
Are you interested in seeing the console errors associated with this? If so, I'll be happy to provide logs.
Also, when someone /report bans a player, it is reported to the others online in yellow. I would have expected this to be red, consistent with the usual colour coding.
@zedadiaswick
Ah sorry, this is indeed the case. I have uploaded a new version and it is awaiting approval.
@heldplayer
I haven't been able to get the new features to work in the latest version. In fact, I'm not sure the latest version is the latest version. The file-size appears to be the same as the earlier version, and it appears to have been created on the 22nd of May, 2012. Can you confirm the upload is correct? or am I missing something else...
@watdidyusaey
I think the suggestion Master_Zangetsu made will work well enough to full fill that request.
As to the SQL database features, what features do you require? ModeratorGui uses the default database as assigned in bukkit.yml so I'm not sure if I can let it do stuff like optimizing.
@heldplayer
For example ultrabans has a reporting system where the mod who kicked/banned/jailed a player can list the "reason" for the ban/kick/etc. IT would be nice if that reason would be synced with moderator GUI
Instead of seperating the report with the actual banning, why not just carry over the reason from another plugin instead of rewriting it?
Also SQL database features are must!
@Master_Zangetsu
i have posted a ticked explaining in more detail
this world be the perfect plugin if it enacted some of the basic commands itself
so /report ban playername reason also banned the player
etc
@XeonG8
Sure, I'll add that to my to do list for tomorrow
EDIT: done :)
@ryvix
I've been thinking about that, though it would require the end user to edit at least one file to make it work, can't make it magically detect the database. And of course it would require MySQL and PHP.
This looks pretty cool. But is it possible to make it so you can run the web server on an external server instead such as Apache? Perhaps if it used a MySQL database and there were some PHP files it would be possible to run from an external web server instead.
any screenshot to show what the web interface looks like?
A new version has been uploaded!
Changes:
You can now close issues
When somebody opens a new issue, everybody with a set permissions node set will see the issue being reported
ModeratorGui now has a shorter prefix for console output
ModeratorGui now takes advantage of colours in the console
You can now change the format of how reports are displayed
When a player logs in with one or more open issues they will be displayed to people with a set permissions node
Behind the scenes optimization
Known caveats
Warning: this version and above will update its tables if there has been a change in their structure, it is essential that you do not edit the config-version variable in config.yml
Notice: if you use SQLite there is a big chance that you will have to manually update the issues table because it introduced a new column to the structure. Other database systems might not be able to convert these either, be warned
@heldplayer
With the outstanding issues, i meant I wanted an issue to be made about a player which could later be checked off as no longer an issue. So one issue i report is when a player is suspected of using xray, but not enough proof has been gathered for a ban. So we know to keep an eye on the player. Or if they're suspected of flying, but again not conclusive proof of them flying, then an issue would be made until we decide he definitely doesn't fly, or he gets banned for flying. Or if a player makes a complaint that still needs to be addressed. Would be good to have it marked as resolved, and then to know who resolved it.
Then I was going to ask for an option to allow players to be able to only report issues on themselves, but i suppose with the above in place they could just attach issues on to other players and an op would get to it next time they logged on and saw the pending issues notification.
@zedadiaswick
I'm glad you like it :)
As for your suggestions, in the order suggested:
Yeah, it's possible, pretty easy as well.
How do you mean "outstanding issues"? Do you mean the latest issues or give them a severity? Or tied into the flying kicks?
Currently it's not possible to remove issues, that's correct. I could add an ID system to make this work though.
I will try to get this to work, maybe make a separate reportable issue type called "kick" to automatically report any kicks. Problem with this is that I've recently seen a rise in players being kicked with a reason of "You logged in from another location".
Same as above.
And yet again, thanks for saying thanks ;)
@heldplayer
Ah, sorry I never replied to this. This was indeed the case.
I have a couple of suggestions.:
Could all reported issues be displayed to those with a certain permission node online at the time they are reported?
Would be good if, when a player logs in, their outstanding issues are reported.
The ability to remove reports, or in the case of issues mark them as solved.
In the console, I can see the 'kicked for floating too long' messages, would be good to have them displayed in-game at the time (I know this is nothing to do with your plugin, but it couples with the next request)
Log all 'kicked for floating' messages as issues associated with that player. Also 'moved wrongly' messages.
Are any of the above a possibility?
Thanks for this plugin otherwise, I've been using it to keep track of my bans for use in appeals. Saved me some time :)
@webshoptv
This plugin doesn't use PHP, this is so it doesn't have to depend on anything else.
Furthermore, a fully working web-gui is already present, it's the the ModeratorGui/web folder. You should extract the contents of the zip to your plugins folder.