aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs34
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs70
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs69
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs38
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs63
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs108
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs97
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs5
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs168
23 files changed, 540 insertions, 218 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 9fcd99c..fb1e831 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -919,7 +919,7 @@ namespace OpenSim
919 break; 919 break;
920 920
921 case "scene": 921 case "scene":
922 if (args.Length == 5) 922 if (args.Length == 4)
923 { 923 {
924 if (m_sceneManager.CurrentScene == null) 924 if (m_sceneManager.CurrentScene == null)
925 { 925 {
@@ -927,39 +927,21 @@ namespace OpenSim
927 } 927 }
928 else 928 else
929 { 929 {
930 bool scriptingOn = !Convert.ToBoolean(args[2]); 930 string key = args[2];
931 bool collisionsOn = !Convert.ToBoolean(args[3]); 931 string value = args[3];
932 bool physicsOn = !Convert.ToBoolean(args[4]); 932 m_sceneManager.CurrentScene.SetSceneCoreDebug(
933 m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); 933 new Dictionary<string, string>() { { key, value } });
934 934
935 MainConsole.Instance.Output( 935 MainConsole.Instance.OutputFormat("Set debug scene {0} = {1}", key, value);
936 String.Format(
937 "Set debug scene scripting = {0}, collisions = {1}, physics = {2}",
938 !scriptingOn, !collisionsOn, !physicsOn));
939 } 936 }
940 } 937 }
941 else 938 else
942 { 939 {
943 MainConsole.Instance.Output("Usage: debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); 940 MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics|teleport true|false");
944 } 941 }
945 942
946 break; 943 break;
947 944
948 case "teleport":
949 foreach(Scene s in m_sceneManager.Scenes)
950 {
951 if (s.DEBUG)
952 {
953 s.DEBUG = false;
954 MainConsole.Instance.Output("Teleport debugging is disabled!");
955 }
956 else{
957 s.DEBUG = true;
958 MainConsole.Instance.Output("Teleport debugging is enabled!");
959 }
960 }
961 break;
962
963 default: 945 default:
964 MainConsole.Instance.Output("Unknown debug command"); 946 MainConsole.Instance.Output("Unknown debug command");
965 break; 947 break;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index ba5f4d5..c40c0ec 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -11418,15 +11418,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11418 scriptQuestion.Data.Questions = question; 11418 scriptQuestion.Data.Questions = question;
11419 scriptQuestion.Data.ObjectName = Util.StringToBytes256(taskName); 11419 scriptQuestion.Data.ObjectName = Util.StringToBytes256(taskName);
11420 scriptQuestion.Data.ObjectOwner = Util.StringToBytes256(ownerName); 11420 scriptQuestion.Data.ObjectOwner = Util.StringToBytes256(ownerName);
11421 11421
11422 OutPacket(scriptQuestion, ThrottleOutPacketType.Task); 11422 OutPacket(scriptQuestion, ThrottleOutPacketType.Task);
11423 } 11423 }
11424 11424
11425 public UUID GetDefaultAnimation(string name)
11426 {
11427 return SLUtil.GetDefaultAvatarAnimation(name);
11428 }
11429
11430 /// <summary> 11425 /// <summary>
11431 /// Handler called when we receive a logout packet. 11426 /// Handler called when we receive a logout packet.
11432 /// </summary> 11427 /// </summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index ca8d8e6..0590716 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
212 scene.EventManager.OnClientLogin += OnClientLogin; 212 scene.EventManager.OnClientLogin += OnClientLogin;
213 } 213 }
214 214
215 public void RegionLoaded(Scene scene) 215 public virtual void RegionLoaded(Scene scene)
216 { 216 {
217 } 217 }
218 218
@@ -582,10 +582,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
582 582
583 // Try the local sim 583 // Try the local sim
584 if (LocalFriendshipOffered(friendID, im)) 584 if (LocalFriendshipOffered(friendID, im))
585 {
586 m_log.DebugFormat("[XXX]: LocalFriendshipOffered successes");
587 return true; 585 return true;
588 }
589 586
590 // The prospective friend is not here [as root]. Let's forward. 587 // The prospective friend is not here [as root]. Let's forward.
591 PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); 588 PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index 0fe1134..e50a84a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 IUserManagement m_uMan; 53 IUserManagement m_uMan;
54 IUserManagement UserManagementModule 54 public IUserManagement UserManagementModule
55 { 55 {
56 get 56 get
57 { 57 {
@@ -62,6 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
62 } 62 }
63 63
64 protected HGFriendsServicesConnector m_HGFriendsConnector = new HGFriendsServicesConnector(); 64 protected HGFriendsServicesConnector m_HGFriendsConnector = new HGFriendsServicesConnector();
65 protected HGStatusNotifier m_StatusNotifier;
65 66
66 #region ISharedRegionModule 67 #region ISharedRegionModule
67 public override string Name 68 public override string Name
@@ -78,6 +79,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
78 scene.RegisterModuleInterface<IFriendsSimConnector>(this); 79 scene.RegisterModuleInterface<IFriendsSimConnector>(this);
79 } 80 }
80 81
82 public override void RegionLoaded(Scene scene)
83 {
84 if (!m_Enabled)
85 return;
86 if (m_StatusNotifier == null)
87 m_StatusNotifier = new HGStatusNotifier(this);
88 }
89
81 #endregion 90 #endregion
82 91
83 #region IFriendsSimConnector 92 #region IFriendsSimConnector
@@ -230,25 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
230 if (friendsPerDomain.ContainsKey("local")) 239 if (friendsPerDomain.ContainsKey("local"))
231 base.StatusNotify(friendsPerDomain["local"], userID, online); 240 base.StatusNotify(friendsPerDomain["local"], userID, online);
232 241
233 foreach (KeyValuePair<string, List<FriendInfo>> kvp in friendsPerDomain) 242 m_StatusNotifier.Notify(userID, friendsPerDomain, online);
234 {
235 if (kvp.Key != "local")
236 {
237 // For the others, call the user agent service
238 List<string> ids = new List<string>();
239 foreach (FriendInfo f in kvp.Value)
240 ids.Add(f.Friend);
241 UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key);
242 List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online);
243
244 if (online && friendsOnline.Count > 0)
245 {
246 IClientAPI client = LocateClientObject(userID);
247 if (client != null)
248 client.SendAgentOnline(friendsOnline.ToArray());
249 }
250 }
251 }
252 243
253// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting StatusNotify for {0}", userID); 244// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting StatusNotify for {0}", userID);
254 } 245 }
@@ -261,25 +252,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
261 252
262 // fid is not a UUID... 253 // fid is not a UUID...
263 string url = string.Empty, tmp = string.Empty, f = string.Empty, l = string.Empty; 254 string url = string.Empty, tmp = string.Empty, f = string.Empty, l = string.Empty;
264 m_log.DebugFormat("[YYY]: FID {0}", fid);
265 if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out f, out l, out tmp)) 255 if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out f, out l, out tmp))
266 { 256 {
267 m_log.DebugFormat("[YYY]: Adding user {0} {1} {2}", f, l, url); 257 if (!agentID.Equals(UUID.Zero))
268 m_uMan.AddUser(agentID, f, l, url);
269
270 string name = m_uMan.GetUserName(agentID);
271 string[] parts = name.Trim().Split(new char[] {' '});
272 if (parts.Length == 2)
273 { 258 {
274 first = parts[0]; 259 m_uMan.AddUser(agentID, f, l, url);
275 last = parts[1]; 260
276 } 261 string name = m_uMan.GetUserName(agentID);
277 else 262 string[] parts = name.Trim().Split(new char[] { ' ' });
278 { 263 if (parts.Length == 2)
279 first = f; 264 {
280 last = l; 265 first = parts[0];
266 last = parts[1];
267 }
268 else
269 {
270 first = f;
271 last = l;
272 }
273 return true;
281 } 274 }
282 return true;
283 } 275 }
284 return false; 276 return false;
285 } 277 }
@@ -744,7 +736,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
744 { 736 {
745 string[] parts = im.fromAgentName.Split(new char[] { '@' }); 737 string[] parts = im.fromAgentName.Split(new char[] { '@' });
746 if (parts.Length == 2) 738 if (parts.Length == 2)
747 m_uMan.AddUser(new UUID(im.fromAgentID), parts[0], "http://" + parts[1]); 739 {
740 string[] fl = parts[0].Trim().Split(new char[] { '.' });
741 if (fl.Length == 2)
742 m_uMan.AddUser(new UUID(im.fromAgentID), fl[0], fl[1], "http://" + parts[1]);
743 else
744 m_uMan.AddUser(new UUID(im.fromAgentID), fl[0], "", "http://" + parts[1]);
745 }
748 } 746 }
749 return true; 747 return true;
750 } 748 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs
new file mode 100644
index 0000000..1fa4dd6
--- /dev/null
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs
@@ -0,0 +1,69 @@
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Reflection;
5using System.Text;
6using OpenSim.Framework;
7using OpenSim.Region.Framework.Interfaces;
8using OpenSim.Services.Interfaces;
9using OpenSim.Services.Connectors.Hypergrid;
10using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
11
12using OpenMetaverse;
13
14using log4net;
15
16namespace OpenSim.Region.CoreModules.Avatar.Friends
17{
18 public class HGStatusNotifier
19 {
20 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
21
22 private HGFriendsModule m_FriendsModule;
23
24 public HGStatusNotifier(HGFriendsModule friendsModule)
25 {
26 m_FriendsModule = friendsModule;
27 }
28
29 public void Notify(UUID userID, Dictionary<string, List<FriendInfo>> friendsPerDomain, bool online)
30 {
31 foreach (KeyValuePair<string, List<FriendInfo>> kvp in friendsPerDomain)
32 {
33 if (kvp.Key != "local")
34 {
35 // For the others, call the user agent service
36 List<string> ids = new List<string>();
37 foreach (FriendInfo f in kvp.Value)
38 ids.Add(f.Friend);
39
40 if (ids.Count == 0)
41 continue; // no one to notify. caller don't do this
42
43 m_log.DebugFormat("[HG STATUS NOTIFIER]: Notifying {0} friends in {1}", ids.Count, kvp.Key);
44 // ASSUMPTION: we assume that all users for one home domain
45 // have exactly the same set of service URLs.
46 // If this is ever not true, we need to change this.
47 UUID friendID = UUID.Zero; String tmp = String.Empty;
48 if (Util.ParseUniversalUserIdentifier(ids[0], out friendID, out tmp, out tmp, out tmp, out tmp))
49 {
50 string friendsServerURI = m_FriendsModule.UserManagementModule.GetUserServerURL(friendID, "FriendsServerURI");
51 if (friendsServerURI != string.Empty)
52 {
53 HGFriendsServicesConnector fConn = new HGFriendsServicesConnector(friendsServerURI);
54
55 List<UUID> friendsOnline = fConn.StatusNotification(ids, userID, online);
56
57 if (online && friendsOnline.Count > 0)
58 {
59 IClientAPI client = m_FriendsModule.LocateClientObject(userID);
60 if (client != null)
61 client.SendAgentOnline(friendsOnline.ToArray());
62 }
63 }
64 }
65 }
66 }
67 }
68 }
69}
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 8b13b01..1e743c3 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -691,7 +691,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
691 Scene.RegionInfo.RegionSettings.Save(); 691 Scene.RegionInfo.RegionSettings.Save();
692 TriggerRegionInfoChange(); 692 TriggerRegionInfoChange();
693 693
694 Scene.SetSceneCoreDebug(disableScripts, disableCollisions, disablePhysics); 694 Scene.SetSceneCoreDebug(
695 new Dictionary<string, string>() {
696 { "scripting", (!disableScripts).ToString() },
697 { "collisions", (!disableCollisions).ToString() },
698 { "physics", (!disablePhysics).ToString() }
699 }
700 );
695 } 701 }
696 702
697 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) 703 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey)
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 02a163f..e86887d 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -497,7 +497,8 @@ namespace OpenSim.Region.CoreModules.World.Land
497 497
498 public bool IsRestrictedFromLand(UUID avatar) 498 public bool IsRestrictedFromLand(UUID avatar)
499 { 499 {
500 ExpireAccessList(); 500 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) == 0)
501 return false;
501 502
502 if (m_scene.Permissions.IsAdministrator(avatar)) 503 if (m_scene.Permissions.IsAdministrator(avatar))
503 return false; 504 return false;
@@ -508,24 +509,27 @@ namespace OpenSim.Region.CoreModules.World.Land
508 if (avatar == LandData.OwnerID) 509 if (avatar == LandData.OwnerID)
509 return false; 510 return false;
510 511
511 if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) 512 if (HasGroupAccess(avatar))
512 { 513 return false;
513 if (LandData.ParcelAccessList.FindIndex( 514
514 delegate(LandAccessEntry e) 515 return (!IsInLandAccessList(avatar));
515 { 516 }
516 if (e.AgentID == avatar && e.Flags == AccessList.Access) 517
517 return true; 518 public bool IsInLandAccessList(UUID avatar)
518 return false; 519 {
519 }) == -1) 520 ExpireAccessList();
520 { 521
521 if (!HasGroupAccess(avatar)) 522 if (LandData.ParcelAccessList.FindIndex(
523 delegate(LandAccessEntry e)
522 { 524 {
523 return true; 525 if (e.AgentID == avatar && e.Flags == AccessList.Access)
524 } 526 return true;
525 } 527 return false;
528 }) == -1)
529 {
530 return false;
526 } 531 }
527 532 return true;
528 return false;
529 } 533 }
530 534
531 public void SendLandUpdateToClient(IClientAPI remote_client) 535 public void SendLandUpdateToClient(IClientAPI remote_client)
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index e4ecc64..4a654a3 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -94,7 +94,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
94 private bool m_RegionOwnerIsGod = false; 94 private bool m_RegionOwnerIsGod = false;
95 private bool m_RegionManagerIsGod = false; 95 private bool m_RegionManagerIsGod = false;
96 private bool m_ParcelOwnerIsGod = false; 96 private bool m_ParcelOwnerIsGod = false;
97 97
98 private bool m_SimpleBuildPermissions = false;
99
98 /// <value> 100 /// <value>
99 /// The set of users that are allowed to create scripts. This is only active if permissions are not being 101 /// The set of users that are allowed to create scripts. This is only active if permissions are not being
100 /// bypassed. This overrides normal permissions. 102 /// bypassed. This overrides normal permissions.
@@ -139,7 +141,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
139 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); 141 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true);
140 m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); 142 m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false);
141 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); 143 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true);
142 144
145 m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false);
146
143 m_allowedScriptCreators 147 m_allowedScriptCreators
144 = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); 148 = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators);
145 m_allowedScriptEditors 149 m_allowedScriptEditors
@@ -824,6 +828,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
824 permission = true; 828 permission = true;
825 } 829 }
826 830
831 if (m_SimpleBuildPermissions &&
832 (parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsInLandAccessList(user))
833 permission = true;
834
827 return permission; 835 return permission;
828 } 836 }
829 837
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index c51e140..b5e79b8 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -598,6 +598,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
598 "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}", 598 "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}",
599 m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions); 599 m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions);
600 } 600 }
601 else
602 {
603 m_log.ErrorFormat(
604 "[TERRAIN]: Could not save terrain from {0} to {1}. {2} {3} {4} {5} {6} {7}",
605 m_scene.RegionInfo.RegionName, filename, fileWidth, fileHeight, fileStartX, fileStartY, offsetX, offsetY);
606 }
601 } 607 }
602 608
603 /// <summary> 609 /// <summary>
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 4b17b9a..32f4eea 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -157,6 +157,15 @@ namespace OpenSim.Region.Framework.Interfaces
157 TaskInventoryItem GetInventoryItem(UUID itemId); 157 TaskInventoryItem GetInventoryItem(UUID itemId);
158 158
159 /// <summary> 159 /// <summary>
160 /// Get all inventory items.
161 /// </summary>
162 /// <param name="name"></param>
163 /// <returns>
164 /// If there are no inventory items then an empty list is returned.
165 /// </returns>
166 List<TaskInventoryItem> GetInventoryItems();
167
168 /// <summary>
160 /// Get inventory items by name. 169 /// Get inventory items by name.
161 /// </summary> 170 /// </summary>
162 /// <param name="name"></param> 171 /// <param name="name"></param>
@@ -164,7 +173,7 @@ namespace OpenSim.Region.Framework.Interfaces
164 /// A list of inventory items with that name. 173 /// A list of inventory items with that name.
165 /// If no inventory item has that name then an empty list is returned. 174 /// If no inventory item has that name then an empty list is returned.
166 /// </returns> 175 /// </returns>
167 IList<TaskInventoryItem> GetInventoryItems(string name); 176 List<TaskInventoryItem> GetInventoryItems(string name);
168 177
169 /// <summary> 178 /// <summary>
170 /// Get the scene object referenced by an inventory item. 179 /// Get the scene object referenced by an inventory item.
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
index 9176d3d..33041e9 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
@@ -27,8 +27,10 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenSim.Framework; 30using System.Reflection;
31using log4net;
31using OpenMetaverse; 32using OpenMetaverse;
33using OpenSim.Framework;
32 34
33using Animation = OpenSim.Framework.Animation; 35using Animation = OpenSim.Framework.Animation;
34 36
@@ -37,7 +39,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
37 [Serializable] 39 [Serializable]
38 public class AnimationSet 40 public class AnimationSet
39 { 41 {
40 public static AvatarAnimations Animations = new AvatarAnimations(); 42// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 43
42 private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); 44 private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation();
43 private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>(); 45 private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>();
@@ -132,9 +134,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation
132 /// </summary> 134 /// </summary>
133 public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID) 135 public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID)
134 { 136 {
135 if (Animations.AnimsUUID.ContainsKey(anim)) 137// m_log.DebugFormat(
138// "[ANIMATION SET]: Setting default animation {0}, sequence number {1}, object id {2}",
139// anim, sequenceNum, objectID);
140
141 if (DefaultAvatarAnimations.AnimsUUID.ContainsKey(anim))
136 { 142 {
137 return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum, objectID); 143 return SetDefaultAnimation(DefaultAvatarAnimations.AnimsUUID[anim], sequenceNum, objectID);
138 } 144 }
139 return false; 145 return false;
140 } 146 }
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs
deleted file mode 100644
index 659c3a5..0000000
--- a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using System.Xml;
30using OpenMetaverse;
31
32namespace OpenSim.Region.Framework.Scenes.Animation
33{
34 public class AvatarAnimations
35 {
36 public Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>();
37 public Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>();
38 public Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>();
39
40 public AvatarAnimations()
41 {
42 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
43 {
44 XmlDocument doc = new XmlDocument();
45 doc.Load(reader);
46 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
47 {
48 if (nod.Attributes["name"] != null)
49 {
50 string name = (string)nod.Attributes["name"].Value;
51 UUID id = (UUID)nod.InnerText;
52 string animState = (string)nod.Attributes["state"].Value;
53
54 AnimsUUID.Add(name, id);
55 AnimsNames.Add(id, name);
56 if (animState != "")
57 AnimStateNames.Add(id, animState);
58 }
59 }
60 }
61 }
62 }
63}
diff --git a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
new file mode 100644
index 0000000..c2b0468
--- /dev/null
+++ b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs
@@ -0,0 +1,108 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using System.Reflection;
30using System.Xml;
31using log4net;
32using OpenMetaverse;
33
34namespace OpenSim.Region.Framework.Scenes.Animation
35{
36 public class DefaultAvatarAnimations
37 {
38// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
39
40 public static readonly string DefaultAnimationsPath = "data/avataranimations.xml";
41
42 public static Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>();
43 public static Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>();
44 public static Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>();
45
46 static DefaultAvatarAnimations()
47 {
48 LoadAnimations(DefaultAnimationsPath);
49 }
50
51 /// <summary>
52 /// Load the default SL avatar animations.
53 /// </summary>
54 /// <returns></returns>
55 private static void LoadAnimations(string path)
56 {
57// Dictionary<string, UUID> animations = new Dictionary<string, UUID>();
58
59 using (XmlTextReader reader = new XmlTextReader(path))
60 {
61 XmlDocument doc = new XmlDocument();
62 doc.Load(reader);
63// if (doc.DocumentElement != null)
64// {
65 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
66 {
67 if (nod.Attributes["name"] != null)
68 {
69 string name = nod.Attributes["name"].Value;
70 UUID id = (UUID)nod.InnerText;
71 string animState = (string)nod.Attributes["state"].Value;
72
73 AnimsUUID.Add(name, id);
74 AnimsNames.Add(id, name);
75 if (animState != "")
76 AnimStateNames.Add(id, animState);
77
78// m_log.DebugFormat("[AVATAR ANIMATIONS]: Loaded {0} {1} {2}", id, name, animState);
79 }
80 }
81// }
82 }
83
84// return animations;
85 }
86
87 /// <summary>
88 /// Get the default avatar animation with the given name.
89 /// </summary>
90 /// <param name="name"></param>
91 /// <returns></returns>
92 public static UUID GetDefaultAnimation(string name)
93 {
94// m_log.DebugFormat(
95// "[AVATAR ANIMATIONS]: Looking for default avatar animation with name {0}", name);
96
97 if (AnimsUUID.ContainsKey(name))
98 {
99// m_log.DebugFormat(
100// "[AVATAR ANIMATIONS]: Found {0} {1} in GetDefaultAvatarAnimation()", AnimsUUID[name], name);
101
102 return AnimsUUID[name];
103 }
104
105 return UUID.Zero;
106 }
107 }
108} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 3584cda..cded9be 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -97,7 +97,9 @@ namespace OpenSim.Region.Framework.Scenes.Animation
97 if (m_scenePresence.IsChildAgent) 97 if (m_scenePresence.IsChildAgent)
98 return; 98 return;
99 99
100 UUID animID = m_scenePresence.ControllingClient.GetDefaultAnimation(name); 100 // XXX: For some reason, we store all animations and use them with upper case names, but in LSL animations
101 // are referenced with lower case names!
102 UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name.ToUpper());
101 if (animID == UUID.Zero) 103 if (animID == UUID.Zero)
102 return; 104 return;
103 105
@@ -121,7 +123,9 @@ namespace OpenSim.Region.Framework.Scenes.Animation
121 if (m_scenePresence.IsChildAgent) 123 if (m_scenePresence.IsChildAgent)
122 return; 124 return;
123 125
124 UUID animID = m_scenePresence.ControllingClient.GetDefaultAnimation(name); 126 // XXX: For some reason, we store all animations and use them with upper case names, but in LSL animations
127 // are referenced with lower case names!
128 UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name);
125 if (animID == UUID.Zero) 129 if (animID == UUID.Zero)
126 return; 130 return;
127 131
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index d1739de..6cf1067 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1217,9 +1217,9 @@ namespace OpenSim.Region.Framework.Scenes
1217 /// <summary> 1217 /// <summary>
1218 /// Copy a task (prim) inventory item to another task (prim) 1218 /// Copy a task (prim) inventory item to another task (prim)
1219 /// </summary> 1219 /// </summary>
1220 /// <param name="destId"></param> 1220 /// <param name="destId">ID of destination part</param>
1221 /// <param name="part"></param> 1221 /// <param name="part">Source part</param>
1222 /// <param name="itemId"></param> 1222 /// <param name="itemId">Source item id to transfer</param>
1223 public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId) 1223 public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId)
1224 { 1224 {
1225 TaskInventoryItem srcTaskItem = part.Inventory.GetInventoryItem(itemId); 1225 TaskInventoryItem srcTaskItem = part.Inventory.GetInventoryItem(itemId);
@@ -1247,14 +1247,14 @@ namespace OpenSim.Region.Framework.Scenes
1247 1247
1248 // Can't transfer this 1248 // Can't transfer this
1249 // 1249 //
1250 if ((part.OwnerID != destPart.OwnerID) && ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)) 1250 if (part.OwnerID != destPart.OwnerID && (srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
1251 return; 1251 return;
1252 1252
1253 bool overrideNoMod = false; 1253 bool overrideNoMod = false;
1254 if ((part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0) 1254 if ((part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0)
1255 overrideNoMod = true; 1255 overrideNoMod = true;
1256 1256
1257 if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) 1257 if (part.OwnerID != destPart.OwnerID && (destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0)
1258 { 1258 {
1259 // object cannot copy items to an object owned by a different owner 1259 // object cannot copy items to an object owned by a different owner
1260 // unless llAllowInventoryDrop has been called 1260 // unless llAllowInventoryDrop has been called
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 44ee453..44a738e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -65,7 +65,16 @@ namespace OpenSim.Region.Framework.Scenes
65 #region Fields 65 #region Fields
66 66
67 public bool EmergencyMonitoring = false; 67 public bool EmergencyMonitoring = false;
68 public bool DEBUG = false; 68
69 /// <summary>
70 /// Show debug information about teleports.
71 /// </summary>
72 public bool DebugTeleporting { get; private set; }
73
74 /// <summary>
75 /// Show debug information about the scene loop.
76 /// </summary>
77 public bool DebugUpdates { get; private set; }
69 78
70 public SynchronizeSceneHandler SynchronizeScene; 79 public SynchronizeSceneHandler SynchronizeScene;
71 public SimStatsReporter StatsReporter; 80 public SimStatsReporter StatsReporter;
@@ -1053,44 +1062,66 @@ namespace OpenSim.Region.Framework.Scenes
1053 } 1062 }
1054 } 1063 }
1055 1064
1056 public void SetSceneCoreDebug(bool ScriptEngine, bool CollisionEvents, bool PhysicsEngine) 1065 public void SetSceneCoreDebug(Dictionary<string, string> options)
1057 { 1066 {
1058 if (m_scripts_enabled != !ScriptEngine) 1067 if (options.ContainsKey("scripting"))
1059 { 1068 {
1060 if (ScriptEngine) 1069 bool enableScripts = true;
1070 if (bool.TryParse(options["scripting"], out enableScripts) && m_scripts_enabled != enableScripts)
1061 { 1071 {
1062 m_log.Info("Stopping all Scripts in Scene"); 1072 if (!enableScripts)
1063
1064 EntityBase[] entities = Entities.GetEntities();
1065 foreach (EntityBase ent in entities)
1066 { 1073 {
1067 if (ent is SceneObjectGroup) 1074 m_log.Info("Stopping all Scripts in Scene");
1068 ((SceneObjectGroup)ent).RemoveScriptInstances(false); 1075
1076 EntityBase[] entities = Entities.GetEntities();
1077 foreach (EntityBase ent in entities)
1078 {
1079 if (ent is SceneObjectGroup)
1080 ((SceneObjectGroup)ent).RemoveScriptInstances(false);
1081 }
1069 } 1082 }
1070 } 1083 else
1071 else
1072 {
1073 m_log.Info("Starting all Scripts in Scene");
1074
1075 EntityBase[] entities = Entities.GetEntities();
1076 foreach (EntityBase ent in entities)
1077 { 1084 {
1078 if (ent is SceneObjectGroup) 1085 m_log.Info("Starting all Scripts in Scene");
1086
1087 EntityBase[] entities = Entities.GetEntities();
1088 foreach (EntityBase ent in entities)
1079 { 1089 {
1080 SceneObjectGroup sog = (SceneObjectGroup)ent; 1090 if (ent is SceneObjectGroup)
1081 sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); 1091 {
1082 sog.ResumeScripts(); 1092 SceneObjectGroup sog = (SceneObjectGroup)ent;
1093 sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0);
1094 sog.ResumeScripts();
1095 }
1083 } 1096 }
1084 } 1097 }
1098
1099 m_scripts_enabled = enableScripts;
1085 } 1100 }
1101 }
1086 1102
1087 m_scripts_enabled = !ScriptEngine; 1103 if (options.ContainsKey("physics"))
1088 m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); 1104 {
1105 bool enablePhysics;
1106 if (bool.TryParse(options["physics"], out enablePhysics))
1107 m_physics_enabled = enablePhysics;
1108 }
1109
1110 if (options.ContainsKey("teleport"))
1111 {
1112 bool enableTeleportDebugging;
1113 if (bool.TryParse(options["teleport"], out enableTeleportDebugging))
1114 DebugTeleporting = enableTeleportDebugging;
1089 } 1115 }
1090 1116
1091 if (m_physics_enabled != !PhysicsEngine) 1117 if (options.ContainsKey("updates"))
1092 { 1118 {
1093 m_physics_enabled = !PhysicsEngine; 1119 bool enableUpdateDebugging;
1120 if (bool.TryParse(options["updates"], out enableUpdateDebugging))
1121 {
1122 DebugUpdates = enableUpdateDebugging;
1123 GcNotify.Enabled = DebugUpdates;
1124 }
1094 } 1125 }
1095 } 1126 }
1096 1127
@@ -1427,7 +1458,7 @@ namespace OpenSim.Region.Framework.Scenes
1427 // Tell the watchdog that this thread is still alive 1458 // Tell the watchdog that this thread is still alive
1428 Watchdog.UpdateThread(); 1459 Watchdog.UpdateThread();
1429 1460
1430// previousFrameTick = m_lastFrameTick; 1461 previousFrameTick = m_lastFrameTick;
1431 m_lastFrameTick = Util.EnvironmentTickCount(); 1462 m_lastFrameTick = Util.EnvironmentTickCount();
1432 maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); 1463 maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc);
1433 maintc = (int)(MinFrameTime * 1000) - maintc; 1464 maintc = (int)(MinFrameTime * 1000) - maintc;
@@ -1442,12 +1473,14 @@ namespace OpenSim.Region.Framework.Scenes
1442 m_firstHeartbeat = false; 1473 m_firstHeartbeat = false;
1443 1474
1444 // Optionally warn if a frame takes double the amount of time that it should. 1475 // Optionally warn if a frame takes double the amount of time that it should.
1445// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) 1476 if (DebugUpdates
1446// m_log.WarnFormat( 1477 && Util.EnvironmentTickCountSubtract(
1447// "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", 1478 m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2))
1448// Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), 1479 m_log.WarnFormat(
1449// MinFrameTime * 1000, 1480 "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}",
1450// RegionInfo.RegionName); 1481 Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick),
1482 MinFrameTime * 1000,
1483 RegionInfo.RegionName);
1451 } 1484 }
1452 } 1485 }
1453 1486
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index ca85d10..ac44ce9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -778,9 +778,9 @@ namespace OpenSim.Region.Framework.Scenes
778 /// A list of inventory items with that name. 778 /// A list of inventory items with that name.
779 /// If no inventory item has that name then an empty list is returned. 779 /// If no inventory item has that name then an empty list is returned.
780 /// </returns> 780 /// </returns>
781 public IList<TaskInventoryItem> GetInventoryItems(string name) 781 public List<TaskInventoryItem> GetInventoryItems(string name)
782 { 782 {
783 IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); 783 List<TaskInventoryItem> items = new List<TaskInventoryItem>();
784 784
785 m_items.LockItemsForRead(true); 785 m_items.LockItemsForRead(true);
786 786
@@ -1295,7 +1295,7 @@ namespace OpenSim.Region.Framework.Scenes
1295 1295
1296 public List<TaskInventoryItem> GetInventoryItems() 1296 public List<TaskInventoryItem> GetInventoryItems()
1297 { 1297 {
1298 List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); 1298 List<TaskInventoryItem> ret = new List<TaskInventoryItem>();
1299 1299
1300 lock (m_items) 1300 lock (m_items)
1301 ret = new List<TaskInventoryItem>(m_items.Values); 1301 ret = new List<TaskInventoryItem>(m_items.Values);
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0847994..2346c60 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3920,7 +3920,7 @@ namespace OpenSim.Region.Framework.Scenes
3920 ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); 3920 ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y);
3921 if (land != null) 3921 if (land != null)
3922 { 3922 {
3923 if (Scene.DEBUG) 3923 if (Scene.DebugTeleporting)
3924 TeleportFlagsDebug(); 3924 TeleportFlagsDebug();
3925 3925
3926 // If we come in via login, landmark or map, we want to 3926 // If we come in via login, landmark or map, we want to
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index e16903c..55c80f5 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Tests
113 } 113 }
114 114
115 /// <summary> 115 /// <summary>
116 /// Test MoveTaskInventoryItem where the item has no parent folder assigned. 116 /// Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent folder assigned.
117 /// </summary> 117 /// </summary>
118 /// <remarks> 118 /// <remarks>
119 /// This should place it in the most suitable user folder. 119 /// This should place it in the most suitable user folder.
@@ -142,9 +142,11 @@ namespace OpenSim.Region.Framework.Tests
142 } 142 }
143 143
144 /// <summary> 144 /// <summary>
145 /// Test MoveTaskInventoryItem where the item has no parent folder assigned. 145 /// Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent folder assigned.
146 /// </summary> 146 /// </summary>
147 /// <remarks>
147 /// This should place it in the most suitable user folder. 148 /// This should place it in the most suitable user folder.
149 /// </remarks>
148 [Test] 150 [Test]
149 public void TestMoveTaskInventoryItemNoParent() 151 public void TestMoveTaskInventoryItemNoParent()
150 { 152 {
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 1e87eed..655f3a5 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1211,11 +1211,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1211 1211
1212 } 1212 }
1213 1213
1214 public UUID GetDefaultAnimation(string name)
1215 {
1216 return UUID.Zero;
1217 }
1218
1219 public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) 1214 public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID)
1220 { 1215 {
1221 1216
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 7bd5590..a2375fe 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -133,11 +133,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC
133 133
134 } 134 }
135 135
136 public UUID GetDefaultAnimation(string name)
137 {
138 return SLUtil.GetDefaultAvatarAnimation(name);
139 }
140
141 public Vector3 Position 136 public Vector3 Position
142 { 137 {
143 get { return m_scene.Entities[m_uuid].AbsolutePosition; } 138 get { return m_scene.Entities[m_uuid].AbsolutePosition; }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index df4c7f8..4d7c40e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4764,7 +4764,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4764 4764
4765 if (m_host.RegionHandle == presence.RegionHandle) 4765 if (m_host.RegionHandle == presence.RegionHandle)
4766 { 4766 {
4767 Dictionary<UUID, string> animationstateNames = AnimationSet.Animations.AnimStateNames; 4767 Dictionary<UUID, string> animationstateNames = DefaultAvatarAnimations.AnimStateNames;
4768 4768
4769 if (presence != null) 4769 if (presence != null)
4770 { 4770 {
@@ -6064,7 +6064,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6064 } 6064 }
6065 6065
6066 if (agent.Animator.Animations.DefaultAnimation.AnimID 6066 if (agent.Animator.Animations.DefaultAnimation.AnimID
6067 == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) 6067 == DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"])
6068 { 6068 {
6069 flags |= ScriptBaseClass.AGENT_SITTING; 6069 flags |= ScriptBaseClass.AGENT_SITTING;
6070 } 6070 }
@@ -8408,7 +8408,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8408 LSL_Vector lower; 8408 LSL_Vector lower;
8409 LSL_Vector upper; 8409 LSL_Vector upper;
8410 if (presence.Animator.Animations.DefaultAnimation.AnimID 8410 if (presence.Animator.Animations.DefaultAnimation.AnimID
8411 == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) 8411 == DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"])
8412 { 8412 {
8413 // This is for ground sitting avatars 8413 // This is for ground sitting avatars
8414 float height = presence.Appearance.AvatarHeight / 2.66666667f; 8414 float height = presence.Appearance.AvatarHeight / 2.66666667f;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
new file mode 100644
index 0000000..e2d0db2
--- /dev/null
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
@@ -0,0 +1,168 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using System.Text;
32using log4net;
33using Nini.Config;
34using NUnit.Framework;
35using OpenMetaverse;
36using OpenMetaverse.Assets;
37using OpenMetaverse.StructuredData;
38using OpenSim.Framework;
39using OpenSim.Region.CoreModules.Avatar.AvatarFactory;
40using OpenSim.Region.OptionalModules.World.NPC;
41using OpenSim.Region.Framework.Scenes;
42using OpenSim.Region.ScriptEngine.Shared;
43using OpenSim.Region.ScriptEngine.Shared.Api;
44using OpenSim.Services.Interfaces;
45using OpenSim.Tests.Common;
46using OpenSim.Tests.Common.Mock;
47
48namespace OpenSim.Region.ScriptEngine.Shared.Tests
49{
50 /// <summary>
51 /// Tests for inventory functions in LSL
52 /// </summary>
53 [TestFixture]
54 public class LSL_ApiInventoryTests
55 {
56 protected Scene m_scene;
57 protected XEngine.XEngine m_engine;
58
59 [SetUp]
60 public void SetUp()
61 {
62 IConfigSource initConfigSource = new IniConfigSource();
63 IConfig config = initConfigSource.AddConfig("XEngine");
64 config.Set("Enabled", "true");
65
66 m_scene = SceneHelpers.SetupScene();
67 SceneHelpers.SetupSceneModules(m_scene, initConfigSource);
68
69 m_engine = new XEngine.XEngine();
70 m_engine.Initialise(initConfigSource);
71 m_engine.AddRegion(m_scene);
72 }
73
74 /// <summary>
75 /// Test giving inventory from an object to an object where both are owned by the same user.
76 /// </summary>
77 [Test]
78 public void TestLlGiveInventoryO2OSameOwner()
79 {
80 TestHelpers.InMethod();
81// log4net.Config.XmlConfigurator.Configure();
82
83 UUID userId = TestHelpers.ParseTail(0x1);
84 string inventoryItemName = "item1";
85
86 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "so1", 0x10);
87 m_scene.AddSceneObject(so1);
88
89 // Create an object embedded inside the first
90 UUID itemId = TestHelpers.ParseTail(0x20);
91 TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, userId);
92
93 LSL_Api api = new LSL_Api();
94 api.Initialize(m_engine, so1.RootPart, so1.RootPart.LocalId, so1.RootPart.UUID);
95
96 // Create a second object
97 SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, userId, "so2", 0x100);
98 m_scene.AddSceneObject(so2);
99
100 api.llGiveInventory(so2.UUID.ToString(), inventoryItemName);
101
102 // Item has copy permissions so original should stay intact.
103 List<TaskInventoryItem> originalItems = so1.RootPart.Inventory.GetInventoryItems();
104 Assert.That(originalItems.Count, Is.EqualTo(1));
105
106 List<TaskInventoryItem> copiedItems = so2.RootPart.Inventory.GetInventoryItems(inventoryItemName);
107 Assert.That(copiedItems.Count, Is.EqualTo(1));
108 Assert.That(copiedItems[0].Name, Is.EqualTo(inventoryItemName));
109 }
110
111 /// <summary>
112 /// Test giving inventory from an object to an object where they have different owners
113 /// </summary>
114 [Test]
115 public void TestLlGiveInventoryO2ODifferentOwners()
116 {
117 TestHelpers.InMethod();
118// log4net.Config.XmlConfigurator.Configure();
119
120 UUID user1Id = TestHelpers.ParseTail(0x1);
121 UUID user2Id = TestHelpers.ParseTail(0x2);
122 string inventoryItemName = "item1";
123
124 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
125 m_scene.AddSceneObject(so1);
126 LSL_Api api = new LSL_Api();
127 api.Initialize(m_engine, so1.RootPart, so1.RootPart.LocalId, so1.RootPart.UUID);
128
129 // Create an object embedded inside the first
130 UUID itemId = TestHelpers.ParseTail(0x20);
131 TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id);
132
133 // Create a second object
134 SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100);
135 m_scene.AddSceneObject(so2);
136 LSL_Api api2 = new LSL_Api();
137 api2.Initialize(m_engine, so2.RootPart, so2.RootPart.LocalId, so2.RootPart.UUID);
138
139 // *** Firstly, we test where llAllowInventoryDrop() has not been called. ***
140 api.llGiveInventory(so2.UUID.ToString(), inventoryItemName);
141
142 {
143 // Item has copy permissions so original should stay intact.
144 List<TaskInventoryItem> originalItems = so1.RootPart.Inventory.GetInventoryItems();
145 Assert.That(originalItems.Count, Is.EqualTo(1));
146
147 // Should have not copied
148 List<TaskInventoryItem> copiedItems = so2.RootPart.Inventory.GetInventoryItems(inventoryItemName);
149 Assert.That(copiedItems.Count, Is.EqualTo(0));
150 }
151
152 // *** Secondly, we turn on allow inventory drop in the target and retest. ***
153 api2.llAllowInventoryDrop(1);
154 api.llGiveInventory(so2.UUID.ToString(), inventoryItemName);
155
156 {
157 // Item has copy permissions so original should stay intact.
158 List<TaskInventoryItem> originalItems = so1.RootPart.Inventory.GetInventoryItems();
159 Assert.That(originalItems.Count, Is.EqualTo(1));
160
161 // Should now have copied.
162 List<TaskInventoryItem> copiedItems = so2.RootPart.Inventory.GetInventoryItems(inventoryItemName);
163 Assert.That(copiedItems.Count, Is.EqualTo(1));
164 Assert.That(copiedItems[0].Name, Is.EqualTo(inventoryItemName));
165 }
166 }
167 }
168} \ No newline at end of file