RandyGaul / cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
4.24k stars 264 forks source link

Issues in cute_net that I'm not sure if are bugs or not. #300

Closed roig closed 2 years ago

roig commented 2 years ago

This is reading an uint32 and saving it to uint16. Could you check if you are writing 32 and not 16 in the packet when sending it? (i can't find where is being written >_<) https://github.com/RandyGaul/cute_headers/blob/f5f74fcaf14046044e2bdbe7bd44e9660a17f244/cute_net.h#L5788

Always returning 0 ? https://github.com/RandyGaul/cute_headers/blob/f5f74fcaf14046044e2bdbe7bd44e9660a17f244/cute_net.h#L8955

client_index is not used, is it correct? https://github.com/RandyGaul/cute_headers/blob/f5f74fcaf14046044e2bdbe7bd44e9660a17f244/cute_net.h#L8834

RandyGaul commented 2 years ago
  1. I originally had this as a uint16 but for some reason changed it to 32 bits, and never updated the rest of the code. I did just double check. Both read/write of the value are 32 bits, and the protocol doc says 32 bits. So a typecast here is sufficient. The rest of the code's runtime doesn't need to be changed to match bitsize.
  2. That's not implemented yet. There's a note about it in the LIMITATIONS section.
  3. client_index is used elsewhere, but not in that particular callback. A (void)client_index should be sufficient to suppress your warnings.
roig commented 2 years ago

Ok! then we can close this :)