1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add session_t typedef + remove unused functions (#6470)

* Add session_t typedef + remove unused functions

u16 peer_id is used everywhere, to be more consistent and permit some evolutions on this type in the future (i'm working on a PoC), uniformize u16 peer_id to SessionId peer_id
This commit is contained in:
Loïc Blot 2017-09-27 19:47:36 +02:00 committed by GitHub
parent 50b2185ced
commit ad7daf7b52
24 changed files with 294 additions and 283 deletions

View file

@ -21,8 +21,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <sstream>
#include "networkexceptions.h"
#include "util/serialize.h"
#include "networkprotocol.h"
NetworkPacket::NetworkPacket(u16 command, u32 datasize, u16 peer_id):
NetworkPacket::NetworkPacket(u16 command, u32 datasize, session_t peer_id):
m_datasize(datasize), m_command(command), m_peer_id(peer_id)
{
m_data.resize(m_datasize);
@ -49,7 +50,7 @@ void NetworkPacket::checkReadOffset(u32 from_offset, u32 field_size)
}
}
void NetworkPacket::putRawPacket(u8 *data, u32 datasize, u16 peer_id)
void NetworkPacket::putRawPacket(u8 *data, u32 datasize, session_t peer_id)
{
// If a m_command is already set, we are rewriting on same packet
// This is not permitted