OK so skimming through our version of the code which I think is the last working version I made this checklist for the calling sequence to get an NPC instantiated and good to go.
Note that this does not include any of the other leads to check. This is a preliminary before I can do any of that....
Calling sequence points to check when an NPC appears in a region:
• First part is register the client interface with the scene.
○ i.e. Scene.RegisterModuleInterface(this);
§ here check the Scene is valid
• next is create the avatar instance
○ npcAvatar = new NPCAvatar(first, last, pos, p_scene)
§ here you need to check the p_scene is valid
• next is create the circuit data
○ check each piece of the circuit data object
• next is adding the circuit to the scene
○ p_scene.AuthenticatedHandler.AddNewCircuit(circuitdata, ACD)
§ make sure p_scene is valid
§ make sure ACD is valid
§ make sure circuitdata is not null
• next is add the client (NPCAvatar) to the scene
○ p_scene.addnewclient(npca)
§ make sure p_scene is valid
§ make sure npca is valid
• next is get the scenepresence back out of the scene
○ p_scene.TryGetScenePresence(npca.agentID, out sp)
§ check p_scene is valid
§ check npca is valid
§ check npca.agentID is not null
§ make sure you get a scenepresence back in sp
• next is get the avatar appearance
○ AvatarAppearance x = GetAppearance(p_cloneappearancefrom, p_scene)
§ check p_cloneappearancefrom is a valid and existing uuid
§ check p_scene is valid
• get the avatar data - what is this? what does avatar data mean?
○ AvatarData adata = scene.AvatarService.GetAvatar(agentID)
§ make sure adata returns a non-null AvatarData - a new one at the worst
§ make sure scene is valid
§ make sure agentID is not null
• then set the appearance of the avatar corresponding to the scenepresence
○ sp.setappearance(x.texture, (byte[])x.VisualParams.Clone());
§ what does this mean?
§ check sp is valid
§ check x.texture is valid
§ check x.VisualParams.Clone returns something
• Add the newly rezzed avatar to the list of npcs
○ m_avatars.add(npca.AgentID, npca)
§ make sure m_avatars isn't null
§ check npca.AgentID is valid
§ check npca is valid
• get the UUID of the NPC Avie
○ P_returnUUID = npca.agentID
§ make sure npca is valid
§ make sure npca.agentID is not null
No comments:
Post a Comment