Anti-explorer
#1
After seeing a few multiplayer server maps, I think it would be wise to make a plugin that would prevent "explorers" - people that choose a direction and walk thousands of blocks far in that direction, without actually doing anything, and then they teleport back to the spawn. This only uses up the server's storage for the generated chunks without anything actually useful in them.

This plugin could, for example, remember the player's position upon spawning the player, and when they go too far from it too fast, it would teleport them back to the remembered position (with a few warnings before that happens, of course).

The plugin should remember the last spawn position for some time, so that the player can't just disconnect and reconnect to continue exploring. Some kind of a timeout should be in place.

Of course a permission to bypass this plugin is needed.

Still needs to be thought of: what about warp - if the player uses a warp, they shouldn't be penalized as if exploring all the way to the destination.
Reply
Thanks given by:
#2
Wouldn't the easiest way be to count how many new chunks are being generated by a specific player instead of checking pos?
Reply
Thanks given by:
#3
There's no way to match the chunks generating to a player causing them to generate, although it should be possible to approximate this. It could be a good metric, true. We could add a function, cWorld:ForEachClientInChunk(), that iterates over all the clients that are using the chunk; if only one is present for a freshly generated chunk, then it's most likely that they're the cause of generating.
Reply
Thanks given by:
#4
But in theory it should only report 1 player if you call it on the hook "HOOK_CHUNK_GENERATING", assuming that hook only gets called egen generating not egen its loaded?

And wouldn't be better if you add a function in cChunkDesc instead? Less variables to keep track of xD
Reply
Thanks given by:
#5
The generator is asynchronous, therefore it's perfectly possible that two players need the same chunk to be generated before the generator actually generates it. And also for this reason it is impossible for the generator to keep track of whether the chunk generation was caused by a player or another piece of code. For example the ChunkWorx plugin generates chunks without any players present.

The cChunkDesc class has no dependencies on other parts of the code, such as the players, and we want to keep it like that, so that the generator can be separated from the server, both for unit tests and for offloading the generating into a separate process, possibly running on a separate machine.
Reply
Thanks given by:
#6
Oh, alright, but then it would be quite hard to know if someone is running around generating new areas or just running a few hundreds block from the spawn...
You could essentially just add a region so it starts counting after the region...
Reply
Thanks given by:
#7
This is a related plugin: https://forum.cuberite.org/showthread.php?tid=1277
Reply
Thanks given by:
#8
well, that would stop the chunks from spawning, I think xoft, want people to still expand the world, but not just a straight line towards 1 direction. but yeah its releated, and its a good plugin Smile
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)