There is no Incoming Packet ID 12
opened this issue · comments
The code:
const CONNECTION_REQUEST = 12
public OnIncomingPacket(playerid, packetid, BitStream:bs)
{
printf("Packet ID: %i", packetid);
return 1;
}
IPacket:CONNECTION_REQUEST(playerid, BitStream:bs)
{
print("Connection request.");
return 1;
}
Output:
Packet ID: 24
[connection] incoming connection: ip:port id: 0
CONNECTION_REQUEST incoming packet never print something but OnIncomingPacket callback print ID 24 so I think there is a mistake in packets, I don't know is this only one problem in packet list.
There really seems to be a bug when comparing the IDs with several third-party sources:
https://github.com/cizaquita/FakeSAMP/blob/master/raknet/PacketEnumerations.h#L43
https://github.com/Dmitriy51/RakNet-Packets-SA-MP/blob/main/Packets.txt#L6
So now this and a few other incorrect cases is fixed: ID_CONNECTION_REQUEST is ID 11 now, as well as ID_AUTH_KEY is ID 12.
But I can assume that "print" function is not applied for other reasons: some of these packets sends to the server even before the player fully establishes a connection and receives his playerid. At the same time, all access to sync you have, you have by playerid, which means that the player should already have it at that time.
Anyway, there really were a couple of mistakes that have now been fixed. Thanks!