[Security] Fix offline player could login as premium if they logged in using the same address (ip and port) as a previous premium player and under a delay of 2 Minutes.

This commit is contained in:
games647
2015-09-05 09:58:15 +02:00
parent 800f077be0
commit 7e2057a7a2
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package com.github.games647.fastlogin.listener;
import com.github.games647.fastlogin.FastLogin;
import com.github.games647.fastlogin.PlayerData;
import de.luricos.bukkit.xAuth.xAuth;
import de.luricos.bukkit.xAuth.xAuthPlayer;
@ -29,7 +30,9 @@ public class PlayerListener implements Listener {
public void onJoin(PlayerJoinEvent joinEvent) {
final Player player = joinEvent.getPlayer();
String address = player.getAddress().toString();
if (plugin.getSession().asMap().containsKey(address)) {
PlayerData session = plugin.getSession().asMap().get(address);
if (session != null && session.getUsername().equals(player.getName())) {
Bukkit.getScheduler().runTaskLater(plugin, () -> {
doLogin(player);
}, 1 * 20L);

View File

@ -5,7 +5,7 @@ version: ${project.version}
main: ${project.groupId}.${project.artifactId}.${project.name}
# meta informations for plugin managers
authors: [Xeroun, games647, 'https://github.com/games647/FastLogin/graphs/contributors']
authors: [games647, 'https://github.com/games647/FastLogin/graphs/contributors']
description: |
${project.description}
website: ${project.url}