From 12bf653bbc4495ed6cd0933c0b47316ca07adbdc Mon Sep 17 00:00:00 2001 From: Sil3nt_One Date: Fri, 18 Jan 2013 16:54:36 +0530 Subject: [PATCH] Prevent users from connecting many times under some circumstances. --- src/main/java/net/md_5/bungee/InitialHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/net/md_5/bungee/InitialHandler.java b/src/main/java/net/md_5/bungee/InitialHandler.java index 28872d341..d27d4c7d1 100644 --- a/src/main/java/net/md_5/bungee/InitialHandler.java +++ b/src/main/java/net/md_5/bungee/InitialHandler.java @@ -59,6 +59,12 @@ public class InitialHandler implements Runnable throw new KickException("Not authenticated with minecraft.net"); } + // Check for multiple connections + if (BungeeCord.instance.connections.containsKey(handshake.username)) + { + throw new KickException("You are already connected to the server"); + } + // fire post auth event BungeeCord.instance.pluginManager.onLogin(event); if (event.isCancelled())