Prepare the project for javadocs
This commit is contained in:
@@ -15,8 +15,9 @@ import fr.xephi.authme.security.RandomString;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
* @authors Xephi59,
|
||||
* <a href="http://dev.bukkit.org/profiles/Possible/">Possible</a>
|
||||
|
||||
* @author Gabriele
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
public class Management {
|
||||
|
||||
@@ -24,11 +25,21 @@ public class Management {
|
||||
private final BukkitScheduler sched;
|
||||
public static RandomString rdm = new RandomString(Settings.captchaLength);
|
||||
|
||||
/**
|
||||
* Constructor for Management.
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public Management(AuthMe plugin) {
|
||||
this.plugin = plugin;
|
||||
this.sched = this.plugin.getServer().getScheduler();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performLogin.
|
||||
* @param player Player
|
||||
* @param password String
|
||||
* @param forceLogin boolean
|
||||
*/
|
||||
public void performLogin(final Player player, final String password, final boolean forceLogin) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@@ -39,6 +50,10 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performLogout.
|
||||
* @param player Player
|
||||
*/
|
||||
public void performLogout(final Player player) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@@ -49,6 +64,12 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performRegister.
|
||||
* @param player Player
|
||||
* @param password String
|
||||
* @param email String
|
||||
*/
|
||||
public void performRegister(final Player player, final String password, final String email) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@@ -59,6 +80,12 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performUnregister.
|
||||
* @param player Player
|
||||
* @param password String
|
||||
* @param force boolean
|
||||
*/
|
||||
public void performUnregister(final Player player, final String password, final boolean force) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@@ -69,6 +96,10 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performJoin.
|
||||
* @param player Player
|
||||
*/
|
||||
public void performJoin(final Player player) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@@ -80,6 +111,11 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performQuit.
|
||||
* @param player Player
|
||||
* @param isKick boolean
|
||||
*/
|
||||
public void performQuit(final Player player, final boolean isKick) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@@ -91,6 +127,12 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performAddEmail.
|
||||
* @param player Player
|
||||
* @param newEmail String
|
||||
* @param newEmailVerify String
|
||||
*/
|
||||
public void performAddEmail(final Player player, final String newEmail, final String newEmailVerify) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
@@ -100,6 +142,12 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method performChangeEmail.
|
||||
* @param player Player
|
||||
* @param oldEmail String
|
||||
* @param newEmail String
|
||||
*/
|
||||
public void performChangeEmail(final Player player, final String oldEmail, final String newEmail) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,8 @@ import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncChangeEmail {
|
||||
|
||||
private final Player player;
|
||||
@@ -20,6 +22,14 @@ public class AsyncChangeEmail {
|
||||
private final String newEmailVerify;
|
||||
private final Messages m;
|
||||
|
||||
/**
|
||||
* Constructor for AsyncChangeEmail.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
* @param oldEmail String
|
||||
* @param newEmail String
|
||||
* @param newEmailVerify String
|
||||
*/
|
||||
public AsyncChangeEmail(Player player, AuthMe plugin, String oldEmail, String newEmail, String newEmailVerify) {
|
||||
this.player = player;
|
||||
this.plugin = plugin;
|
||||
@@ -29,6 +39,13 @@ public class AsyncChangeEmail {
|
||||
this.m = Messages.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for AsyncChangeEmail.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
* @param oldEmail String
|
||||
* @param newEmail String
|
||||
*/
|
||||
public AsyncChangeEmail(Player player, AuthMe plugin, String oldEmail, String newEmail) {
|
||||
this(player, plugin, oldEmail, newEmail, newEmail);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import fr.xephi.authme.task.TimeoutTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import fr.xephi.authme.util.Utils.GroupType;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncronousJoin {
|
||||
|
||||
private final AuthMe plugin;
|
||||
@@ -37,6 +39,12 @@ public class AsyncronousJoin {
|
||||
private final Messages m;
|
||||
private final BukkitScheduler sched;
|
||||
|
||||
/**
|
||||
* Constructor for AsyncronousJoin.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
* @param database DataSource
|
||||
*/
|
||||
public AsyncronousJoin(Player player, AuthMe plugin, DataSource database) {
|
||||
this.player = player;
|
||||
this.plugin = plugin;
|
||||
@@ -245,6 +253,10 @@ public class AsyncronousJoin {
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method needFirstSpawn.
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean needFirstSpawn() {
|
||||
if (player.hasPlayedBefore())
|
||||
return false;
|
||||
@@ -269,6 +281,11 @@ public class AsyncronousJoin {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method placePlayerSafely.
|
||||
* @param player Player
|
||||
* @param spawnLoc Location
|
||||
*/
|
||||
private void placePlayerSafely(final Player player, final Location spawnLoc) {
|
||||
if (spawnLoc == null)
|
||||
return;
|
||||
|
||||
@@ -22,6 +22,8 @@ import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncronousLogin {
|
||||
|
||||
protected Player player;
|
||||
@@ -34,6 +36,14 @@ public class AsyncronousLogin {
|
||||
private static RandomString rdm = new RandomString(Settings.captchaLength);
|
||||
private Messages m = Messages.getInstance();
|
||||
|
||||
/**
|
||||
* Constructor for AsyncronousLogin.
|
||||
* @param player Player
|
||||
* @param password String
|
||||
* @param forceLogin boolean
|
||||
* @param plugin AuthMe
|
||||
* @param data DataSource
|
||||
*/
|
||||
public AsyncronousLogin(Player player, String password, boolean forceLogin,
|
||||
AuthMe plugin, DataSource data) {
|
||||
this.player = player;
|
||||
@@ -45,10 +55,18 @@ public class AsyncronousLogin {
|
||||
this.database = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIP.
|
||||
* @return String
|
||||
*/
|
||||
protected String getIP() {
|
||||
return plugin.getIP(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method needsCaptcha.
|
||||
* @return boolean
|
||||
*/
|
||||
protected boolean needsCaptcha() {
|
||||
if (Settings.useCaptcha) {
|
||||
if (!plugin.captcha.containsKey(name)) {
|
||||
@@ -75,6 +93,7 @@ public class AsyncronousLogin {
|
||||
/**
|
||||
* Checks the precondition for authentication (like user known) and returns
|
||||
* the playerAuth-State
|
||||
* @return PlayerAuth
|
||||
*/
|
||||
protected PlayerAuth preAuth() {
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
@@ -200,6 +219,11 @@ public class AsyncronousLogin {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method displayOtherAccounts.
|
||||
* @param auth PlayerAuth
|
||||
* @param p Player
|
||||
*/
|
||||
public void displayOtherAccounts(PlayerAuth auth, Player p) {
|
||||
if (!Settings.displayOtherAccounts) {
|
||||
return;
|
||||
|
||||
@@ -21,6 +21,8 @@ import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import fr.xephi.authme.util.Utils.GroupType;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ProcessSyncronousPlayerLogin implements Runnable {
|
||||
|
||||
private LimboPlayer limbo;
|
||||
@@ -32,6 +34,12 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
||||
private PluginManager pm;
|
||||
private JsonCache playerCache;
|
||||
|
||||
/**
|
||||
* Constructor for ProcessSyncronousPlayerLogin.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
* @param data DataSource
|
||||
*/
|
||||
public ProcessSyncronousPlayerLogin(Player player, AuthMe plugin,
|
||||
DataSource data) {
|
||||
this.plugin = plugin;
|
||||
@@ -44,6 +52,10 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
||||
this.playerCache = new JsonCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLimbo.
|
||||
* @return LimboPlayer
|
||||
*/
|
||||
public LimboPlayer getLimbo() {
|
||||
return limbo;
|
||||
}
|
||||
@@ -103,6 +115,10 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
// Limbo contains the State of the Player before /login
|
||||
|
||||
@@ -12,6 +12,8 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import fr.xephi.authme.util.Utils.GroupType;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncronousLogout {
|
||||
|
||||
protected Player player;
|
||||
@@ -21,6 +23,12 @@ public class AsyncronousLogout {
|
||||
protected boolean canLogout = true;
|
||||
private Messages m = Messages.getInstance();
|
||||
|
||||
/**
|
||||
* Constructor for AsyncronousLogout.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
* @param database DataSource
|
||||
*/
|
||||
public AsyncronousLogout(Player player, AuthMe plugin,
|
||||
DataSource database) {
|
||||
this.player = player;
|
||||
|
||||
@@ -16,6 +16,8 @@ import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
|
||||
protected Player player;
|
||||
@@ -23,12 +25,21 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
protected String name;
|
||||
private Messages m = Messages.getInstance();
|
||||
|
||||
/**
|
||||
* Constructor for ProcessSyncronousPlayerLogout.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public ProcessSyncronousPlayerLogout(Player player, AuthMe plugin) {
|
||||
this.player = player;
|
||||
this.plugin = plugin;
|
||||
this.name = player.getName().toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
if (plugin.sessions.containsKey(name))
|
||||
|
||||
@@ -15,6 +15,8 @@ import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncronousQuit {
|
||||
|
||||
protected AuthMe plugin;
|
||||
@@ -26,6 +28,13 @@ public class AsyncronousQuit {
|
||||
private boolean needToChange = false;
|
||||
private boolean isKick = false;
|
||||
|
||||
/**
|
||||
* Constructor for AsyncronousQuit.
|
||||
* @param p Player
|
||||
* @param plugin AuthMe
|
||||
* @param database DataSource
|
||||
* @param isKick boolean
|
||||
*/
|
||||
public AsyncronousQuit(Player p, AuthMe plugin, DataSource database,
|
||||
boolean isKick) {
|
||||
this.player = p;
|
||||
|
||||
@@ -6,6 +6,8 @@ import org.bukkit.entity.Player;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
|
||||
protected AuthMe plugin;
|
||||
@@ -14,6 +16,14 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
protected boolean isFlying;
|
||||
protected boolean needToChange;
|
||||
|
||||
/**
|
||||
* Constructor for ProcessSyncronousPlayerQuit.
|
||||
* @param plugin AuthMe
|
||||
* @param player Player
|
||||
* @param isOp boolean
|
||||
* @param isFlying boolean
|
||||
* @param needToChange boolean
|
||||
*/
|
||||
public ProcessSyncronousPlayerQuit(AuthMe plugin, Player player
|
||||
, boolean isOp, boolean isFlying
|
||||
, boolean needToChange) {
|
||||
@@ -24,6 +34,10 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
this.needToChange = needToChange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncRegister {
|
||||
|
||||
protected Player player;
|
||||
@@ -24,6 +26,14 @@ public class AsyncRegister {
|
||||
private DataSource database;
|
||||
private Messages m = Messages.getInstance();
|
||||
|
||||
/**
|
||||
* Constructor for AsyncRegister.
|
||||
* @param player Player
|
||||
* @param password String
|
||||
* @param email String
|
||||
* @param plugin AuthMe
|
||||
* @param data DataSource
|
||||
*/
|
||||
public AsyncRegister(Player player, String password, String email,
|
||||
AuthMe plugin, DataSource data) {
|
||||
this.player = player;
|
||||
@@ -34,10 +44,19 @@ public class AsyncRegister {
|
||||
this.database = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIp.
|
||||
* @return String
|
||||
*/
|
||||
protected String getIp() {
|
||||
return plugin.getIP(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method preRegisterCheck.
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
*/
|
||||
protected boolean preRegisterCheck() throws Exception {
|
||||
String lowpass = password.toLowerCase();
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
@@ -92,6 +111,10 @@ public class AsyncRegister {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method emailRegister.
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void emailRegister() throws Exception {
|
||||
if (Settings.getmaxRegPerEmail > 0) {
|
||||
if (!plugin.getPermissionsManager().hasPermission(player, "authme.allow2accounts") && database.getAllAuthsByEmail(email).size() >= Settings.getmaxRegPerEmail) {
|
||||
|
||||
@@ -14,6 +14,8 @@ import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ProcessSyncEmailRegister implements Runnable {
|
||||
|
||||
protected Player player;
|
||||
@@ -21,12 +23,21 @@ public class ProcessSyncEmailRegister implements Runnable {
|
||||
private AuthMe plugin;
|
||||
private Messages m = Messages.getInstance();
|
||||
|
||||
/**
|
||||
* Constructor for ProcessSyncEmailRegister.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public ProcessSyncEmailRegister(Player player, AuthMe plugin) {
|
||||
this.player = player;
|
||||
this.name = player.getName().toLowerCase();
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
|
||||
|
||||
@@ -19,6 +19,8 @@ import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
|
||||
protected Player player;
|
||||
@@ -26,6 +28,11 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
private AuthMe plugin;
|
||||
private Messages m = Messages.getInstance();
|
||||
|
||||
/**
|
||||
* Constructor for ProcessSyncronousPasswordRegister.
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public ProcessSyncronousPasswordRegister(Player player, AuthMe plugin) {
|
||||
this.player = player;
|
||||
this.name = player.getName().toLowerCase();
|
||||
@@ -44,6 +51,10 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method forceLogin.
|
||||
* @param player Player
|
||||
*/
|
||||
protected void forceLogin(Player player) {
|
||||
Utils.teleportToSpawn(player);
|
||||
if (LimboCache.getInstance().hasLimboPlayer(name))
|
||||
@@ -63,6 +74,10 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
|
||||
|
||||
@@ -21,6 +21,8 @@ import fr.xephi.authme.task.TimeoutTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import fr.xephi.authme.util.Utils.GroupType;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncronousUnregister {
|
||||
|
||||
protected Player player;
|
||||
@@ -31,6 +33,13 @@ public class AsyncronousUnregister {
|
||||
protected boolean force;
|
||||
private JsonCache playerCache;
|
||||
|
||||
/**
|
||||
* Constructor for AsyncronousUnregister.
|
||||
* @param player Player
|
||||
* @param password String
|
||||
* @param force boolean
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public AsyncronousUnregister(Player player, String password,
|
||||
boolean force, AuthMe plugin) {
|
||||
this.player = player;
|
||||
@@ -41,6 +50,10 @@ public class AsyncronousUnregister {
|
||||
this.playerCache = new JsonCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIp.
|
||||
* @return String
|
||||
*/
|
||||
protected String getIp() {
|
||||
return plugin.getIP(player);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user