commit
80656c8246
Binary file not shown.
Binary file not shown.
BIN
libs/xAuth.jar
BIN
libs/xAuth.jar
Binary file not shown.
62
pom.xml
62
pom.xml
@ -75,6 +75,7 @@
|
||||
<archive>
|
||||
<manifestFile>${manifest.file}</manifestFile>
|
||||
</archive>
|
||||
<finalName>AuthMe-${project.version}</finalName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -139,7 +140,7 @@
|
||||
<!-- Essentials Repo -->
|
||||
<repository>
|
||||
<id>ess-repo</id>
|
||||
<url>http://repo.ess3.net/content/groups/public</url>
|
||||
<url>http://repo.ess3.net/content/groups/essentials</url>
|
||||
</repository>
|
||||
|
||||
<!-- CombatTagPlus Repo -->
|
||||
@ -154,12 +155,6 @@
|
||||
<url>http://repo.luricos.de/content/repositories/releases/</url>
|
||||
</repository>
|
||||
|
||||
<!-- SpoutCraft Repo -->
|
||||
<repository>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
|
||||
<!-- Attribute Repo -->
|
||||
<repository>
|
||||
<id>comphenix-snapshots</id>
|
||||
@ -192,13 +187,6 @@
|
||||
<version>3.8.10.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Database Library -->
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.187</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Java Email API -->
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
@ -215,7 +203,7 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mcstats.bukkit</groupId>
|
||||
<artifactId>metrics-lite</artifactId>
|
||||
<artifactId>metrics</artifactId>
|
||||
<version>R7</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
@ -376,23 +364,6 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Spout API, https://spoutcraft.org/downloads/ -->
|
||||
<dependency>
|
||||
<groupId>org.spoutcraft</groupId>
|
||||
<artifactId>spoutcraftplugin</artifactId>
|
||||
<version>1.6.4-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Local Dependencies -->
|
||||
|
||||
<!-- It doesn't have a Maven Repo, http://dev.bukkit.org/bukkit-plugins/chestshop/ -->
|
||||
@ -404,32 +375,5 @@
|
||||
<systemPath>${project.basedir}/libs/ChestShop.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- Citizens 1.X (No API) -->
|
||||
<dependency>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens</artifactId>
|
||||
<version>1.2.4</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/Citizens.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- Old version of xAuth by Cypherx -->
|
||||
<dependency>
|
||||
<groupId>com.cypherx</groupId>
|
||||
<artifactId>xauth</artifactId>
|
||||
<version>2.0.26</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/xAuth.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- A SpoutApi Plugin, http://dev.bukkit.org/bukkit-plugins/notifications/ -->
|
||||
<dependency>
|
||||
<groupId>me.muizers</groupId>
|
||||
<artifactId>Notifications</artifactId>
|
||||
<version>1.6</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/Notifications.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@ -15,6 +15,7 @@ import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
@ -28,7 +29,8 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.mcstats.MetricsLite;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.mcstats.Metrics;
|
||||
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.maxmind.geoip.LookupService;
|
||||
@ -61,7 +63,6 @@ import fr.xephi.authme.listener.AuthMeChestShopListener;
|
||||
import fr.xephi.authme.listener.AuthMeEntityListener;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||
import fr.xephi.authme.listener.AuthMeServerListener;
|
||||
import fr.xephi.authme.listener.AuthMeSpoutListener;
|
||||
import fr.xephi.authme.plugin.manager.BungeeCordMessage;
|
||||
import fr.xephi.authme.plugin.manager.CitizensCommunicator;
|
||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||
@ -72,8 +73,6 @@ import fr.xephi.authme.settings.OtherAccounts;
|
||||
import fr.xephi.authme.settings.PlayersLogs;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.Spawn;
|
||||
import me.muizers.Notifications.Notifications;
|
||||
import net.citizensnpcs.Citizens;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
|
||||
public class AuthMe extends JavaPlugin {
|
||||
@ -90,13 +89,12 @@ public class AuthMe extends JavaPlugin {
|
||||
private Utils utils = Utils.getInstance();
|
||||
private FileCache playerBackup = new FileCache(this);
|
||||
public CitizensCommunicator citizens;
|
||||
public boolean isCitizensActive = false;
|
||||
public SendMailSSL mail = null;
|
||||
public int CitizensVersion = 0;
|
||||
public int CombatTag = 0;
|
||||
public boolean CombatTag = false;
|
||||
public double ChestShop = 0;
|
||||
public boolean BungeeCord = false;
|
||||
public Essentials ess;
|
||||
public Notifications notifications;
|
||||
public API api;
|
||||
public Management management;
|
||||
public HashMap<String, Integer> captcha = new HashMap<String, Integer>();
|
||||
@ -109,6 +107,7 @@ public class AuthMe extends JavaPlugin {
|
||||
public boolean delayedAntiBot = true;
|
||||
protected static String vgUrl = "http://monitor-1.verygames.net/api/?action=ipclean-real-ip&out=raw&ip=%IP%&port=%PORT%";
|
||||
public DataManager dataManager;
|
||||
public ConcurrentHashMap<String, BukkitTask> sessions = new ConcurrentHashMap<String, BukkitTask>();
|
||||
|
||||
public Settings getSettings() {
|
||||
return settings;
|
||||
@ -130,12 +129,12 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
|
||||
try {
|
||||
MetricsLite metrics = new MetricsLite(this);
|
||||
Metrics metrics = new Metrics(this);
|
||||
metrics.start();
|
||||
ConsoleLogger.info("Metrics-Lite started successfully!");
|
||||
ConsoleLogger.info("Metrics started successfully!");
|
||||
} catch (IOException e) {
|
||||
// Failed to submit the stats :-(
|
||||
ConsoleLogger.showError("Can't start Metrics-Lite! The plugin will work anyway...");
|
||||
ConsoleLogger.showError("Can't start Metrics! The plugin will work anyway...");
|
||||
}
|
||||
|
||||
citizens = new CitizensCommunicator(this);
|
||||
@ -188,9 +187,6 @@ public class AuthMe extends JavaPlugin {
|
||||
// Check Combat Tag Version
|
||||
combatTag();
|
||||
|
||||
// Check Notifications
|
||||
checkNotifications();
|
||||
|
||||
// Check Multiverse
|
||||
checkMultiverse();
|
||||
|
||||
@ -225,10 +221,7 @@ public class AuthMe extends JavaPlugin {
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
|
||||
}
|
||||
if (pm.isPluginEnabled("Spout")) {
|
||||
pm.registerEvents(new AuthMeSpoutListener(database), this);
|
||||
ConsoleLogger.info("Successfully hook with Spout!");
|
||||
}
|
||||
|
||||
pm.registerEvents(new AuthMePlayerListener(this, database), this);
|
||||
pm.registerEvents(new AuthMeBlockListener(database, this), this);
|
||||
pm.registerEvents(new AuthMeEntityListener(database, this), this);
|
||||
@ -394,40 +387,18 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkNotifications() {
|
||||
if (!Settings.notifications) {
|
||||
this.notifications = null;
|
||||
return;
|
||||
}
|
||||
if (this.getServer().getPluginManager().getPlugin("Notifications") != null && this.getServer().getPluginManager().getPlugin("Notifications").isEnabled()) {
|
||||
this.notifications = (Notifications) this.getServer().getPluginManager().getPlugin("Notifications");
|
||||
ConsoleLogger.info("Successfully hook with Notifications");
|
||||
} else {
|
||||
this.notifications = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void combatTag() {
|
||||
if (this.getServer().getPluginManager().getPlugin("CombatTag") != null && this.getServer().getPluginManager().getPlugin("CombatTag").isEnabled()) {
|
||||
this.CombatTag = 1;
|
||||
this.CombatTag = true;
|
||||
} else {
|
||||
this.CombatTag = 0;
|
||||
this.CombatTag = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void citizensVersion() {
|
||||
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled()) {
|
||||
Citizens cit = (Citizens) this.getServer().getPluginManager().getPlugin("Citizens");
|
||||
String ver = cit.getDescription().getVersion();
|
||||
String[] args = ver.split("\\.");
|
||||
if (args[0].contains("1")) {
|
||||
this.CitizensVersion = 1;
|
||||
} else {
|
||||
this.CitizensVersion = 2;
|
||||
}
|
||||
} else {
|
||||
this.CitizensVersion = 0;
|
||||
}
|
||||
if (this.getServer().getPluginManager().getPlugin("Citizens") != null && this.getServer().getPluginManager().getPlugin("Citizens").isEnabled())
|
||||
this.isCitizensActive = true;
|
||||
else this.isCitizensActive = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -72,13 +72,7 @@ public class SendMailSSL {
|
||||
message.setSentDate(new Date());
|
||||
BodyPart messageBodyPart = new MimeBodyPart();
|
||||
messageBodyPart.setText(mailText);
|
||||
|
||||
Multipart multipart = new MimeMultipart();
|
||||
|
||||
multipart.addBodyPart(messageBodyPart);
|
||||
|
||||
messageBodyPart = new MimeBodyPart();
|
||||
|
||||
multipart.addBodyPart(messageBodyPart);
|
||||
message.setContent(multipart);
|
||||
Transport transport = session.getTransport("smtp");
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
package fr.xephi.authme.api;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.Utils;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
@ -18,29 +21,41 @@ import fr.xephi.authme.settings.Settings;
|
||||
public class API {
|
||||
|
||||
public static final String newline = System.getProperty("line.separator");
|
||||
public static AuthMe instance;
|
||||
public static DataSource database;
|
||||
public static API singleton;
|
||||
public AuthMe plugin;
|
||||
public DataSource database;
|
||||
|
||||
public API(AuthMe instance, DataSource database) {
|
||||
API.instance = instance;
|
||||
API.database = database;
|
||||
public API(AuthMe plugin, DataSource database) {
|
||||
this.plugin = plugin;
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
public API(Server serv) {
|
||||
this.plugin = (AuthMe) serv.getPluginManager().getPlugin("AuthMe");
|
||||
this.database = this.plugin.database;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook into AuthMe
|
||||
*
|
||||
* @return AuthMe instance
|
||||
* @return
|
||||
*
|
||||
* @return AuthMe plugin
|
||||
*/
|
||||
public static AuthMe hookAuthMe() {
|
||||
Plugin plugin = Bukkit.getServer().getPluginManager().getPlugin("AuthMe");
|
||||
if (plugin == null || !(plugin instanceof AuthMe)) {
|
||||
public static API getInstance() {
|
||||
if (singleton != null)
|
||||
return singleton;
|
||||
Plugin p = Bukkit.getServer().getPluginManager().getPlugin("AuthMe");
|
||||
if (p == null || !(p instanceof AuthMe)) {
|
||||
return null;
|
||||
}
|
||||
return (AuthMe) plugin;
|
||||
AuthMe authme = (AuthMe) p;
|
||||
singleton = (new API(authme, authme.database));
|
||||
return singleton;
|
||||
}
|
||||
|
||||
public AuthMe getPlugin() {
|
||||
return instance;
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -48,7 +63,7 @@ public class API {
|
||||
* @param player
|
||||
* @return true if player is authenticate
|
||||
*/
|
||||
public static boolean isAuthenticated(Player player) {
|
||||
public boolean isAuthenticated(Player player) {
|
||||
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
||||
}
|
||||
|
||||
@ -59,7 +74,7 @@ public class API {
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean isaNPC(Player player) {
|
||||
if (instance.getCitizensCommunicator().isNPC(player, instance))
|
||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
||||
return true;
|
||||
return CombatTagComunicator.isNPC(player);
|
||||
}
|
||||
@ -70,7 +85,7 @@ public class API {
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
public boolean isNPC(Player player) {
|
||||
if (instance.getCitizensCommunicator().isNPC(player, instance))
|
||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
||||
return true;
|
||||
return CombatTagComunicator.isNPC(player);
|
||||
}
|
||||
@ -80,11 +95,11 @@ public class API {
|
||||
* @param player
|
||||
* @return true if the player is unrestricted
|
||||
*/
|
||||
public static boolean isUnrestricted(Player player) {
|
||||
public boolean isUnrestricted(Player player) {
|
||||
return Utils.getInstance().isUnrestricted(player);
|
||||
}
|
||||
|
||||
public static Location getLastLocation(Player player) {
|
||||
public Location getLastLocation(Player player) {
|
||||
try {
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(player.getName().toLowerCase());
|
||||
|
||||
@ -100,7 +115,7 @@ public class API {
|
||||
}
|
||||
}
|
||||
|
||||
public static void setPlayerInventory(Player player, ItemStack[] content,
|
||||
public void setPlayerInventory(Player player, ItemStack[] content,
|
||||
ItemStack[] armor) {
|
||||
try {
|
||||
player.getInventory().setContents(content);
|
||||
@ -114,7 +129,7 @@ public class API {
|
||||
* @param playerName
|
||||
* @return true if player is registered
|
||||
*/
|
||||
public static boolean isRegistered(String playerName) {
|
||||
public boolean isRegistered(String playerName) {
|
||||
String player = playerName.toLowerCase();
|
||||
return database.isAuthAvailable(player);
|
||||
}
|
||||
@ -124,8 +139,7 @@ public class API {
|
||||
* playerName, String passwordToCheck
|
||||
* @return true if the password is correct , false else
|
||||
*/
|
||||
public static boolean checkPassword(String playerName,
|
||||
String passwordToCheck) {
|
||||
public boolean checkPassword(String playerName, String passwordToCheck) {
|
||||
if (!isRegistered(playerName))
|
||||
return false;
|
||||
String player = playerName.toLowerCase();
|
||||
@ -144,7 +158,7 @@ public class API {
|
||||
* playerName, String password
|
||||
* @return true if the player is register correctly
|
||||
*/
|
||||
public static boolean registerPlayer(String playerName, String password) {
|
||||
public boolean registerPlayer(String playerName, String password) {
|
||||
try {
|
||||
String name = playerName.toLowerCase();
|
||||
String hash = PasswordSecurity.getHash(Settings.getPasswordHash, password, name);
|
||||
@ -167,8 +181,8 @@ public class API {
|
||||
* @param Player
|
||||
* player
|
||||
*/
|
||||
public static void forceLogin(Player player) {
|
||||
instance.management.performLogin(player, "dontneed", true);
|
||||
public void forceLogin(Player player) {
|
||||
plugin.management.performLogin(player, "dontneed", true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.Spawn;
|
||||
import fr.xephi.authme.settings.SpoutCfg;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
|
||||
@ -47,7 +46,6 @@ public class AdminCommand implements CommandExecutor {
|
||||
|
||||
public AuthMe plugin;
|
||||
private Messages m = Messages.getInstance();
|
||||
private SpoutCfg s = SpoutCfg.getInstance();
|
||||
public DataSource database;
|
||||
|
||||
public AdminCommand(AuthMe plugin, DataSource database) {
|
||||
@ -154,7 +152,6 @@ public class AdminCommand implements CommandExecutor {
|
||||
YamlConfiguration newConfig = YamlConfiguration.loadConfiguration(newConfigFile);
|
||||
Settings.reloadConfigOptions(newConfig);
|
||||
m.reLoad();
|
||||
s.reLoad();
|
||||
plugin.database.close();
|
||||
plugin.setupDatabase();
|
||||
m.send(sender, "reload");
|
||||
|
||||
@ -2,8 +2,6 @@ package fr.xephi.authme.commands;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -89,9 +87,6 @@ public class ChangePasswordCommand implements CommandExecutor {
|
||||
PlayerCache.getInstance().updatePlayer(auth);
|
||||
m.send(player, "pwd_changed");
|
||||
ConsoleLogger.info(player.getName() + " changed his password");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " change his password!"));
|
||||
}
|
||||
} else {
|
||||
m.send(player, "wrong_pwd");
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package fr.xephi.authme.commands;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -172,21 +171,8 @@ public class EmailCommand implements CommandExecutor {
|
||||
m.send(player, "email_invalid");
|
||||
return true;
|
||||
}
|
||||
final String finalhashnew = hashnew;
|
||||
final PlayerAuth finalauth = auth;
|
||||
if (data instanceof Thread) {
|
||||
finalauth.setHash(hashnew);
|
||||
auth.setHash(hashnew);
|
||||
data.updatePassword(auth);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
finalauth.setHash(finalhashnew);
|
||||
data.updatePassword(finalauth);
|
||||
}
|
||||
});
|
||||
}
|
||||
plugin.mail.main(auth, thePass);
|
||||
m.send(player, "email_send");
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
|
||||
@ -27,7 +27,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class UnregisterCommand implements CommandExecutor {
|
||||
|
||||
@ -98,9 +97,6 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||
m.send(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!Settings.unRegisteredGroup.isEmpty()) {
|
||||
@ -116,9 +112,6 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||
m.send(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
}
|
||||
if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
|
||||
Location spawn = plugin.getSpawnLocation(player);
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawn, false);
|
||||
|
||||
@ -1,132 +0,0 @@
|
||||
package fr.xephi.authme.converter;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.cypherx.xauth.xAuth;
|
||||
import com.cypherx.xauth.database.Table;
|
||||
import com.cypherx.xauth.utils.xAuthLog;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class oldxAuthToFlat {
|
||||
|
||||
public AuthMe instance;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
public oldxAuthToFlat(AuthMe instance, DataSource database,
|
||||
CommandSender sender) {
|
||||
this.instance = instance;
|
||||
this.database = database;
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
public boolean convert() {
|
||||
if (instance.getServer().getPluginManager().getPlugin("xAuth") == null) {
|
||||
sender.sendMessage("[AuthMe] xAuth plugin not found");
|
||||
return false;
|
||||
}
|
||||
if (!(new File(instance.getDataFolder().getParent() + File.separator + "xAuth" + File.separator + "xAuth.h2.db").exists())) {
|
||||
sender.sendMessage("[AuthMe] xAuth H2 database not found, checking for MySQL or SQLite data...");
|
||||
}
|
||||
List<Integer> players = getXAuthPlayers();
|
||||
if (players == null || players.isEmpty()) {
|
||||
sender.sendMessage("[AuthMe] Error while import xAuthPlayers");
|
||||
return false;
|
||||
}
|
||||
sender.sendMessage("[AuthMe] Starting import...");
|
||||
try {
|
||||
for (int id : players) {
|
||||
String pl = getIdPlayer(id);
|
||||
String psw = getPassword(id);
|
||||
if (psw != null && !psw.isEmpty() && pl != null) {
|
||||
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com");
|
||||
database.saveAuth(auth);
|
||||
}
|
||||
}
|
||||
sender.sendMessage("[AuthMe] Successfull convert from xAuth database");
|
||||
} catch (Exception e) {
|
||||
sender.sendMessage("[AuthMe] An error has been thrown while import xAuth database, the import hadn't fail but can be not complete ");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getIdPlayer(int id) {
|
||||
String realPass = "";
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
String sql = String.format("SELECT `playername` FROM `%s` WHERE `id` = ?", xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
|
||||
ps = conn.prepareStatement(sql);
|
||||
ps.setInt(1, id);
|
||||
rs = ps.executeQuery();
|
||||
if (!rs.next())
|
||||
return null;
|
||||
realPass = rs.getString("playername").toLowerCase();
|
||||
} catch (SQLException e) {
|
||||
xAuthLog.severe("Failed to retrieve name for account: " + id, e);
|
||||
return null;
|
||||
} finally {
|
||||
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
|
||||
}
|
||||
return realPass;
|
||||
}
|
||||
|
||||
public List<Integer> getXAuthPlayers() {
|
||||
List<Integer> xP = new ArrayList<Integer>();
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
String sql = String.format("SELECT * FROM `%s`", xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
|
||||
ps = conn.prepareStatement(sql);
|
||||
rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
xP.add(rs.getInt("id"));
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
xAuthLog.severe("Cannot import xAuthPlayers", e);
|
||||
return new ArrayList<Integer>();
|
||||
} finally {
|
||||
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
|
||||
}
|
||||
return xP;
|
||||
}
|
||||
|
||||
public String getPassword(int accountId) {
|
||||
String realPass = "";
|
||||
Connection conn = xAuth.getPlugin().getDatabaseController().getConnection();
|
||||
PreparedStatement ps = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
String sql = String.format("SELECT `password`, `pwtype` FROM `%s` WHERE `id` = ?", xAuth.getPlugin().getDatabaseController().getTable(Table.ACCOUNT));
|
||||
ps = conn.prepareStatement(sql);
|
||||
ps.setInt(1, accountId);
|
||||
rs = ps.executeQuery();
|
||||
if (!rs.next())
|
||||
return null;
|
||||
realPass = rs.getString("password");
|
||||
} catch (SQLException e) {
|
||||
xAuthLog.severe("Failed to retrieve password hash for account: " + accountId, e);
|
||||
return null;
|
||||
} finally {
|
||||
xAuth.getPlugin().getDatabaseController().close(conn, ps, rs);
|
||||
}
|
||||
return realPass;
|
||||
}
|
||||
}
|
||||
@ -20,19 +20,13 @@ public class xAuthConverter implements Converter {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Class.forName("com.cypherx.xauth.xAuth");
|
||||
oldxAuthToFlat converter = new oldxAuthToFlat(plugin, database, sender);
|
||||
converter.convert();
|
||||
} catch (ClassNotFoundException e) {
|
||||
try {
|
||||
Class.forName("de.luricos.bukkit.xAuth.xAuth");
|
||||
newxAuthToFlat converter = new newxAuthToFlat(plugin, database, sender);
|
||||
xAuthToFlat converter = new xAuthToFlat(plugin, database, sender);
|
||||
converter.convert();
|
||||
} catch (ClassNotFoundException ce) {
|
||||
sender.sendMessage("xAuth has not been found, please put xAuth.jar in your plugin folder and restart!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -17,13 +17,13 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
|
||||
public class newxAuthToFlat {
|
||||
public class xAuthToFlat {
|
||||
|
||||
public AuthMe instance;
|
||||
public DataSource database;
|
||||
public CommandSender sender;
|
||||
|
||||
public newxAuthToFlat(AuthMe instance, DataSource database,
|
||||
public xAuthToFlat(AuthMe instance, DataSource database,
|
||||
CommandSender sender) {
|
||||
this.instance = instance;
|
||||
this.database = database;
|
||||
@ -1,33 +0,0 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
|
||||
/**
|
||||
*
|
||||
* This event is call when a player logging in through a timed session
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
package fr.xephi.authme.gui;
|
||||
|
||||
import org.getspout.spoutapi.event.screen.ButtonClickEvent;
|
||||
|
||||
public interface Clickable {
|
||||
|
||||
public void handleClick(ButtonClickEvent event);
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package fr.xephi.authme.gui;
|
||||
|
||||
import org.getspout.spoutapi.event.screen.ButtonClickEvent;
|
||||
import org.getspout.spoutapi.gui.GenericButton;
|
||||
|
||||
public class CustomButton extends GenericButton {
|
||||
|
||||
public Clickable handleRef = null;
|
||||
|
||||
public CustomButton(Clickable c) {
|
||||
handleRef = c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onButtonClick(ButtonClickEvent event) {
|
||||
handleRef.handleClick(event);
|
||||
}
|
||||
|
||||
public CustomButton setMidPos(int x, int y) {
|
||||
this.setX(x).setY(y).shiftXPos(-(width / 2)).shiftYPos(-(height / 2));
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,96 +0,0 @@
|
||||
package fr.xephi.authme.gui.screens;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.getspout.spoutapi.event.screen.ButtonClickEvent;
|
||||
import org.getspout.spoutapi.gui.Button;
|
||||
import org.getspout.spoutapi.gui.Color;
|
||||
import org.getspout.spoutapi.gui.GenericLabel;
|
||||
import org.getspout.spoutapi.gui.GenericPopup;
|
||||
import org.getspout.spoutapi.gui.GenericTextField;
|
||||
import org.getspout.spoutapi.gui.RenderPriority;
|
||||
import org.getspout.spoutapi.gui.Widget;
|
||||
import org.getspout.spoutapi.gui.WidgetAnchor;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.gui.Clickable;
|
||||
import fr.xephi.authme.gui.CustomButton;
|
||||
import fr.xephi.authme.settings.SpoutCfg;
|
||||
|
||||
public class LoginScreen extends GenericPopup implements Clickable {
|
||||
|
||||
public AuthMe plugin = AuthMe.getInstance();
|
||||
private SpoutCfg spoutCfg = SpoutCfg.getInstance();
|
||||
private CustomButton exitBtn;
|
||||
private CustomButton loginBtn;
|
||||
private GenericTextField passBox;
|
||||
private GenericLabel titleLbl;
|
||||
private GenericLabel textLbl;
|
||||
private GenericLabel errorLbl;
|
||||
|
||||
String exitTxt = spoutCfg.getString("LoginScreen.exit button");
|
||||
String loginTxt = spoutCfg.getString("LoginScreen.login button");
|
||||
String exitMsg = spoutCfg.getString("LoginScreen.exit message");
|
||||
String title = spoutCfg.getString("LoginScreen.title");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> textlines = (List<String>) spoutCfg.getList("LoginScreen.text");
|
||||
public SpoutPlayer splayer;
|
||||
|
||||
public LoginScreen(SpoutPlayer player) {
|
||||
this.splayer = player;
|
||||
createScreen();
|
||||
}
|
||||
|
||||
private void createScreen() {
|
||||
int objects = textlines.size() + 4;
|
||||
int part = !(textlines.size() <= 5) ? 195 / objects : 20;
|
||||
int h = 3 * part / 4, w = 8 * part;
|
||||
titleLbl = new GenericLabel();
|
||||
titleLbl.setText(title).setTextColor(new Color(1.0F, 0, 0, 1.0F)).setAlign(WidgetAnchor.TOP_CENTER).setHeight(h).setWidth(w).setX(maxWidth / 2).setY(25);
|
||||
this.attachWidget(plugin, titleLbl);
|
||||
int ystart = 25 + h + part / 2;
|
||||
for (int x = 0; x < textlines.size(); x++) {
|
||||
textLbl = new GenericLabel();
|
||||
textLbl.setText(textlines.get(x)).setAlign(WidgetAnchor.TOP_CENTER).setHeight(h).setWidth(w).setX(maxWidth / 2).setY(ystart + x * part);
|
||||
this.attachWidget(plugin, textLbl);
|
||||
}
|
||||
passBox = new GenericTextField();
|
||||
passBox.setMaximumCharacters(18).setMaximumLines(1).setHeight(h - 2).setWidth(w - 2).setY(220 - h - 2 * part);
|
||||
passBox.setPasswordField(true);
|
||||
setXToMid(passBox);
|
||||
this.attachWidget(plugin, passBox);
|
||||
errorLbl = new GenericLabel();
|
||||
errorLbl.setText("").setTextColor(new Color(1.0F, 0, 0, 1.0F)).setHeight(h).setWidth(w).setX(passBox.getX() + passBox.getWidth() + 2).setY(passBox.getY());
|
||||
this.attachWidget(plugin, errorLbl);
|
||||
loginBtn = new CustomButton(this);
|
||||
loginBtn.setText(loginTxt).setHeight(h).setWidth(w).setY(220 - h - part);
|
||||
setXToMid(loginBtn);
|
||||
this.attachWidget(plugin, loginBtn);
|
||||
exitBtn = new CustomButton(this);
|
||||
exitBtn.setText(exitTxt).setHeight(h).setWidth(w).setY(220 - h);
|
||||
setXToMid(exitBtn);
|
||||
this.attachWidget(plugin, exitBtn);
|
||||
this.setPriority(RenderPriority.Highest);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void handleClick(ButtonClickEvent event) {
|
||||
Button b = event.getButton();
|
||||
SpoutPlayer player = event.getPlayer();
|
||||
if (event.isCancelled() || event == null || event.getPlayer() == null)
|
||||
return;
|
||||
if (b.equals(loginBtn)) {
|
||||
plugin.management.performLogin(player, passBox.getText(), false);
|
||||
} else if (b.equals(exitBtn)) {
|
||||
event.getPlayer().kickPlayer(exitMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private void setXToMid(Widget w) {
|
||||
w.setX((maxWidth - w.getWidth()) / 2);
|
||||
}
|
||||
|
||||
}
|
||||
@ -39,7 +39,6 @@ import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.Utils;
|
||||
import fr.xephi.authme.api.API;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
@ -54,7 +53,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
public static GameMode gm = GameMode.SURVIVAL;
|
||||
public static ConcurrentHashMap<String, GameMode> gameMode = new ConcurrentHashMap<String, GameMode>();
|
||||
public static ConcurrentHashMap<String, String> joinMessage = new ConcurrentHashMap<String, String>();
|
||||
private Utils utils = Utils.getInstance();
|
||||
private Messages m = Messages.getInstance();
|
||||
public AuthMe plugin;
|
||||
private DataSource data;
|
||||
@ -344,6 +342,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (!Settings.isMovementAllowed) {
|
||||
if (!event.getFrom().getBlock().equals(event.getTo().getBlock()))
|
||||
event.setTo(event.getFrom());
|
||||
return;
|
||||
}
|
||||
@ -355,16 +354,17 @@ public class AuthMePlayerListener implements Listener {
|
||||
int radius = Settings.getMovementRadius;
|
||||
Location spawn = plugin.getSpawnLocation(player);
|
||||
|
||||
if (spawn != null && spawn.getWorld() != null)
|
||||
if (spawn != null && spawn.getWorld() != null) {
|
||||
if (!event.getPlayer().getWorld().equals(spawn.getWorld())) {
|
||||
event.getPlayer().teleport(spawn);
|
||||
return;
|
||||
}
|
||||
if ((spawn.distance(player.getLocation()) > radius) && spawn.getWorld() != null) {
|
||||
if ((spawn.distance(player.getLocation()) > radius)) {
|
||||
event.getPlayer().teleport(spawn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAntiBotMod(final Player player) {
|
||||
if (plugin.delayedAntiBot || plugin.antibotMod)
|
||||
@ -405,6 +405,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (player == null)
|
||||
return;
|
||||
final String name = player.getName().toLowerCase();
|
||||
boolean isAuthAvailable = data.isAuthAvailable(name);
|
||||
|
||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||
return;
|
||||
@ -412,7 +413,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) {
|
||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
event.setKickMessage(m.send("country_banned")[0]);
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
@ -420,7 +421,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
if (Settings.enableProtection && !Settings.countries.isEmpty()) {
|
||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||
if (((code == null) || (!Settings.countries.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
if (((code == null) || (!Settings.countries.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
event.setKickMessage(m.send("country_banned")[0]);
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
@ -441,18 +442,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.isAuthAvailable(name) && LimboCache.getInstance().hasLimboPlayer(name))
|
||||
if (Settings.isSessionsEnabled)
|
||||
if (PlayerCache.getInstance().isAuthenticated(name))
|
||||
if (!Settings.sessionExpireOnIpChange)
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
LimboCache.getInstance().deleteLimboPlayer(name);
|
||||
}
|
||||
});
|
||||
|
||||
// Check if forceSingleSession is set to true, so kick player that has
|
||||
// joined with same nick of online player
|
||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||
@ -589,7 +578,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
String name = player.getName().toLowerCase();
|
||||
|
||||
plugin.management.performQuit(player);
|
||||
plugin.management.performQuit(player, false);
|
||||
|
||||
if (data.getAuth(name) != null && !PlayerCache.getInstance().isAuthenticated(name) && Settings.enableProtection)
|
||||
event.setQuitMessage(null);
|
||||
@ -611,7 +600,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.management.performQuit(player);
|
||||
plugin.management.performQuit(player, true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
|
||||
@ -56,20 +56,16 @@ public class AuthMeServerListener implements Listener {
|
||||
ConsoleLogger.info("Multiverse-Core has been disabled, unhook!");
|
||||
return;
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("Notifications")) {
|
||||
plugin.notifications = null;
|
||||
ConsoleLogger.info("Notifications has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("ChestShop")) {
|
||||
plugin.ChestShop = 0;
|
||||
ConsoleLogger.info("ChestShop has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("CombatTag")) {
|
||||
plugin.CombatTag = 0;
|
||||
plugin.CombatTag = false;
|
||||
ConsoleLogger.info("CombatTag has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("Citizens")) {
|
||||
plugin.CitizensVersion = 0;
|
||||
plugin.isCitizensActive = false;
|
||||
ConsoleLogger.info("Citizens has been disabled, unhook!");
|
||||
}
|
||||
if (pluginName.equalsIgnoreCase("Vault")) {
|
||||
@ -85,8 +81,6 @@ public class AuthMeServerListener implements Listener {
|
||||
plugin.checkEssentials();
|
||||
if (pluginName.equalsIgnoreCase("Multiverse-Core"))
|
||||
plugin.checkMultiverse();
|
||||
if (pluginName.equalsIgnoreCase("Notifications"))
|
||||
plugin.checkNotifications();
|
||||
if (pluginName.equalsIgnoreCase("ChestShop"))
|
||||
plugin.checkChestShop();
|
||||
if (pluginName.equalsIgnoreCase("CombatTag"))
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
package fr.xephi.authme.listener;
|
||||
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.gui.screens.LoginScreen;
|
||||
import fr.xephi.authme.settings.SpoutCfg;
|
||||
|
||||
public class AuthMeSpoutListener implements Listener {
|
||||
|
||||
private DataSource data;
|
||||
|
||||
public AuthMeSpoutListener(DataSource data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onSpoutCraftEnable(final SpoutCraftEnableEvent event) {
|
||||
if (SpoutCfg.getInstance().getBoolean("LoginScreen.enabled")) {
|
||||
if (data.isAuthAvailable(event.getPlayer().getName().toLowerCase()) && !PlayerCache.getInstance().isAuthenticated(event.getPlayer().getName().toLowerCase())) {
|
||||
event.getPlayer().getMainScreen().attachPopupScreen(new LoginScreen(event.getPlayer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,9 @@
|
||||
package fr.xephi.authme.plugin.manager;
|
||||
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.CitizensManager;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
|
||||
public class CitizensCommunicator {
|
||||
|
||||
@ -16,14 +14,10 @@ public class CitizensCommunicator {
|
||||
}
|
||||
|
||||
public boolean isNPC(final Entity player, AuthMe instance) {
|
||||
try {
|
||||
if (instance.CitizensVersion == 1) {
|
||||
return CitizensManager.isNPC(player);
|
||||
} else if (instance.CitizensVersion == 2) {
|
||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||
} else {
|
||||
if (!this.instance.isCitizensActive)
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
return false;
|
||||
} catch (Exception npe) {
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package fr.xephi.authme.plugin.manager;
|
||||
|
||||
import net.minelink.ctplus.CombatTagPlus;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -10,6 +8,9 @@ import org.bukkit.plugin.Plugin;
|
||||
import com.trc202.CombatTag.CombatTag;
|
||||
import com.trc202.CombatTagApi.CombatTagApi;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import net.minelink.ctplus.CombatTagPlus;
|
||||
|
||||
public abstract class CombatTagComunicator {
|
||||
|
||||
public static CombatTagApi combatApi;
|
||||
@ -21,6 +22,8 @@ public abstract class CombatTagComunicator {
|
||||
* @return true if the player is an NPC
|
||||
*/
|
||||
public static boolean isNPC(Entity player) {
|
||||
if (!AuthMe.getInstance().CombatTag)
|
||||
return false;
|
||||
try {
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("CombatTag") != null) {
|
||||
combatApi = new CombatTagApi((CombatTag) Bukkit.getServer().getPluginManager().getPlugin("CombatTag"));
|
||||
|
||||
@ -16,8 +16,8 @@ import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*
|
||||
* @authors Xephi59, <a
|
||||
* href="http://dev.bukkit.org/profiles/Possible/">Possible</a>
|
||||
* @authors Xephi59,
|
||||
* <a href="http://dev.bukkit.org/profiles/Possible/">Possible</a>
|
||||
*
|
||||
*/
|
||||
public class Management {
|
||||
@ -65,12 +65,12 @@ public class Management {
|
||||
});
|
||||
}
|
||||
|
||||
public void performQuit(final Player player) {
|
||||
public void performQuit(final Player player, final boolean isKick) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new AsyncronousQuit(player, plugin, database).process();
|
||||
new AsyncronousQuit(player, plugin, database, isKick).process();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package fr.xephi.authme.process.join;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -17,7 +15,6 @@ import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.Utils;
|
||||
import fr.xephi.authme.Utils.groupType;
|
||||
import fr.xephi.authme.api.API;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.cache.backup.DataFileCache;
|
||||
@ -26,7 +23,6 @@ import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.events.ProtectInventoryEvent;
|
||||
import fr.xephi.authme.events.SessionEvent;
|
||||
import fr.xephi.authme.events.SpawnTeleportEvent;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||
@ -95,76 +91,6 @@ public class AsyncronousJoin {
|
||||
}
|
||||
final Location spawnLoc = plugin.getSpawnLocation(player);
|
||||
if (database.isAuthAvailable(name)) {
|
||||
if (Settings.isSessionsEnabled) {
|
||||
PlayerAuth auth = database.getAuth(name);
|
||||
long timeout = Settings.getSessionTimeout * 60000;
|
||||
long lastLogin = auth.getLastLogin();
|
||||
long cur = new Date().getTime();
|
||||
if ((cur - lastLogin < timeout || timeout == 0) && !auth.getIp().matches("198.168.(0|1).1")) {
|
||||
if (auth.getNickname().equalsIgnoreCase(name) && auth.getIp().equals(ip)) {
|
||||
if (PlayerCache.getInstance().getAuth(name) != null) {
|
||||
PlayerCache.getInstance().updatePlayer(auth);
|
||||
} else {
|
||||
PlayerCache.getInstance().addPlayer(auth);
|
||||
database.setLogged(name);
|
||||
}
|
||||
m.send(player, "valid_session");
|
||||
// Restore Permission Group
|
||||
utils.setGroup(player, Utils.groupType.LOGGEDIN);
|
||||
plugin.getServer().getPluginManager().callEvent(new SessionEvent(auth, true));
|
||||
return;
|
||||
} else if (!Settings.sessionExpireOnIpChange) {
|
||||
final GameMode gM = AuthMePlayerListener.gameMode.get(name);
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, true);
|
||||
player.setGameMode(gM);
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, false);
|
||||
player.kickPlayer(m.send("invalid_session")[0]);
|
||||
}
|
||||
|
||||
});
|
||||
return;
|
||||
} else if (auth.getNickname().equalsIgnoreCase(name)) {
|
||||
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, true);
|
||||
Utils.forceGM(player);
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, false);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
// Player change his IP between 2 relog-in
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
} else {
|
||||
final GameMode gM = AuthMePlayerListener.gameMode.get(name);
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, true);
|
||||
player.setGameMode(gM);
|
||||
AuthMePlayerListener.causeByAuthMe.put(name, false);
|
||||
player.kickPlayer(m.send("invalid_session")[0]);
|
||||
}
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Session is ended correctly
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
}
|
||||
}
|
||||
// isent in session or session was ended correctly
|
||||
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
|
||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@ -255,7 +181,7 @@ public class AsyncronousJoin {
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info("ProtectInventoryEvent has been cancelled for " + player.getName() + " ...");
|
||||
} else {
|
||||
API.setPlayerInventory(player, ev.getEmptyInventory(), ev.getEmptyArmor());
|
||||
plugin.api.setPlayerInventory(player, ev.getEmptyInventory(), ev.getEmptyArmor());
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
}
|
||||
@ -302,6 +228,23 @@ public class AsyncronousJoin {
|
||||
}
|
||||
|
||||
});
|
||||
if (Settings.isSessionsEnabled && database.isAuthAvailable(name) && (PlayerCache.getInstance().isAuthenticated(name) || database.isLogged(name))) {
|
||||
if (plugin.sessions.containsKey(name))
|
||||
plugin.sessions.get(name).cancel();
|
||||
plugin.sessions.remove(name);
|
||||
PlayerAuth auth = database.getAuth(name);
|
||||
if (auth != null && auth.getIp().equals(ip)) {
|
||||
m.send(player, "valid_session");
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
plugin.management.performLogin(player, "dontneed", true);
|
||||
} else if (Settings.sessionExpireOnIpChange) {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
m.send(player, "invalid_session");
|
||||
}
|
||||
return;
|
||||
}
|
||||
BukkitTask msgT = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||
}
|
||||
|
||||
@ -19,7 +19,6 @@ import fr.xephi.authme.security.RandomString;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class AsyncronousLogin {
|
||||
|
||||
@ -147,6 +146,7 @@ public class AsyncronousLogin {
|
||||
}
|
||||
|
||||
player.setNoDamageTicks(0);
|
||||
if (!forceLogin)
|
||||
m.send(player, "login");
|
||||
|
||||
displayOtherAccounts(auth, player);
|
||||
@ -156,14 +156,9 @@ public class AsyncronousLogin {
|
||||
m.send(player, "add_email");
|
||||
}
|
||||
|
||||
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getName() + " logged in!");
|
||||
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " logged in!"));
|
||||
}
|
||||
|
||||
// makes player isLoggedin via API
|
||||
PlayerCache.getInstance().addPlayer(auth);
|
||||
database.setLogged(name);
|
||||
|
||||
@ -91,7 +91,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
||||
RestoreInventoryEvent event = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
API.setPlayerInventory(player, event.getInventory(), event.getArmor());
|
||||
plugin.api.setPlayerInventory(player, event.getInventory(), event.getArmor());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,8 @@ public class AsyncronousLogout {
|
||||
private Utils utils = Utils.getInstance();
|
||||
private FileCache playerBackup;
|
||||
|
||||
public AsyncronousLogout(Player player, AuthMe plugin, DataSource database) {
|
||||
public AsyncronousLogout(Player player, AuthMe plugin,
|
||||
DataSource database) {
|
||||
this.player = player;
|
||||
this.plugin = plugin;
|
||||
this.database = database;
|
||||
@ -50,8 +51,6 @@ public class AsyncronousLogout {
|
||||
final Player p = player;
|
||||
BukkitScheduler sched = p.getServer().getScheduler();
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
||||
if (Settings.isSessionsEnabled)
|
||||
auth.setLastLogin(0L);
|
||||
database.updateSession(auth);
|
||||
auth.setQuitLocX(p.getLocation().getX());
|
||||
auth.setQuitLocY(p.getLocation().getY());
|
||||
|
||||
@ -15,7 +15,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
|
||||
@ -32,6 +31,9 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (plugin.sessions.containsKey(name))
|
||||
plugin.sessions.get(name).cancel();
|
||||
plugin.sessions.remove(name);
|
||||
int delay = Settings.getRegistrationTimeout * 20;
|
||||
int interval = Settings.getWarnMessageInterval;
|
||||
BukkitScheduler sched = player.getServer().getScheduler();
|
||||
@ -61,9 +63,6 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
});
|
||||
m.send(player, "logout");
|
||||
ConsoleLogger.info(player.getDisplayName() + " logged out");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " logged out!"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.Utils;
|
||||
@ -30,13 +31,16 @@ public class AsyncronousQuit {
|
||||
private boolean isOp = false;
|
||||
private boolean isFlying = false;
|
||||
private boolean needToChange = false;
|
||||
private boolean isKick = false;
|
||||
|
||||
public AsyncronousQuit(Player p, AuthMe plugin, DataSource database) {
|
||||
public AsyncronousQuit(Player p, AuthMe plugin, DataSource database,
|
||||
boolean isKick) {
|
||||
this.p = p;
|
||||
this.plugin = plugin;
|
||||
this.database = database;
|
||||
this.name = p.getName().toLowerCase();
|
||||
this.playerBackup = new FileCache(plugin);
|
||||
this.isKick = isKick;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
@ -79,9 +83,24 @@ public class AsyncronousQuit {
|
||||
playerBackup.removeCache(player);
|
||||
}
|
||||
}
|
||||
if (Settings.isSessionsEnabled && !isKick) {
|
||||
BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
if (database.isLogged(name))
|
||||
database.setUnlogged(name);
|
||||
plugin.sessions.remove(name);
|
||||
}
|
||||
|
||||
}, Settings.getSessionTimeout * 20 * 60);
|
||||
plugin.sessions.put(name, task);
|
||||
} else {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
}
|
||||
AuthMePlayerListener.gameMode.remove(name);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(player, inv, armor, isOp, isFlying, needToChange));
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, inv, armor, isOp, isFlying, needToChange));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,12 +4,13 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import fr.xephi.authme.api.API;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.events.RestoreInventoryEvent;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
|
||||
protected AuthMe plugin;
|
||||
protected Player player;
|
||||
protected boolean isOp;
|
||||
protected boolean isFlying;
|
||||
@ -17,9 +18,10 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
protected ItemStack[] armor;
|
||||
protected boolean needToChange;
|
||||
|
||||
public ProcessSyncronousPlayerQuit(Player player, ItemStack[] inv,
|
||||
ItemStack[] armor, boolean isOp, boolean isFlying,
|
||||
public ProcessSyncronousPlayerQuit(AuthMe plugin, Player player,
|
||||
ItemStack[] inv, ItemStack[] armor, boolean isOp, boolean isFlying,
|
||||
boolean needToChange) {
|
||||
this.plugin = plugin;
|
||||
this.player = player;
|
||||
this.isOp = isOp;
|
||||
this.isFlying = isFlying;
|
||||
@ -34,7 +36,7 @@ public class ProcessSyncronousPlayerQuit implements Runnable {
|
||||
RestoreInventoryEvent ev = new RestoreInventoryEvent(player, inv, armor);
|
||||
player.getServer().getPluginManager().callEvent(ev);
|
||||
if (!ev.isCancelled()) {
|
||||
API.setPlayerInventory(player, ev.getInventory(), ev.getArmor());
|
||||
plugin.api.setPlayerInventory(player, ev.getInventory(), ev.getArmor());
|
||||
}
|
||||
}
|
||||
if (needToChange) {
|
||||
|
||||
@ -12,7 +12,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class ProcessSyncronousEmailRegister implements Runnable {
|
||||
|
||||
@ -47,9 +46,6 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
||||
player.saveData();
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " has registered by email!"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@ import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import me.muizers.Notifications.Notification;
|
||||
|
||||
public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
|
||||
@ -118,9 +117,6 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
|
||||
if (!Settings.noConsoleSpam)
|
||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " has registered!"));
|
||||
}
|
||||
|
||||
// Kick Player after Registration is enabled, kick the player
|
||||
if (Settings.forceRegKick) {
|
||||
|
||||
@ -63,7 +63,7 @@ public final class Settings extends YamlConfiguration {
|
||||
isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled,
|
||||
reloadSupport, rakamakUseIp, noConsoleSpam, removePassword,
|
||||
displayOtherAccounts, useCaptcha, emailRegistration, multiverse,
|
||||
notifications, chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||
chestshop, bungee, banUnsafeIp, doubleEmailCheck,
|
||||
sessionExpireOnIpChange, disableSocialSpy, forceOnlyAfterLogin,
|
||||
useEssentialsMotd, usePurge, purgePlayerDat, purgeEssentialsFile,
|
||||
supportOldPassword, purgeLimitedCreative, purgeAntiXray,
|
||||
@ -217,7 +217,6 @@ public final class Settings extends YamlConfiguration {
|
||||
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
||||
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
||||
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
||||
notifications = configFile.getBoolean("Hooks.notifications", true);
|
||||
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
||||
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds", new ArrayList<String>());
|
||||
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
||||
@ -384,7 +383,6 @@ public final class Settings extends YamlConfiguration {
|
||||
getmaxRegPerEmail = configFile.getInt("Email.maxRegPerEmail", 1);
|
||||
multiverse = configFile.getBoolean("Hooks.multiverse", true);
|
||||
chestshop = configFile.getBoolean("Hooks.chestshop", true);
|
||||
notifications = configFile.getBoolean("Hooks.notifications", true);
|
||||
bungee = configFile.getBoolean("Hooks.bungeecord", false);
|
||||
getForcedWorlds = (List<String>) configFile.getList("settings.restrictions.ForceSpawnOnTheseWorlds");
|
||||
banUnsafeIp = configFile.getBoolean("settings.restrictions.banUnsafedIP", false);
|
||||
@ -587,6 +585,8 @@ public final class Settings extends YamlConfiguration {
|
||||
set("Purge.removePermissions", false);
|
||||
changes = true;
|
||||
}
|
||||
if (contains("Hooks.notifications"))
|
||||
set("Hooks.notifications", null);
|
||||
|
||||
if (changes) {
|
||||
plugin.getLogger().warning("Merge new Config Options - I'm not an error, please don't report me");
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
package fr.xephi.authme.settings;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SpoutCfg extends CustomConfiguration {
|
||||
|
||||
private static SpoutCfg instance = null;
|
||||
|
||||
public SpoutCfg(File file) {
|
||||
super(file);
|
||||
loadDefaults();
|
||||
load();
|
||||
save();
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private void loadDefaults() {
|
||||
this.set("Spout GUI enabled", true);
|
||||
this.set("LoginScreen.enabled", true);
|
||||
this.set("LoginScreen.exit button", "Quit");
|
||||
this.set("LoginScreen.exit message", "Good Bye");
|
||||
this.set("LoginScreen.login button", "Login");
|
||||
this.set("LoginScreen.title", "LOGIN");
|
||||
this.set("LoginScreen.text", new ArrayList<String>() {
|
||||
|
||||
{
|
||||
add("Sample text");
|
||||
add("Change this at spout.yml");
|
||||
add("--- AuthMe Reloaded by ---");
|
||||
add("Xephi59");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static SpoutCfg getInstance() {
|
||||
if (instance == null)
|
||||
instance = new SpoutCfg(new File("plugins" + File.separator + "AuthMe", "spout.yml"));
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
@ -375,8 +375,6 @@ Hooks:
|
||||
chestshop: true
|
||||
# Do we need to hook with BungeeCord for get the real Player ip ?
|
||||
bungeecord: false
|
||||
# Do we need to hook with Notifications for Notifs sending ?
|
||||
notifications: true
|
||||
# Do we need to disable Essentials SocialSpy on join ?
|
||||
disableSocialSpy: true
|
||||
# Do we need to force /motd Essentials command on join ?
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
Spout GUI enabled: true
|
||||
LoginScreen:
|
||||
enabled: true
|
||||
exit button: Quit
|
||||
exit message: Good Bye
|
||||
login button: Login
|
||||
title: LOGIN
|
||||
text:
|
||||
- Sample text
|
||||
- Change this at spout.yml
|
||||
- '--- AuthMe Reloaded by ---'
|
||||
- Xephi59
|
||||
Loading…
x
Reference in New Issue
Block a user