-
Notifications
You must be signed in to change notification settings - Fork 294
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
Ownership change, gained, lost events no longer fire #178
Comments
I just looked into this with current master. I don't see anything wrong with the code. networked-aframe/src/components/networked.js Line 186 in 393ec7b
and is set on connect here networked-aframe/src/components/networked.js Line 269 in 393ec7b
and the condition you're referring here networked-aframe/src/components/networked.js Lines 216 to 219 in 393ec7b
seems to works as attended.
so the comparison between -1 and a date is true here. There is no need for and additional networked-aframe/examples/js/toggle-ownership.component.js Lines 28 to 49 in c3a12ae
|
I tested socketio, webrtc and easyrtc adapters, all three are working properly. |
Ach, thank you. Sorry, I should have closed this a while ago. |
Not sure when this started happening but on the most recent NAF update the ownership events do not fire (including on toggle-ownership example).
The issue seems stems from the comparison that happens in the component networked.js here:
networked-aframe/src/components/networked.js
Line 167 in 4ee7157
The lastOwnerTime variable is never initialized (and so the comparison between date and -1 is always false).
The following line, that also checks for the -1, appears to fix the issue but I am not certain it is the correct approach. Perhaps lastOwnerTime needs to be initialized on network creation :)
The text was updated successfully, but these errors were encountered: