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

Server Crashed

Discussion in 'Plugin Help' started by Shockskill, Feb 24, 2017.

  1. Shockskill

    Shockskill Silverfish

    Messages:
    15
    GitHub:
    Shockskill
    Catchable fatal error: Object of class pocketmine\level\Level could not be converted to string in /h ome/UHC/plugins/UHC/src/UHC/Main.php on line 644

    I dont know how i
    Remedy
    PHP:
                [642]               $level $this->plugin->getServer()->getLevelByName($arena);   
                [
    643]                if($level instanceof Level){
                [
    644]                $this->plugin->getServer()->unloadLevel($level);
                [
    645]                if(is_dir("worlds/".$level)){                 
                [
    646]                rmdir($level);                       
                                 }
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    upload the plugin or source code if possible
     
  3. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Change this:
    PHP:
    if(is_dir("worlds/".$level)){
    to this:
    PHP:
    if(is_dir("worlds/".$level->getFolderName())){
     
    TheDiamondYT likes this.
  4. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    The php docs state that "The directory must be empty, and the relevant permissions must permit this." , and of course a world directory is not empty... So you might want to delete the files inside of it first.

    Also you need to do what @jasonwynn10 stated above.
     
    jasonwynn10 likes this.
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    What @jasonwynn10 stated has nothing to do with what you said, does it?
    See http://stackoverflow.com/documentat...files-and-directories#t=201703051625368772849 for deleting directories... (Because I wrote it)
     
  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.