Muqsit / InvMenu

A PocketMine-MP virion to create and manage virtual inventories!
https://poggit.pmmp.io/ci/Muqsit/InvMenu/~
GNU General Public License v3.0
201 stars 75 forks source link

PS4 #99

Closed xxFLORII closed 4 years ago

xxFLORII commented 4 years ago

PlayStation4 players don't get a Menu sent by InvMenu

Muqsit commented 4 years ago

Duplicate of #73

xxAROX commented 4 years ago

I found a method, its very unstable but it works: PlayerNetwork.php

    public function notify(int $timestamp) : void{
        if ($this->session instanceof MyCustomPlayer) {
            if ($this->session->getOS() /*returns the device-os, you can find them at 'LoginPacket::$clientData["DeviceOS"]'*/ == 11) {
                if ($this->current !== null && $timestamp !== $this->current->timestamp) {
                    $this->processCurrent(true);
                }
            } else {
                if ($this->current !== null && $timestamp === $this->current->timestamp) {
                    $this->processCurrent(true);
                }
            }
        }
    }