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

Server Crash?

Comments in 'Plugin Development' started by Junkdude, Apr 4, 2016.

  1. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    I have been modifying a plugin to my own likings to list all staff. But whenever its enabled in a phar, the server crashes.
    <?php
    namespace xFlareEditForDarknessPEToListStaff\xStaffx;

    use pocketmine\utils\TextFormat;
    use pocketmine\plugin\PluginBase;
    use pocketmine\event\Listener;
    use pocketmine\event\player\PlayerChatEvent;
    use pocketmine\command\CommandSender;
    use pocketmine\command\Command;
    use pocketmine\Player;

    class Main extends PluginBase implements Listener{
    public function onEnable(){
    $this->getServer()->getPluginManager()->registerEvents($this, $this);
    $this->saveDefaultConfig();
    $this->getLogger()->info(TEXTFORMAT::BLUE . "[Staff]" .TEXTFORMAT::RED. " >>" .TEXTFORMAT::AQUA. " xStaffx Edit By DarknessPE");
    }
    public function onCommand(CommandSender $sender, Command $command, $label, array $args) {
    $cmd = strtolower($command->getName());
    switch ($cmd){
    case "staff":
    if (!($sender instanceof Player)){
    $sender->sendMessage(TEXTFORMAT::GOLD. "--------[Staff]--------");
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff1"));
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff2"));
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff3"));
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff4"));
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff5"));
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff6"));
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff7"));
    $sender->sendMessage(TEXTFORMAT::GREEN . "- " . $this->getConfig()->get("staff8"));
    return true;
    }
    $player = $this->getServer()->getPlayer($sender->getName());
    if ($player->hasPermission("darknesspe.staff")){
    $sender->sendMessage("--------[Staff]--------");
    $sender->sendMessage("- " . $this->getConfig()->get("staff1"));
    $sender->sendMessage("- " . $this->getConfig()->get("staff2"));
    $sender->sendMessage("- " . $this->getConfig()->get("staff3"));
    $sender->sendMessage("- " . $this->getConfig()->get("staff4"));
    $sender->sendMessage("- " . $this->getConfig()->get("staff5"));
    $sender->sendMessage("- " . $this->getConfig()->get("staff6"));
    $sender->sendMessage("- " . $this->getConfig()->get("staff7"));
    $sender->sendMessage("- " . $this->getConfig()->get("staff8"));
    return true;
    }
    break;
    }
    }
    }
    ?>
    name: xStaffx
    description: Allows users to view all rules with /rules
    author: xFlareEditForDarknessPEToListStaff
    main: DarknessPE\Main
    load: POSTWORLD
    version: 1.0.0
    api: [2.0.0]
    commands:
    staff:
    usage: /staff
    description: Shows a list of staff.
    permissions:
    darknesspe.staff:
    default: true
    description: Allows user to use /staff
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    We need to know more before we can help you. Please provide more information.

    What does it say in the console when it crashes? What crashes in the first place? Can you provide a complete crash log?

    Follow when posting:
    applqpak, Primus and PEMapModder like this.
  3. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    umm, i dont know what this had to do with this. should i use pastebin?
  4. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Pastebin is fine.
    applqpak likes this.
  5. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
  6. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    but when i remove the plugin everything is fine
  7. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Of course it is, since the problem is in the plugin itself...
    applqpak and HotFireyDeath like this.
  8. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    but i cant figure out what it is, thats why i was asking if any of you could help, i scanned the code, the plugin.yml everything!
  9. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Wait, is that really the crashdump?
    applqpak and HotFireyDeath like this.
  10. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    yes that really is the crash dump, and all the console says is sever crashed
  11. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Weird, try using PocketMine and see the difference...
    applqpak likes this.
  12. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    will do brb
  13. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    wierd works on Imagicalmine but not genisys. Hmm time to update
  14. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    i dont know if the api is just incompatible or what
  15. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    man wish i could figure it out
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Code:
    Genisys version: 1.1dev #208 [Protocol 45; API 2.0.0]
    Did you mention this?

    And now, this is not a problem that causes any present issues, but why do you call it TEXTFORMAT rather than the original form TextFormat? It may lead to problems in the future.

    Now, my answer: This plugin definitely does not lead to a memory leak. Your crash dump is irrelevant.
    Last edited: Apr 5, 2016
  17. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    So should i try changine TEXTFORMAt -> TextFormat then?
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    That's a good practice. But about your problem, it is not related to your plugin. At least, normally not.
    HotFireyDeath, Oneeb and applqpak like this.
  19. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    What is TEXTFORMAT?
  20. Junkdude
    Offline

    Junkdude New Member

    Joined:
    Mar 30, 2015
    Posts:
    19
    Minecraft User:
    Junkdude
    removed textformat nothing

Share This Page

Advertisement