lsalzman / enet

ENet reliable UDP networking library
MIT License
2.66k stars 667 forks source link

ID's for Connected Computers #251

Closed cuppajoeman closed 2 months ago

cuppajoeman commented 2 months ago

Hi there, I'm working on a client-server multiplayer game.

I want to send back a game update which contains all the players and their current positions, on the client I am going to iterate through this list and if the ID of the current player we are iterating through is the same as the client's ID then I want to use this to do some special rendering (that indicates you are controlling this player).

My question is if I have to implement this ID system myself or if enet gives unique ID's out on connection which can be used for this purpose.


Also I was trying to figure this out myself. Here's what I've looked at:

cuppajoeman commented 2 months ago

I spoke to lsalzman and he said not to use that attribute because it is for internal use only and might not be unique, instead you can implement your own system which generates unique ID's for connected users