Visitar URL original
Add a spawned persistent spheres (server side) example by vincentfretin · Pull Request #328 · networked-aframe/networked-aframe · GitHub
Skip to content

Add a spawned persistent spheres (server side) example - #328

Draft
vincentfretin wants to merge 1 commit into
masterfrom
persistent-room-server
Draft

vincentfretin wants to merge 1 commit into
masterfrom
persistent-room-server

Conversation

@vincentfretin

@vincentfretin vincentfretin commented Mar 26, 2022 •

Copy link
Copy Markdown
Member

#327 was using a peer to peer persistence.
In this example, we save the persistent entities server side. This addresses #139

  • keep in memory server side the persistent entities (using the NAF u persistent firstSync messages may not be the right way though, this requires to have unreliable transport on the websocket, so currently with wseasyrtc, see Make the easyrtc adapter unreliable transport configurable #324 to use websocket for easyrtc adapter)
  • broadcast persistentEntityCreated message to all participants from the server when a participant create a persistent entity
  • send persistentEntities message from the server that includes all persistent entities of the room when a participant join the room
  • persistent-server component that do the necessary things with the persistentEntityCreated and persistentEntities messages coming from the server
  • use NAF option firstSyncSource to allow firstSync entities from the server only, see Add more doc about persistent entities #265
  • persist entities in a file on the filesystem (persisting in postgres via superbase out of scope for this repo)

@vincentfretin

Copy link
Copy Markdown
Member Author

To save on the server persistent entities, saving all components updates is probably wrong in some cases.
If you spawn for example a video, you want to save the position, rotation, scale and url of the video, but not the video.currentTime on the server. But you still want the video current time to be synced between participants.
So you want to save only if isFirstSync is true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant