Jump to content

Recommended Posts

Posted

Not a huge deal but I'm curious:

 

In the UMAPropertyHandler in the ObjectNodeReady() method the property handlers are being registered.

 

If when an "other" player exits the world are the current players registered object property change handlers automatically unregistered for the "other" player? or is there a way to detect that the "other" player exited so that I can unregister the handlers myself? I'm just wondering if I have registered property handlers that are accumulating and never getting unregistered. I can see a message on the Editor console "Removing Node for , OID " but in the UMAPropertyHandler I don't know how to catch that.

 

Thanks

Posted

I'm not sure if it needed to be done but this is how I ended up doing it in the UMAPropertyHandler:

   // Use this for initialization
   void Start()
   {
       SceneManager.sceneLoaded += SceneLoaded;
       ClientAPI.WorldManager.ObjectRemoved += WorldManager_ObjectRemoved;
   }

   private void WorldManager_ObjectRemoved(object sender, AtavismObjectNode objNode)
   {
       if (objNode.Oid == GetComponent().Oid)
       {
           Debug.Log("****************************************************atavismNode needs to be removed for:  " + GetComponent().GetComponent().name);
           GetComponent().RemoveObjectPropertyChangeHandler("beltDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("capeDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("chestDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("feetDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("handDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("headDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("legDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("shoulderDisplayID", EquipmentChangeHandler);
           GetComponent().RemoveObjectPropertyChangeHandler("umaData", UmaDataHandler);
       }
   }

Posted

This is for my modified UMAPropertyHandler for my attempt at implementing UMA2.5 so it would need to be modified if you are not using UMA2.5.

 

The reason I did this is because I suspect that registered events are not being unregistered when a player exits the game.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recommended Cloud Solution


    ksweb.net

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.