Cuberite Forum
Anti-explorer - Printable Version

+- Cuberite Forum (
+-- Forum: Plugins (
+--- Forum: Plugin Requests (
+--- Thread: Anti-explorer (/thread-1594.html)

Anti-explorer - xoft - 09-25-2014

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.

RE: Anti-explorer - tryy3 - 09-25-2014

Wouldn't the easiest way be to count how many new chunks are being generated by a specific player instead of checking pos?

RE: Anti-explorer - xoft - 09-25-2014

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.

RE: Anti-explorer - tryy3 - 09-25-2014

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

RE: Anti-explorer - xoft - 09-25-2014

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.

RE: Anti-explorer - tryy3 - 09-26-2014

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...

RE: Anti-explorer - LogicParrot - 09-30-2014

This is a related plugin:

RE: Anti-explorer - tryy3 - 10-01-2014

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