Prepare the project for javadocs
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
package fr.xephi.authme.converter;
|
||||
|
||||
/**
|
||||
*/
|
||||
public interface Converter extends Runnable {
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
* @author Xephi59
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
public class CrazyLoginConverter implements Converter {
|
||||
|
||||
@@ -22,16 +23,29 @@ public class CrazyLoginConverter implements Converter {
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
/**
|
||||
* Constructor for CrazyLoginConverter.
|
||||
* @param instance AuthMe
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public CrazyLoginConverter(AuthMe instance, CommandSender sender) {
|
||||
this.instance = instance;
|
||||
this.database = instance.database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getInstance.
|
||||
* @return CrazyLoginConverter
|
||||
*/
|
||||
public CrazyLoginConverter getInstance() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
String fileName = Settings.crazyloginFileName;
|
||||
|
||||
@@ -13,6 +13,7 @@ import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
* @author Xephi59
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
public class FlatToSql implements Converter {
|
||||
|
||||
@@ -44,6 +45,10 @@ public class FlatToSql implements Converter {
|
||||
columnID = Settings.getMySQLColumnId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.bukkit.command.CommandSender;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FlatToSqlite implements Converter {
|
||||
|
||||
public CommandSender sender;
|
||||
@@ -32,10 +34,18 @@ public class FlatToSqlite implements Converter {
|
||||
private String database;
|
||||
private String columnID;
|
||||
private Connection con;
|
||||
/**
|
||||
* Constructor for FlatToSqlite.
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public FlatToSqlite(CommandSender sender) {
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @param o AutoCloseable
|
||||
*/
|
||||
private static void close(AutoCloseable o) {
|
||||
if (o != null) {
|
||||
try {
|
||||
@@ -46,6 +56,10 @@ public class FlatToSqlite implements Converter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
database = Settings.getMySQLDatabase;
|
||||
@@ -105,11 +119,20 @@ public class FlatToSqlite implements Converter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method connect.
|
||||
* @throws ClassNotFoundException
|
||||
* @throws SQLException
|
||||
*/
|
||||
private synchronized void connect() throws ClassNotFoundException, SQLException {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
con = DriverManager.getConnection("jdbc:sqlite:plugins/AuthMe/" + database + ".db");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setup.
|
||||
* @throws SQLException
|
||||
*/
|
||||
private synchronized void setup() throws SQLException {
|
||||
Statement st = null;
|
||||
ResultSet rs = null;
|
||||
@@ -153,6 +176,11 @@ public class FlatToSqlite implements Converter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method saveAuth.
|
||||
* @param s String
|
||||
* @return boolean
|
||||
*/
|
||||
private synchronized boolean saveAuth(String s) {
|
||||
PreparedStatement pst = null;
|
||||
try {
|
||||
|
||||
@@ -7,13 +7,24 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.SQLite;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ForceFlatToSqlite implements Converter {
|
||||
|
||||
private DataSource data;
|
||||
/**
|
||||
* Constructor for ForceFlatToSqlite.
|
||||
* @param data DataSource
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public ForceFlatToSqlite(DataSource data, AuthMe plugin) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
DataSource sqlite = null;
|
||||
|
||||
@@ -20,6 +20,7 @@ import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
* @author Xephi59
|
||||
* @version $Revision: 1.0 $
|
||||
*/
|
||||
public class RakamakConverter implements Converter {
|
||||
|
||||
@@ -27,16 +28,29 @@ public class RakamakConverter implements Converter {
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
/**
|
||||
* Constructor for RakamakConverter.
|
||||
* @param instance AuthMe
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public RakamakConverter(AuthMe instance, CommandSender sender) {
|
||||
this.instance = instance;
|
||||
this.database = instance.database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getInstance.
|
||||
* @return RakamakConverter
|
||||
*/
|
||||
public RakamakConverter getInstance() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
HashAlgorithm hash = Settings.getPasswordHash;
|
||||
|
||||
@@ -9,16 +9,26 @@ import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class RoyalAuthConverter implements Converter {
|
||||
|
||||
public AuthMe plugin;
|
||||
private DataSource data;
|
||||
|
||||
/**
|
||||
* Constructor for RoyalAuthConverter.
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public RoyalAuthConverter(AuthMe plugin) {
|
||||
this.plugin = plugin;
|
||||
this.data = plugin.database;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
for (OfflinePlayer o : plugin.getServer().getOfflinePlayers()) {
|
||||
|
||||
@@ -4,18 +4,32 @@ import java.io.File;
|
||||
|
||||
import fr.xephi.authme.settings.CustomConfiguration;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class RoyalAuthYamlReader extends CustomConfiguration {
|
||||
|
||||
/**
|
||||
* Constructor for RoyalAuthYamlReader.
|
||||
* @param file File
|
||||
*/
|
||||
public RoyalAuthYamlReader(File file) {
|
||||
super(file);
|
||||
load();
|
||||
save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLastLogin.
|
||||
* @return long
|
||||
*/
|
||||
public long getLastLogin() {
|
||||
return getLong("timestamps.quit");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getHash.
|
||||
* @return String
|
||||
*/
|
||||
public String getHash() {
|
||||
return getString("login.password");
|
||||
}
|
||||
|
||||
@@ -11,18 +11,29 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.datasource.FlatFile;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class SqlToFlat implements Converter {
|
||||
|
||||
public AuthMe plugin;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
/**
|
||||
* Constructor for SqlToFlat.
|
||||
* @param plugin AuthMe
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public SqlToFlat(AuthMe plugin, CommandSender sender) {
|
||||
this.plugin = plugin;
|
||||
this.database = plugin.database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
@@ -6,18 +6,29 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class vAuthConverter implements Converter {
|
||||
|
||||
public AuthMe plugin;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
/**
|
||||
* Constructor for vAuthConverter.
|
||||
* @param plugin AuthMe
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public vAuthConverter(AuthMe plugin, CommandSender sender) {
|
||||
this.plugin = plugin;
|
||||
this.database = plugin.database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
@@ -14,18 +14,29 @@ import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class vAuthFileReader {
|
||||
|
||||
public AuthMe plugin;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
/**
|
||||
* Constructor for vAuthFileReader.
|
||||
* @param plugin AuthMe
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public vAuthFileReader(AuthMe plugin, CommandSender sender) {
|
||||
this.plugin = plugin;
|
||||
this.database = plugin.database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method convert.
|
||||
* @throws IOException
|
||||
*/
|
||||
public void convert() throws IOException {
|
||||
final File file = new File(plugin.getDataFolder().getParent() + "" + File.separator + "vAuth" + File.separator + "passwords.yml");
|
||||
Scanner scanner;
|
||||
@@ -57,12 +68,22 @@ public class vAuthFileReader {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isUUIDinstance.
|
||||
* @param s String
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean isUUIDinstance(String s) {
|
||||
if (String.valueOf(s.charAt(8)).equalsIgnoreCase("-"))
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getName.
|
||||
* @param uuid UUID
|
||||
* @return String
|
||||
*/
|
||||
private String getName(UUID uuid) {
|
||||
try {
|
||||
for (OfflinePlayer op : Bukkit.getOfflinePlayers()) {
|
||||
|
||||
@@ -4,16 +4,27 @@ import org.bukkit.command.CommandSender;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class xAuthConverter implements Converter {
|
||||
|
||||
public AuthMe plugin;
|
||||
public CommandSender sender;
|
||||
|
||||
/**
|
||||
* Constructor for xAuthConverter.
|
||||
* @param plugin AuthMe
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public xAuthConverter(AuthMe plugin, CommandSender sender) {
|
||||
this.plugin = plugin;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
@@ -17,18 +17,29 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class xAuthToFlat {
|
||||
|
||||
public AuthMe instance;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
/**
|
||||
* Constructor for xAuthToFlat.
|
||||
* @param instance AuthMe
|
||||
* @param sender CommandSender
|
||||
*/
|
||||
public xAuthToFlat(AuthMe instance, CommandSender sender) {
|
||||
this.instance = instance;
|
||||
this.database = instance.database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method convert.
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean convert() {
|
||||
if (instance.getServer().getPluginManager().getPlugin("xAuth") == null) {
|
||||
sender.sendMessage("[AuthMe] xAuth plugin not found");
|
||||
@@ -59,6 +70,11 @@ public class xAuthToFlat {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIdPlayer.
|
||||
* @param id int
|
||||
* @return String
|
||||
*/
|
||||
public String getIdPlayer(int id) {
|
||||
String realPass = "";
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
@@ -81,6 +97,10 @@ public class xAuthToFlat {
|
||||
return realPass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getXAuthPlayers.
|
||||
* @return List<Integer>
|
||||
*/
|
||||
public List<Integer> getXAuthPlayers() {
|
||||
List<Integer> xP = new ArrayList<>();
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
@@ -102,6 +122,11 @@ public class xAuthToFlat {
|
||||
return xP;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getPassword.
|
||||
* @param accountId int
|
||||
* @return String
|
||||
*/
|
||||
public String getPassword(int accountId) {
|
||||
String realPass = "";
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
|
||||
Reference in New Issue
Block a user