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

PMPM - PocketMine Plugin Manager

Discussion in 'General discussion' started by HittmanA, Nov 21, 2016.

?

Should PMPM...

  1. Be integrated with Poggit

    100.0%
  2. Use my service which would replace Poggit

    0 vote(s)
    0.0%
  1. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Plugins can still attempt to create a new object of a class that hasn't been loaded unless it is disabled.
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Neither would work. PHP won't reload a class that is already loaded. The server must be restarted.
     
    Jack Noordhuis likes this.
  3. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    Wait wait wait. Why can't we just delete the phar file, restart the server, install the new phar, and restart the server?
     
  4. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Then make sure all plugins that need updates are disabled before you update them and either shut down the server or update the plugins when the server is shutting down.
     
    HittmanA likes this.
  5. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Why restart the server 3 times just to install 1 plugin? You'd be better off disabling the plugins, updating them then restarting the server.

    A plugin cannot create new instances after it it disabled so it won't be able to cause any problems.
     
    HittmanA likes this.
  6. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Deleting the phar file and editing the phar file is the same business.
    And you have to ensure that the server automatically restarts. Otherwise you have to make the owner manually start the server twice.
     
    HittmanA likes this.
  7. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    Wait this could work, couldn't it @SOFe ? I mean just disable the plugin(s) update and restart, right?
     
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    This is unreliable. Nobody knows what happens. Even if the plugin is disabled, its code still in PHP's memory. Nobody knows if PHP would do weird stuff and suddenly loads the classes required by the code.
    For example, what if an AsyncTask is executing? Disabling the plugin doesn't promise its AsyncTasks will stop executing.
    Edit: to be precise, in the current PocketMine implementation, you can't even know if there is an AsyncTask from the plugin run. You can detect the class loader for the AsyncTask running, but what if the AsyncTask is actually from a dependency plugin that is not disabled?
    There are too many possibilities that you must not neglect. As the comic above says, just don't do that. I don't want to see velociraptors in a server.
     
    Sandertv likes this.
  9. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    Then what would you recommend doing?
     
  10. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Don't use a plugin at all. Use a standalone program to manage plugins.
     
  11. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    You mean like an app? What do you mean by a standalone program?
     
  12. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Yes. A shell script, a batch script, a native program, a .jar, a .phar, etc. Anything that is not in the context of "inside a PocketMine server".
     
  13. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    What about a NodeJS CLI?
     
  14. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    It may not be 100% safe but it's the safest way possible using only a plugin.

    A developer should always write their plugins to handle it's AsyncTask's knowing that it's code might be executed after the plugin is disabled.
     
  15. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    Ok which should we do? Both have good points.
     
  16. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    I could also make a PHP CLi
     
  17. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Entirely up to you. I for one wouldn't trust other developers to always perform the required checks in their asynctasks so you'd be safer going with @SOFe's method but it would mean your users would need to know how to install more than a plugin (unless you get the plugin to automatically install the updating scripts/program).
     
  18. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Umm i am quite confusing where this thread have gone
    so are we making a plugin that interface with poggit web api
    OR make a plugin that interface your own plugin repo?
     
  19. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    I'm talking about the AsyncTask body, not the onCompletion() method. An AsyncTask has the right to load a class in the onRun() method. And AsyncTask can't immediately know that a plugin is disabled. There must be a slight delay, and I don't think anyone would really bother to check it between every two statements in an AsyncTask.
    Just make a plugins.cmd/plugins.sh and a PoggitManager.phar, and all are settled.
    Poggit. Look at the poll.
     
  20. HittmanA

    HittmanA Zombie

    Messages:
    207
    GitHub:
    hittmana
    How could a .phar be used? I can make it a .php file but I don't know how to make the .phar interact with the CL.
     
  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.