diff --git a/src/network/connection.cpp b/src/network/connection.cpp index 69deb4dd5..d51324ed4 100644 --- a/src/network/connection.cpp +++ b/src/network/connection.cpp @@ -2924,7 +2924,7 @@ void Connection::Send(u16 peer_id, u8 channelnum, ConnectionCommand c; - c.send(peer_id, channelnum, pkt->oldForgePacket(), reliable); + c.send(peer_id, channelnum, pkt, reliable); putCommand(c); } diff --git a/src/network/connection.h b/src/network/connection.h index 33b7d0f7f..0aa63d4cf 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -437,19 +437,12 @@ struct ConnectionCommand peer_id = peer_id_; } void send(u16 peer_id_, u8 channelnum_, - SharedBuffer data_, bool reliable_) + NetworkPacket* pkt, bool reliable_) { type = CONNCMD_SEND; peer_id = peer_id_; channelnum = channelnum_; - data = data_; - reliable = reliable_; - } - void sendToAll(u8 channelnum_, SharedBuffer data_, bool reliable_) - { - type = CONNCMD_SEND_TO_ALL; - channelnum = channelnum_; - data = data_; + data = pkt->oldForgePacket(); reliable = reliable_; } diff --git a/src/network/networkpacket.cpp b/src/network/networkpacket.cpp index b2b1974d7..cfbca32d3 100644 --- a/src/network/networkpacket.cpp +++ b/src/network/networkpacket.cpp @@ -510,7 +510,7 @@ NetworkPacket& NetworkPacket::operator<<(video::SColor src) return *this; } -SharedBuffer NetworkPacket::oldForgePacket() +Buffer NetworkPacket::oldForgePacket() { SharedBuffer sb(m_datasize + 2); writeU16(&sb[0], m_command); diff --git a/src/network/networkpacket.h b/src/network/networkpacket.h index e8c8565b0..4a801b444 100644 --- a/src/network/networkpacket.h +++ b/src/network/networkpacket.h @@ -104,7 +104,7 @@ public: NetworkPacket& operator<<(video::SColor src); // Temp, we remove SharedBuffer when migration finished - SharedBuffer oldForgePacket(); + Buffer oldForgePacket(); private: template void checkDataSize() {