aboutsummaryrefslogtreecommitdiff
path: root/src/network/packethandlers
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-13 22:01:49 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-13 22:01:49 +0100
commit083c8c734e8af037d8ad3a1a35475a5d4756572c (patch)
tree4265ace09d605b3d1fbcde7dde2e2510798171ea /src/network/packethandlers
parent74d34da6cbb06a4d5659eb3287a87239c31da22c (diff)
downloadminetest-083c8c734e8af037d8ad3a1a35475a5d4756572c.tar.gz
minetest-083c8c734e8af037d8ad3a1a35475a5d4756572c.tar.bz2
minetest-083c8c734e8af037d8ad3a1a35475a5d4756572c.zip
Replace NetworkPacket pointers to references
Diffstat (limited to 'src/network/packethandlers')
-rw-r--r--src/network/packethandlers/client.cpp8
-rw-r--r--src/network/packethandlers/server.cpp6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/network/packethandlers/client.cpp b/src/network/packethandlers/client.cpp
index 838c85989..5acf04f91 100644
--- a/src/network/packethandlers/client.cpp
+++ b/src/network/packethandlers/client.cpp
@@ -77,8 +77,8 @@ void Client::handleCommand_AuthAccept(NetworkPacket* pkt)
<< m_recommended_send_interval<<std::endl;
// Reply to server
- NetworkPacket* resp_pkt = new NetworkPacket(TOSERVER_INIT2, 0);
- Send(resp_pkt);
+ NetworkPacket resp_pkt(TOSERVER_INIT2, 0);
+ Send(&resp_pkt);
m_state = LC_Init;
}
@@ -128,8 +128,8 @@ void Client::handleCommand_InitLegacy(NetworkPacket* pkt)
}
// Reply to server
- NetworkPacket* resp_pkt = new NetworkPacket(TOSERVER_INIT2, 0);
- Send(resp_pkt);
+ NetworkPacket resp_pkt(TOSERVER_INIT2, 0);
+ Send(&resp_pkt);
m_state = LC_Init;
}
diff --git a/src/network/packethandlers/server.cpp b/src/network/packethandlers/server.cpp
index ee30dfd06..9070be356 100644
--- a/src/network/packethandlers/server.cpp
+++ b/src/network/packethandlers/server.cpp
@@ -617,14 +617,14 @@ void Server::handleCommand_Init_Legacy(NetworkPacket* pkt)
Answer with a TOCLIENT_INIT
*/
- NetworkPacket* resp_pkt = new NetworkPacket(TOCLIENT_INIT_LEGACY, 1 + 6 + 8 + 4,
+ NetworkPacket resp_pkt(TOCLIENT_INIT_LEGACY, 1 + 6 + 8 + 4,
pkt->getPeerId());
- *resp_pkt << (u8) deployed << (v3s16) floatToInt(v3f(0,0,0), BS)
+ resp_pkt << (u8) deployed << (v3s16) floatToInt(v3f(0,0,0), BS)
<< (u64) m_env->getServerMap().getSeed()
<< g_settings->getFloat("dedicated_server_step");
- Send(resp_pkt);
+ Send(&resp_pkt);
m_clients.event(pkt->getPeerId(), CSE_Init);
}