setMyAvatarSkin functionality issues!

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

wadapav
Posts: 14
Joined: 29 Oct 2018, 11:00

setMyAvatarSkin functionality issues!

Postby wadapav » 31 Jan 2019, 09:06

using the setMyAvatarSkin method in the openspace object to broadcast the changes in the players skin to all other clients. My problem is that it seems to be causing the skin property setting twice for the local player.

Based on the documentation the following definition of skin seems to cause the property to set directly and not by way of the setUserVariables.

"This property is set by OpenSpace when the IOpenSpaceAPI.setMyAvatarSkin method is called on the client of the avatar's owner."

So the skin property is set and subsequent skin replacement functionality executed to effect the client side skin change.

The problem:

After the skin is changed by what seems to be a direct call on the client side it is also effected by the setUserVariables broadcast and applies the change again.

This would seem like an easy fix to just skip this second unexpected update but I cannot tell where the property update is coming from to assist with the condition to apply or skip.

Is there some way to know what caused the skin property update to help facilitate the decision making or does it seem like the functionality I am experiencing is not the default behaviour?
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: setMyAvatarSkin functionality issues!

Postby Bax » 01 Feb 2019, 10:11

I think this is the issue:
After the skin is changed by what seems to be a direct call on the client side it is also effected by the setUserVariables broadcast and applies the change again.

Actually you shouldn't change the skin directly. You just need to call the setMyAvatarSkin method. This will cause the skin change on your client and all other clients. In fact if you check our example, that's the way it works.
Hope this helps.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 15 guests