diff options
Diffstat (limited to 'OpenSim')
13 files changed, 149 insertions, 11 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index 3f29f5b..47fb6d7 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs | |||
@@ -2202,5 +2202,10 @@ VALUES | |||
2202 | } | 2202 | } |
2203 | } | 2203 | } |
2204 | } | 2204 | } |
2205 | |||
2206 | public UUID[] GetObjectIDs(UUID regionID) | ||
2207 | { | ||
2208 | return new UUID[0]; | ||
2209 | } | ||
2205 | } | 2210 | } |
2206 | } | 2211 | } |
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index faf749f..4e7c8af 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -119,8 +119,10 @@ namespace OpenSim.Data.MySQL | |||
119 | 119 | ||
120 | // Eligibility check | 120 | // Eligibility check |
121 | // | 121 | // |
122 | if ((flags & (uint)PrimFlags.Temporary) != 0) | 122 | // PrimFlags.Temporary is not used in OpenSim code and cannot |
123 | return; | 123 | // be guaranteed to always be clear. Don't check it. |
124 | // if ((flags & (uint)PrimFlags.Temporary) != 0) | ||
125 | // return; | ||
124 | if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) | 126 | if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) |
125 | return; | 127 | return; |
126 | 128 | ||
@@ -1972,6 +1974,37 @@ namespace OpenSim.Data.MySQL | |||
1972 | } | 1974 | } |
1973 | } | 1975 | } |
1974 | 1976 | ||
1977 | public UUID[] GetObjectIDs(UUID regionID) | ||
1978 | { | ||
1979 | List<UUID> uuids = new List<UUID>(); | ||
1980 | |||
1981 | lock (m_dbLock) | ||
1982 | { | ||
1983 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
1984 | { | ||
1985 | dbcon.Open(); | ||
1986 | |||
1987 | using (MySqlCommand cmd = dbcon.CreateCommand()) | ||
1988 | { | ||
1989 | cmd.CommandText = "select UUID from prims where RegionUUID = ?RegionUUID"; | ||
1990 | cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); | ||
1991 | |||
1992 | using (IDataReader reader = ExecuteReader(cmd)) | ||
1993 | { | ||
1994 | while (reader.Read()) | ||
1995 | { | ||
1996 | UUID id = new UUID(reader["UUID"].ToString()); | ||
1997 | |||
1998 | uuids.Add(id); | ||
1999 | } | ||
2000 | } | ||
2001 | } | ||
2002 | } | ||
2003 | } | ||
2004 | |||
2005 | return uuids.ToArray(); | ||
2006 | } | ||
2007 | |||
1975 | private void LoadSpawnPoints(RegionSettings rs) | 2008 | private void LoadSpawnPoints(RegionSettings rs) |
1976 | { | 2009 | { |
1977 | rs.ClearSpawnPoints(); | 2010 | rs.ClearSpawnPoints(); |
diff --git a/OpenSim/Data/Null/NullSimulationData.cs b/OpenSim/Data/Null/NullSimulationData.cs index 8f2314f..a39ef0b 100644 --- a/OpenSim/Data/Null/NullSimulationData.cs +++ b/OpenSim/Data/Null/NullSimulationData.cs | |||
@@ -151,5 +151,10 @@ namespace OpenSim.Data.Null | |||
151 | public void Shutdown() | 151 | public void Shutdown() |
152 | { | 152 | { |
153 | } | 153 | } |
154 | |||
155 | public UUID[] GetObjectIDs(UUID regionID) | ||
156 | { | ||
157 | return new UUID[0]; | ||
158 | } | ||
154 | } | 159 | } |
155 | } | 160 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index f40e866..9175a8f 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -2890,5 +2890,9 @@ namespace OpenSim.Data.SQLite | |||
2890 | } | 2890 | } |
2891 | } | 2891 | } |
2892 | 2892 | ||
2893 | public UUID[] GetObjectIDs(UUID regionID) | ||
2894 | { | ||
2895 | return new UUID[0]; | ||
2896 | } | ||
2893 | } | 2897 | } |
2894 | } | 2898 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs index 0fcafcc..ccb583d 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs | |||
@@ -116,5 +116,6 @@ namespace OpenSim.Region.Framework.Interfaces | |||
116 | /// <param name="regionUUID">the region UUID</param> | 116 | /// <param name="regionUUID">the region UUID</param> |
117 | void RemoveRegionEnvironmentSettings(UUID regionUUID); | 117 | void RemoveRegionEnvironmentSettings(UUID regionUUID); |
118 | 118 | ||
119 | UUID[] GetObjectIDs(UUID regionID); | ||
119 | } | 120 | } |
120 | } | 121 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs index e424976..d7c80f7 100644 --- a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs | |||
@@ -106,6 +106,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
106 | RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); | 106 | RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); |
107 | void StoreRegionWindlightSettings(RegionLightShareData wl); | 107 | void StoreRegionWindlightSettings(RegionLightShareData wl); |
108 | void RemoveRegionWindlightSettings(UUID regionID); | 108 | void RemoveRegionWindlightSettings(UUID regionID); |
109 | UUID[] GetObjectIDs(UUID regionID); | ||
109 | 110 | ||
110 | /// <summary> | 111 | /// <summary> |
111 | /// Load Environment settings from region storage | 112 | /// Load Environment settings from region storage |
diff --git a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs index a95e75a..075724e 100644 --- a/OpenSim/Region/Framework/Scenes/CollisionSounds.cs +++ b/OpenSim/Region/Framework/Scenes/CollisionSounds.cs | |||
@@ -266,9 +266,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
266 | else | 266 | else |
267 | { | 267 | { |
268 | volume = Math.Abs(colInfo.relativeVel); | 268 | volume = Math.Abs(colInfo.relativeVel); |
269 | if (volume < 0.2f) | 269 | // Most noral collisions (running into walls, stairs) |
270 | // should never be heard. | ||
271 | if (volume < 3.2f) | ||
270 | continue; | 272 | continue; |
271 | m_log.DebugFormat("Collision speed was {0}", volume); | 273 | // m_log.DebugFormat("Collision speed was {0}", volume); |
272 | 274 | ||
273 | // Cap to 0.2 times volume because climbing stairs should not be noisy | 275 | // Cap to 0.2 times volume because climbing stairs should not be noisy |
274 | // Also changed scaling | 276 | // Also changed scaling |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e83696b..6feb883 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1059,6 +1059,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1059 | IsChildAgent = true; | 1059 | IsChildAgent = true; |
1060 | m_scene.SwapRootAgentCount(true); | 1060 | m_scene.SwapRootAgentCount(true); |
1061 | RemoveFromPhysicalScene(); | 1061 | RemoveFromPhysicalScene(); |
1062 | ParentID = 0; // Child agents can't be sitting | ||
1062 | 1063 | ||
1063 | // FIXME: Set RegionHandle to the region handle of the scene this agent is moving into | 1064 | // FIXME: Set RegionHandle to the region handle of the scene this agent is moving into |
1064 | 1065 | ||
@@ -2102,6 +2103,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2102 | 2103 | ||
2103 | public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset) | 2104 | public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset) |
2104 | { | 2105 | { |
2106 | if (IsChildAgent) | ||
2107 | return; | ||
2108 | |||
2105 | if (ParentID != 0) | 2109 | if (ParentID != 0) |
2106 | { | 2110 | { |
2107 | StandUp(); | 2111 | StandUp(); |
@@ -2905,8 +2909,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2905 | 2909 | ||
2906 | // If we don't have a PhysActor, we can't cross anyway | 2910 | // If we don't have a PhysActor, we can't cross anyway |
2907 | // Also don't do this while sat, sitting avatars cross with the | 2911 | // Also don't do this while sat, sitting avatars cross with the |
2908 | // object they sit on. | 2912 | // object they sit on. ParentUUID denoted a pending sit, don't |
2909 | if (ParentID != 0 || PhysicsActor == null) | 2913 | // interfere with it. |
2914 | if (ParentID != 0 || PhysicsActor == null || ParentUUID != UUID.Zero) | ||
2910 | return; | 2915 | return; |
2911 | 2916 | ||
2912 | if (!IsInTransit) | 2917 | if (!IsInTransit) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6af3c1e..713f832 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4564,10 +4564,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4564 | ScriptSleep(5000); | 4564 | ScriptSleep(5000); |
4565 | } | 4565 | } |
4566 | 4566 | ||
4567 | public void llTeleportAgent(string agent, string simname, LSL_Vector pos, LSL_Vector lookAt) | 4567 | public void llTeleportAgent(string agent, string destination, LSL_Vector pos, LSL_Vector lookAt) |
4568 | { | 4568 | { |
4569 | m_host.AddScriptLPS(1); | 4569 | m_host.AddScriptLPS(1); |
4570 | UUID agentId = new UUID(); | 4570 | UUID agentId = new UUID(); |
4571 | |||
4572 | Vector3 targetPos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); | ||
4573 | Vector3 targetLookAt = new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z); | ||
4574 | |||
4571 | if (UUID.TryParse(agent, out agentId)) | 4575 | if (UUID.TryParse(agent, out agentId)) |
4572 | { | 4576 | { |
4573 | ScenePresence presence = World.GetScenePresence(agentId); | 4577 | ScenePresence presence = World.GetScenePresence(agentId); |
@@ -4576,26 +4580,84 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4576 | // agent must not be a god | 4580 | // agent must not be a god |
4577 | if (presence.GodLevel >= 200) return; | 4581 | if (presence.GodLevel >= 200) return; |
4578 | 4582 | ||
4579 | if (simname == String.Empty) | 4583 | if (destination == String.Empty) |
4580 | simname = World.RegionInfo.RegionName; | 4584 | destination = World.RegionInfo.RegionName; |
4585 | |||
4586 | // agent must be over the owners land | ||
4587 | if (m_host.OwnerID == World.LandChannel.GetLandObject( | ||
4588 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) | ||
4589 | { | ||
4590 | DoLLTeleport(presence, destination, targetPos, targetLookAt); | ||
4591 | } | ||
4592 | else // or must be wearing the prim | ||
4593 | { | ||
4594 | if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) | ||
4595 | { | ||
4596 | DoLLTeleport(presence, destination, targetPos, targetLookAt); | ||
4597 | } | ||
4598 | } | ||
4599 | } | ||
4600 | } | ||
4601 | } | ||
4602 | |||
4603 | public void llTeleportAgentGlobalCoords(string agent, LSL_Vector global_coords, LSL_Vector pos, LSL_Vector lookAt) | ||
4604 | { | ||
4605 | m_host.AddScriptLPS(1); | ||
4606 | UUID agentId = new UUID(); | ||
4607 | |||
4608 | ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y); | ||
4609 | |||
4610 | Vector3 targetPos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); | ||
4611 | Vector3 targetLookAt = new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z); | ||
4612 | if (UUID.TryParse(agent, out agentId)) | ||
4613 | { | ||
4614 | ScenePresence presence = World.GetScenePresence(agentId); | ||
4615 | if (presence != null && presence.PresenceType != PresenceType.Npc) | ||
4616 | { | ||
4617 | // agent must not be a god | ||
4618 | if (presence.GodLevel >= 200) return; | ||
4581 | 4619 | ||
4582 | // agent must be over the owners land | 4620 | // agent must be over the owners land |
4583 | if (m_host.OwnerID == World.LandChannel.GetLandObject( | 4621 | if (m_host.OwnerID == World.LandChannel.GetLandObject( |
4584 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) | 4622 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) |
4585 | { | 4623 | { |
4586 | World.RequestTeleportLocation(presence.ControllingClient, simname, new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z), (uint)TeleportFlags.ViaLocation); | 4624 | World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); |
4587 | } | 4625 | } |
4588 | else // or must be wearing the prim | 4626 | else // or must be wearing the prim |
4589 | { | 4627 | { |
4590 | if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) | 4628 | if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) |
4591 | { | 4629 | { |
4592 | World.RequestTeleportLocation(presence.ControllingClient, simname, new Vector3((float)pos.x, (float)pos.y, (float)pos.z), new Vector3((float)lookAt.x, (float)lookAt.y, (float)lookAt.z), (uint)TeleportFlags.ViaLocation); | 4630 | World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); |
4593 | } | 4631 | } |
4594 | } | 4632 | } |
4595 | } | 4633 | } |
4596 | } | 4634 | } |
4597 | } | 4635 | } |
4598 | 4636 | ||
4637 | private void DoLLTeleport(ScenePresence sp, string destination, Vector3 targetPos, Vector3 targetLookAt) | ||
4638 | { | ||
4639 | UUID assetID = KeyOrName(destination); | ||
4640 | |||
4641 | // The destinaion is not an asset ID and also doesn't name a landmark. | ||
4642 | // Use it as a sim name | ||
4643 | if (assetID == UUID.Zero) | ||
4644 | { | ||
4645 | World.RequestTeleportLocation(sp.ControllingClient, destination, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); | ||
4646 | return; | ||
4647 | } | ||
4648 | |||
4649 | AssetBase lma = World.AssetService.Get(assetID.ToString()); | ||
4650 | if (lma == null) | ||
4651 | return; | ||
4652 | |||
4653 | if (lma.Type != (sbyte)AssetType.Landmark) | ||
4654 | return; | ||
4655 | |||
4656 | AssetLandmark lm = new AssetLandmark(lma); | ||
4657 | |||
4658 | World.RequestTeleportLocation(sp.ControllingClient, lm.RegionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); | ||
4659 | } | ||
4660 | |||
4599 | public void llTextBox(string agent, string message, int chatChannel) | 4661 | public void llTextBox(string agent, string message, int chatChannel) |
4600 | { | 4662 | { |
4601 | IDialogModule dm = World.RequestModuleInterface<IDialogModule>(); | 4663 | IDialogModule dm = World.RequestModuleInterface<IDialogModule>(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index 048124d..749fc97 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -407,6 +407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
407 | void llTargetRemove(int number); | 407 | void llTargetRemove(int number); |
408 | void llTeleportAgentHome(string agent); | 408 | void llTeleportAgentHome(string agent); |
409 | void llTeleportAgent(string agent, string simname, LSL_Vector pos, LSL_Vector lookAt); | 409 | void llTeleportAgent(string agent, string simname, LSL_Vector pos, LSL_Vector lookAt); |
410 | void llTeleportAgentGlobalCoords(string agent, LSL_Vector global, LSL_Vector pos, LSL_Vector lookAt); | ||
410 | void llTextBox(string avatar, string message, int chat_channel); | 411 | void llTextBox(string avatar, string message, int chat_channel); |
411 | LSL_String llToLower(string source); | 412 | LSL_String llToLower(string source); |
412 | LSL_String llToUpper(string source); | 413 | LSL_String llToUpper(string source); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 2d23d30..976969a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -1860,6 +1860,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1860 | m_LSL_Functions.llTeleportAgent(agent, simname, pos, lookAt); | 1860 | m_LSL_Functions.llTeleportAgent(agent, simname, pos, lookAt); |
1861 | } | 1861 | } |
1862 | 1862 | ||
1863 | public void llTeleportAgentGlobalCoords(string agent, LSL_Vector global, LSL_Vector pos, LSL_Vector lookAt) | ||
1864 | { | ||
1865 | m_LSL_Functions.llTeleportAgentGlobalCoords(agent, global, pos, lookAt); | ||
1866 | } | ||
1867 | |||
1863 | public void llTeleportAgentHome(string agent) | 1868 | public void llTeleportAgentHome(string agent) |
1864 | { | 1869 | { |
1865 | m_LSL_Functions.llTeleportAgentHome(agent); | 1870 | m_LSL_Functions.llTeleportAgentHome(agent); |
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs index c9cbbfa..6db830b 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs | |||
@@ -164,5 +164,9 @@ namespace OpenSim.Services.Connectors | |||
164 | m_database.RemoveRegionEnvironmentSettings(regionUUID); | 164 | m_database.RemoveRegionEnvironmentSettings(regionUUID); |
165 | } | 165 | } |
166 | 166 | ||
167 | public UUID[] GetObjectIDs(UUID regionID) | ||
168 | { | ||
169 | return m_database.GetObjectIDs(regionID); | ||
170 | } | ||
167 | } | 171 | } |
168 | } | 172 | } |
diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 1845eb9..3f99a39 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs | |||
@@ -127,6 +127,11 @@ namespace OpenSim.Data.Null | |||
127 | { | 127 | { |
128 | m_store.RemoveRegionEnvironmentSettings(regionUUID); | 128 | m_store.RemoveRegionEnvironmentSettings(regionUUID); |
129 | } | 129 | } |
130 | |||
131 | public UUID[] GetObjectIDs(UUID regionID) | ||
132 | { | ||
133 | return new UUID[0]; | ||
134 | } | ||
130 | } | 135 | } |
131 | 136 | ||
132 | /// <summary> | 137 | /// <summary> |
@@ -318,5 +323,10 @@ namespace OpenSim.Data.Null | |||
318 | public void Shutdown() | 323 | public void Shutdown() |
319 | { | 324 | { |
320 | } | 325 | } |
326 | |||
327 | public UUID[] GetObjectIDs(UUID regionID) | ||
328 | { | ||
329 | return new UUID[0]; | ||
330 | } | ||
321 | } | 331 | } |
322 | } | 332 | } |