originally this idea was for minecraft modding, but i made it more simpler, for general purposes
Basically i want to create a coupon system. On a website (bitbucket/gitlab) i store a file, in that file there is a coupon and an action.
If people type that coupon into the console/Scanner Class, some action should happen. And you should not be able to run the same coupon again on that machine.
The coupon should be re-usable for different machines/clients.
Any idea if this is possible, and how to start? And where/how should you store the "Coupon already used on this machine/client" information?
Example:
{
"coupon": "XMAS-2023",
"expiration-time-unix": "1703632534955",
"action": "System.out.println(\"Merry Christmas! You got a cookie\");"
}
Java 11 , no external library, if possible