commit
f3c2967e83
132
pom.xml
132
pom.xml
@ -2,41 +2,41 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>fr.xephi.authme.AuthMe</groupId>
|
<groupId>fr.xephi.authme.AuthMe</groupId>
|
||||||
<artifactId>AuthMe</artifactId>
|
<artifactId>AuthMe</artifactId>
|
||||||
<version>5.0-SNAPSHOT</version>
|
<version>5.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>AuthMeReloaded</name>
|
<name>AuthMeReloaded</name>
|
||||||
<description>Authentication plugin for CraftBukkit/Spigot!</description>
|
<description>Authentication plugin for CraftBukkit/Spigot!</description>
|
||||||
<url>http://dev.bukkit.org/bukkit-plugins/authme-reloaded/</url>
|
<url>http://dev.bukkit.org/bukkit-plugins/authme-reloaded/</url>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|
||||||
<!-- Change Compiler Version (JDK) HERE! -->
|
<!-- Change Compiler Version (JDK) HERE! -->
|
||||||
<maven.compiler.source>1.7</maven.compiler.source>
|
<maven.compiler.source>1.7</maven.compiler.source>
|
||||||
<maven.compiler.target>1.7</maven.compiler.target>
|
<maven.compiler.target>1.7</maven.compiler.target>
|
||||||
|
|
||||||
<!-- Change MC Version HERE! -->
|
<!-- Change MC Version HERE! -->
|
||||||
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
||||||
|
|
||||||
<mainClass>${project.groupId}.${project.artifactId}</mainClass>
|
<mainClass>${project.groupId}.${project.artifactId}</mainClass>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! -->
|
<!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! -->
|
||||||
<ciManagement>
|
<ciManagement>
|
||||||
<system>jenkins</system>
|
<system>jenkins</system>
|
||||||
<url>http://ci.xephi.fr</url>
|
<url>http://ci.xephi.fr</url>
|
||||||
</ciManagement>
|
</ciManagement>
|
||||||
|
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
<system>GitHub</system>
|
<system>GitHub</system>
|
||||||
<url>https://github.com/Xephi/AuthMeReloaded/issues</url>
|
<url>https://github.com/Xephi/AuthMeReloaded/issues</url>
|
||||||
</issueManagement>
|
</issueManagement>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -48,10 +48,10 @@
|
|||||||
<target>${maven.compiler.target}</target>
|
<target>${maven.compiler.target}</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- <plugin>
|
<plugin>
|
||||||
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
||||||
<artifactId>maven-replacer-plugin</artifactId>
|
<artifactId>replacer</artifactId>
|
||||||
<version>1.4.1</version>
|
<version>1.5.3</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>prepare-package</phase>
|
<phase>prepare-package</phase>
|
||||||
@ -64,12 +64,12 @@
|
|||||||
<file>target/classes/plugin.yml</file>
|
<file>target/classes/plugin.yml</file>
|
||||||
<replacements>
|
<replacements>
|
||||||
<replacement>
|
<replacement>
|
||||||
<token>${version}</token>
|
<token>maven-version</token>
|
||||||
<value>${version}</value>
|
<value>${project.version}</value>
|
||||||
</replacement>
|
</replacement>
|
||||||
</replacements>
|
</replacements>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin> -->
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
@ -81,107 +81,96 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
|
||||||
<!-- SpigotMC Repo (Bukkit and SpigotAPI) -->
|
<!-- SpigotMC Repo (Bukkit and SpigotAPI) -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- Vault Repo -->
|
<!-- Vault Repo (Already in ess repo!) -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>vault-repo</id>
|
<id>vault-repo</id>
|
||||||
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
|
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- Citizens 2.X Repo -->
|
<!-- Citizens 2.X Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>everything</id>
|
<id>citizens-repo</id>
|
||||||
<url>http://repo.citizensnpcs.co</url>
|
<url>http://repo.citizensnpcs.co</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- EssentialsX Repo -->
|
<!-- Essentials Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>ess-repo</id>
|
<id>ess-repo</id>
|
||||||
<url>http://repo.ess3.net/content/groups/public</url>
|
<url>http://repo.ess3.net/content/groups/public</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- CombatTagPlus Repo -->
|
<!-- CombatTagPlus Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>minelink-thirdparty</id>
|
<id>minelink-thirdparty</id>
|
||||||
<url>http://repo.minelink.net/content/repositories/public</url>
|
<url>http://repo.minelink.net/content/repositories/public</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- CombatTag Repo, Unofficial (needs replacement) -->
|
<!-- CombatTag Repo, Unofficial (needs replacement) UPDATE: this server is OFFLINE
|
||||||
<repository>
|
<repository>
|
||||||
<id>techcable-repo</id>
|
<id>techcable-repo</id>
|
||||||
<url>http://repo.techcable.net/content/repositories/snapshots/</url>
|
<url>http://repo.techcable.net/content/repositories/snapshots/</url>
|
||||||
</repository>
|
</repository> -->
|
||||||
|
|
||||||
<!-- XAuth Repo -->
|
<!-- XAuth Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>bukkit-plugins-releases</id>
|
<id>luricos-releases</id>
|
||||||
<name>repo.luricos.de releases</name>
|
|
||||||
<url>http://repo.luricos.de/content/repositories/releases/</url>
|
<url>http://repo.luricos.de/content/repositories/releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- SpoutCraft Repo -->
|
<!-- SpoutCraft Repo -->
|
||||||
<repository>
|
|
||||||
<id>sonatype-nexus-releases</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/releases</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>sonatype-nexus-snapshots</id>
|
<id>sonatype-nexus-snapshots</id>
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||||
<!-- <snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
<updatePolicy>always</updatePolicy>
|
|
||||||
</snapshots> -->
|
|
||||||
</repository>
|
</repository>
|
||||||
<!-- End of Spout Repo -->
|
|
||||||
|
|
||||||
<!-- Attribute Repo -->
|
<!-- Attribute Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>comphenix-snapshots</id>
|
<id>comphenix-snapshots</id>
|
||||||
<name>Comphenix Maven Snapshots</name>
|
|
||||||
<url>http://repo.comphenix.net/content/repositories/snapshots/</url>
|
<url>http://repo.comphenix.net/content/repositories/snapshots/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- Multiverse Repo -->
|
<!-- Multiverse Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>onarandombox</id>
|
<id>onarandombox</id>
|
||||||
<url>http://repo.onarandombox.com/content/groups/public</url>
|
<url>http://repo.onarandombox.com/content/groups/public</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- Maven Dependencies -->
|
<!-- Maven Dependencies -->
|
||||||
|
|
||||||
<!-- MySql Library -->
|
<!-- MySql Library -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>5.1.35</version>
|
<version>5.1.35</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SQLite Library -->
|
<!-- SQLite Library -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xerial</groupId>
|
<groupId>org.xerial</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
<version>3.8.10.1</version>
|
<version>3.8.10.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Database Library -->
|
<!-- Database Library -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>1.4.187</version>
|
<version>1.4.187</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java Email API -->
|
<!-- Java Email API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.mail</groupId>
|
<groupId>com.sun.mail</groupId>
|
||||||
@ -193,14 +182,14 @@
|
|||||||
<artifactId>mail</artifactId>
|
<artifactId>mail</artifactId>
|
||||||
<version>1.5.0-b01</version>
|
<version>1.5.0-b01</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Maxmind GeoIp API -->
|
<!-- Maxmind GeoIp API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.maxmind.geoip</groupId>
|
<groupId>com.maxmind.geoip</groupId>
|
||||||
<artifactId>geoip-api</artifactId>
|
<artifactId>geoip-api</artifactId>
|
||||||
<version>1.2.14</version>
|
<version>1.2.14</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project,
|
<!-- Spigot-Api, http://www.spigotmc.org/ Based on the Bukkit project,
|
||||||
http://bukkit.org/ -->
|
http://bukkit.org/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -208,7 +197,8 @@
|
|||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>${bukkitVersion}</version>
|
<version>${bukkitVersion}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Attribute -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.attribute</groupId>
|
<groupId>com.comphenix.attribute</groupId>
|
||||||
<artifactId>AttributeStorage</artifactId>
|
<artifactId>AttributeStorage</artifactId>
|
||||||
@ -224,12 +214,12 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Vault, http://dev.bukkit.org/bukkit-plugins/vault/ -->
|
<!-- Vault, http://dev.bukkit.org/bukkit-plugins/vault/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<artifactId>Vault</artifactId>
|
<artifactId>VaultAPI</artifactId>
|
||||||
<version>1.5.4</version>
|
<version>1.5</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -241,7 +231,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Citizens 2.X, NPC plugin, http://dev.bukkit.org/bukkit-plugins/citizens/ -->
|
<!-- Citizens 2.X, NPC plugin, http://dev.bukkit.org/bukkit-plugins/citizens/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.citizensnpcs</groupId>
|
<groupId>net.citizensnpcs</groupId>
|
||||||
@ -258,7 +248,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Multi World plugin, http://www.spigotmc.org/resources/multiverse-core.390/ -->
|
<!-- Multi World plugin, http://www.spigotmc.org/resources/multiverse-core.390/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.onarandombox.multiversecore</groupId>
|
<groupId>com.onarandombox.multiversecore</groupId>
|
||||||
@ -277,7 +267,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Essentials plugin -->
|
<!-- Essentials plugin -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.ess3</groupId>
|
<groupId>net.ess3</groupId>
|
||||||
@ -294,7 +284,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Anti PvPLogging plugin, https://github.com/MinelinkNetwork/CombatTagPlus -->
|
<!-- Anti PvPLogging plugin, https://github.com/MinelinkNetwork/CombatTagPlus -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.minelink</groupId>
|
<groupId>net.minelink</groupId>
|
||||||
@ -311,12 +301,12 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Anti PvPLogging plugin, http://www.spigotmc.org/resources/combat-tag.3182/ -->
|
<!-- Anti PvPLogging plugin, http://www.spigotmc.org/resources/combat-tag.3182/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.trc202</groupId>
|
<groupId>com.trc202</groupId>
|
||||||
<artifactId>combattag</artifactId>
|
<artifactId>CombatTag</artifactId>
|
||||||
<version>6.4.1-SNAPSHOT</version>
|
<version>6.2.1-SNAPSHOT</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
@ -328,7 +318,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- XAuth, another authentication plugin, required by the database converter -->
|
<!-- XAuth, another authentication plugin, required by the database converter -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.luricos.bukkit</groupId>
|
<groupId>de.luricos.bukkit</groupId>
|
||||||
@ -345,7 +335,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Spout API, https://spoutcraft.org/downloads/ -->
|
<!-- Spout API, https://spoutcraft.org/downloads/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spoutcraft</groupId>
|
<groupId>org.spoutcraft</groupId>
|
||||||
@ -362,7 +352,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Local Dependencies -->
|
<!-- Local Dependencies -->
|
||||||
|
|
||||||
<!-- It doesn't have a Maven Repo, http://dev.bukkit.org/bukkit-plugins/chestshop/ -->
|
<!-- It doesn't have a Maven Repo, http://dev.bukkit.org/bukkit-plugins/chestshop/ -->
|
||||||
@ -383,7 +373,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Citizens 1.X (No API) -->
|
<!-- Citizens 1.X (No API) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.citizensnpcs</groupId>
|
<groupId>net.citizensnpcs</groupId>
|
||||||
@ -392,7 +382,7 @@
|
|||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/libs/Citizens.jar</systemPath>
|
<systemPath>${project.basedir}/libs/Citizens.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Old version of xAuth by Cypherx -->
|
<!-- Old version of xAuth by Cypherx -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cypherx</groupId>
|
<groupId>com.cypherx</groupId>
|
||||||
@ -401,7 +391,7 @@
|
|||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/libs/xAuth.jar</systemPath>
|
<systemPath>${project.basedir}/libs/xAuth.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- A SpoutApi Plugin, http://dev.bukkit.org/bukkit-plugins/notifications/ -->
|
<!-- A SpoutApi Plugin, http://dev.bukkit.org/bukkit-plugins/notifications/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.muizers</groupId>
|
<groupId>me.muizers</groupId>
|
||||||
@ -410,6 +400,6 @@
|
|||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/libs/Notifications.jar</systemPath>
|
<systemPath>${project.basedir}/libs/Notifications.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -4,12 +4,16 @@ import java.io.UnsupportedEncodingException;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.mail.BodyPart;
|
||||||
import javax.mail.Message;
|
import javax.mail.Message;
|
||||||
import javax.mail.PasswordAuthentication;
|
import javax.mail.MessagingException;
|
||||||
|
import javax.mail.Multipart;
|
||||||
import javax.mail.Session;
|
import javax.mail.Session;
|
||||||
import javax.mail.Transport;
|
import javax.mail.Transport;
|
||||||
import javax.mail.internet.InternetAddress;
|
import javax.mail.internet.InternetAddress;
|
||||||
|
import javax.mail.internet.MimeBodyPart;
|
||||||
import javax.mail.internet.MimeMessage;
|
import javax.mail.internet.MimeMessage;
|
||||||
|
import javax.mail.internet.MimeMultipart;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
@ -37,20 +41,16 @@ public class SendMailSSL {
|
|||||||
sendername = Settings.getmailSenderName;
|
sendername = Settings.getmailSenderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String port = String.valueOf(Settings.getMailPort);
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.put("mail.smtp.host", Settings.getmailSMTP);
|
props.put("mail.smtp.host", Settings.getmailSMTP);
|
||||||
props.put("mail.smtp.socketFactory.port", String.valueOf(Settings.getMailPort));
|
|
||||||
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
|
|
||||||
props.put("mail.smtp.auth", "true");
|
props.put("mail.smtp.auth", "true");
|
||||||
props.put("mail.smtp.port", String.valueOf(Settings.getMailPort));
|
props.put("mail.smtp.port", port);
|
||||||
|
props.put("mail.smtp.starttls.enable", true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
|
Session session = Session.getInstance(props, null);
|
||||||
|
|
||||||
protected PasswordAuthentication getPasswordAuthentication() {
|
|
||||||
return new PasswordAuthentication(Settings.getmailAccount, Settings.getmailPassword);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
final Message message = new MimeMessage(session);
|
final Message message = new MimeMessage(session);
|
||||||
try {
|
try {
|
||||||
message.setFrom(new InternetAddress(Settings.getmailAccount, sendername));
|
message.setFrom(new InternetAddress(Settings.getmailAccount, sendername));
|
||||||
@ -60,26 +60,34 @@ public class SendMailSSL {
|
|||||||
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(auth.getEmail()));
|
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(auth.getEmail()));
|
||||||
message.setSubject(Settings.getMailSubject);
|
message.setSubject(Settings.getMailSubject);
|
||||||
message.setSentDate(new Date());
|
message.setSentDate(new Date());
|
||||||
|
BodyPart messageBodyPart = new MimeBodyPart();
|
||||||
String text = Settings.getMailText;
|
String text = Settings.getMailText;
|
||||||
text = text.replace("<playername>", auth.getNickname());
|
messageBodyPart.setText(text);
|
||||||
text = text.replace("<servername>", plugin.getServer().getServerName());
|
|
||||||
text = text.replace("<generatedpass>", newPass);
|
Multipart multipart = new MimeMultipart();
|
||||||
message.setContent(text, "text/html");
|
|
||||||
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
|
||||||
|
messageBodyPart = new MimeBodyPart();
|
||||||
|
|
||||||
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
message.setContent(multipart);
|
||||||
|
final Transport transport = session.getTransport("smtp");
|
||||||
|
transport.connect(Settings.getmailSMTP, Settings.getmailAccount, Settings.getmailPassword);
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Transport.send(message);
|
transport.sendMessage(message, message.getAllRecipients());
|
||||||
} catch (Exception e) {
|
} catch (MessagingException e) {
|
||||||
ConsoleLogger.showError("Some error appears while trying to send mail to " + auth.getEmail());
|
System.out.println("Some error occured while trying to send a mail to " + auth.getEmail());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
if (!Settings.noConsoleSpam)
|
|
||||||
ConsoleLogger.info("Email sent to : " + auth.getNickname());
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ConsoleLogger.showError("Some error appears while trying to send mail to " + auth.getEmail());
|
System.out.println("Some error occured while trying to send a mail to " + auth.getEmail());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package fr.xephi.authme.cache.limbo;
|
package fr.xephi.authme.cache.limbo;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -83,6 +84,10 @@ public class LimboPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setTimeoutTaskId(BukkitTask i) {
|
public void setTimeoutTaskId(BukkitTask i) {
|
||||||
|
if (this.timeoutTaskId != null) {
|
||||||
|
if (Bukkit.getScheduler().isCurrentlyRunning(this.timeoutTaskId.getTaskId()) || Bukkit.getScheduler().isQueued(this.timeoutTaskId.getTaskId()))
|
||||||
|
Bukkit.getScheduler().cancelTask(this.timeoutTaskId.getTaskId());
|
||||||
|
}
|
||||||
this.timeoutTaskId = i;
|
this.timeoutTaskId = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +96,10 @@ public class LimboPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMessageTaskId(BukkitTask messageTaskId) {
|
public void setMessageTaskId(BukkitTask messageTaskId) {
|
||||||
|
if (this.messageTaskId != null) {
|
||||||
|
if (Bukkit.getScheduler().isCurrentlyRunning(this.messageTaskId.getTaskId()) || Bukkit.getScheduler().isQueued(this.messageTaskId.getTaskId()))
|
||||||
|
Bukkit.getScheduler().cancelTask(this.messageTaskId.getTaskId());
|
||||||
|
}
|
||||||
this.messageTaskId = messageTaskId;
|
this.messageTaskId = messageTaskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -268,7 +268,8 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("register") || args[0].equalsIgnoreCase("reg")) {
|
} else
|
||||||
|
if (args[0].equalsIgnoreCase("register") || args[0].equalsIgnoreCase("reg")) {
|
||||||
if (args.length != 3) {
|
if (args.length != 3) {
|
||||||
sender.sendMessage("Usage: /authme register playername password");
|
sender.sendMessage("Usage: /authme register playername password");
|
||||||
return true;
|
return true;
|
||||||
@ -394,7 +395,8 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
ConsoleLogger.showError(ex.getMessage());
|
ConsoleLogger.showError(ex.getMessage());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (args[0].equalsIgnoreCase("changepassword") || args[0].equalsIgnoreCase("cp")) {
|
} else
|
||||||
|
if (args[0].equalsIgnoreCase("changepassword") || args[0].equalsIgnoreCase("cp")) {
|
||||||
if (args.length != 3) {
|
if (args.length != 3) {
|
||||||
sender.sendMessage("Usage: /authme changepassword playername newpassword");
|
sender.sendMessage("Usage: /authme changepassword playername newpassword");
|
||||||
return true;
|
return true;
|
||||||
@ -460,10 +462,10 @@ public class AdminCommand implements CommandExecutor {
|
|||||||
int interval = Settings.getWarnMessageInterval;
|
int interval = Settings.getWarnMessageInterval;
|
||||||
BukkitScheduler sched = sender.getServer().getScheduler();
|
BukkitScheduler sched = sender.getServer().getScheduler();
|
||||||
if (delay != 0) {
|
if (delay != 0) {
|
||||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name), delay);
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||||
}
|
}
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTask(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||||
if (Settings.applyBlindEffect)
|
if (Settings.applyBlindEffect)
|
||||||
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||||
m.send(target, "unregistered");
|
m.send(target, "unregistered");
|
||||||
|
|||||||
@ -2,8 +2,6 @@ package fr.xephi.authme.commands;
|
|||||||
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -29,6 +27,7 @@ import fr.xephi.authme.settings.Messages;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
|
import me.muizers.Notifications.Notification;
|
||||||
|
|
||||||
public class UnregisterCommand implements CommandExecutor {
|
public class UnregisterCommand implements CommandExecutor {
|
||||||
|
|
||||||
@ -93,10 +92,10 @@ public class UnregisterCommand implements CommandExecutor {
|
|||||||
int interval = Settings.getWarnMessageInterval;
|
int interval = Settings.getWarnMessageInterval;
|
||||||
BukkitScheduler sched = sender.getServer().getScheduler();
|
BukkitScheduler sched = sender.getServer().getScheduler();
|
||||||
if (delay != 0) {
|
if (delay != 0) {
|
||||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name), delay);
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||||
}
|
}
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTask(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||||
m.send(player, "unregistered");
|
m.send(player, "unregistered");
|
||||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||||
if (plugin.notifications != null) {
|
if (plugin.notifications != null) {
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -86,7 +85,6 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
String msg = event.getMessage();
|
String msg = event.getMessage();
|
||||||
// WorldEdit GUI Shit
|
|
||||||
if (msg.equalsIgnoreCase("/worldedit cui"))
|
if (msg.equalsIgnoreCase("/worldedit cui"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -403,7 +401,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPlayerLogin(PlayerLoginEvent event) {
|
public void onPlayerLogin(PlayerLoginEvent event) {
|
||||||
Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
final String name = player.getName().toLowerCase();
|
final String name = player.getName().toLowerCase();
|
||||||
@ -447,18 +445,31 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
if (Settings.isSessionsEnabled)
|
if (Settings.isSessionsEnabled)
|
||||||
if (PlayerCache.getInstance().isAuthenticated(name))
|
if (PlayerCache.getInstance().isAuthenticated(name))
|
||||||
if (!Settings.sessionExpireOnIpChange)
|
if (!Settings.sessionExpireOnIpChange)
|
||||||
LimboCache.getInstance().deleteLimboPlayer(name);
|
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
|
// Check if forceSingleSession is set to true, so kick player that has
|
||||||
// joined with same nick of online player
|
// joined with same nick of online player
|
||||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
|
|
||||||
event.setKickMessage(m.send("same_nick")[0]);
|
event.setKickMessage(m.send("same_nick")[0]);
|
||||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||||
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
utils.addNormal(player, limbo.getGroup());
|
|
||||||
LimboCache.getInstance().deleteLimboPlayer(player.getName().toLowerCase());
|
@Override
|
||||||
}
|
public void run() {
|
||||||
|
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
|
||||||
|
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
||||||
|
Utils.getInstance().addNormal(player, limbo.getGroup());
|
||||||
|
LimboCache.getInstance().deleteLimboPlayer(player.getName().toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,27 +580,6 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void placePlayerSafely(Player player, Location spawnLoc) {
|
|
||||||
if (!Settings.noTeleport)
|
|
||||||
return;
|
|
||||||
if (Settings.isTeleportToSpawnEnabled || (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())))
|
|
||||||
return;
|
|
||||||
Block b = player.getLocation().getBlock();
|
|
||||||
if (b.getType() == Material.PORTAL || b.getType() == Material.ENDER_PORTAL || b.getType() == Material.LAVA || b.getType() == Material.STATIONARY_LAVA) {
|
|
||||||
m.send(player, "unsafe_spawn");
|
|
||||||
if (spawnLoc.getWorld() != null)
|
|
||||||
player.teleport(spawnLoc);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Block c = player.getLocation().add(0D, 1D, 0D).getBlock();
|
|
||||||
if (c.getType() == Material.PORTAL || c.getType() == Material.ENDER_PORTAL || c.getType() == Material.LAVA || c.getType() == Material.STATIONARY_LAVA) {
|
|
||||||
m.send(player, "unsafe_spawn");
|
|
||||||
if (spawnLoc.getWorld() != null)
|
|
||||||
player.teleport(spawnLoc);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
if (event.getPlayer() == null) {
|
if (event.getPlayer() == null) {
|
||||||
@ -616,7 +606,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if ((Settings.isForceSingleSessionEnabled) && (event.getReason().contains("You logged in from another location"))) {
|
if ((!Settings.isForceSingleSessionEnabled) && (event.getReason().contains(m.getString("same_nick")))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -272,7 +272,7 @@ public class AsyncronousJoin {
|
|||||||
int time = Settings.getRegistrationTimeout * 20;
|
int time = Settings.getRegistrationTimeout * 20;
|
||||||
int msgInterval = Settings.getWarnMessageInterval;
|
int msgInterval = Settings.getWarnMessageInterval;
|
||||||
if (time != 0) {
|
if (time != 0) {
|
||||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), time);
|
BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name), time);
|
||||||
if (!LimboCache.getInstance().hasLimboPlayer(name))
|
if (!LimboCache.getInstance().hasLimboPlayer(name))
|
||||||
LimboCache.getInstance().addLimboPlayer(player);
|
LimboCache.getInstance().addLimboPlayer(player);
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||||
@ -302,11 +302,12 @@ public class AsyncronousJoin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, msg, msgInterval));
|
BukkitTask msgT = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval));
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void placePlayerSafely(final Player player, final Location spawnLoc) {
|
private void placePlayerSafely(final Player player,
|
||||||
|
final Location spawnLoc) {
|
||||||
Location loc = null;
|
Location loc = null;
|
||||||
if (spawnLoc == null)
|
if (spawnLoc == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -3,8 +3,6 @@ package fr.xephi.authme.process.login;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
@ -21,6 +19,7 @@ import fr.xephi.authme.security.RandomString;
|
|||||||
import fr.xephi.authme.settings.Messages;
|
import fr.xephi.authme.settings.Messages;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
|
import me.muizers.Notifications.Notification;
|
||||||
|
|
||||||
public class AsyncronousLogin {
|
public class AsyncronousLogin {
|
||||||
|
|
||||||
@ -64,7 +63,8 @@ public class AsyncronousLogin {
|
|||||||
player.sendMessage(s.replace("THE_CAPTCHA", plugin.cap.get(name)).replace("<theCaptcha>", plugin.cap.get(name)));
|
player.sendMessage(s.replace("THE_CAPTCHA", plugin.cap.get(name)).replace("<theCaptcha>", plugin.cap.get(name)));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) {
|
} else
|
||||||
|
if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) {
|
||||||
try {
|
try {
|
||||||
plugin.captcha.remove(name);
|
plugin.captcha.remove(name);
|
||||||
plugin.cap.remove(name);
|
plugin.cap.remove(name);
|
||||||
@ -87,14 +87,14 @@ public class AsyncronousLogin {
|
|||||||
if (!database.isAuthAvailable(name)) {
|
if (!database.isAuthAvailable(name)) {
|
||||||
m.send(player, "user_unknown");
|
m.send(player, "user_unknown");
|
||||||
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
||||||
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
||||||
String[] msg;
|
String[] msg;
|
||||||
if (Settings.emailRegistration) {
|
if (Settings.emailRegistration) {
|
||||||
msg = m.send("reg_email_msg");
|
msg = m.send("reg_email_msg");
|
||||||
} else {
|
} else {
|
||||||
msg = m.send("reg_msg");
|
msg = m.send("reg_msg");
|
||||||
}
|
}
|
||||||
BukkitTask msgT = Bukkit.getScheduler().runTask(plugin, new MessageTask(plugin, name, msg, Settings.getWarnMessageInterval));
|
BukkitTask msgT = Bukkit.getScheduler().runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, Settings.getWarnMessageInterval));
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
package fr.xephi.authme.process.logout;
|
package fr.xephi.authme.process.logout;
|
||||||
|
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
@ -17,6 +15,7 @@ import fr.xephi.authme.settings.Messages;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
|
import me.muizers.Notifications.Notification;
|
||||||
|
|
||||||
public class ProcessSyncronousPlayerLogout implements Runnable {
|
public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||||
|
|
||||||
@ -37,10 +36,10 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
|||||||
int interval = Settings.getWarnMessageInterval;
|
int interval = Settings.getWarnMessageInterval;
|
||||||
BukkitScheduler sched = player.getServer().getScheduler();
|
BukkitScheduler sched = player.getServer().getScheduler();
|
||||||
if (delay != 0) {
|
if (delay != 0) {
|
||||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name), delay);
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||||
}
|
}
|
||||||
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, m.send("login_msg"), interval));
|
BukkitTask msgT = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), interval));
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||||
try {
|
try {
|
||||||
if (player.isInsideVehicle())
|
if (player.isInsideVehicle())
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
package fr.xephi.authme.process.register;
|
package fr.xephi.authme.process.register;
|
||||||
|
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
@ -14,6 +12,7 @@ import fr.xephi.authme.settings.Messages;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
|
import me.muizers.Notifications.Notification;
|
||||||
|
|
||||||
public class ProcessSyncronousEmailRegister implements Runnable {
|
public class ProcessSyncronousEmailRegister implements Runnable {
|
||||||
|
|
||||||
@ -37,13 +36,13 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
|||||||
int time = Settings.getRegistrationTimeout * 20;
|
int time = Settings.getRegistrationTimeout * 20;
|
||||||
int msgInterval = Settings.getWarnMessageInterval;
|
int msgInterval = Settings.getWarnMessageInterval;
|
||||||
if (time != 0) {
|
if (time != 0) {
|
||||||
LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel();
|
LimboCache.getInstance().getLimboPlayer(name).getTimeoutTaskId().cancel();
|
||||||
BukkitTask id = Bukkit.getScheduler().runTaskLater(plugin, new TimeoutTask(plugin, name), time);
|
BukkitTask id = Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name), time);
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
||||||
BukkitTask nwMsg = Bukkit.getScheduler().runTask(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));
|
BukkitTask nwMsg = Bukkit.getScheduler().runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
|
||||||
player.saveData();
|
player.saveData();
|
||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
package fr.xephi.authme.process.register;
|
package fr.xephi.authme.process.register;
|
||||||
|
|
||||||
import me.muizers.Notifications.Notification;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -22,6 +20,7 @@ import fr.xephi.authme.settings.Messages;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
|
import me.muizers.Notifications.Notification;
|
||||||
|
|
||||||
public class ProcessSyncronousPasswordRegister implements Runnable {
|
public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||||
|
|
||||||
@ -67,10 +66,10 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
|||||||
int interval = Settings.getWarnMessageInterval;
|
int interval = Settings.getWarnMessageInterval;
|
||||||
BukkitScheduler sched = plugin.getServer().getScheduler();
|
BukkitScheduler sched = plugin.getServer().getScheduler();
|
||||||
if (delay != 0) {
|
if (delay != 0) {
|
||||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
BukkitTask id = sched.runTaskLaterAsynchronously(plugin, new TimeoutTask(plugin, name), delay);
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||||
}
|
}
|
||||||
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, m.send("login_msg"), interval));
|
BukkitTask msgT = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), interval));
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||||
try {
|
try {
|
||||||
plugin.pllog.removePlayer(name);
|
plugin.pllog.removePlayer(name);
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package fr.xephi.authme.task;
|
package fr.xephi.authme.task;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
@ -33,11 +32,11 @@ public class MessageTask implements Runnable {
|
|||||||
for (String ms : msg) {
|
for (String ms : msg) {
|
||||||
player.sendMessage(ms);
|
player.sendMessage(ms);
|
||||||
}
|
}
|
||||||
BukkitScheduler sched = plugin.getServer().getScheduler();
|
BukkitTask late = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, this, interval * 20);
|
||||||
BukkitTask late = sched.runTaskLater(plugin, this, interval * 20);
|
|
||||||
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(late);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(late);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package fr.xephi.authme.task;
|
package fr.xephi.authme.task;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ public class TimeoutTask implements Runnable {
|
|||||||
if (PlayerCache.getInstance().isAuthenticated(name))
|
if (PlayerCache.getInstance().isAuthenticated(name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
for (final Player player : plugin.getServer().getOnlinePlayers()) {
|
||||||
if (player.getName().toLowerCase().equals(name)) {
|
if (player.getName().toLowerCase().equals(name)) {
|
||||||
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
||||||
LimboPlayer inv = LimboCache.getInstance().getLimboPlayer(name);
|
LimboPlayer inv = LimboCache.getInstance().getLimboPlayer(name);
|
||||||
@ -44,14 +45,27 @@ public class TimeoutTask implements Runnable {
|
|||||||
playerCache.removeCache(player);
|
playerCache.removeCache(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameMode gm = AuthMePlayerListener.gameMode.get(name);
|
final GameMode gm = AuthMePlayerListener.gameMode.get(name);
|
||||||
if (gm != null)
|
if (gm != null) {
|
||||||
{
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
player.setGameMode(gm);
|
|
||||||
ConsoleLogger.info("Set " + player.getName() + " to gamemode: " + gm.name());
|
@Override
|
||||||
|
public void run() {
|
||||||
|
player.setGameMode(gm);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
ConsoleLogger.info("Set " + player.getName() + " to gamemode: " + gm.name());
|
||||||
}
|
}
|
||||||
player.kickPlayer(m.send("timeout")[0]);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
break;
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (player.isOnline())
|
||||||
|
player.kickPlayer(m.send("timeout")[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ author: Xephi59
|
|||||||
website: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/
|
website: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/
|
||||||
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.
|
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: fr.xephi.authme.AuthMe
|
main: fr.xephi.authme.AuthMe
|
||||||
version: 5.0-SNAPSHOT
|
version: maven-version
|
||||||
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag, Essentials, EssentialsSpawn]
|
softdepend: [Vault, ChestShop, Spout, Multiverse-Core, Notifications, Citizens, CombatTag, Essentials, EssentialsSpawn]
|
||||||
commands:
|
commands:
|
||||||
register:
|
register:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user