Spoon detection class

Discussion in 'Plugin/Virion API' started by falk, May 9, 2017.

  1. falk

    falk Slime Poggit Reviewer Verified

    Messages:
    75
    GitHub:
    falkirks
    I am so tired of getting reports on GitHub about third party server builds. This is a simple class which will detect if your plugin is running on a spoon, print a message to the console, disable your plugin, and force the user to agree to read and agree to a predefined message.

    To use it in your plugin you must add the following to your onEnable method
    PHP:
    SpoonDetector::printSpoon($this'spoon.txt');
     
  2. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    676
    GitHub:
    dktapps
    I need this in my life so badly
     
  3. TheDiamondYT

    TheDiamondYT Zombie Verified

    Messages:
    296
    GitHub:
    TheDiamondYT1
    I'll spoon u
     
    PianoRalph04 and HimbeersaftLP like this.
  4. I should consider making something similar in plugins that I will eventually make public. ;)
     
    PianoRalph04 likes this.
  5. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,276
    GitHub:
    jasonwynn10
    I am adding this to all plugins I work on from now on
     
  6. That's a great idea, I'm thinking of doing it too.
     
    jasonwynn10 likes this.
  7. ProjectInfinity

    ProjectInfinity Witch

    Messages:
    50
    GitHub:
    projectinfinity
    Interesting, but is it really that much of a problem? Personally I have not experienced any third party forks causing trouble for any of my plugins.
     
  8. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    733
    GitHub:
    SalmonDE
    Depends on the plugin. I had enough errors which were caused by using another server software than the plugin was written for.

    And btw, I love you for this @falk <3
     
    falk and jasonwynn10 like this.
  9. ProjectInfinity

    ProjectInfinity Witch

    Messages:
    50
    GitHub:
    projectinfinity
    Do you have any examples of such issues? Unless they've made some heavy alterations I don't see how it should affect plugins.
     
  10. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    796
    GitHub:
    Sandertv
    I've had a quite extreme issue actually @ProjectInfinity. When using generateCustomCommandData inside of a Command class, PocketMine accepts arrays as input, while spoons/forks accept a stdClass. This results in every single command dissapearing on spoons, while working perfectly fine on PocketMine.
     
    falk and jasonwynn10 like this.
  11. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin Noobiest member in the PMMP Team

    Messages:
    1,760
    GitHub:
    sof3
    jasonwynn10 and dktapps like this.
  12. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    676
    GitHub:
    dktapps
    tbh this is still very much roughly hacked together since 0.16... most of the problems result from spoons claiming to support newer PocketMine API versions with hefty changes, while failing to copy-paste all of the (often extensive) changes and bugfixes.

    I document the majority of changes in the release notes when I create a new tag, so plugin devs know exactly what in their plugins will break and what needs fixing. Spoons do no such thing, and as a result it is nearly impossible for developers to maintain consistency if they try to support spoons. Hence, why this is so useful (and also highly amusing).
     
  13. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,374
    GitHub:
    robske110
    under which license are you releasing that code?
     
  14. falk

    falk Slime Poggit Reviewer Verified

    Messages:
    75
    GitHub:
    falkirks
    It is under MIT right now because it is released as a component of SimpleWarp, but if I release it as a virion later it will be in the public domain.
     
    jasonwynn10 likes this.
  15. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer Verified

    Messages:
    1,374
    GitHub:
    robske110
    yay, MIT is fair enough :)
     
    jasonwynn10 likes this.
  16. falk

    falk Slime Poggit Reviewer Verified

    Messages:
    75
    GitHub:
    falkirks
    And now it up as it's own GitHub repo (https://github.com/Falkirks/spoondetector), building on poggit as a virion, and released in the public domain.
     

Share This Page

  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.