I am trying to use Extension Interoperability, so i can split down the character information pull from the database into multiple extensions so they can be reused for loading an enemy character without pulling there inventory. I know i could create another extension and copy the code but i dont think thats right to do. It's going to become a very long script accounting for each Item type amongst other things. Especially if all we need to know is the enemy CharacterProperties.
So i have a main class in the RPG Example. GetModelhandler, this pulls 5 hashtables of information for all the information for the character. I have created another script to pull only CharacterProperties but i cannot seem to get the GetModelHandler to call the GetCharProperties.
So checking the example on http://docs2x.smartfoxserver.com/Extens ... w#advanced
I have the below in a second extension
Code: Select all
@Override
public Object handleInternalMessage(User sender, ISFSObject params)
{
etc.
}
How ever as the code isnt within the main extension I want the Zone extension to pass to the extension that will control which data to query to then query any of the 5 internalmessages.
Code: Select all
MyZoneExtension zoneExt = (MyZoneExtension) getParentZone().getExtension();
Vec3D vec = zoneExt.handleInternalMessage("test", someVec3D);
From my understanding grabs the parent zone extension zoneExt and then handles the internal event.
What i am unsure is how i can do that when i need to instantiate a new GetCharProperties.
Any help appreciated, Thank you.