forked from balr0g/VoxelGuest
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented UUID-based player handling in Asshat module
---- Addresses #112 Non-UUID classes in the Asshat module have been marked deprecated and will be removed soon. A system to convert the old DB table is still required but should be very easy to implement. However, names were stored lower-case while Mojang's API is case-sensitive. Tab-completion for the UUID table is currently not supported. Player-login and /ban, /unban, /banreason, /gag, /ungag commands can slow down the server's main event loop since a synchronous web request is sent to resolve a player's UUID.
- Loading branch information
Showing
13 changed files
with
377 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/com/thevoxelbox/voxelguest/modules/asshat/ban/BannedUUIDPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.thevoxelbox.voxelguest.modules.asshat.ban; | ||
|
||
import com.j256.ormlite.field.DatabaseField; | ||
import com.j256.ormlite.table.DatabaseTable; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* @author Monofraps | ||
*/ | ||
@DatabaseTable(tableName = "bans_uuid") | ||
public class BannedUUIDPlayer | ||
{ | ||
@DatabaseField(generatedId = true) | ||
private long id; | ||
@DatabaseField | ||
private UUID playerUUID; | ||
@DatabaseField | ||
private String banReason; | ||
|
||
/** | ||
* ORM constructor. | ||
*/ | ||
public BannedUUIDPlayer() | ||
{ | ||
} | ||
|
||
/** | ||
* @param playerName The name of the banned player. | ||
* @param banReason The reason the player is banned for. | ||
*/ | ||
public BannedUUIDPlayer(final UUID playerUUID, final String banReason) | ||
{ | ||
this.playerUUID = playerUUID; | ||
this.banReason = banReason; | ||
} | ||
|
||
public final UUID getPlayerUUID() | ||
{ | ||
return playerUUID; | ||
} | ||
|
||
/** | ||
* @return Returns the reason the player is banned for. | ||
*/ | ||
public final String getBanReason() | ||
{ | ||
return banReason; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.