mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Make MapEditEvent more complete
SetBlocksNotSent is no longer used.
This commit is contained in:
@@ -696,11 +696,13 @@ void Server::AsyncRunStep(bool initial_step)
|
||||
std::map<v3s16, MapBlock*> modified_blocks;
|
||||
m_env->getServerMap().transformLiquids(modified_blocks, m_env);
|
||||
|
||||
/*
|
||||
Set the modified blocks unsent for all the clients
|
||||
*/
|
||||
if (!modified_blocks.empty()) {
|
||||
SetBlocksNotSent(modified_blocks);
|
||||
MapEditEvent event;
|
||||
event.type = MEET_OTHER;
|
||||
for (const auto &pair : modified_blocks) {
|
||||
event.modified_blocks.insert(pair.first);
|
||||
}
|
||||
m_env->getMap().dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
m_clients.step(dtime);
|
||||
@@ -1253,17 +1255,6 @@ void Server::onMapEditEvent(const MapEditEvent &event)
|
||||
m_unsent_map_edit_queue.push(new MapEditEvent(event));
|
||||
}
|
||||
|
||||
void Server::SetBlocksNotSent(std::map<v3s16, MapBlock *>& block)
|
||||
{
|
||||
std::vector<session_t> clients = m_clients.getClientIDs();
|
||||
ClientInterface::AutoLock clientlock(m_clients);
|
||||
// Set the modified blocks unsent for all the clients
|
||||
for (const session_t client_id : clients) {
|
||||
if (RemoteClient *client = m_clients.lockedGetClientNoEx(client_id))
|
||||
client->SetBlocksNotSent(block);
|
||||
}
|
||||
}
|
||||
|
||||
void Server::peerAdded(con::Peer *peer)
|
||||
{
|
||||
verbosestream<<"Server::peerAdded(): peer->id="
|
||||
|
Reference in New Issue
Block a user