Hi there, first time poster here and the project I'm working on is my first with nodeJS, though I do know other programming languages.I am making a simple card game that lets any given person connect and the server should be smart enough to put two random unassigned connections into their own room together to play the game.I am wondering if there is a known method in nodeJS to do this easier than just counting the connections. Currently I am pushing all new socket.id connections into an array, then have a separate function periodically sweeping this array and assign them two-by-two into a newly spawned room. Is this inefficient? Any feedback on how I could do it better would be greatly appreciated as I'm a nodeJS newbie!! :]
Submitted July 03, 2018 at 02:19PM by Grandpa_Willy
No comments:
Post a Comment