Fixed BungeeCord force logins if there is a lobby server

This commit is contained in:
games647
2016-06-11 13:24:35 +02:00
parent 9fc7e0bf43
commit 413a0325f8
8 changed files with 17 additions and 12 deletions

View File

@ -1,3 +1,7 @@
######1.5.2
* Fixed BungeeCord force logins if there is a lobby server
######1.5.1
* Fixed BungeeCord support by correctly saving the proxy ids

View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -17,12 +17,6 @@
<name>FastLoginBungee</name>
<repositories>
<!--Waterfall-->
<!-- <repository>
<id>ellune-releases</id>
<url>https://repo.ellune.net/content/repositories/snapshots/</url>
</repository>-->
<!--BungeeCord with also the part outside the API-->
<repository>
<id>RYRED-REPO</id>

View File

@ -14,6 +14,7 @@ import java.util.logging.Level;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.event.PreLoginEvent;
import net.md_5.bungee.api.event.ServerConnectedEvent;
@ -88,4 +89,10 @@ public class PlayerConnectionListener implements Listener {
ForceLoginTask loginTask = new ForceLoginTask(plugin, player, serverConnectedEvent.getServer());
ProxyServer.getInstance().getScheduler().runAsync(plugin, loginTask);
}
@EventHandler
public void onServerConnected(PlayerDisconnectEvent disconnectEvent) {
ProxiedPlayer player = disconnectEvent.getPlayer();
plugin.getSession().remove(player.getPendingConnection());
}
}

View File

@ -28,7 +28,7 @@ public class ForceLoginTask implements Runnable {
@Override
public void run() {
PendingConnection pendingConnection = player.getPendingConnection();
LoginSession session = plugin.getSession().remove(pendingConnection);
LoginSession session = plugin.getSession().get(pendingConnection);
PlayerProfile playerProfile = session.getProfile();
//force login only on success

View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -8,7 +8,7 @@
<packaging>pom</packaging>
<name>FastLogin</name>
<version>1.5.1</version>
<version>1.5.2</version>
<inceptionYear>2015</inceptionYear>
<url>https://www.spigotmc.org/resources/fastlogin.14153/</url>
<description>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<relativePath>../pom.xml</relativePath>
</parent>