Possible to disable plugin after a certain time

Discussion in 'Spigot Plugin Development' started by EliteTech87, Sep 15, 2019.

  1. I made a premium plugin, but I want to offer it on a time scale for free. For example, after 2 weeks, the plugin will no longer work. I have no idea how to implement this into my plugins, but I need a bit of code I can shove into my plugin's folder that has this clock function.
     
  2. You will have to use some sort of persistent data somewhere.
    You can
    A: Use some hidden local File (unsafe)
    B: Use servlets and send an http request with the servers IP to check for the first time the plugin was started on a server
    But i dont think you are allowed to do that.

    Keep in mind that hardcoding database logins is always a bad idea.

    PS
    Spigot states that every plugin HAS to work even without access to the internet.
    So Website calls might not be allowed. You will have to do something really sneaky.
     
    #2 7smile7, Sep 15, 2019
    Last edited: Sep 15, 2019
  3. You do realise you can't post it here?
     
  4. The best solution would be to make a "stripped down" free version with limited options and a premium version with all options.

    You can come up with all kinds of semi-functional solutions like encrypted datetime stamps etc, but the moment they expire it would just be a simple matter of deleting the plugin folder and start over.

    Like 7smile7 said, the plugin must work without internet access, so there's no safe solution for this. Even if it was allowed, if someone really wants to get their hands on your plugin for free, it's not going to stop them. Think of it like this: If major game companies can't prevent their games from being hacked, what chances do you think you have with a simple Java plugin that's usually even much easier to decompile?
     
  5. Doesn´t this just count for Premium Plugins?
    If he releases it as free, which disables itself after time amount x, it isn´t considered a Premium Plugin -> shouldn´t be affected by the Premium Resources Guidelines.

    ...right?
     
  6. Regardless of whatever hacky steps you do to disable the plugin, its super simple to decompile and remove the code that disables it.

    My point is, dont bother with it.
    Create a free version that is missing some of the bigger features of your premium plugin.
     
  7. I don't recommend doing this in any way, not even how @7smile7 does it. It's not that it will not work, i suppose that if you code it right, it will work fine, but there will be always someone that will take it and bypass that... (like BSMC and others...)

    In my place, doing the stripped free version will be the best idea. Just remove some of the bigger features, as @ShaneBee said.
     
    • Winner Winner x 1
  8. Sure you are allowed to have your plugin disable itself after x amount of time. But what's the point? The only way to make that work is to have the expiration date stored somewhere in your plugin's data folder. If you hard code it, it won't work as you have no idea when someone downloads your plugin. So either the user just changes the expiration data or just deletes the whole data folder.
     
  9. My idea is to have a timer in the plugin, no internet access needed. I am also attempting to make it so that if the code is deleted the main sources code will be deleted. I have done the corruption method before, but only based on a website's time. As for the plugin, it is a a special type of custom made plugin, professionally setup and configured to that one server. (User installs it to other server, it will not work)
     
  10. Sounds like something SpigotMC staff will not approve on this website.
     
  11. I wouldn't be publishing it here
     
  12. Then don't ask here, ask where you will publish it.
    I think we don't have reason to help if you're gonna put that plugin on MCM or other sites.
     
  13. This is a site encompassing the entirety of the existing Spigot development. BTW, the plugin is on my own site
     
  14. I don't think you can do this.
     
  15. Even if you do that, any could break this system.
     
  16. I'd just encode/"encrypt" the date somehow and store it somewhere arbitrary in the server folder (or temporary data folder, because you have access to the user's System properties, including their home folder environment variable), perhaps with a hidden attribute? In a manner that the end-user won't be able to fudge the "encryption", too. Perhaps two-input encryption, where one-half the String is verified credentials from you, the other half is the date. Either way, this would be frowned upon and difficult to sell the idea to the resource processors without them believing it's malicious or a violation. Even harder to make it impossible to spoof the "trial" system.
     
  17. If he does it on his website he could just as well compile custom versions for his buyers like how spigot has their default anti piracy system