aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-05 19:44:27 +0000
committerJeff Ames2008-02-05 19:44:27 +0000
commit6ed5283bc06a62f38eb517e67b975832b603bf61 (patch)
treee5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.zip
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs119
1 files changed, 60 insertions, 59 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 81783f8..28760fd 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -26,6 +26,7 @@
26* 26*
27*/ 27*/
28 28
29using System;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using libsecondlife; 31using libsecondlife;
31using libsecondlife.Packets; 32using libsecondlife.Packets;
@@ -37,12 +38,14 @@ namespace OpenSim.Region.Environment.Scenes
37{ 38{
38 public partial class Scene 39 public partial class Scene
39 { 40 {
41 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42
40 /// <summary> 43 /// <summary>
41 /// Start all the scripts in the scene which should be started. 44 /// Start all the scripts in the scene which should be started.
42 /// </summary> 45 /// </summary>
43 public void StartScripts() 46 public void StartScripts()
44 { 47 {
45 MainLog.Instance.Verbose("PRIMINVENTORY", "Starting scripts in scene"); 48 m_log.Info("[PRIMINVENTORY]: Starting scripts in scene");
46 49
47 foreach (SceneObjectGroup group in Entities.Values) 50 foreach (SceneObjectGroup group in Entities.Values)
48 { 51 {
@@ -80,8 +83,8 @@ namespace OpenSim.Region.Environment.Scenes
80 83
81 if (!TryGetAvatar(avatarId, out avatar)) 84 if (!TryGetAvatar(avatarId, out avatar))
82 { 85 {
83 MainLog.Instance.Error( 86 m_log.Error(String.Format(
84 "AGENTINVENTORY", "Could not find avatar {0} to add inventory item", avatarId); 87 "[AGENTINVENTORY]: Could not find avatar {0} to add inventory item", avatarId));
85 return; 88 return;
86 } 89 }
87 90
@@ -143,10 +146,10 @@ namespace OpenSim.Region.Environment.Scenes
143 } 146 }
144 else 147 else
145 { 148 {
146 MainLog.Instance.Error( 149 m_log.Error(String.Format(
147 "AGENTINVENTORY", 150 "[AGENTINVENTORY]: " +
148 "Avatar {0} cannot be found to update its inventory item asset", 151 "Avatar {0} cannot be found to update its inventory item asset",
149 avatarId); 152 avatarId));
150 } 153 }
151 154
152 return LLUUID.Zero; 155 return LLUUID.Zero;
@@ -168,10 +171,10 @@ namespace OpenSim.Region.Environment.Scenes
168 SceneObjectGroup group = part.ParentGroup; 171 SceneObjectGroup group = part.ParentGroup;
169 if (null == group) 172 if (null == group)
170 { 173 {
171 MainLog.Instance.Error( 174 m_log.Error(String.Format(
172 "PRIMINVENTORY", 175 "[PRIMINVENTORY]: " +
173 "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist", 176 "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
174 itemId, primId); 177 itemId, primId));
175 178
176 return; 179 return;
177 } 180 }
@@ -217,10 +220,10 @@ namespace OpenSim.Region.Environment.Scenes
217 } 220 }
218 else 221 else
219 { 222 {
220 MainLog.Instance.Error( 223 m_log.Error(String.Format(
221 "PRIMINVENTORY", 224 "[PRIMINVENTORY]: " +
222 "Avatar {0} cannot be found to update its prim item asset", 225 "Avatar {0} cannot be found to update its prim item asset",
223 avatarId); 226 avatarId));
224 } 227 }
225 } 228 }
226 229
@@ -289,16 +292,14 @@ namespace OpenSim.Region.Environment.Scenes
289 } 292 }
290 else 293 else
291 { 294 {
292 MainLog.Instance.Error( 295 m_log.Error(
293 "AGENTINVENTORY", 296 "[AGENTINVENTORY]: Item ID " + itemID + " not found for an inventory item update.");
294 "Item ID " + itemID + " not found for an inventory item update.");
295 } 297 }
296 } 298 }
297 else 299 else
298 { 300 {
299 MainLog.Instance.Error( 301 m_log.Error(
300 "AGENTINVENTORY", 302 "[AGENTINVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
301 "Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
302 } 303 }
303 } 304 }
304 305
@@ -311,7 +312,7 @@ namespace OpenSim.Region.Environment.Scenes
311 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID); 312 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
312 if (userInfo == null) 313 if (userInfo == null)
313 { 314 {
314 MainLog.Instance.Error("AGENTINVENTORY", "Failed to find user " + oldAgentID.ToString()); 315 m_log.Error("[AGENTINVENTORY]: Failed to find user " + oldAgentID.ToString());
315 return; 316 return;
316 } 317 }
317 318
@@ -320,13 +321,13 @@ namespace OpenSim.Region.Environment.Scenes
320 item = userInfo.RootFolder.HasItem(oldItemID); 321 item = userInfo.RootFolder.HasItem(oldItemID);
321 if (item == null) 322 if (item == null)
322 { 323 {
323 MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + oldItemID.ToString()); 324 m_log.Error("[AGENTINVENTORY]: Failed to find item " + oldItemID.ToString());
324 return; 325 return;
325 } 326 }
326 } 327 }
327 else 328 else
328 { 329 {
329 MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + oldItemID.ToString()); 330 m_log.Error("[AGENTINVENTORY]: Failed to find item " + oldItemID.ToString());
330 return; 331 return;
331 } 332 }
332 } 333 }
@@ -335,7 +336,7 @@ namespace OpenSim.Region.Environment.Scenes
335 AssetBase asset = AssetCache.CopyAsset(item.assetID); 336 AssetBase asset = AssetCache.CopyAsset(item.assetID);
336 if (asset == null) 337 if (asset == null)
337 { 338 {
338 MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find asset " + item.assetID.ToString()); 339 m_log.Warn("[AGENTINVENTORY]: Failed to find asset " + item.assetID.ToString());
339 return; 340 return;
340 } 341 }
341 342
@@ -360,14 +361,14 @@ namespace OpenSim.Region.Environment.Scenes
360 public void MoveInventoryItem(IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, 361 public void MoveInventoryItem(IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length,
361 string newName) 362 string newName)
362 { 363 {
363 MainLog.Instance.Verbose( 364 m_log.Info(
364 "AGENTINVENTORY", 365 "[AGENTINVENTORY]: " +
365 "Moving item for " + remoteClient.AgentId.ToString()); 366 "Moving item for " + remoteClient.AgentId.ToString());
366 367
367 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 368 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
368 if (userInfo == null) 369 if (userInfo == null)
369 { 370 {
370 MainLog.Instance.Error("AGENTINVENTORY", "Failed to find user " + remoteClient.AgentId.ToString()); 371 m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
371 return; 372 return;
372 } 373 }
373 374
@@ -388,13 +389,13 @@ namespace OpenSim.Region.Environment.Scenes
388 } 389 }
389 else 390 else
390 { 391 {
391 MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + itemID.ToString()); 392 m_log.Error("[AGENTINVENTORY]: Failed to find item " + itemID.ToString());
392 return; 393 return;
393 } 394 }
394 } 395 }
395 else 396 else
396 { 397 {
397 MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder"); 398 m_log.Error("[AGENTINVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder");
398 return; 399 return;
399 } 400 }
400 } 401 }
@@ -497,8 +498,8 @@ namespace OpenSim.Region.Environment.Scenes
497 } 498 }
498 else 499 else
499 { 500 {
500 MainLog.Instance.Error( 501 m_log.Error(String.Format(
501 "PRIMINVENTORY", "Inventory requested of prim {0} which doesn't exist", primLocalID); 502 "[PRIMINVENTORY]: Inventory requested of prim {0} which doesn't exist", primLocalID));
502 } 503 }
503 } 504 }
504 505
@@ -523,11 +524,11 @@ namespace OpenSim.Region.Environment.Scenes
523 } 524 }
524 else 525 else
525 { 526 {
526 MainLog.Instance.Error( 527 m_log.Error(String.Format(
527 "PRIMINVENTORY", 528 "[PRIMINVENTORY]: " +
528 "Removal of item {0} requested of prim {1} but this prim does not exist", 529 "Removal of item {0} requested of prim {1} but this prim does not exist",
529 itemID, 530 itemID,
530 localID); 531 localID));
531 } 532 }
532 } 533 }
533 534
@@ -547,18 +548,18 @@ namespace OpenSim.Region.Environment.Scenes
547 { 548 {
548 // TODO Retrieve itemID from client's inventory to pass on 549 // TODO Retrieve itemID from client's inventory to pass on
549 //group.AddInventoryItem(remoteClient, primLocalID, null); 550 //group.AddInventoryItem(remoteClient, primLocalID, null);
550 MainLog.Instance.Verbose( 551 m_log.Info(String.Format(
551 "PRIMINVENTORY", 552 "[PRIMINVENTORY]: " +
552 "Non script prim inventory not yet implemented!" 553 "Non script prim inventory not yet implemented!"
553 + "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}", 554 + "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}",
554 itemID, folderID, primLocalID, remoteClient.Name); 555 itemID, folderID, primLocalID, remoteClient.Name));
555 } 556 }
556 else 557 else
557 { 558 {
558 MainLog.Instance.Warn( 559 m_log.Warn(String.Format(
559 "PRIMINVENTORY", 560 "[PRIMINVENTORY]: " +
560 "Update with item {0} requested of prim {1} for {2} but this prim does not exist", 561 "Update with item {0} requested of prim {1} for {2} but this prim does not exist",
561 itemID, primLocalID, remoteClient.Name); 562 itemID, primLocalID, remoteClient.Name));
562 } 563 }
563 } 564 }
564 565
@@ -596,25 +597,25 @@ namespace OpenSim.Region.Environment.Scenes
596 group.StartScript(localID, copyID); 597 group.StartScript(localID, copyID);
597 group.GetProperites(remoteClient); 598 group.GetProperites(remoteClient);
598 599
599 // MainLog.Instance.Verbose( 600 // m_log.Info(
600 // "PRIMINVENTORY", 601 // String.Format("[PRIMINVENTORY]: " +
601 // "Rezzed script {0} into prim local ID {1} for user {2}", 602 // "Rezzed script {0} into prim local ID {1} for user {2}",
602 // item.inventoryName, localID, remoteClient.Name); 603 // item.inventoryName, localID, remoteClient.Name));
603 } 604 }
604 else 605 else
605 { 606 {
606 MainLog.Instance.Error( 607 m_log.Error(String.Format(
607 "PRIMINVENTORY", 608 "[PRIMINVENTORY]: " +
608 "Could not rez script {0} into prim local ID {1} for user {2}" 609 "Could not rez script {0} into prim local ID {1} for user {2}"
609 + " because the prim could not be found in the region!", 610 + " because the prim could not be found in the region!",
610 item.inventoryName, localID, remoteClient.Name); 611 item.inventoryName, localID, remoteClient.Name));
611 } 612 }
612 } 613 }
613 else 614 else
614 { 615 {
615 MainLog.Instance.Error( 616 m_log.Error(String.Format(
616 "PRIMINVENTORY", "Could not find script inventory item {0} to rez for {1}!", 617 "[PRIMINVENTORY]: Could not find script inventory item {0} to rez for {1}!",
617 itemID, remoteClient.Name); 618 itemID, remoteClient.Name));
618 } 619 }
619 } 620 }
620 } 621 }
@@ -646,7 +647,7 @@ namespace OpenSim.Region.Environment.Scenes
646 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) 647 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
647 { 648 {
648 EntityBase selectedEnt = null; 649 EntityBase selectedEnt = null;
649 //MainLog.Instance.Verbose("CLIENT", "LocalID:" + Data.ObjectLocalID.ToString()); 650 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString());
650 651
651 List<EntityBase> EntitieList = GetEntities(); 652 List<EntityBase> EntitieList = GetEntities();
652 653