aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-09 02:21:56 +0100
committerJustin Clark-Casey (justincc)2011-07-09 02:21:56 +0100
commitf99b89990c9e4b136b77125c680c7a7c510a6ef2 (patch)
tree3f5ed8a492ba14fc66b6fe4571a430007e9ef953 /OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
parentrefactor: Get LSLString(LSLInteger i) constructor to now call LSLString(int i... (diff)
downloadopensim-SC_OLD-f99b89990c9e4b136b77125c680c7a7c510a6ef2.zip
opensim-SC_OLD-f99b89990c9e4b136b77125c680c7a7c510a6ef2.tar.gz
opensim-SC_OLD-f99b89990c9e4b136b77125c680c7a7c510a6ef2.tar.bz2
opensim-SC_OLD-f99b89990c9e4b136b77125c680c7a7c510a6ef2.tar.xz
Add scratch AvatarFactoryModuleTests with one test to do a partial check on AvatarFactoryModule.SetAppearance()
Baked texture set not yet checked, nor persistence of data in avatar service This is a foundation for later npc related tests.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index d02a305..1955e5b 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -116,16 +116,20 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
116 #endregion 116 #endregion
117 117
118 /// <summary> 118 /// <summary>
119 /// Check for the existence of the baked texture assets. Request a rebake 119 /// Check for the existence of the baked texture assets.
120 /// unless checkonly is true.
121 /// </summary> 120 /// </summary>
122 /// <param name="client"></param> 121 /// <param name="client"></param>
123 /// <param name="checkonly"></param>
124 public bool ValidateBakedTextureCache(IClientAPI client) 122 public bool ValidateBakedTextureCache(IClientAPI client)
125 { 123 {
126 return ValidateBakedTextureCache(client, true); 124 return ValidateBakedTextureCache(client, true);
127 } 125 }
128 126
127 /// <summary>
128 /// Check for the existence of the baked texture assets. Request a rebake
129 /// unless checkonly is true.
130 /// </summary>
131 /// <param name="client"></param>
132 /// <param name="checkonly"></param>
129 private bool ValidateBakedTextureCache(IClientAPI client, bool checkonly) 133 private bool ValidateBakedTextureCache(IClientAPI client, bool checkonly)
130 { 134 {
131 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 135 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
@@ -156,13 +160,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
156 160
157 defonly = false; // found a non-default texture reference 161 defonly = false; // found a non-default texture reference
158 162
159 if (! CheckBakedTextureAsset(client,face.TextureID,idx)) 163 if (!CheckBakedTextureAsset(client, face.TextureID, idx))
160 { 164 {
161 // the asset didn't exist if we are only checking, then we found a bad 165 // the asset didn't exist if we are only checking, then we found a bad
162 // one and we're done otherwise, ask for a rebake 166 // one and we're done otherwise, ask for a rebake
163 if (checkonly) return false; 167 if (checkonly)
168 return false;
164 169
165 m_log.InfoFormat("[AVFACTORY]: missing baked texture {0}, requesting rebake", face.TextureID); 170 m_log.InfoFormat("[AVFACTORY]: missing baked texture {0}, requesting rebake", face.TextureID);
171
166 client.SendRebakeAvatarTextures(face.TextureID); 172 client.SendRebakeAvatarTextures(face.TextureID);
167 } 173 }
168 } 174 }
@@ -183,7 +189,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
183 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 189 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
184 if (sp == null) 190 if (sp == null)
185 { 191 {
186 m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}",client.AgentId); 192 m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}", client.AgentId);
187 return; 193 return;
188 } 194 }
189 195
@@ -211,7 +217,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
211 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; 217 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
212 218
213 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", client.AgentId); 219 m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", client.AgentId);
214 Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(client,false); }); 220 Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(client, false); });
215 221
216 // This appears to be set only in the final stage of the appearance 222 // This appears to be set only in the final stage of the appearance
217 // update transaction. In theory, we should be able to do an immediate 223 // update transaction. In theory, we should be able to do an immediate
@@ -220,9 +226,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
220 // save only if there were changes, send no matter what (doesn't hurt to send twice) 226 // save only if there were changes, send no matter what (doesn't hurt to send twice)
221 if (changed) 227 if (changed)
222 QueueAppearanceSave(client.AgentId); 228 QueueAppearanceSave(client.AgentId);
229
223 QueueAppearanceSend(client.AgentId); 230 QueueAppearanceSend(client.AgentId);
224 } 231 }
225
226 } 232 }
227 233
228 // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); 234 // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());