ProperWarnings
ProperWarnings - a smart warning system
I've developed this plugin because I've the server a friend of mine had a problem with another warning system plugin that didn't have the features he wanted. So I've developed this from his needs, and what I didn't like about it.
- You can warn players without writing out their full name, even if they're offline. If player "thisisareallylongusername" joins once you can do /warn player thisisareallylong some warning, and it will match it to "thisisareallylongusername". It first looks for a player online with that name, if nothing was found it will look trough all players who have ever been online matching that name. If mulitple matches it will not warn anyone but give you a list of all players, their full names and UUID.
- You can warn players based on UUID.
- You can check warnings for a player based on name or UUID, it does a wildcarded search in case of a playername (kiwi will give a list of warnings for all players with "kiwi" in their name).
- Pagination! Does not spam chat with hundreds of warnings, but 5 at once.
- Ability to delete a warning.
- Separate permission nodes for warning, checking and deleting.
- Saves the player who places a warning in UUID, not player name (when doing a check it will get the player's current nick name based on the UUID).
- Saves the warned player's UUID and name at the time.
- Saves in MySQL.
- Prepared statements to prevent SQLi (makes it near impossible).
- Automatic table creation.
- EXPERIMENTAL!! It should work for everyone, if not contact me and I'll help. Ability to convert data from SimpleWarnings (it was required for the server I play on), both MySQL and SQLite. Runs on a seperate thread, so it doesn't lag the server and is pretty fast. On my home server with a mere 1 GB dedicated RAM it took 11 seconds to convert ~550 warnings from SQLite.
Command usage
There is currently one one command. The command is "warn", but it has a few arguments.
Warning a player based on player name
If a player called "th1s51al0ngn1ck" has broken a rules, let's say greifing, you'd simply do "/warn player th1s51 Greifing x amount of blocks around player Y's house." This will also work if they're offline. I've designed the plugin something like this:1. Check if there's a player online who's name matches the name given in the command. If match found, warn the player.
2. Get all the players who have ever been online (don't worry, this is actually pretty fast), check if their current username contains the player name given from the command. In case of a match, add that match to a list of matches. It then continues until it has gone trough all the players.
3. In case of no matches, tell the player. In case of one match, tell the command runner the match's full name. In case of multiple matches give a table of full usernames and UUID's.
Warning a player based on UUID
/warn playeruuid this-isnt-a-real-uuid This player has been hacking.Getting all the warnings for (a) player(s) based on name
/warn check username <pageNumber> (pageNumber is optional)This will match all usernames that contain what you're searching for. For example I can do "/warn check ii" and it will match "kiipa", "piika" "kiiap" and so on. That way you don't have to know the full name of someone. It also gives results in pages, 5 warnings per page. If you don't specify a page number it will default to 0. It also starts at page 0, not page 1. If you want to look at the next page just do "/warn check ii 1". The results will be displayed something like this:
#1 <2014-08-16 10:49>
kiipa warned for Griefing by console.
The first row shows the ID of the warning (it's used for deleting a warning), the timestamp that the warning was placed, who was warned, what for and by whom.
Getting all warnings for a player based on UUID
/warn checkuuid UUIDIt will only match the UUID instead of usernames, otherwise it's identical to checking with usernames.
Deleting a warning
To delete a warning you need the ID of it. You can get this trough check or checkuuid./warn delete ID
Permission
The permissions are pretty straight forward, shouldn't need much explaining.ProperWarnings.check - lets you use /warn check and /warn checkuuid.
ProperWarnings.warn - lets you use /warn player and /warn playeruuid.
ProperWarnings.delete - lets you use /warn delete.
Screenshots
Checking records for a player (I've censored the usernames).

Warning an offline player, without typing out the fullname:

In case of multiple matches (I think it's because I've played in online-mode: false and true).

-
View User Profile
-
Send Message
Posted Aug 17, 2014@TheMrGong
I'm using JavaPlugin::getServer()::getPlayer("playerName")::getUniqueId(). Or just "getServer().getPlayer('kiipa').getUniqueId()". Running under 1.7
-
View User Profile
-
Send Message
Posted Aug 17, 2014What did you use to get playername from UUID? Is there an API in 1.7.9?