1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 18:19:55 +00:00

Fix a header size

This commit is contained in:
Koncord 2016-08-06 03:28:01 +08:00
parent 114a11ea78
commit 1022b6b27c
3 changed files with 4 additions and 4 deletions

View file

@ -161,7 +161,7 @@ void Networking::ReciveMessage(RakNet::Packet *packet)
{
RakNet::RakNetGUID id;
if(packet->length < 3)
if(packet->length < 2)
return;
RakNet::BitStream bsIn(&packet->data[1], packet->length, false);

View file

@ -16,7 +16,7 @@ void BasePacket::Packet(RakNet::BitStream *bs, BasePlayer *player, bool send)
if(send)
{
bs->Write((RakNet::MessageID) packetID);
bs->Write(packetID);
bs->Write(player->guid);
}
}
@ -66,7 +66,7 @@ void BasePacket::SetSendStream(RakNet::BitStream *bitStream)
void BasePacket::RequestData(RakNet::RakNetGUID player)
{
bsSend->ResetWritePointer();
bsSend->Write((RakNet::MessageID) packetID);
bsSend->Write(packetID);
bsSend->Write(player);
peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, 0, player, false);
}

View file

@ -35,7 +35,7 @@ namespace mwmp
size_t headerSize()
{
return 10; // 10 == char + char + RakNetGUID (uint64_t)
return 9; // 9 == packetID + RakNetGUID (uint64_t)
}
protected: