mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Server: Only send node removal/addition to client if client's player is near it. Otherwise set the modified blocks unsent.
This commit is contained in:
parent
b5ace9a064
commit
3269fce795
2 changed files with 86 additions and 7 deletions
11
src/server.h
11
src/server.h
|
@ -403,8 +403,15 @@ private:
|
|||
void SendInventory(u16 peer_id);
|
||||
void SendChatMessage(u16 peer_id, const std::wstring &message);
|
||||
void BroadcastChatMessage(const std::wstring &message);
|
||||
void sendRemoveNode(v3s16 p, u16 ignore_id=0);
|
||||
void sendAddNode(v3s16 p, MapNode n, u16 ignore_id=0);
|
||||
/*
|
||||
Send a node removal/addition event to all clients except ignore_id.
|
||||
Additionally, if far_players!=NULL, players further away than
|
||||
far_d_nodes are ignored and their peer_ids are added to far_players
|
||||
*/
|
||||
void sendRemoveNode(v3s16 p, u16 ignore_id=0,
|
||||
core::list<u16> *far_players=NULL, float far_d_nodes=100);
|
||||
void sendAddNode(v3s16 p, MapNode n, u16 ignore_id=0,
|
||||
core::list<u16> *far_players=NULL, float far_d_nodes=100);
|
||||
|
||||
// Environment and Connection must be locked when called
|
||||
void SendBlockNoLock(u16 peer_id, MapBlock *block, u8 ver);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue