pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.27k stars 1.54k forks source link

Kick reason not showed when kicking after LoginEvent #5321

Closed dadodasyra closed 1 year ago

dadodasyra commented 1 year ago

Issue description

Steps to reproduce the issue

class Main extends PluginBase {
    protected function onEnable(): void {
        $this->getServer()->getPluginManager()->registerEvents(new class() implements Listener {
            public function onLogin(PlayerLoginEvent $event): void {
              $event->setKickMessage("Hello world");
              $event->cancel();
            }
        }, $this);
    }
}

OS and versions

Plugins

More infos

The problem is present in every kicking way while doing it between Login and Join event. Even while using Player->kick() on LoginEvent. Maybe this is a client sided issue, maybe not. Maybe PMMP close the socket too early before the client gets the disconnect packet. In my memories this bug wasn't existing in PM3. This could be related to #4588, #4592 #4594 image

dktapps commented 1 year ago

This issue has been around for years and I've tried many times to work around it. The most recent workaround in RakLib (allowing the client to end the session itself) should have taken care of this.

Closing as a client issue (WF).