summaryrefslogtreecommitdiff
path: root/src/clientiface.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2018-03-08 22:58:43 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-03-09 23:27:26 +0100
commit6036f865cba44fd26374a3a649370f51d5d4ff6c (patch)
treedb455a782214ba65356196bf7fd4dd80ce9174d2 /src/clientiface.cpp
parentb592c52f1cafa0e668817b0c01347cc7402d035c (diff)
downloadminetest-6036f865cba44fd26374a3a649370f51d5d4ff6c.tar.gz
minetest-6036f865cba44fd26374a3a649370f51d5d4ff6c.tar.bz2
minetest-6036f865cba44fd26374a3a649370f51d5d4ff6c.zip
Drop less performant Server::setBlockNotSent for ClientInterface::markBlockposAsNotSent
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r--src/clientiface.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index a3c44fb9e..3a6caf800 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -648,6 +648,15 @@ std::vector<session_t> ClientInterface::getClientIDs(ClientState min_state)
return reply;
}
+void ClientInterface::markBlockposAsNotSent(const v3s16 &pos)
+{
+ MutexAutoLock clientslock(m_clients_mutex);
+ for (const auto &client : m_clients) {
+ if (client.second->getState() >= CS_Active)
+ client.second->SetBlockNotSent(pos);
+ }
+}
+
/**
* Verify if user limit was reached.
* User limit count all clients from HelloSent state (MT protocol user) to Active state