-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add address map for better client index looking up #120
Conversation
Some warnings need to be fixed, see above. |
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 #define NETCODE_ADDRESS_MAP_BUCKETS 256 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add functions netcode_map_create and netcode_map_destroy that use the allocator, the same way these methods are used for other types. -- thanks!
I have added the create and destroy functions using allocator. |
Merged. Thanks! |
No description provided.