mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-31 03:07:34 +02:00
[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:
@ -1,6 +1,7 @@
|
|||||||
package com.github.games647.fastlogin.listener;
|
package com.github.games647.fastlogin.listener;
|
||||||
|
|
||||||
import com.github.games647.fastlogin.FastLogin;
|
import com.github.games647.fastlogin.FastLogin;
|
||||||
|
import com.github.games647.fastlogin.PlayerData;
|
||||||
|
|
||||||
import de.luricos.bukkit.xAuth.xAuth;
|
import de.luricos.bukkit.xAuth.xAuth;
|
||||||
import de.luricos.bukkit.xAuth.xAuthPlayer;
|
import de.luricos.bukkit.xAuth.xAuthPlayer;
|
||||||
@ -29,7 +30,9 @@ public class PlayerListener implements Listener {
|
|||||||
public void onJoin(PlayerJoinEvent joinEvent) {
|
public void onJoin(PlayerJoinEvent joinEvent) {
|
||||||
final Player player = joinEvent.getPlayer();
|
final Player player = joinEvent.getPlayer();
|
||||||
String address = player.getAddress().toString();
|
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, () -> {
|
Bukkit.getScheduler().runTaskLater(plugin, () -> {
|
||||||
doLogin(player);
|
doLogin(player);
|
||||||
}, 1 * 20L);
|
}, 1 * 20L);
|
||||||
|
@ -5,7 +5,7 @@ version: ${project.version}
|
|||||||
main: ${project.groupId}.${project.artifactId}.${project.name}
|
main: ${project.groupId}.${project.artifactId}.${project.name}
|
||||||
|
|
||||||
# meta informations for plugin managers
|
# 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: |
|
description: |
|
||||||
${project.description}
|
${project.description}
|
||||||
website: ${project.url}
|
website: ${project.url}
|
||||||
|
Reference in New Issue
Block a user