1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-21 08:55:21 +01:00

Network: Batch individual particle packets (#16458)

also bumps proto ver
This commit is contained in:
Lars Müller
2025-09-22 18:46:34 +02:00
committed by GitHub
parent 4c29bf6923
commit 5f5ea13251
9 changed files with 116 additions and 51 deletions

View File

@@ -605,9 +605,11 @@ private:
void SendDeleteParticleSpawner(session_t peer_id, u32 id);
// Spawns particle on peer with peer_id (PEER_ID_INEXISTENT == all)
void SendSpawnParticle(session_t peer_id, u16 protocol_version,
const ParticleParameters &p);
// Spawn particles for a specific client, batching them if clients support it.
void SendSpawnParticles(RemotePlayer *player,
const std::vector<ParticleParameters> &particles);
// Spawn all particles for this step, batching them if clients support it.
void SendSpawnParticles();
void SendActiveObjectRemoveAdd(RemoteClient *client, PlayerSAO *playersao);
void SendActiveObjectMessages(session_t peer_id, const std::string &datas,
@@ -805,6 +807,10 @@ private:
MetricCounterPtr m_packet_recv_counter;
MetricCounterPtr m_packet_recv_processed_counter;
MetricCounterPtr m_map_edit_event_counter;
// Particles to send this server step
// [playername] = list of params, empty playername for broadcast
std::unordered_map<std::string, std::vector<ParticleParameters>> m_particles_to_send;
};
/*