You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using PeerJS’s 'unavailable-id' error type, it might be possible to automatically decide which client is the host.
All clients would initially attempt to claim the host ID.
If a client receives the 'unavailable-id' error, that indicates a peer has already taken the role of host and the client should attempt to connect to the existing host.
API could be P2P({ isHost: 'auto' }).
This has the advantage of the web app not needing to decide who hosts in advance. Just fire up the P2P transport and the first client to connect will host.
The disadvantage would likely be primarily for longer running games once #3 is implemented. With state persistence it would probably be desirable to have a static host. Some form of #4 could mitigate that: any client can host and all clients persist state.
The text was updated successfully, but these errors were encountered:
Using PeerJS’s
'unavailable-id'
error type, it might be possible to automatically decide which client is the host.All clients would initially attempt to claim the host ID.
If a client receives the
'unavailable-id'
error, that indicates a peer has already taken the role of host and the client should attempt to connect to the existing host.API could be
P2P({ isHost: 'auto' })
.This has the advantage of the web app not needing to decide who hosts in advance. Just fire up the
P2P
transport and the first client to connect will host.The disadvantage would likely be primarily for longer running games once #3 is implemented. With state persistence it would probably be desirable to have a static host. Some form of #4 could mitigate that: any client can host and all clients persist state.
The text was updated successfully, but these errors were encountered: