by stjo · 5y ago · 0 comments
It’s so cheap[1] to start and stop servers on demand that I’ve decided to give “away” servers for free. I wrote a little proxy in Go that detects minecraft login requests and starts a server with the specific world. After a dropped connection I stop it.
[1] For 15€/month you can have ~30 servers running in parallel and thousands of powered down worlds. https://contabo.com/en/vps/
1) Initial world creation is quite slow - 10-15 seconds on a moderately powerful hardware. Since I want first joins to be as fast as possible, I keep 1000 pre-generated worlds and one of them is chosen randomly to be used as template on your first login.
2) In addition to login packets, minecraft clients send a ping packet to check if the server is online. I forge a valid response because I don't want to start a server just so you can see "server is up, 0 players online".
You could take this a step further by "decaying" the bases in some way (remove torches, remove some large percent of the items in chests, add vines, weather rock, move blocks from the ceiling to the floor, etc)
Otherwise someone should make one. No need to full reset servers any more.
Then you just need a good heuristic to guess whether or not a group of blocks matches your definition of a base to be explored.
But that's my skepticism talking.
As for the skins - servers run in "offline mode", which means no communication with the Microsoft authentication API responsible for validating accounts and (I believe) giving skins to players.
So 16GB of ram should be enough for 20-60 servers.