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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recommended Cloud Solution


    ksweb.net

×
×
  • Create New...

Important Information

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