mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-22 16:48:21 +01:00
Update 2.7.16
This commit is contained in:
parent
6c8ba0d7ef
commit
bad44f3af7
Binary file not shown.
Binary file not shown.
13
pom.xml
13
pom.xml
@ -28,12 +28,12 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<version>2.7.15b1</version>
|
||||
<version>2.7.16</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.5.1-R0.2</version>
|
||||
<version>1.5.2-R0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
@ -59,7 +59,7 @@
|
||||
<dependency>
|
||||
<groupId>org.getSpout</groupId>
|
||||
<artifactId>SpoutPlugin</artifactId>
|
||||
<version>1.4.7-R1.0-SNAPSHOT</version>
|
||||
<version>1.5.1-R0.3-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/SpoutPlugin.jar</systemPath>
|
||||
</dependency>
|
||||
@ -118,13 +118,6 @@
|
||||
<version>2.5-b654</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/Multiverse-Core-2.5.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.5-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/BungeeCord.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
|
@ -23,6 +23,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@ -53,6 +54,7 @@ import uk.org.whoami.authme.listener.AuthMeChestShopListener;
|
||||
import uk.org.whoami.authme.listener.AuthMeEntityListener;
|
||||
import uk.org.whoami.authme.listener.AuthMePlayerListener;
|
||||
import uk.org.whoami.authme.listener.AuthMeSpoutListener;
|
||||
import uk.org.whoami.authme.plugin.manager.BungeeCordMessage;
|
||||
import uk.org.whoami.authme.plugin.manager.CitizensCommunicator;
|
||||
import uk.org.whoami.authme.plugin.manager.CombatTagComunicator;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
@ -96,6 +98,7 @@ public class AuthMe extends JavaPlugin {
|
||||
public API api;
|
||||
public HashMap<String, Integer> captcha = new HashMap<String, Integer>();
|
||||
public HashMap<String, String> cap = new HashMap<String, String>();
|
||||
public HashMap<String, String> realIp = new HashMap<String, String>();
|
||||
public MultiverseCore mv = null;
|
||||
|
||||
@Override
|
||||
@ -245,17 +248,19 @@ public class AuthMe extends JavaPlugin {
|
||||
pm.registerEvents(new AuthMeChestShopListener(database, this), this);
|
||||
ConsoleLogger.info("Successfully hook with ChestShop!");
|
||||
}
|
||||
if (Settings.bungee)
|
||||
Bukkit.getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeCordMessage(this));
|
||||
|
||||
//Find Permissions
|
||||
if(Settings.isPermissionCheckEnabled) {
|
||||
RegisteredServiceProvider<Permission> permissionProvider =
|
||||
if (pm.getPlugin("Vault") != null) {
|
||||
RegisteredServiceProvider<Permission> permissionProvider =
|
||||
getServer().getServicesManager().getRegistration(net.milkbowl.vault.permission.Permission.class);
|
||||
if (permissionProvider != null)
|
||||
permission = permissionProvider.getProvider();
|
||||
else {
|
||||
ConsoleLogger.showError("Vault and Permissions plugins is needed for enable AuthMe Reloaded!");
|
||||
ConsoleLogger.showError("Server Shutdown for Security");
|
||||
this.getServer().shutdown();
|
||||
if (permissionProvider != null) {
|
||||
permission = permissionProvider.getProvider();
|
||||
ConsoleLogger.info("Vault plugin detected, hook with " + permission.getName() + " system");
|
||||
}
|
||||
else {
|
||||
ConsoleLogger.showError("Vault plugin is detected but not the permissions plugin!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -433,8 +438,13 @@ public class AuthMe extends JavaPlugin {
|
||||
String name = player.getName().toLowerCase();
|
||||
if ((PlayerCache.getInstance().isAuthenticated(name)) && (!player.isDead()) &&
|
||||
(Settings.isSaveQuitLocationEnabled.booleanValue())) {
|
||||
PlayerAuth auth = new PlayerAuth(player.getName().toLowerCase(), (int)player.getLocation().getX(), (int)player.getLocation().getY(), (int)player.getLocation().getZ());
|
||||
this.database.updateQuitLoc(auth);
|
||||
final PlayerAuth auth = new PlayerAuth(player.getName().toLowerCase(), (int)player.getLocation().getX(), (int)player.getLocation().getY(), (int)player.getLocation().getZ());
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
database.updateQuitLoc(auth);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (LimboCache.getInstance().hasLimboPlayer(name))
|
||||
{
|
||||
@ -461,10 +471,6 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
public void setCitizensCommunicator(CitizensCommunicator citizens) {
|
||||
this.citizens = citizens;
|
||||
}
|
||||
|
||||
public CitizensCommunicator getCitizensCommunicator() {
|
||||
return citizens;
|
||||
}
|
||||
@ -483,14 +489,14 @@ public class AuthMe extends JavaPlugin {
|
||||
for (i = 0 ; i <= players.length ; i++) {
|
||||
Random rdm = new Random();
|
||||
int a = rdm.nextInt(players.length);
|
||||
if (!(players[a].hasPermission("authme.vip"))) {
|
||||
if (!(authmePermissible(players[a], "authme.vip"))) {
|
||||
player = players[a];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (player == null) {
|
||||
for (Player p : players) {
|
||||
if (!(p.hasPermission("authme.vip"))) {
|
||||
if (!(authmePermissible(p, "authme.vip"))) {
|
||||
player = p;
|
||||
break;
|
||||
}
|
||||
@ -499,4 +505,21 @@ public class AuthMe extends JavaPlugin {
|
||||
return player;
|
||||
}
|
||||
|
||||
public boolean authmePermissible(Player player, String perm) {
|
||||
if (player.hasPermission(perm))
|
||||
return true;
|
||||
else if (permission != null) {
|
||||
return permission.playerHas(player, perm);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean authmePermissible(CommandSender sender, String perm) {
|
||||
if (sender.hasPermission(perm)) return true;
|
||||
else if (permission != null) {
|
||||
return permission.has(sender, perm);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package uk.org.whoami.authme;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author stefano
|
||||
*/
|
||||
public class LogActions {
|
||||
|
||||
private boolean logData;
|
||||
private File dataLog;
|
||||
private boolean logMessages;
|
||||
private File messageLog;
|
||||
private String dataFolder;
|
||||
private String dLog,mLog;
|
||||
|
||||
public LogActions() {
|
||||
try {
|
||||
if (logData)
|
||||
this.dataLog = new File(dataFolder, dLog);
|
||||
if (logMessages)
|
||||
this.messageLog = new File(dataFolder, mLog);
|
||||
} catch (Exception e){
|
||||
|
||||
ConsoleLogger.showError("[AuthMe] Error opening logfiles; bad filename?");
|
||||
if (logData)
|
||||
this.dataLog = new File(dataFolder, "death_data.log");
|
||||
if (logMessages)
|
||||
this.messageLog = new File(dataFolder, "death_messages.log");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void initFiles() {
|
||||
if (logData && !this.dataLog.exists()) {
|
||||
try {
|
||||
this.dataLog.createNewFile();
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(this.dataLog,true));
|
||||
writer.write("#AuthMe Registration Log - This file stores serialized data on player regitration, changepassword and unregistration:");
|
||||
writer.newLine();
|
||||
writer.write("#Date | Time | Player | ip | Action [Register|ChangePassword|Unregister]");
|
||||
writer.newLine();
|
||||
writer.write("#Dont remove this file if you want to store all Registration Action");
|
||||
writer.newLine();
|
||||
writer.write("#If This file will become too big, rename it and let plugin create new one");
|
||||
writer.newLine();
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
ConsoleLogger.showError("[AuthMe] Error writing data log: ");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (logMessages && !this.messageLog.exists()) {
|
||||
try {
|
||||
this.messageLog.createNewFile();
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(this.messageLog,true));
|
||||
writer.write("#AuthMe Multiple Access Log - This file stores player Login, Wrong Password and Error");
|
||||
writer.newLine();
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
ConsoleLogger.showError("[AuthMe] Error writing message log: ");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -5,8 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import me.muizers.Notifications.Notification;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@ -68,15 +66,8 @@ public class Management {
|
||||
public void run() {
|
||||
String ip = player.getAddress().getAddress().getHostAddress();
|
||||
if (Settings.bungee) {
|
||||
try {
|
||||
for (ProxiedPlayer pp : BungeeCord.getInstance().getPlayers()) {
|
||||
if (pp.getName().toLowerCase() == name) {
|
||||
ip = pp.getAddress().getAddress().getHostAddress();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
}
|
||||
if (plugin.realIp.containsKey(name))
|
||||
ip = plugin.realIp.get(name);
|
||||
}
|
||||
World world = player.getWorld();
|
||||
Location spawnLoc = world.getSpawnLocation();
|
||||
@ -502,7 +493,7 @@ public class Management {
|
||||
|
||||
}
|
||||
for (Player player : AuthMe.getInstance().getServer().getOnlinePlayers()) {
|
||||
if (player.hasPermission("authme.seeOtherAccounts")) {
|
||||
if (plugin.authmePermissible(player, "authme.seeOtherAccounts")) {
|
||||
player.sendMessage("[AuthMe] The player " + auth.getNickname() + " has " + String.valueOf(accountList.size()) + " accounts");
|
||||
player.sendMessage(message);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public class Utils {
|
||||
String token = generateToken();
|
||||
writer.write(token+":"+System.currentTimeMillis()/1000+"\r\n");
|
||||
writer.flush();
|
||||
System.out.println("[AuthMe] Security passpartu token: "+ token);
|
||||
ConsoleLogger.info("[AuthMe] Security passpartu token: "+ token);
|
||||
writer.close();
|
||||
return true;
|
||||
} catch(Exception e) {
|
||||
|
@ -91,7 +91,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!sender.hasPermission("authme.admin." + args[0].toLowerCase())) {
|
||||
if (!plugin.authmePermissible(sender, "authme.admin." + args[0].toLowerCase())) {
|
||||
sender.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class CaptchaCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!player.hasPermission("authme." + label.toLowerCase())) {
|
||||
if (!plugin.authmePermissible(player, "authme." + label.toLowerCase())) {
|
||||
player.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class ChangePasswordCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!sender.hasPermission("authme." + label.toLowerCase())) {
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
sender.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class EmailCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!sender.hasPermission("authme." + label.toLowerCase())) {
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
sender.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class LoginCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!player.hasPermission("authme." + label.toLowerCase())) {
|
||||
if (!plugin.authmePermissible(player, "authme." + label.toLowerCase())) {
|
||||
player.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class LogoutCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!sender.hasPermission("authme." + label.toLowerCase())) {
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
sender.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import uk.org.whoami.authme.Management;
|
||||
import uk.org.whoami.authme.Utils;
|
||||
import uk.org.whoami.authme.cache.auth.PlayerCache;
|
||||
import uk.org.whoami.authme.datasource.DataSource;
|
||||
import uk.org.whoami.authme.settings.Messages;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -23,6 +24,7 @@ public class PasspartuCommand implements CommandExecutor {
|
||||
private Utils utils = new Utils();
|
||||
private DataSource database;
|
||||
public AuthMe plugin;
|
||||
private Messages m;
|
||||
|
||||
public PasspartuCommand(DataSource database, AuthMe plugin) {
|
||||
this.database = database;
|
||||
@ -32,6 +34,11 @@ public class PasspartuCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmnd, String label, String[] args) {
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme.admin." + args[0].toLowerCase())) {
|
||||
sender.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(sender.getName().toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
|
@ -20,8 +20,6 @@ import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Date;
|
||||
|
||||
import me.muizers.Notifications.Notification;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
@ -72,7 +70,7 @@ public class RegisterCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!sender.hasPermission("authme." + label.toLowerCase())) {
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
sender.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
@ -82,15 +80,8 @@ public class RegisterCommand implements CommandExecutor {
|
||||
String ipA = player.getAddress().getAddress().getHostAddress();
|
||||
|
||||
if (Settings.bungee) {
|
||||
try {
|
||||
for (ProxiedPlayer pp : BungeeCord.getInstance().getPlayers()) {
|
||||
if (pp.getName().toLowerCase() == name) {
|
||||
ipA = pp.getAddress().getAddress().getHostAddress();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
}
|
||||
if (plugin.realIp.containsKey(name))
|
||||
ipA = plugin.realIp.get(name);
|
||||
}
|
||||
|
||||
final String ip = ipA;
|
||||
@ -113,7 +104,7 @@ public class RegisterCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if(Settings.getmaxRegPerIp > 0 ){
|
||||
if(!sender.hasPermission("authme.allow2accounts") && database.getAllAuthsByIp(ipA).size() >= Settings.getmaxRegPerIp) {
|
||||
if(!plugin.authmePermissible(sender, "authme.allow2accounts") && database.getAllAuthsByIp(ipA).size() >= Settings.getmaxRegPerIp) {
|
||||
player.sendMessage(m._("max_reg"));
|
||||
return true;
|
||||
}
|
||||
@ -136,7 +127,7 @@ public class RegisterCommand implements CommandExecutor {
|
||||
}
|
||||
final String email = args[0];
|
||||
if(Settings.getmaxRegPerEmail > 0) {
|
||||
if (!sender.hasPermission("authme.allow2accounts") && database.getAllAuthsByEmail(email).size() >= Settings.getmaxRegPerEmail) {
|
||||
if (!plugin.authmePermissible(sender, "authme.allow2accounts") && database.getAllAuthsByEmail(email).size() >= Settings.getmaxRegPerEmail) {
|
||||
player.sendMessage(m._("max_reg"));
|
||||
return true;
|
||||
}
|
||||
@ -144,7 +135,7 @@ public class RegisterCommand implements CommandExecutor {
|
||||
RandomString rand = new RandomString(Settings.getRecoveryPassLength);
|
||||
final String thePass = rand.nextString();
|
||||
if (!thePass.isEmpty()) {
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (PasswordSecurity.userSalt.containsKey(name)) {
|
||||
|
@ -64,7 +64,7 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!sender.hasPermission("authme." + label.toLowerCase())) {
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
sender.sendMessage(m._("no_perm"));
|
||||
return true;
|
||||
}
|
||||
|
@ -16,12 +16,12 @@
|
||||
|
||||
package uk.org.whoami.authme.listener;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -582,7 +582,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
//Check if forceSingleSession is set to true, so kick player that has joined with same nick of online player
|
||||
if(player.isOnline() && Settings.isForceSingleSessionEnabled ) {
|
||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
|
||||
//System.out.println(" limbo ? "+limbo.getGroup());
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, m._("same_nick"));
|
||||
if(PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
||||
utils.addNormal(player, limbo.getGroup());
|
||||
@ -615,9 +614,19 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Settings.bungee) {
|
||||
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
||||
DataOutputStream out = new DataOutputStream(b);
|
||||
|
||||
try {
|
||||
out.writeUTF("IP");
|
||||
} catch (IOException e) {
|
||||
}
|
||||
player.sendPluginMessage(this.plugin, "BungeeCord", b.toByteArray());
|
||||
}
|
||||
if (event.getResult() != PlayerLoginEvent.Result.KICK_FULL) return;
|
||||
if (player.isBanned()) return;
|
||||
if (!player.hasPermission("authme.vip")) {
|
||||
if (!plugin.authmePermissible(player, "authme.vip")) {
|
||||
event.disallow(Result.KICK_FULL, m._("kick_fullserver"));
|
||||
return;
|
||||
}
|
||||
@ -661,15 +670,8 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
String ip = player.getAddress().getAddress().getHostAddress();
|
||||
if (Settings.bungee) {
|
||||
try {
|
||||
for (ProxiedPlayer pp : BungeeCord.getInstance().getPlayers()) {
|
||||
if (pp.getName().toLowerCase() == name) {
|
||||
ip = pp.getAddress().getAddress().getHostAddress();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
}
|
||||
if (plugin.realIp.containsKey(name))
|
||||
ip = plugin.realIp.get(name);
|
||||
}
|
||||
if(Settings.isAllowRestrictedIp && !Settings.getRestrictedIp(name, ip)) {
|
||||
int gM = gameMode.get(name);
|
||||
@ -774,7 +776,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
if (event.getPlayer() == null) {
|
||||
return;
|
||||
@ -789,7 +791,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(name) && !player.isDead()) {
|
||||
if(Settings.isSaveQuitLocationEnabled && data.isAuthAvailable(name)) {
|
||||
final PlayerAuth auth = new PlayerAuth(event.getPlayer().getName().toLowerCase(),(int)player.getLocation().getX(),(int)player.getLocation().getY(),(int)player.getLocation().getZ());
|
||||
final PlayerAuth auth = new PlayerAuth(event.getPlayer().getName().toLowerCase(),player.getLocation().getBlock().getX(),player.getLocation().getBlock().getY(),player.getLocation().getBlock().getZ());
|
||||
try {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
@ -802,7 +804,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
||||
//System.out.println("e' nel quit");
|
||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
|
||||
if(Settings.protectInventoryBeforeLogInEnabled && player.hasPlayedBefore()) {
|
||||
RestoreInventoryEvent ev = new RestoreInventoryEvent(player, limbo.getInventory(), limbo.getArmour());
|
||||
@ -813,7 +814,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
utils.addNormal(player, limbo.getGroup());
|
||||
player.setOp(limbo.getOperator());
|
||||
//System.out.println("debug quit group reset "+limbo.getGroup());
|
||||
this.plugin.getServer().getScheduler().cancelTask(limbo.getTimeoutTaskId());
|
||||
LimboCache.getInstance().deleteLimboPlayer(name);
|
||||
if(playerBackup.doesCacheExist(name)) {
|
||||
@ -937,7 +937,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (event.isCancelled() || event.getPlayer() == null) return;
|
||||
if (event.getClickedBlock() == null) return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
String name = player.getName().toLowerCase();
|
||||
@ -955,18 +954,13 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
final int sign = event.getClickedBlock().getTypeId();
|
||||
if (sign == Material.SIGN_POST.getId() || sign == Material.WALL_SIGN.getId()) {
|
||||
event.setUseInteractedBlock(org.bukkit.event.Event.Result.DENY);
|
||||
}
|
||||
} catch (NullPointerException npe) {
|
||||
}
|
||||
if (event.getClickedBlock() != null && event.getClickedBlock().getType() != Material.AIR)
|
||||
event.setUseInteractedBlock(org.bukkit.event.Event.Result.DENY);
|
||||
event.setUseItemInHand(org.bukkit.event.Event.Result.DENY);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
|
||||
if (event.isCancelled() || event.getPlayer() == null) {
|
||||
return;
|
||||
@ -991,7 +985,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerDropItem(PlayerDropItemEvent event) {
|
||||
if (event.isCancelled() || event.getPlayer() == null) {
|
||||
return;
|
||||
@ -1015,7 +1009,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerBedEnter(PlayerBedEnterEvent event) {
|
||||
if (event.isCancelled() || event.getPlayer() == null) {
|
||||
return;
|
||||
@ -1062,4 +1056,5 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
package uk.org.whoami.authme.plugin.manager;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
|
||||
import uk.org.whoami.authme.AuthMe;
|
||||
import uk.org.whoami.authme.ConsoleLogger;
|
||||
|
||||
public class BungeeCordMessage implements PluginMessageListener {
|
||||
|
||||
public AuthMe plugin;
|
||||
|
||||
public BungeeCordMessage(AuthMe plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||
ConsoleLogger.info("PluginMessage send to " + player.getName() + " , the message was : " + message.toString());
|
||||
plugin.realIp.put(player.getName().toLowerCase(), message.toString());
|
||||
}
|
||||
|
||||
}
|
@ -16,11 +16,17 @@ public class CitizensCommunicator {
|
||||
}
|
||||
|
||||
public boolean isNPC(final Entity player, AuthMe instance) {
|
||||
if (instance.CitizensVersion == 1) {
|
||||
return CitizensManager.isNPC(player);
|
||||
} else if (instance.CitizensVersion == 2) {
|
||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||
} else {
|
||||
try {
|
||||
if (instance.CitizensVersion == 1) {
|
||||
return CitizensManager.isNPC(player);
|
||||
} else if (instance.CitizensVersion == 2) {
|
||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
return false;
|
||||
} catch (NullPointerException npe) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ public void mergeConfig() {
|
||||
}
|
||||
|
||||
public enum messagesLang {
|
||||
en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw, fi, zhcn
|
||||
en, de, br, cz, pl, fr, ru, hu, sk, es, zhtw, fi, zhcn, lt
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,42 +1,43 @@
|
||||
unknown_user: '&fUtilisateur non enregistrer'
|
||||
unsafe_spawn: '&fTeleportation dans un endroit sur'
|
||||
not_logged_in: '&cNon connecter!'
|
||||
reg_voluntarily: '&fVous venez d arriver? faites un "/register motdepasse confirmermotdepasse"'
|
||||
# Traduction par: André
|
||||
unknown_user: '&fUtilisateur non enregistré'
|
||||
unsafe_spawn: '&fTéléportation dans un endroit sûr'
|
||||
not_logged_in: '&cNon connecté!'
|
||||
reg_voluntarily: '&fVous venez d''arriver? faites un "/register motdepasse confirmermotdepasse"'
|
||||
usage_log: '&cUtilisez: /login motdepasse'
|
||||
wrong_pwd: '&cMauvais MotDePasse'
|
||||
unregistered: '&cVous avez ete desenregistrer!'
|
||||
reg_disabled: '&cL''enregistrement est desactiver'
|
||||
valid_session: '&cVous etes authentifier'
|
||||
login: '&cLogin effectuer!'
|
||||
vb_nonActiv: '&fCe compte n''est pas activer, consultez vos emails!'
|
||||
user_regged: '&cCe nom est deja utiliser'
|
||||
wrong_pwd: '&cMauvais MotdePasse'
|
||||
unregistered: '&cCe compte a été supprimé!'
|
||||
reg_disabled: '&cL''enregistrement est désactivé'
|
||||
valid_session: '&cVous êtes authentifié'
|
||||
login: '&cConnection effectuée!'
|
||||
vb_nonActiv: '&fCe compte n''est pas actif, consultez vos emails!'
|
||||
user_regged: '&cCe nom est deja utilisé..'
|
||||
usage_reg: '&cUtilisez la commande /register motdepasse confirmermotdepasse'
|
||||
max_reg: '&fLimite d''enregistrement atteinte pour cet account'
|
||||
max_reg: '&fLimite d''enregistrement atteinte pour ce compte'
|
||||
no_perm: '&cVous n''avez pas la permission'
|
||||
error: '&fUne erreur est apparue, veuillez contacter un administrateur'
|
||||
login_msg: '&cConnectez-vous via un /login motdepasse'
|
||||
reg_msg: '&cUtilisez /register motdepasse confirmermotdepasse'
|
||||
usage_unreg: '&cUtilisez: /unregister password'
|
||||
pwd_changed: '&cMotdePasse changer avec succes!'
|
||||
user_unknown: '&c Ce pseudo n est pas enregistrer'
|
||||
login_msg: '&cPour vous connecter, utilisez: /login motdepasse'
|
||||
reg_msg: '&cPour vous inscrire, utilisez /register motdepasse confirmermotdepasse'
|
||||
usage_unreg: '&cPour supprimer ce compte, utilisez: /unregister password'
|
||||
pwd_changed: '&cMotdePasse changé avec succès!'
|
||||
user_unknown: '&c Ce compte n''est pas enregistré'
|
||||
password_error: '&fCe mot de passe est incorrect'
|
||||
unvalid_session: '&fSession invalide, relancez le jeu ou attendez la fin de la session'
|
||||
reg_only: '&fSeul les joueurs enregistrer sont admis!'
|
||||
logged_in: '&cVous etes deja connecter!'
|
||||
logout: '&cVous avez ete deconnecter'
|
||||
same_nick: '&fUne personne ayant ce pseudo joue deja !'
|
||||
registered: '&cEnregistrement reussi!'
|
||||
pass_len: '&fVotre mot de passe ne respecte pas les normes de longueurs'
|
||||
reload: '&fConfig et BDD ont ete relancer'
|
||||
timeout: '&fVous avez ete expulser, trop lent pour vous enregistrer !'
|
||||
usage_changepassword: '&fCommande /changepassword ancienmdp nouveaumdp'
|
||||
reg_only: '&fSeul les joueurs enregistré sont admis!'
|
||||
logged_in: '&cVous êtes déjà connecté!'
|
||||
logout: '&cVous avez été déconnecté!'
|
||||
same_nick: '&fUne personne ayant ce même pseudo joue deja..'
|
||||
registered: '&cEnregistrement réussi avec succès!'
|
||||
pass_len: '&fVotre mot de passe n''est pas assez long..'
|
||||
reload: '&fConfiguration et BDD relancé avec succès'
|
||||
timeout: '&fVous avez été expulsé car vous êtes trop lent pour vous enregistrer !'
|
||||
usage_changepassword: '&fPour changer de mot de passe, utilisez: /changepassword ancienmdp nouveaumdp'
|
||||
name_len: '&cVotre pseudo est trop long ou trop court'
|
||||
regex: '&cVotre pseudo contient des caracteres interdits! Caracteres Autorises: REG_EX'
|
||||
regex: '&cCaractères autorisés: REG_EX'
|
||||
add_email: '&cMerci d''ajouter votre email : /email add yourEmail confirmEmail'
|
||||
bad_database_email: '[AuthMe] La commande /email est disponible uniquement pour MySQL et SQLite, contactez un Admin'
|
||||
recovery_email: '&cOublie de MotDePasse? Utilisez /email recovery <yourEmail>'
|
||||
usage_captcha: '&cTrop de Mauvais MotDePasse, utilisez: /captcha <leCaptcha>'
|
||||
wrong_captcha: '&cCaptcha Incorrect, entrez de nouveau : /captcha THE_CAPTCHA'
|
||||
valid_captcha: '&cLe Captcha est valide, Merci!'
|
||||
recovery_email: '&cVous avez oublié votre MotdePasse? Utilisez /email recovery <yourEmail>'
|
||||
usage_captcha: '&cTrop de tentatives de connexion échouées, utilisez: /captcha <leCaptcha>'
|
||||
wrong_captcha: '&cCaptcha incorrect, écrivez de nouveau : /captcha THE_CAPTCHA'
|
||||
valid_captcha: '&cLe Captcha est valide, merci!'
|
||||
kick_forvip: '&cUn joueur VIP a rejoint le serveur plein!'
|
||||
kick_fullserver: '&cThe server is actually full, Sorry!'
|
||||
kick_fullserver: '&cLe serveur est actuellement plein, désolé!'
|
||||
|
42
src/main/resources/messages_lt.yml
Normal file
42
src/main/resources/messages_lt.yml
Normal file
@ -0,0 +1,42 @@
|
||||
unknown_user: '&cNaudotojo nera duombazeje'
|
||||
unsafe_spawn: '&6Atsijungimo vieta nesaugi, perkeliame jus i atsiradimo vieta.'
|
||||
not_logged_in: '&cTu neprisijunges!'
|
||||
reg_voluntarily: '&ePrisiregistruokite: /register slaptazodis pakartotiSlaptazodi'
|
||||
usage_log: '&eKomandos panaudojimas: /login slaptazodis'
|
||||
wrong_pwd: '&cNeteisingas slaptazosdis'
|
||||
unregistered: '&aSekmingai issiregistravote!'
|
||||
reg_disabled: '&6Registracija yra isjungta'
|
||||
valid_session: '&aSesijos prisijungimas'
|
||||
login: '&aSekmingai prisijungete'
|
||||
vb_nonActiv: '&aJusu vartotojas nera patvirtintas, patikrinkite el.pasta.'
|
||||
user_regged: '&cVartotojo vardas jau uzregistruotas'
|
||||
usage_reg: '&eNaudojimas: /register slaptazodis pakartotiSlaptazodi'
|
||||
max_reg: '&cJus pasiekete maksimalu registraciju skaiciu.'
|
||||
no_perm: '&cNera leidimo'
|
||||
error: '&cAtsirado klaida, praneskite adminstratoriui.'
|
||||
login_msg: '&ePrasome prisijungti: /login slaptazodis'
|
||||
reg_msg: '&ePrasome prisiregistruoti: /register slaptazodis pakartotiSlaptazodi'
|
||||
usage_unreg: '&ePanaikinti registracija: /unregister slaptazodis"
|
||||
pwd_changed: '&aSlaptazodis pakeistas'
|
||||
user_unknown: '&cVartotojas neprisiregistraves'
|
||||
password_error: '&cSlaptazodziai nesutampa'
|
||||
unvalid_session: '&cSesijos laikai nesutampa, prasome palaukti kol secija baigsis.'
|
||||
reg_only: '&cTik prisiregistravusiem zaidejams: apsilankykite: http://example.com tam kad uzsiregistruoti.'
|
||||
logged_in: '&cTu aju prisijunges!'
|
||||
logout: '&aSekmingai atsijungete'
|
||||
same_nick: '&cKazkas situo vardu jau zaidzia.'
|
||||
registered: '&aSekmingai prisiregistravote.'
|
||||
pass_len: '&cJusu slaptazodis buvo per ilgas arba per trumpas.'
|
||||
reload: '&aNustatymai ir duomenu baze buvo perkrauta.'
|
||||
timeout: '&cNespejote prisijungti'
|
||||
usage_changepassword: '&ePanaudojimas: /changepassword senasSlaptazodis naujasSlaptazodis'
|
||||
name_len: '&cJusu varsdas yra per ilgas arba per trumpas.'
|
||||
regex: '&cJusu varde yra neledziamu simboliu, leidziami: REG_EX'
|
||||
add_email: '&ePrasau pridekite savo el.pasta : /email add Email confirmEmail'
|
||||
bad_database_email: '&c[AuthMe] si /email komanda leidziama tik su MySQL ir SQLite, susisiekite su administratorium'
|
||||
recovery_email: '&cPamirsote slaptazodi? Rasykite: /email recovery el.pastas'
|
||||
usage_captcha: '&cPanaudojimas: /captcha <theCaptcha>'
|
||||
wrong_captcha: '&cNeteisinga Captcha, naudokite : /captcha THE_CAPTCHA'
|
||||
valid_captcha: '&cJusu captcha Teisinga!'
|
||||
kick_forvip: '&cA VIP prisijunge i pilna serveri!'
|
||||
kick_fullserver: '&cServeris yra pilnas, Atsiprasome.'
|
@ -3,7 +3,7 @@ author: darkwarriros,Xephi
|
||||
website: http://www.multiplayer-italia.com/
|
||||
description: AuthMe prevents people, which aren't logged in, from doing stuff like placing blocks, moving, typing commands or seeing the inventory of the current player.
|
||||
main: uk.org.whoami.authme.AuthMe
|
||||
version: 2.7.15b1
|
||||
version: 2.7.16
|
||||
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag]
|
||||
commands:
|
||||
register:
|
||||
|
Loading…
Reference in New Issue
Block a user