Unlock-able permissions and content via keygen

Discussion in 'Plugin Development' started by anuvare, Sep 13, 2011.


Is this plugin a good idea/feasible?

  1. Yes

  2. No

    0 vote(s)
Thread Status:
Not open for further replies.
  1. Offline


    I've been running a moderately sized server since last October and like many other servers we have a rank for donators via permissions that gives them special abilities. Currently we manually add people to this rank in permissions. Then I started thinking what if there was a plugin that would automatically add people to a given rank in permissions when they entered a key in the chat.

    For example: We have a keygen as well as the plugin. We generate a key and send it to the player by email or whatever. The player opens chat ingame and types in say: /key 1739037768 for example.
    The plugin then checks the key and if correct adds the player to the new rank. The next time the server reloads the player is part of the donator rank.

    Having to coding knowledge myself is this possible and would anyone like to take a crack at it?

    Also this plugin could theoretically interface with iconomy to give players a given amount of currency.

    I really see the possibilities for a system like this as endless.
  2. Offline


    I think I red something like here in the forums already... but have no clue where, sorry.

    I would recommend using a database to store the donators. Your script could put the player into that db if paypal (or which system you use) reports "success" for the transaction and then your plugin could check onEnable which players are stored in the db and then put them into permissions.
  3. Offline


    Well, the easiest way is to connect to an SQL if your forums has one. (or if you have a website). The next easiest way is to use a system that I thought of to generate/validate codes without a network. I havn't tested it, and I don't know if there's a better way, but...

    Find a really high prime number. (something in the 100,000's) This number is SUPER secret and a new one must be used for each code set. The chances of guessing a code are one in (insert prime number here).

    Generate a random number between 1 and 1000. (NOT 0)

    Multiply each together to get the code.

    To decode:
    Divide by the super secret prime number.
    If the result is a whole number, then a valid code is entered.

    And of course, you would need to put in the generator in a php (NO JAVASCRIPT, the donator can find out your super secret number) or however you would need to do that. I don't know much about how you run things, but the code generation and validation is the important part.
Thread Status:
Not open for further replies.

Share This Page