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

MyPlot is segfaulting my server.

Comments in 'Plugin Development' started by thebigsmileXD, Sep 1, 2016.

  1. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Hello fellas,
    I use a modified version of MyPlot by wiez (https://github.com/mwvent/WattzMCPE-MyPlot this one) (Actually may post a newer link later with my updated version).
    That version uses MySQL (so i can access plot data on my website).
    It crashes when players execute several commands:
    /p home
    /p claim (its a new crash)
    /p biome

    I simply get a segfault, thats all.
    I added debug functions, and checked the whole plugin. The commands have no bugs in them.
    Command::execute() will execute the subcommands.
    These return true is succeeded, and then execute returns true because the subcommand succeeded.
    Exactly after executing the last line of Command::execute() the server is segfaulting.
    I use a PHP7 ThreadSafe php binary, i could upload it if you want.

    Does ANYONE have an idea?
    Also i have a TestServer running, there it doesn't crash.. could it be a plugin issue? PurePerms or something?
    PHP:
        public function execute(CommandSender $sender$alias, array $args) {
            if (!isset(
    $args[0])) {
                return 
    $this->sendHelp($sender);
            }
            
    $subCommand strtolower(array_shift($args));
            if (!isset(
    $this->subCommands[$subCommand])) {
                return 
    $this->sendHelp($sender);
            }
            
    $command $this->commandObjects[$this->subCommands[$subCommand]];
            
    $canUse $command->canUse($sender);
            if(
    $canUse){
            print 
    "Line:".__LINE__." function:".__FUNCTION__;
                if(!
    $command->execute($sender$args)){
                    
    $sender->sendMessage(TextFormat::YELLOW "Usage: /p " $command->getName() . " " $command->getUsage());
                }
            print 
    "Line:".__LINE__." function:".__FUNCTION__;
            print 
    $bla?"Erfolg":"Misserfolg";
            }
            elseif(!(
    $sender instanceof Player)){
            print 
    "Line:".__LINE__." function:".__FUNCTION__;
                
    $sender->sendMessage(TextFormat::RED "Please run this command in-game.");
            }
            else{
            print 
    "Line:".__LINE__." function:".__FUNCTION__;
                
    $sender->sendMessage(TextFormat::RED "You do not have permissions to run this command");
            }
            print 
    "Line:".__LINE__." function:".__FUNCTION__;
            return 
    true;
        }
  2. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Check from where the function is called and then add debugs there (probably in PM itself)
  3. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Check from where the function is called and then add debugs there (probably in PM itself)

Share This Page

Advertisement