Only sync block updates to clients that are in range.
Currently all block changes are sent to all clients.
There is a TODO for this in server/src/sys/terrain_sync.rs
.
The main difficulty is figuring out how to efficiently separate out what to send to each client. In the case where there are many updates within a single chunk at the same time it would be ideal to group all those together and then send that to each client that can see that chunk. However, in the case where block changes are more sparsely distributed it would be better to just create a HashMap
(or maybe a Vec
) for each client and then fill that collection with the individual block updates that are within the range of that client. Both of these cases seem like they have the potential to occur in veloren.