Its basically just a counter as it is implemented now. So the player id will be 1-n where n is the total amount of users to ever join that game instance.
/Chris
NonobaGameUser.UserId question
Chris说
很久以前 | 帖子#2
zproxy说
很久以前 | 帖子#3you could always use the mod operator.
var color = NonobaGameUser.UserId % 8
var color = NonobaGameUser.UserId % 8
vitch说
很久以前 | 帖子#4Thanks for the reply Chris... And thanks for the suggestion zproxy - that wouldn't quite work for me though because I could end up with more than one user with the same colour... It's easy enough to work around, I was just wondering if I needed to bother with the deadline fast appoaching...
Thanks again,
Kelvin :)
Thanks again,
Kelvin :)
greenseed说
很久以前 | 帖子#5how do you delete messages???
帖子#6被删除了
回复主题
现在就注册以回复主题
vitch说
很久以前 | 帖子#1Does the NonobaGameUser.UserId uniquely identify a given user globally or only within one game session?
My game has up to 8 players at a time. I need to assign one of 8 colours to each of the users playing. Can I just use the user id and presume it is between 0 and 7 (as it seems to be on the development server). Or do I need to write some additional logic to assign some kind of instance id. Especially since people could leave and new people could join during the course of a game...
The documentation says: "An unique id for this connected player for the entire lifetime of the game. Useful for identifying one player from another in messages sent between the clients and the server."
From this it isn't clear to me if e.g. user 4 leaves and a new user joins then will they be assigned the old user id of 4 or will they be assigned a new user id (which would possibly be > 7)?
Thanks,
Kelvin :)