mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-28 05:05:14 +01:00
Merge pull request #101 from AuthMe-Team/move-convert-command
Move the converter command [WIP]
This commit is contained in:
commit
c11fa9f158
@ -122,7 +122,7 @@ typing commands or using the inventory. It can also kick players with uncommonly
|
||||
</li><li><a href="http://dev.bukkit.org/server-mods/authme-reloaded/pages/web-site-integration/">Website Integration</a>
|
||||
</li><li><a href="https://raw.githubusercontent.com/Xephi/AuthMeReloaded/master/src/main/resources/config.yml">Click here for an example of the Config file</a>
|
||||
</li><li><a href="http://dev.bukkit.org/server-mods/authme-reloaded/pages/how-to-import-database-from-rakamak/">How to convert from Rakamak</a>
|
||||
</li><li>Convert from FlatFile (auths.db but not the sqlite one) to MySQL: /converter
|
||||
</li><li>Convert from FlatFile (auths.db but not the sqlite one) to MySQL: /authme converter
|
||||
</li></ul>
|
||||
<hr>
|
||||
|
||||
|
@ -5,6 +5,7 @@ import fr.xephi.authme.command.executable.HelpCommand;
|
||||
import fr.xephi.authme.command.executable.authme.AccountsCommand;
|
||||
import fr.xephi.authme.command.executable.authme.AuthMeCommand;
|
||||
import fr.xephi.authme.command.executable.authme.ChangePasswordAdminCommand;
|
||||
import fr.xephi.authme.command.executable.authme.ConverterCommand;
|
||||
import fr.xephi.authme.command.executable.authme.FirstSpawnCommand;
|
||||
import fr.xephi.authme.command.executable.authme.ForceLoginCommand;
|
||||
import fr.xephi.authme.command.executable.authme.GetEmailCommand;
|
||||
@ -24,7 +25,6 @@ import fr.xephi.authme.command.executable.authme.UnregisterAdminCommand;
|
||||
import fr.xephi.authme.command.executable.authme.VersionCommand;
|
||||
import fr.xephi.authme.command.executable.captcha.CaptchaCommand;
|
||||
import fr.xephi.authme.command.executable.changepassword.ChangePasswordCommand;
|
||||
import fr.xephi.authme.command.executable.converter.ConverterCommand;
|
||||
import fr.xephi.authme.command.executable.email.AddEmailCommand;
|
||||
import fr.xephi.authme.command.executable.email.ChangeEmailCommand;
|
||||
import fr.xephi.authme.command.executable.email.EmailBaseCommand;
|
||||
@ -269,6 +269,17 @@ public final class CommandInitializer {
|
||||
.executableCommand(new VersionCommand())
|
||||
.build();
|
||||
|
||||
CommandDescription.builder()
|
||||
.parent(AUTHME_BASE)
|
||||
.labels("converter", "convert", "conv")
|
||||
.description("Converter Command")
|
||||
.detailedDescription("Converter command for AuthMeReloaded.")
|
||||
.withArgument("job", "Conversion job: xauth / crazylogin / rakamak / " +
|
||||
"royalauth / vauth / sqlitetosql", false)
|
||||
.permissions(OP_ONLY, AdminPermission.CONVERTER)
|
||||
.executableCommand(new ConverterCommand())
|
||||
.build();
|
||||
|
||||
// Register the base login command
|
||||
final CommandDescription LOGIN_BASE = CommandDescription.builder()
|
||||
.parent(null)
|
||||
@ -381,18 +392,6 @@ public final class CommandInitializer {
|
||||
.executableCommand(new CaptchaCommand())
|
||||
.build();
|
||||
|
||||
// Register the base converter command
|
||||
CommandDescription CONVERTER_BASE = CommandDescription.builder()
|
||||
.parent(null)
|
||||
.labels("converter", "convert", "conv")
|
||||
.description("Converter Command")
|
||||
.detailedDescription("Converter command for AuthMeReloaded.")
|
||||
.withArgument("job", "Conversion job: xauth / crazylogin / rakamak / " +
|
||||
"royalauth / vauth / sqlitetosql", false)
|
||||
.permissions(OP_ONLY, AdminPermission.CONVERTER)
|
||||
.executableCommand(new ConverterCommand())
|
||||
.build();
|
||||
|
||||
Set<CommandDescription> baseCommands = ImmutableSet.of(
|
||||
AUTHME_BASE,
|
||||
LOGIN_BASE,
|
||||
@ -401,8 +400,7 @@ public final class CommandInitializer {
|
||||
UNREGISTER_BASE,
|
||||
CHANGE_PASSWORD_BASE,
|
||||
EMAIL_BASE,
|
||||
CAPTCHA_BASE,
|
||||
CONVERTER_BASE);
|
||||
CAPTCHA_BASE);
|
||||
|
||||
setHelpOnAllBases(baseCommands);
|
||||
return baseCommands;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package fr.xephi.authme.command.executable.converter;
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.command.CommandService;
|
@ -7,8 +7,6 @@ import fr.xephi.authme.datasource.DataSourceType;
|
||||
import fr.xephi.authme.datasource.SQLite;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,6 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -1,13 +1,11 @@
|
||||
package fr.xephi.authme.process.register;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.permission.PlayerPermission;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
|
@ -16,7 +16,7 @@ softdepend:
|
||||
commands:
|
||||
authme:
|
||||
description: AuthMe op commands
|
||||
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version'
|
||||
usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version|converter'
|
||||
register:
|
||||
description: Register an account
|
||||
usage: /register <password> <confirmpassword>
|
||||
@ -40,9 +40,6 @@ commands:
|
||||
captcha:
|
||||
description: Captcha command
|
||||
usage: /captcha <code>
|
||||
converter:
|
||||
description: Converter from different other auth plugins
|
||||
usage: /converter <datatype>
|
||||
permissions:
|
||||
authme.admin.*:
|
||||
description: Give access to all admin commands.
|
||||
|
@ -50,7 +50,7 @@ public class CommandInitializerTest {
|
||||
// It obviously doesn't make sense to test much of the concrete data
|
||||
// that is being initialized; we just want to guarantee with this test
|
||||
// that data is indeed being initialized and we take a few "probes"
|
||||
assertThat(commands.size(), equalTo(9));
|
||||
assertThat(commands.size(), equalTo(8));
|
||||
assertThat(commandsIncludeLabel(commands, "authme"), equalTo(true));
|
||||
assertThat(commandsIncludeLabel(commands, "register"), equalTo(true));
|
||||
assertThat(commandsIncludeLabel(commands, "help"), equalTo(false));
|
||||
|
Loading…
Reference in New Issue
Block a user