Closed kienhg96 closed 10 months ago
First issue. The map returns 0 if the client index isn't found, but client index of 0 is a valid index.
Please change that to return -1 if client index is found
Please change
To be some function of the max clients, because as the max clients increases for the server, you will need more buckets.
(Maybe it should just be #define NETCODE_ADDRESS_MAP_BUCKETS NETCODE_MAX_CLIENTS? Then the size is n^2 on max clients... which is fine, and it handles worst case)
Please add a unit test for the map
Ok, I'll check them
I fixed the issues above, please have a check
I have added the create and destroy functions using allocator.
I think you should wrap the allocator_context
, allocate_function
and free_function
to a new struct called allocator
.
It could be much more convenient.
Merged. Thanks!
Some warnings need to be fixed, see above.