Rewrite multiplayer mode to WebRTC #177
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are unwanted changes in index.html.
This approach still uses Firebase, but changes its role to only act as signaling. All drawing activities should be handled by WebRTC.
This would mean a major overhaul of how sessions are handled.
Proposed architecture
mesh connection:
every client will communicate its local state like cursor position and if its a host
start connection:
host establishes stream to every connecting remote to send them the canvas
if host leaves, peers decide which one of them takes host status and host establish new stream to other peers.
for MVP host should be able to edit the canvas, while clients can send changes that are applied by host