My goal was to make a page, where people could upload their .pkm files, and have a GTS instance start up, let them download the .pkm, and then have the instance shut off. But, I got lazy, and tired from adding checks everywhere. The main base is here though, so it works! If anybody wants to fix it up, go right ahead
http://kowiz.cowxp.com/GTSPHP.zip
It goes via IP address, so it may not work correctly if you're connecting to the GTS server on the same LAN
The sendpkm and pokehaxlib were modified to take a 2nd argument, port number
(doesn't contain the cname version)
(probably should have removed the dnsspoof function due to redundancy)
You're suppose to (manually) run a server GTS server on port 81, maybe with the randomizing pkm files
When somebody submits a pokemon, an instance will start up on port 82
Then they connect to the GTS. Via their IP, they are automatically forwarded to port 82, where they receive the pkm, and the port 82 instanced server shuts down.
If port 82 is being taken up by somebody else submitting, and somebody submits a pokemon, it automatically goes to port 83, and starts the instanced server there.
After the instanced servers shut down, the IP is deleted, and it will let people submit from the first port number(82 in this case)
If they don't have a pokemon submitted, then they'll be sent to port 81.
You can modify the .htaccess file to allow for more instances.
You are required to have a webserver with PHP running on port 80.