Fix a header size

pull/33/head
Koncord 9 years ago
parent 114a11ea78
commit 1022b6b27c

@ -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);

@ -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);
}

@ -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:

Loading…
Cancel
Save