On Wed, Oct 30, 2013 at 10:05:43AM -0700, Paul Canning wrote:
> I'm looking to make some small games that can be played over a local 
> network (or if the app is published online, private rooms using socket.io)
> 
> Is there a way to set one device, say an iPad, as the "Master" device 
> (image the dealer in Poker) and then have the connected clients (people on 
> their own tablet or smartphone) as the "Slaves".
> 
> It would mean the Master has a different display to the Slaves (for the 
> Poker example, the Master would show the community cards and the Slaves 
> would only see their 2 cards).
> 
> I'm certain this is possible, but I'd like some pointers on how to 
> differentiate the master from the slaves and show different information to 
> either party.

In this context, I'd suggest that you've got two problems: First, the clients
all have to connect -- if there's no server, that means a shared network of
some sort. If there is, that may well be where the logic should live (unless
you're going to invent a protocol for them to talk to each other and agree on
state. This way possibly leads to madness, since distributed systems are hard.)

The next stage would be having each client read that shared state and display
appropriately. If there's a central server, it can arbitrate all that and only
show clients what they need to see; if there's not, well, now you have 2N+1
problems, and replication is just one.

The player who's in charge of a game does not neccesarily have to be the same
machine that runs that game. Servers are nice that way.

Aria

Attachment: pgpEe_Zhh09wi.pgp
Description: PGP signature

Reply via email to