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

Help fixing PortalsPE plugin

Discussion in 'Development' started by Awzaw, Jun 12, 2017.

  1. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    I've been asked to repair luca28pet's PortalsPE plugin, and need some help: my fork is here, and I've made no significant changes to the original yet.

    The teleport actually works... but in 'event' mode it spams console with an error that I'm having trouble understanding, and RakLib blocks the IP. I've tried adding a cooldown in the event handler, changing PlayerMoveEvent event priority, and of course checking $player->teleport() is getting valid arguments, and everything seems correct. If I switch to using PlayerInteractEvent there is no error.

    If anyone wants to take a look at this, here's the console output, using PocketMine-MP version 1.6.2dev "Unleashed" (API 3.0.0-ALPHA5) (commit bf3868c0). The error can only happen when $this->forceMovement is null, and $this->teleportPosition !== null in Player, but I can't see how that can happen, let alone twice as the result of a single call to teleport().

    Code:
    PocketMine $./start.sh
    [17:02:06] [Server thread/WARNING]: Non-packaged PocketMine-MP installation detected, do not use on production.
    [17:02:06] [Server thread/INFO]: Loading pocketmine.yml...
    [17:02:06] [Server thread/INFO]: Loading server properties...
    [17:02:06] [Server thread/INFO]: Selected English (eng) as the base language
    [17:02:06] [Server thread/INFO]: Starting Minecraft: PE server version v1.1.0.55
    [17:02:06] [Server thread/INFO]: Opening server on 0.0.0.0:19132
    [17:02:06] [Server thread/INFO]: This server is running PocketMine-MP version 1.6.2dev "Unleashed" (API 3.0.0-ALPHA5)
    [17:02:06] [Server thread/INFO]: PocketMine-MP is distributed under the LGPL License
    [17:02:07] [Server thread/INFO]: Loading recipes...
    [17:02:07] [Server thread/INFO]: Loading resource packs...
    [17:02:07] [Server thread/INFO]: Loading DevTools v1.11.3
    [17:02:07] [Server thread/INFO]: Enabling DevTools v1.11.3
    [17:02:07] [Server thread/INFO]: Loading source plugin PortalsPE v1
    [17:02:07] [Server thread/INFO]: [DevTools] Registered folder plugin loader
    [17:02:07] [Server thread/INFO]: Preparing level "output1288"
    [17:02:07] [Server thread/INFO]: Enabling PortalsPE v1
    [17:02:07] [Server thread/INFO]: Default game type: Creative Mode
    [17:02:07] [Server thread/INFO]: Done (1.265s)! For help, type "help" or "?"
    version
    [17:02:14] [Server thread/INFO]: This server is running PocketMine-MP 1.6.2dev 「Unleashed」 implementing API version 3.0.0-ALPHA5 for Minecraft: PE v1.1.0.55 (protocol version 113)
    [17:02:35] [Server thread/INFO]: awzaw[/192.168.1.29:40303] logged in with entity id 1 at (output1288, 2027, 83, 2044)
    [17:02:36] [Server thread/INFO]: awzaw joined the game
    [17:02:41] [Server thread/INFO]: Preparing level "flat"
    [17:02:41] [Server thread/CRITICAL]: TypeError: "Argument 1 passed to pocketmine\Player::sendPosition() must be an instance of pocketmine\math\Vector3, null given, called in /Users/jazzwhistle/PocketMine/src/pocketmine/Player.php on line 2147" (EXCEPTION) in "/src/pocketmine/Player" at line 3953
    [17:02:41] [RakLibServer thread/NOTICE]: Blocked 192.168.1.29 for 5 seconds
    [17:02:41] [Server thread/CRITICAL]: TypeError: "Argument 1 passed to pocketmine\Player::sendPosition() must be an instance of pocketmine\math\Vector3, null given, called in /Users/jazzwhistle/PocketMine/src/pocketmine/Player.php on line 2147" (EXCEPTION) in "/src/pocketmine/Player" at line 3953
     
    Last edited: Jun 12, 2017
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    That error isn't only from that plugin. I'm noticing the same error with other plugins. I think it's something that has been changed in PMMP, because I never had that problem before.
     
    Awzaw, kazuya and jasonwynn10 like this.
  3. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Interesting - maybe related to movement checks? UPDATE: not affected by allow-movement-cheats. Also the error happens after, not during, the plugin call to teleport() on line 65, so if I do this:

    PHP:
                    var_dump($toPos);
                    
    $player->teleport($toPos);
                    
    var_dump($player->getName());
    I get this:
    Code:
    [17:54:06] [Server thread/INFO]: [17:54:06] awzaw joined the game.
    [17:54:16] [Server thread/INFO]: Preparing level "flat"
    object(pocketmine\level\Position)#15591 (4) {
      ["level"]=>
      object(pocketmine\level\Level)#15495 (0) {
      }
      ["x"]=>
      int(251)
      ["y"]=>
      int(4)
      ["z"]=>
      int(258)
    }
    [17:54:16] [Server thread/INFO]: [17:54:16] awzaw moved from output1288 to flat
    string(5) "awzaw"
    [17:54:16] [Server thread/CRITICAL]: TypeError: "Argument 1 passed to pocketmine\Player::sendPosition() must be an instance of pocketmine\math\Vector3, null given, called in /Users/jazzwhistle/PocketMine/src/pocketmine/Player.php on line 2147" (EXCEPTION) in "/src/pocketmine/Player" at line 3953
    [17:54:16] [RakLibServer thread/NOTICE]: Blocked 192.168.1.29 for 5 seconds
    [17:54:16] [Server thread/CRITICAL]: TypeError: "Argument 1 passed to pocketmine\Player::sendPosition() must be an instance of pocketmine\math\Vector3, null given, called in /Users/jazzwhistle/PocketMine/src/pocketmine/Player.php on line 2147" (EXCEPTION) in "/src/pocketmine/Player" at line 3953
    
    
     
    Last edited: Jun 12, 2017
    Sandertv and jasonwynn10 like this.
  4. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Dktapps has shed some light on this problem, which is indeed part of a larger issue, and is being investigated:

    Until there's a real fix, I've silenced the errors by hacking Player to check if forceMovement is null before the call.
     
    Last edited: Jun 13, 2017
  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.