1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

two players with the same name

Discussion in 'Help' started by Winchester, Aug 11, 2018.

  1. Winchester

    Winchester Baby Zombie

    Messages:
    133
    I am having problems with player that put the same username, which causes one of them to be kicked from the server, someone knows how to work around this, preventing a player from being able to put the name that a player has already chosen?
     
  2. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    The game requires you to login to an xbox account to play on multiplayer servers that aren't on your network, unless you use a proxy, and even then PocketMine also checks if a player is logged into an xbox account by default. Have you turned off that feature?
     
    Winchester, Muqsit and corytortoise like this.
  3. Winchester

    Winchester Baby Zombie

    Messages:
    133
    I disabled the xbox auth so that people who do not have the official game can play with me, but if someone tries to log in with the same name the original player is kicked out of the game, I could at least let others try to log in without anyone using SimpleAuth plugin
     
  4. Winchester

    Winchester Baby Zombie

    Messages:
    133
    Do you have any idea how to solve this?
     
  5. Tee7even

    Tee7even Slime

    Messages:
    81
    GitHub:
    tee7even
    People who didn't buy the game can have an xbox account too.

    But anyway, you can write a plugin to prevent kicking out the player that is already playing when someone tries to join with the same name. The code will be somewhat like this:
    PHP:
    public function onPlayerPreLogin(PlayerPreLoginEvent $event) {
        
    $player $event->getPlayer();
        foreach (
    $this->plugin->getServer()->getOnlinePlayers() as $onlinePlayer) {
            if (
    $onlinePlayer !== $player && $player->getLowerCaseName() === $onlinePlayer->getLowerCaseName()) {
                
    $event->setKickMessage("Already logged in");
                
    $event->setCancelled();
                return;
            }
        }
    }
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    That's why Xbox Live auth exists. I don't think anybody is updating the old auth plugins anymore.
    Chances are high that an auth plugin would use a higher priority than default, so you may want to set yours to HIGHEST or MONITOR, even. I'd check for you if I knew which version of SimpleAuth OP is using.

    Of course, the simplest method would be to just reeneable Xbox Live auth, assuming what you said is true.
     
  7. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    the simplest method is to cancel the kick event which produced by PMMP when a it's logged from another location
    people disable xbl for a reason as clearly stated and do not wish to use it for the same reason
    so please stop telling them to do it

    OR you can on login packet if name taken, change their username to something else
    like Thunder33345_recovery_1
    which will be prompted password for thunder33345,
    with a message saying this will kick the current user on the same name if auth successful
    if they success,
    the current player will be kicked
    the new player will retransfer to the same server, changing the username back to thunder33345
     
    EdwardHamHam and corytortoise like this.
  8. Flavius12

    Flavius12 Spider Jockey

    Messages:
    32
    GitHub:
    flavius12
    As I know the unofficial/cracked versions of MCPE break the Xbox Auth services. So, even if you have a free Xbox Live account, you are not able to join while in-game.
    I implemented this feature a long time ago in ServerAuth. But since auth plugins are useless nowadays I abandoned the development of that plugin. However I published the latest source code I was working to. Maybe you can finish it and run ServerAuth on your server to solve your issue.
     
  9. Tee7even

    Tee7even Slime

    Messages:
    81
    GitHub:
    tee7even
    That was true for a while, but now there are unofficial copies that work completely fine.
     
    Last edited: Aug 14, 2018
  10. Destroyer57

    Destroyer57 Zombie

    Messages:
    275
    Ban-Ip it from console
     
  11. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    this is a bad idea as what if i shared both devices from different IP \
    involving an administrator over such an mundane task is unnecessary
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.