For a game server with 500-1000 clients using UDP where each client sends their id with the packet, what would be the most effective way to store the clients on the server for fast lookup based on their id?
I'm thinking an implementation of a binary tree, but I'm open to suggestions from people who have done this before.
Don't store it based on ID, since that violates the "never trust the client" law.
The client should be proving who they are rather than instructing who they are.
Personally I'd store them in a hash table with they key composed of the client's IP, return UDP port and a secret id that only that client knows about.