Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Pocketmine likes to troll me ._.

Comments in 'Plugin Development' started by Samueljh1, Apr 12, 2015.

  1. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    OK, for some reason if I unload a loaded world, the server *sometimes* crashes. Its the evil

    PHP:
    getChunk() on null
    Error .........

    I tried kicking everyone on the map and removing all the entities - and doing nothing. It still crashes #Somtimes !!! This is also a common problem apparently (#ManyWorlds) :p

    Any way to fix dis? Thanks :)
  2. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    I would also like to hear a way to fix this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    I believe it is an issue with pthreads or other parts of PHP binaries.
  4. Blubbll
    Offline

    Blubbll Active Member

    Joined:
    Oct 3, 2013
    Posts:
    325
    Minecraft User:
    Blubbll
    You could just add if null then $world = world or stuff. I guess this works.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Maybe because you are trying to unload a null world. Check your values before passing.
  6. Blubbll
    Offline

    Blubbll Active Member

    Joined:
    Oct 3, 2013
    Posts:
    325
    Minecraft User:
    Blubbll
    It's the fault of the Owner of the ManyWorlds plugin, he must set a default value when worlds are null, so the process aborts itself or something.
  7. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    No and no.

    This is the code that does the unload:

    PHP:
          if (!$this->getServer()->isLevelLoaded($level)) {
             
    $sender->sendMessage("[MW] Level $level is not loaded.");
             continue;
           }
           
    $world $this->getServer()->getLevelByName($level);
           if (
    $world === null) {
             
    $sender->sendMessage("[MW] Unable to get $level");
             continue;
           }
           if (!
    $this->getServer()->unloadLevel($world,$force)) {
             
    $sender->sendMessage("[MW] Unable to unload $level.  Try -f");
             continue;
           }
           
    $sender->sendMessage("[MW] $level unloaded.");
    So actually, it does check if $world is null. Also, it is only calling the API unloadLevel method.

    What is more problematic is that I can't consistently get the error. In fact, right now, I have been unloading levels willy nilly without crashes...
    Last edited: Apr 15, 2015

Share This Page

Advertisement