Logged in from another location

Discussion in 'Bukkit Discussion' started by bergerkiller, Jul 18, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    bergerkiller

    I just noticed that when you join an offline server twice with the same account (name), the already logged-in user gets kicked. What is up with this??? It does not make sense to kick the player that was already on the server to let someone new with the same name in. I am currently writing a (desperate?) plugin which handles the login event to kick the player that tries to log in, but obviously not everyone can write plugins like that. I believe this is a bug which should be fixed soon, before annoying people start "kicking" players on servers by joining the server with their name.

    EDIT

    Temporary fix I use:
    Code:
        @Override
        public void onPlayerKick(PlayerKickEvent event) {
            if (event.getReason() == "Logged in from another location.") {
                event.setCancelled(true);
            }
        }
    
        @Override
        public void onPlayerLogin(PlayerLoginEvent event) {
            for (Player p : plugin.getServer().getOnlinePlayers()) {
                if (p != event.getPlayer() && p.getName().equalsIgnoreCase(event.getPlayer().getName())) {
                    event.setResult(Result.KICK_OTHER);
                    event.setKickMessage("Another player with your name is already on this server!");
                    break;
                }
            }
        }
     
  2. Offline

    Drakia

    The Bukkit team does not fully endorse offline servers, this is how it is coded by Mojang, and they will most likely not be changing this behaviour. If you want your server to be secured against users doing actions such as this, run in online mode and don't support piracy.
     
  3. Offline

    bergerkiller

    Expected reply, although you are completely right. :)
    I still find this behaviour kind of odd, even for a legit online server.
     
  4. Offline

    Drakia

    It's standard behaviour in most online games, actually. And if your server were set to online mode, this wouldn't happen, because you can't just randomly change your username when signed in.
     
  5. Offline

    bergerkiller

    You can log in with the same account on a different computer, but not sure if this is possible through the webserver.
     
  6. Offline

    Paah

    I think xAuth blocks this.
     
  7. Offline

    Jeronimo654

    can someone please write a simple plugin or a tutorial to fix this problem.
     
  8. Offline

    Sk1zZo

    Yea, can you make a plugin with this?
     
Thread Status:
Not open for further replies.

Share This Page