Reloading a Player/Entity

Discussion in 'Plugin Development' started by CypherX, Mar 27, 2012.

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

    CypherX

    When a player connects to the server and a player with the same name is already connected, the Player object used by the server is replaced with the newly connecting players. Normally this is fine since the first player would be kicked with the "You have logged in from another location" message, but if the second player is prevented from joining during the onPlayerLogin phase for any reason, including a 'reverse single session' feature, the first player's object used by the server remains overwritten by the second players which can cause all sorts of issues.

    Now, as the title states, is there any way to reload a player to restore their server reference?
     
  2. Offline

    Njol

    Can't you use PlayerPreLoginEvent? The player entity has not been created when this event is called.
     
  3. Offline

    CypherX

    PlayerPreLoginEvent isn't called when the server is running in offline-mode (at least it wasn't a few months ago when I tried, who knows if that's changed) which is almost a prerequisite for this plugin.
     
  4. Offline

    SirTyler

    sounds like online-mode = true fixes it then...
     
  5. Offline

    CypherX

    Good job, Captain obvious. If that was an option I wouldn't be asking now would I?
     
  6. Offline

    SirTyler

    And why isn't an option? Offline mode isn't exactly a smart option.
     
  7. Offline

    CypherX

    Because it's for use in an offline-mode authentication plugin.
     
  8. Offline

    Ralm

    Offline mode have its issues and problems but at the same time can bring some good stuff, such a huge ammount of players. So with AuthMe plugin, aplication system, etc it can work, but in the end its still annoying AS HELL to manage those kids that keep getting bans and still log in.
     
  9. Offline

    SirTyler

    Offline mode brings a huge amount of low quality players that cant follow rules or lack common sense (in most cases). Personally I wouldn't want them on my server regardless of how many Id get.

    Honestly I think there are enough of those but good luck. To perhaps answer your question the only thing I could think of is grabbing the player object and if this error occurs Object.remove() it, that or try messing with packets.
     
  10. Offline

    CypherX

    It's not for a new authentication plugin, it's for my xAuth plugin.

    Also, this server is shit.
     
Thread Status:
Not open for further replies.

Share This Page