Protection against "Logged in from another location" messages

Discussion in 'Archived: Plugin Requests' started by Krazy, Apr 18, 2012.

  1. Offline

    Krazy

    maybe this code compiled in plugin.jar fix this POBLEM :)

    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;
                }
            }
        }
     
    TheRealZuriki likes this.
  2. Offline

    Jeronimo654

    can someone please make a plugin which kicks the new player not the one who is already playing ;)
     
  3. Offline

    Krazy

    BUMP
     
  4. Offline

    Krazy

    bump
     
  5. Offline

    Zaros

    Bumping is against the rules. If someone cares to work on this, they will post.
     
  6. Offline

    TheRealZuriki

    Thank you for the code in the OP. I used some of it in my plugin to fix an issue I was having. The simplest solution is probably the correct one, this is something I should remember for the future!
     
  7. Offline

    Iron_Crystal

    Where does it say bumping is against the rules? People do it all the time
     
  8. Offline

    Blackbirddddd

    Can I please have a jar edition of this?
     
  9. Offline

    Hoolean Retired Staff

    1. This thread was last active 6 months ago
    2. Just do Online-Mode: true
    3. Looking at the code, at least half of it doesn't work
     
  10. Offline

    Codex Arcanum

    Nope. Bumping is not disallowed, as evidenced by this. One bump after 3 days of inactivity is far from unreasonable.
     
  11. Offline

    Hoolean Retired Staff

    Did you even read my post? The person posted in april!
     
  12. Offline

    Codex Arcanum

    Well, honestly, no. I was skimming around the forums and saw someone say something incorrect. I neglected to check the date, replied, and moved on because I had lost interest in the thread. Still, that was dumb, my bad.
     
  13. Offline

    Hoolean Retired Staff

    That's OK then ;D
     

Share This Page