diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-04 17:48:07 +0100 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-03-05 16:49:51 +1000 |
commit | b214cde5b4a833e1826ec6850b95bf1938c8b0a0 (patch) | |
tree | 1692546699da08769e7d5e6c10435fb037924aa3 /src/server.cpp | |
parent | 9e675793155d7cd56bbd2222df7b45245008c647 (diff) | |
download | minetest-b214cde5b4a833e1826ec6850b95bf1938c8b0a0.tar.gz minetest-b214cde5b4a833e1826ec6850b95bf1938c8b0a0.tar.bz2 minetest-b214cde5b4a833e1826ec6850b95bf1938c8b0a0.zip |
Remove Queue class which uses std::list and use native std::queue
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/server.cpp b/src/server.cpp index 2587c2d89..444fbc751 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -906,7 +906,8 @@ void Server::AsyncRunStep(bool initial_step) while(m_unsent_map_edit_queue.size() != 0) { - MapEditEvent* event = m_unsent_map_edit_queue.pop_front(); + MapEditEvent* event = m_unsent_map_edit_queue.front(); + m_unsent_map_edit_queue.pop(); // Players far away from the change are stored here. // Instead of sending the changes, MapBlocks are set not sent @@ -1292,7 +1293,7 @@ void Server::onMapEditEvent(MapEditEvent *event) if(m_ignore_map_edit_events_area.contains(event->getArea())) return; MapEditEvent *e = event->clone(); - m_unsent_map_edit_queue.push_back(e); + m_unsent_map_edit_queue.push(e); } Inventory* Server::getInventory(const InventoryLocation &loc) @@ -1395,7 +1396,7 @@ void Server::peerAdded(con::Peer *peer) c.type = con::PEER_ADDED; c.peer_id = peer->id; c.timeout = false; - m_peer_change_queue.push_back(c); + m_peer_change_queue.push(c); } void Server::deletingPeer(con::Peer *peer, bool timeout) @@ -1409,7 +1410,7 @@ void Server::deletingPeer(con::Peer *peer, bool timeout) c.type = con::PEER_REMOVED; c.peer_id = peer->id; c.timeout = timeout; - m_peer_change_queue.push_back(c); + m_peer_change_queue.push(c); } bool Server::getClientConInfo(u16 peer_id, con::rtt_stat_type type, float* retval) @@ -1458,7 +1459,8 @@ void Server::handlePeerChanges() { while(m_peer_change_queue.size() > 0) { - con::PeerChange c = m_peer_change_queue.pop_front(); + con::PeerChange c = m_peer_change_queue.front(); + m_peer_change_queue.pop(); verbosestream<<"Server: Handling peer change: " <<"id="<<c.peer_id<<", timeout="<<c.timeout @@ -1837,7 +1839,7 @@ void Server::SendPlayerHP(u16 peer_id) // Send to other clients std::string str = gob_cmd_punched(playersao->readDamage(), playersao->getHP()); ActiveObjectMessage aom(playersao->getId(), true, str); - playersao->m_messages_out.push_back(aom); + playersao->m_messages_out.push(aom); } void Server::SendPlayerBreath(u16 peer_id) |