How to maintain player connections.
ExitVip
✭
Hello. I have a question. I want to maintain a list of connections for all players. I might add, remove, or retrieve a player's connection to this list. For example, when a player goes online, I need to add his connection to the list, and when the player drops, I need to remove the connection. Can you give me a suggestion on what data structures to use to maintain this list. List or Dictionary. Do I need to focus on multithreaded access. Do I need to use thread locks.
0
Comments
-
Can someone give me some advice0
-
@Kaiserludi admin0
-
We are using ConcurrentDictionary for this purpose. Please note that you should not use Peer's ConnectionId property as a key, because it is not guaranteed to be unique,0