AuthMe 3.0
//Changes 3.0:// * Repackaging from uk.org.whoami.authme to fr.xephi.authme, please developpers, update! * Rewrite some of parts of the plugin * Some code was already perfect , also did not change it :p * Full support for phpbb3 * Add full support for WordPress + passwordHash: WORDPRESS * Completely rewrite Management system for inventories and tp issues, Thanks to : [[http://dev.bukkit.org/profiles/Possible/|Possible]] * Rework on /passpartu command * Completely rewrite the password encryption method * Add a way for developers to add their own Password Encryption Method on AuthMe via event way (please see fr.xephi.authme.events.PasswordEncryptionEvent) * Add an auto purge with players.dat removing method and essentials files removing ( if you want authme to hook with an another plugin let me know ) * Complete Hook with BungeeCord by removing the /server command before login * message_lang.yml will never be overwritten with English Strings , but correctly update the message_lang.yml when needed to * Fix a lot of issues mentioned in tickets , commants , or by mp, Thanks for all your reports!
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class AuthMeTeleportEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
|
||||
public AuthMeTeleportEvent(Player player, Location to) {
|
||||
this.player = player;
|
||||
this.from = player.getLocation();
|
||||
this.to = to;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class CustomEvent extends Event implements Cancellable {
|
||||
|
||||
private boolean isCancelled;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static Server s;
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return this.isCancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.isCancelled = cancelled;
|
||||
}
|
||||
|
||||
public static Server getServer() {
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class LoginEvent extends Event {
|
||||
|
||||
private Player player;
|
||||
private boolean isLogin;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public LoginEvent(Player player, boolean isLogin) {
|
||||
this.player = player;
|
||||
this.isLogin = isLogin;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setLogin(boolean isLogin) {
|
||||
this.isLogin = isLogin;
|
||||
}
|
||||
|
||||
public boolean isLogin() {
|
||||
return isLogin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import fr.xephi.authme.security.crypts.EncryptionMethod;
|
||||
|
||||
/**
|
||||
* <p>This event is called when we need to compare or get an hash password,
|
||||
* for set a custom EncryptionMethod</p>
|
||||
*
|
||||
* @see fr.xephi.authme.security.crypts.EncryptionMethod
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class PasswordEncryptionEvent extends Event {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private EncryptionMethod method = null;
|
||||
private String playerName = "";
|
||||
|
||||
public PasswordEncryptionEvent(EncryptionMethod method, String playerName) {
|
||||
this.method = method;
|
||||
this.playerName = playerName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public void setMethod(EncryptionMethod method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public EncryptionMethod getMethod() {
|
||||
return method;
|
||||
}
|
||||
|
||||
public String getPlayerName() {
|
||||
return playerName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class ProtectInventoryEvent extends CustomEvent {
|
||||
|
||||
private ItemStack[] storedinventory;
|
||||
private ItemStack[] storedarmor;
|
||||
private ItemStack[] emptyInventory = null;
|
||||
private ItemStack[] emptyArmor = null;
|
||||
private Player player;
|
||||
|
||||
public ProtectInventoryEvent(Player player, ItemStack[] storedinventory, ItemStack[] storedarmor) {
|
||||
this.player = player;
|
||||
this.storedinventory = storedinventory;
|
||||
this.storedarmor = storedarmor;
|
||||
this.emptyInventory = new ItemStack[36];
|
||||
this.emptyArmor = new ItemStack[4];
|
||||
}
|
||||
|
||||
public ItemStack[] getStoredInventory() {
|
||||
return this.storedinventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getStoredArmor() {
|
||||
return this.storedarmor;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setNewInventory(ItemStack[] emptyInventory) {
|
||||
this.emptyInventory = emptyInventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getEmptyInventory() {
|
||||
return this.emptyInventory;
|
||||
}
|
||||
|
||||
public void setNewArmor(ItemStack[] emptyArmor) {
|
||||
this.emptyArmor = emptyArmor;
|
||||
}
|
||||
|
||||
public ItemStack[] getEmptyArmor() {
|
||||
return this.emptyArmor;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class RegisterTeleportEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
|
||||
public RegisterTeleportEvent(Player player, Location to) {
|
||||
this.player = player;
|
||||
this.from = player.getLocation();
|
||||
this.to = to;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class ResetInventoryEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
|
||||
public ResetInventoryEvent(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class RestoreInventoryEvent extends CustomEvent {
|
||||
|
||||
private ItemStack[] inventory;
|
||||
private ItemStack[] armor;
|
||||
private Player player;
|
||||
|
||||
public RestoreInventoryEvent(Player player, ItemStack[] inventory, ItemStack[] armor) {
|
||||
this.player = player;
|
||||
this.inventory = inventory;
|
||||
this.armor = armor;
|
||||
}
|
||||
|
||||
public ItemStack[] getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
public void setInventory(ItemStack[] inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getArmor() {
|
||||
return this.armor;
|
||||
}
|
||||
|
||||
public void setArmor(ItemStack[] armor) {
|
||||
this.armor = armor;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class SessionEvent extends CustomEvent {
|
||||
|
||||
private PlayerAuth player;
|
||||
private boolean isLogin;
|
||||
|
||||
public SessionEvent(PlayerAuth auth, boolean isLogin) {
|
||||
this.player = auth;
|
||||
this.isLogin = isLogin;
|
||||
}
|
||||
|
||||
public PlayerAuth getPlayerAuth() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(PlayerAuth player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public boolean isLogin() {
|
||||
return isLogin;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class SpawnTeleportEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
private boolean isAuthenticated;
|
||||
|
||||
public SpawnTeleportEvent(Player player, Location from, Location to, boolean isAuthenticated) {
|
||||
this.player = player;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.isAuthenticated = isAuthenticated;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
public boolean isAuthenticated() {
|
||||
return isAuthenticated;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import fr.xephi.authme.cache.backup.FileCache;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class StoreInventoryEvent extends CustomEvent {
|
||||
|
||||
private ItemStack[] inventory;
|
||||
private ItemStack[] armor;
|
||||
private Player player;
|
||||
|
||||
public StoreInventoryEvent(Player player) {
|
||||
this.player = player;
|
||||
this.inventory = player.getInventory().getContents();
|
||||
this.armor = player.getInventory().getArmorContents();
|
||||
}
|
||||
|
||||
public StoreInventoryEvent(Player player, FileCache fileCache) {
|
||||
this.player = player;
|
||||
this.inventory = fileCache.readCache(player.getName().toLowerCase()).getInventory();
|
||||
this.armor = fileCache.readCache(player.getName().toLowerCase()).getArmour();
|
||||
}
|
||||
|
||||
public ItemStack[] getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
public void setInventory(ItemStack[] inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getArmor() {
|
||||
return this.armor;
|
||||
}
|
||||
|
||||
public void setArmor(ItemStack[] armor) {
|
||||
this.armor = armor;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user