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

Need Server to restart

Comments in 'Plugin Development' started by BacuRoyal, Dec 10, 2013.

  1. BacuRoyal
    Offline

    BacuRoyal New Member

    Joined:
    Oct 18, 2013
    Posts:
    16
    Minecraft User:
    BacuAGaming
    Hello does anyone know of a plugin that will restart another plugin or the server? Thanks BacuRoyal
  2. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Do you want a wrapper? Or a plugin to restart your server?
  3. Darunia18
    Offline

    Darunia18 Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    755
    Plugins:
    2
    Minecraft User:
    Darunia18
    There was a plugin just released called Sheep. It allows you to load plugins without a server restart, unload with a restart, and reload plugins without a restart. As for restarting the server, there is a plugin for that, but it only works on Linux and maybe Macs, but it does not work on Windows. Hope this helps :)
  4. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    If you want a server to restart, use my PMRunner, it can restart PocketMine
  5. Darunia18
    Offline

    Darunia18 Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    755
    Plugins:
    2
    Minecraft User:
    Darunia18
    I forgot about that! It's still pretty new and I haven't had time to test it out yet. Thanks :)
  6. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    ;)
  7. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I'm probably wrong but would this do anything remotely helpful?
    PHP:
    exec('sleep 10 && ./start.sh');
  8. BacuRoyal
    Offline

    BacuRoyal New Member

    Joined:
    Oct 18, 2013
    Posts:
    16
    Minecraft User:
    BacuAGaming
    I need it to do it without me having to do anything. PMRunner is great by the way
  9. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    I don't think that works but if you have linux you would want to put sleep 5 or 10 or whatever you want in the start.sh file
  10. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Why wouldn't it work?
  11. ZacHack
    Offline

    ZacHack Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    325
    Plugins:
    6
    Minecraft User:
    _ZacHack_
    We'll if you have linux it'll probably work but windows command script is completely different
  12. BacuRoyal
    Offline

    BacuRoyal New Member

    Joined:
    Oct 18, 2013
    Posts:
    16
    Minecraft User:
    BacuAGaming
    I have windows sadly
  13. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,707
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Yeah, there is a command for Linux and a different syntax for Mac, but nothing easy for windows. I would have to run some complex temporary vbscript with a delayer.
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    class Loader{
    private 
    $pA=ServerAPI::request()->api->plugin;
    private 
    $cA=ServerAPI::request()->api->console;
    private 
    $list=array();#IDK how to get a dir list in PluginAPI::configPath(Plugin)
    function init(){
      
    $this->cA->register("unload","<plugin class name>",array($this,"cmdHandler"));
      foreach(
    $this->list as $candidate){
        
    $candidate->__construct(ServerAPI::request()->api,ServerAPI::request());
        
    $candidate->init();
      }
    }
    function 
    cmdHandler($cmd,$a,$issuer){
      if(
    $issuer!=="console")return "Only run on console";
      if(
    $cmd==="load"){
        foreach(
    $this->list as $o=>candidate){
          if(
    explode("\0x0",$candidate)[1]===$a[1])$this->list[$o]=#blahblahblah
        
    }
      }
      if(
    $cmd==="unload"){
        
    $success=false;
        foreach(
    $this->list as $offset=>$candidate){
          if(
    $candidate->name===$a[0]){
            
    $this->list[$offset]==="disabled\0x0".$candidate->name;
            
    $success=true;
            break;
          }
        }
      if(
    $cmd==="reload"){
        
    $this->cA->run("unload ".implode(" ",$a));
        
    $this->cA->run("load ".implode(" ",$a));
      }
      }
    }
    }
    class 
    CustomAPI{
      
    #extends the API with the `if(in_array(Loader::list))call()` or something like this
    }
    I don't know what I am doing now.

Share This Page

Advertisement