Hi, If you want to do something using the LAN this can help 
https://github.com/wankdanker/node-discover (look the examples/master.js 
file)
The first user will be the master and any other user a "slave". If the 
master disconnect it will elect a new master.

Or you can use something like https://github.com/stianeikeland/node-etcd to 
create the same thing but without using the broadcast address (using http 
with less network overhead)

On Monday, November 4, 2013 7:12:08 AM UTC-3, Paul Canning wrote:
>
> In this instance, the "Master" will be essentially "Player 1" and gets 
> assigned, in the Poker example, as the dealer (display for the community 
> cards).
>
> My post is asking more of a "how to" rather then the idea.
>
> Are there any examples of what I am describing? Are there any packages 
> that help implement this kind of multi-user relationship? I will be using 
> Socket.io (or similar) to deal with the data flow over websockets, and I 
> know this has rooms, which will be utilised.
>
> Is there a way to find users automatically on the same LAN?
>
> On Saturday, November 2, 2013 12:04:03 AM UTC, Aria Stewart wrote:
>>
>> 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 
>>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to