Server Render Distance Based on Current Players
#1
So I run my Cuberite server on a Raspberry Pi. As such I can't support many players and a high render distance at same time. But a high render distance would be nice when alone on the server. Would it be possible for a plugin to change the server render distance based on the number of current players in the server without restarting?
Reply
Thanks given by:
#2
Hello, welcome to the forum.

Such a plugin would be already half-possible with the current API. The render distance (called View Distance in our code) is settable on a per-client basis through cClientHandle:SetViewDistance(); it is clamped to the world's max view distance (cWorld:SetMaxViewDistance()). However, just setting the view distance will NOT unload the chunks that were already loaded for the client and it will not load new chunks; it will only affect loading and unloading while the player moves around. This may be insufficient for your use case. There are internal methods that load and unload chunks (cClientHandle::StreamNextChunk(), cClientHandle::UnloadOutOfRangeChunks()), we might export them to the API for plugins to use.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)