aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorMelanie2010-11-02 22:58:33 +0000
committerMelanie2010-11-02 22:58:33 +0000
commit26f12f479f17aef37451fb30f9b1de376c8676ac (patch)
treeecaf084da6ca491301450c0f8a8460a8b1dc981a /OpenSim/Region/CoreModules/Avatar
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentFix default club feet (diff)
downloadopensim-SC-26f12f479f17aef37451fb30f9b1de376c8676ac.zip
opensim-SC-26f12f479f17aef37451fb30f9b1de376c8676ac.tar.gz
opensim-SC-26f12f479f17aef37451fb30f9b1de376c8676ac.tar.bz2
opensim-SC-26f12f479f17aef37451fb30f9b1de376c8676ac.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs77
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs22
2 files changed, 33 insertions, 66 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index bfbbcf8..7f482cb 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
117 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 117 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
118 if (sp == null) 118 if (sp == null)
119 { 119 {
120 m_log.WarnFormat("[AVFACTORY] SetAppearance unable to find presence for {0}",client.AgentId); 120 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}", client.AgentId);
121 return false; 121 return false;
122 } 122 }
123 123
@@ -147,14 +147,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
147 /// <param name="visualParam"></param> 147 /// <param name="visualParam"></param>
148 public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) 148 public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams)
149 { 149 {
150// DEBUG ON 150// m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance for {0}",client.AgentId);
151 m_log.WarnFormat("[AVFACTORY] SetAppearance for {0}",client.AgentId);
152// DEBUG OFF
153 151
154 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 152 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
155 if (sp == null) 153 if (sp == null)
156 { 154 {
157 m_log.WarnFormat("[AVFACTORY] SetAppearance unable to find presence for {0}",client.AgentId); 155 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SetAppearance unable to find presence for {0}",client.AgentId);
158 return; 156 return;
159 } 157 }
160 158
@@ -212,8 +210,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
212 { 210 {
213 if (m_scene.AssetService.Get(textureID.ToString()) == null) 211 if (m_scene.AssetService.Get(textureID.ToString()) == null)
214 { 212 {
215 m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}", 213 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Missing baked texture {0} ({1}) for avatar {2}",
216 textureID,idx,client.Name); 214 textureID, idx, client.Name);
217 return false; 215 return false;
218 } 216 }
219 return true; 217 return true;
@@ -223,9 +221,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
223 221
224 public void QueueAppearanceSend(UUID agentid) 222 public void QueueAppearanceSend(UUID agentid)
225 { 223 {
226// DEBUG ON 224// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance send for {0}",agentid);
227 m_log.WarnFormat("[AVFACTORY] Queue appearance send for {0}",agentid);
228// DEBUG OFF
229 225
230 // 100 nanoseconds (ticks) we should wait 226 // 100 nanoseconds (ticks) we should wait
231 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 10000000); 227 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 10000000);
@@ -238,9 +234,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
238 234
239 public void QueueAppearanceSave(UUID agentid) 235 public void QueueAppearanceSave(UUID agentid)
240 { 236 {
241// DEBUG ON 237// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Queue appearance save for {0}",agentid);
242 m_log.WarnFormat("[AVFACTORY] Queue appearance save for {0}",agentid);
243// DEBUG OFF
244 238
245 // 100 nanoseconds (ticks) we should wait 239 // 100 nanoseconds (ticks) we should wait
246 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 10000000); 240 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 10000000);
@@ -256,13 +250,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
256 ScenePresence sp = m_scene.GetScenePresence(agentid); 250 ScenePresence sp = m_scene.GetScenePresence(agentid);
257 if (sp == null) 251 if (sp == null)
258 { 252 {
259 m_log.WarnFormat("[AVFACTORY] Agent {0} no longer in the scene",agentid); 253 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid);
260 return; 254 return;
261 } 255 }
262 256
263// DEBUG ON 257// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Handle appearance send for {0}", agentid);
264 m_log.WarnFormat("[AVFACTORY] Handle appearance send for {0}",agentid);
265// DEBUG OFF
266 258
267 // Send the appearance to everyone in the scene 259 // Send the appearance to everyone in the scene
268 sp.SendAppearanceToAllOtherAgents(); 260 sp.SendAppearanceToAllOtherAgents();
@@ -288,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
288 ScenePresence sp = m_scene.GetScenePresence(agentid); 280 ScenePresence sp = m_scene.GetScenePresence(agentid);
289 if (sp == null) 281 if (sp == null)
290 { 282 {
291 m_log.WarnFormat("[AVFACTORY] Agent {0} no longer in the scene",agentid); 283 m_log.WarnFormat("[AVATAR FACTORY MODULE]: Agent {0} no longer in the scene", agentid);
292 return; 284 return;
293 } 285 }
294 286
@@ -339,13 +331,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
339 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 331 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
340 if (sp == null) 332 if (sp == null)
341 { 333 {
342 m_log.WarnFormat("[AVFACTORY] SendWearables unable to find presence for {0}",client.AgentId); 334 m_log.WarnFormat("[AVATAR FACTORY MODULE]: SendWearables unable to find presence for {0}", client.AgentId);
343 return; 335 return;
344 } 336 }
345 337
346// DEBUG ON 338// m_log.WarnFormat("[AVATAR FACTORY MODULE]: Received request for wearables of {0}", client.AgentId);
347 m_log.WarnFormat("[AVFACTORY]: Received request for wearables of {0}", client.AgentId); 339
348// DEBUG OFF
349 client.SendWearables(sp.Appearance.Wearables,sp.Appearance.Serial++); 340 client.SendWearables(sp.Appearance.Wearables,sp.Appearance.Serial++);
350 } 341 }
351 342
@@ -359,25 +350,22 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
359 ScenePresence sp = m_scene.GetScenePresence(client.AgentId); 350 ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
360 if (sp == null) 351 if (sp == null)
361 { 352 {
362 m_log.WarnFormat("[AVFACTORY] AvatarIsWearing unable to find presence for {0}",client.AgentId); 353 m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing unable to find presence for {0}", client.AgentId);
363 return; 354 return;
364 } 355 }
365 356
366// DEBUG ON 357// m_log.WarnFormat("[AVATAR FACTORY MODULE]: AvatarIsWearing called for {0}",client.AgentId);
367 m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}",client.AgentId);
368// DEBUG OFF
369 358
370 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance); 359 AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false);
371 360
372 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) 361 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
373 { 362 {
374 if (wear.Type < AvatarWearable.MAX_WEARABLES) 363 if (wear.Type < AvatarWearable.MAX_WEARABLES)
375 { 364 avatAppearance.Wearables[wear.Type].Add(wear.ItemID,UUID.Zero);
376 AvatarWearable newWearable = new AvatarWearable(wear.ItemID,UUID.Zero);
377 avatAppearance.SetWearable(wear.Type, newWearable);
378 }
379 } 365 }
380 366
367 avatAppearance.GetAssetsFrom(sp.Appearance);
368
381 // This could take awhile since it needs to pull inventory 369 // This could take awhile since it needs to pull inventory
382 SetAppearanceAssets(sp.UUID, ref avatAppearance); 370 SetAppearanceAssets(sp.UUID, ref avatAppearance);
383 371
@@ -393,34 +381,35 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
393 { 381 {
394 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) 382 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
395 { 383 {
396 if (appearance.Wearables[i].ItemID == UUID.Zero) 384 for (int j = 0 ; j < appearance.Wearables[j].Count ; j ++ )
397 {
398 appearance.Wearables[i].AssetID = UUID.Zero;
399 }
400 else
401 { 385 {
402 InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); 386 if (appearance.Wearables[i][j].ItemID == UUID.Zero)
387 continue;
388
389 // Ignore ruth's assets
390 if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID)
391 continue;
392 InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
403 baseItem = invService.GetItem(baseItem); 393 baseItem = invService.GetItem(baseItem);
404 394
405 if (baseItem != null) 395 if (baseItem != null)
406 { 396 {
407 appearance.Wearables[i].AssetID = baseItem.AssetID; 397 appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID);
408 } 398 }
409 else 399 else
410 { 400 {
411 m_log.ErrorFormat( 401 m_log.ErrorFormat(
412 "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", 402 "[AVATAR FACTORY MODULE]: Can't find inventory item {0} for {1}, setting to default",
413 appearance.Wearables[i].ItemID, (WearableType)i); 403 appearance.Wearables[i][j].ItemID, (WearableType)i);
414 404
415 appearance.Wearables[i].ItemID = UUID.Zero; 405 appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID);
416 appearance.Wearables[i].AssetID = UUID.Zero;
417 } 406 }
418 } 407 }
419 } 408 }
420 } 409 }
421 else 410 else
422 { 411 {
423 m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); 412 m_log.WarnFormat("[AVATAR FACTORY MODULE]: user {0} has no inventory, appearance isn't going to work", userID);
424 } 413 }
425 } 414 }
426 } 415 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 9080e1c..d81703a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -173,28 +173,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
173 173
174 InventoryCollection contents 174 InventoryCollection contents
175 = m_scene.InventoryService.GetFolderContent(inventoryFolder.Owner, inventoryFolder.ID); 175 = m_scene.InventoryService.GetFolderContent(inventoryFolder.Owner, inventoryFolder.ID);
176 //List<InventoryFolderImpl> childFolders = inventoryFolder.RequestListOfFolderImpls();
177 //List<InventoryItemBase> items = inventoryFolder.RequestListOfItems();
178
179 /*
180 Dictionary identicalFolderNames = new Dictionary<string, int>();
181
182 foreach (InventoryFolderImpl folder in inventories)
183 {
184 if (!identicalFolderNames.ContainsKey(folder.Name))
185 identicalFolderNames[folder.Name] = 0;
186 else
187 identicalFolderNames[folder.Name] = identicalFolderNames[folder.Name]++;
188
189 int folderNameNumber = identicalFolderName[folder.Name];
190
191 SaveInvDir(
192 folder,
193 string.Format(
194 "{0}{1}{2}/",
195 path, ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, folderNameNumber));
196 }
197 */
198 176
199 foreach (InventoryFolderBase childFolder in contents.Folders) 177 foreach (InventoryFolderBase childFolder in contents.Folders)
200 { 178 {