SpigotBuyerCheck
NOTE: While this application can be used instantly, it is recommended to personalize it and learn from it as a developer. Seeing this is made 'FOR' developers - it should not be too hard.
https://github.com/Maximvdw/SpigotBuyerCheck
Test it for my plugins:
http://buyercheck.mvdw-software.com/
When a user isn't in any buyers lists
When a user is found in the buyers
When trying a spigot username that does not exist
Detailed buyer page
About - Why would you need this?
This J2EE application was created to provide an online web interface that fetches the buyers of your premium plugins so you can check if a user is in it. The reason why you may want to use this might be to provide a site where other users that wan't to help others can check if users actually bought your plugin - or if you want to automatically check specific users to be in your buyers.
About - How does it work?
This is a J2EE application using the SpigotSite core. It will log in using your credentials you add to a config file. Since this is a tool that will be used for premium developers you will have a 2FA key. The way this works: instead of having a phone that you have to get a token from it will "act" like the phone to generate those tokens on the fly, this will allow you to let the application run without interfering every 30 days. You can still use the access token in Google Authenticator on your phone.
Once logged in, the application will update all buyers every 30 minutes (currently not configurable). The public site has a simple form where you can enter a username. The username will first be checked to see if its actually a real spigot name. After that it will check if its in the buyer lists of one of your buyers. This checking is done using the cached buyers that are updated every 30 minutes.
It will output a list of all plugins the username bought from you.
Requirements
- A JBoss server (I use Wildfly 9 and 10)
- Your 2FA access token code:
- If you did not store the 2FA key you will have to regenerate it (or extract it).
- Go to "Two step verification"

- Confirm your password
- Enable "Verification with App", if its already enabled - disable and enable again
- Copy the code on the bottom to the config.yml

- Scan the QR code with the Google Authenticator App to generate a verification token and "Confirm"
- Optional: Apache or other webserver to get a nicer domain name and to forward requests. (I use apache)
Installation
- Make sure you have an up and running J2EE server (Wildfly 9 and 10 in screenshots)
I am using the same server I use for the Modules for my QAPlugin
- Upload the WAR file and deploy it
- The first time you start the application the config file will be generated
(NOTE: You can however see the page. If you try to enter a name you will get this error
)
- Stop the application again and open the config
A folder called "SpigotBuyerCheck" will be created in either your "BIN" or root of your Wildfly/Jboss server folder
Inside this folder is the config.
- Open the config and fill in your details
- Make sure its saved and uploaded
- Start it again
- The application now works, but you are using the port and long URL containing the version ,etc...
- Configure your DNS server to use a subdomain that routes to the server you have the J2EE server running
- Create a new PROXY directive in your Apache
What to do as a developer?
1) Change the ugly logo
2) Personalize it, some text saying its your plugins ...
3) Learn from it
4) Add an API (will be added in future)
Quick explanation of the code. The main part is SpigotSiteServerBean
https://github.com/Maximvdw/SpigotB...gotbuyercheck/beans/SpigotSiteServerBean.java
1) Initialize the Spigot Site Core (bypassing Cloudflare etc...)
2) Load your config settings
3) Load all your plugins that are premium and put them in a list called "resources"
4) Start a task that updates your buyers every 30 minutes, and start it now as well
5) For every "resource" in the "resources" list load the buyers - add those buyers to a Map linking the plugin name to a list of buyers
Then for the actual checking:
https://github.com/Maximvdw/SpigotB...buyercheck/controllers/RequestController.java
Most of the code is error handling and providing some nice responses.
When the user is actually found it will check if its in your buyers. It will return a list of all plugins its found in.
When its not found in any plugin it will display the error, else it will just send the correct JSTL data
The rest is some required J2EE code and the UI with the JSTL. JSTL is basically a way to use java objects in your HTML.
https://github.com/Maximvdw/SpigotBuyerCheck/blob/master/src/webapp/WEB-INF/pages/index.jsp
Most of the above is JS, HTML and CSS but the c:xxxx are special JSTL tags
Build in API
Replace https://buyercheck.mvdw-software.com/ with your own URL
http://buyercheck.mvdw-software.com/api/checkbuyer?user_id=35704
http://buyercheck.mvdw-software.com/api/checkbuyer?username=Maximvdw
http://buyercheck.mvdw-software.com/api/checkbuyer/FeatherBoard?user_id=35704
http://buyercheck.mvdw-software.com/api/checkbuyer/FeatherBoard?username=md_5
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta