Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to auto sync specific var when user connect? #97

Closed
Vamoss opened this issue Feb 15, 2018 · 2 comments
Closed

Is there a way to auto sync specific var when user connect? #97

Vamoss opened this issue Feb 15, 2018 · 2 comments

Comments

@Vamoss
Copy link

Vamoss commented Feb 15, 2018

I have a situation where I don't use an object template because I have a fixed object in the scene. I need to propagate a property to all clients.
Thanks!

@Vamoss
Copy link
Author

Vamoss commented Feb 15, 2018

I know I could use broadcastDataGuaranteed, but it is hard to handle all the situations like:

When a new user connects
When the host changes the property
When I am the first user and need to configure the property

@haydenjameslee
Copy link
Collaborator

I would suggest making a custom A-Frame component that stores the property. Then have some way to determine who is the "host" of the room (we will eventually provide a nice way to do with through NAF but it doesn't exist yet) eg. ?host=true as a url parameter, or work out who has been in the room the longest. Whoever is the host then spawns this entity with the custom component and configures it. This will handle all your situations.

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

No branches or pull requests

2 participants