Update of patch #3698 (project freeciv):
Category: None => docs
_______________________________________________________
Follow-up Comment #5:
> Packets without a key will use the previous packet of the same
> kind.
Yes.
> Packets with one key will use the previous packet of the same
> kind that had the same key.
Yes.
> Packets with two keys will use the previous packet of the same
> kind that has the same value when the keys are combined taking
> the first byte of key1 followed by the rest of key1 xor'ed
> with key2.
No. It takes in account both keys. There are two functions passed to the hash
table initialization :
* hash_packet_xxx() which returns a hash value (the index of the hash table
where to start to lookup). With 2 keys, as for coordinates for Freeciv <= 2.1,
it is calculated as :
((key1 << 8) ^ key2)
So, the combination of both keys with a xor'ed value issued from the first key
left-shifted by 1 byte and the second key. I don't know how it is supposed to
work with other types...
* cmp_packet_xxx() which returns 0 only if both keys are matched. This is the
function that grant that both keys are correctly checked.
Note that there is no packet using 2 keys currently.
> If no previous packet following those conditions exist it will
> use zero.
Yes.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?3698>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev