Solved %%__USER__%%

Discussion in 'Spigot Plugin Development' started by Trophonix, Jun 26, 2016.

Thread Status:
Not open for further replies.
  1. Solved. Click here for the answer

    I've seen a couple of threads asking about this in the last ~month, but I can't find anything that helps my problem. Firstly, I do have this correct, right? It's
    Code (Text):
    %%__USER__%%
    and will be replaced by the downloader by Spigot?

    In the code, I've got this:
    Code (Text):
    final String uid = "%%__USER__%%";

    ...

    MsgUtils.send(Bukkit.getConsoleSender(), new String[] {
            "&6&l<-------------------- Trade+ -------------------->",
            "&6&l<" + center("This copy is licened to " + uid) + ">",
            "&6&l<------------------------------------------------>"
    });
    Uploaded to spigot and downloaded it, and it just prints this:
    [​IMG]

    Thanks. :)
     
    #1 Trophonix, Jun 26, 2016
    Last edited: Jun 26, 2016
  2. Is it a premium plugin?
     
  3. Yep.
     
  4. First of all, I am not sure if the admins wants this public (idek why, but yet)

    And to answer,
    it only works on premium

    EDIT: sniped by kat :3
     
    • Funny Funny x 1
  5. Thanks, it is a premium plugin. :)
     
  6. Could you try to set it in loadConfig0() ?
     
  7. Maybe you have to buy it? idk :p
     
  8. Negative.
    It's simply manipulating bytecode on download and quickly replacing "%%__USER__%%" with the user id (spigot/members/name.id)
     
  9. Is it in the main class?
     
  10. I am honestly not sure, but I know it looks for loadConfig0 in the main class, so probably.
     
  11. Pretty sure it looks for a global variable in the main class.
     
  12. What do you mean, like a method called "loadConfig0"? o_O
     
  13. Well, then.
    Are we allowed to go download leaked plugins and check their source for that thingie?
     
  14. It's just a name for the checking method. q:
    Premium plugins use em due crackers would have a higher chance of thinking "ohh, configs." instead of "ooh, anti-piracy"
     
  15. Made it this:
    Code (Text):
    private void loadConfig0() {
        this.uid = "%%__USER__%%";
        MsgUtils.send(Bukkit.getConsoleSender(), new String[] {
                "&6&l<-------------------- Trade+ -------------------->",
                "&6&l<" + center("This copy is licened to " + uid) + ">",
                "&6&l<------------------------------------------------>"
        });
    }
    and I call it in the first line of my onEnable.
    Same problem.
     
  16. You have to be a buyer for it to work. If you download your own plugin it will not get parsed. I'm not even sure if adding someone manually as a buyer is enough to trigger it. I do think money has to exchange hands.

    Edit: Just confirmed, it is not parsed by manually adding a buyer. Tested it with my wife's account.

    Edit Again: Adding a buyer manually will get parsed. I double checked my wife's downloaded copy and her ID was indeed there. Weird thing is Notepad is unable to search for the ID (why I originally thought it wasnt there), but double checking with Notepad++ shows it is there, plain as day. So yes, it will get parsed for someone if you manually add them as a buyer.
     
    #16 BillyGalbreath, Jun 26, 2016
    Last edited: Jun 26, 2016
    • Informative Informative x 1
  17. (Didn't use the reply thing due notification)

    I can possibly buy it? Like, later this week, that is, cause only got 0.6USD on my paypal >.<
     
    • Funny Funny x 1
  18. That moment when you can't buy your own plugin (Someone put meme here.)
     
  19. Dang. That seems kinda weird, why not just do it on download for everyone? o_O
    Oh well. Thanks.

    I mean, I won't object ;)
    Thanks for your help.

    Thank you @camden as well.
     
Thread Status:
Not open for further replies.