I'm currently developing a poker texas holdem application using node.js, socket.io and javascript.
The problem I'm having is when I try to shuffle the deck using a math.random function it shuffles the deck as intended but it shuffles the deck differently to for each user connected to the the application.
Basically I want to be able to shuffle the deck using some kind of random function but still shuffle it the same way for all users.
I'm using io.sockets.emit(); to use the shuffle function on all users.
Shuffle the deck on the server side (node.js) and then send every user his cards and community cards.
If it lets you set a seed, share the seed between players then allow them to shuffle the cards using this seed for their random number generator.
The other way would be to get the host to shuffle then let the host tell the other players what order their cards should be in.