diff options
author | Adam Frisby | 2009-08-18 00:23:27 +1000 |
---|---|---|
committer | Adam Frisby | 2009-08-18 00:23:27 +1000 |
commit | 58d9d6026eb36d530c7cec753279b7aeaa6b43eb (patch) | |
tree | 86a09687ef01b308ac2ae8e1023ec9ddb943c54f /OpenSim/Region | |
parent | * Implementing a bunch of Unimplemented MRM stubs. (diff) | |
parent | Add System.Xml reference to the console project (diff) | |
download | opensim-SC_OLD-58d9d6026eb36d530c7cec753279b7aeaa6b43eb.zip opensim-SC_OLD-58d9d6026eb36d530c7cec753279b7aeaa6b43eb.tar.gz opensim-SC_OLD-58d9d6026eb36d530c7cec753279b7aeaa6b43eb.tar.bz2 opensim-SC_OLD-58d9d6026eb36d530c7cec753279b7aeaa6b43eb.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
12 files changed, 158 insertions, 40 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index df80290..2fd26bf 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -120,6 +120,7 @@ namespace OpenSim | |||
120 | configSource.AddSwitch("Startup", "gridmode"); | 120 | configSource.AddSwitch("Startup", "gridmode"); |
121 | configSource.AddSwitch("Startup", "physics"); | 121 | configSource.AddSwitch("Startup", "physics"); |
122 | configSource.AddSwitch("Startup", "gui"); | 122 | configSource.AddSwitch("Startup", "gui"); |
123 | configSource.AddSwitch("Startup", "console"); | ||
123 | 124 | ||
124 | configSource.AddConfig("StandAlone"); | 125 | configSource.AddConfig("StandAlone"); |
125 | configSource.AddConfig("Network"); | 126 | configSource.AddConfig("Network"); |
@@ -223,4 +224,4 @@ namespace OpenSim | |||
223 | _IsHandlingException = false; | 224 | _IsHandlingException = false; |
224 | } | 225 | } |
225 | } | 226 | } |
226 | } \ No newline at end of file | 227 | } |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 390cfcd..38874f9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim | |||
52 | protected string m_startupCommandsFile; | 52 | protected string m_startupCommandsFile; |
53 | protected string m_shutdownCommandsFile; | 53 | protected string m_shutdownCommandsFile; |
54 | protected bool m_gui = false; | 54 | protected bool m_gui = false; |
55 | protected string m_consoleType = "local"; | ||
55 | 56 | ||
56 | private string m_timedScript = "disabled"; | 57 | private string m_timedScript = "disabled"; |
57 | private Timer m_scriptTimer; | 58 | private Timer m_scriptTimer; |
@@ -71,7 +72,10 @@ namespace OpenSim | |||
71 | m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "startup_commands.txt"); | 72 | m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "startup_commands.txt"); |
72 | m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "shutdown_commands.txt"); | 73 | m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "shutdown_commands.txt"); |
73 | 74 | ||
74 | m_gui = startupConfig.GetBoolean("gui", false); | 75 | if (startupConfig.GetString("console", String.Empty) == String.Empty) |
76 | m_gui = startupConfig.GetBoolean("gui", false); | ||
77 | else | ||
78 | m_consoleType= startupConfig.GetString("console", String.Empty); | ||
75 | 79 | ||
76 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); | 80 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); |
77 | if (m_logFileAppender != null) | 81 | if (m_logFileAppender != null) |
@@ -110,13 +114,31 @@ namespace OpenSim | |||
110 | if (m_gui) // Driven by external GUI | 114 | if (m_gui) // Driven by external GUI |
111 | m_console = new CommandConsole("Region"); | 115 | m_console = new CommandConsole("Region"); |
112 | else | 116 | else |
113 | m_console = new LocalConsole("Region"); | 117 | { |
118 | switch (m_consoleType) | ||
119 | { | ||
120 | case "basic": | ||
121 | m_console = new CommandConsole("Region"); | ||
122 | break; | ||
123 | case "rest": | ||
124 | m_console = new RemoteConsole("Region"); | ||
125 | ((RemoteConsole)m_console).ReadConfig(m_config.Source); | ||
126 | break; | ||
127 | default: | ||
128 | m_console = new LocalConsole("Region"); | ||
129 | break; | ||
130 | } | ||
131 | } | ||
132 | |||
114 | MainConsole.Instance = m_console; | 133 | MainConsole.Instance = m_console; |
115 | 134 | ||
116 | RegisterConsoleCommands(); | 135 | RegisterConsoleCommands(); |
117 | 136 | ||
118 | base.StartupSpecific(); | 137 | base.StartupSpecific(); |
119 | 138 | ||
139 | if (m_console is RemoteConsole) | ||
140 | ((RemoteConsole)m_console).SetServer(m_httpServer); | ||
141 | |||
120 | //Run Startup Commands | 142 | //Run Startup Commands |
121 | if (String.IsNullOrEmpty(m_startupCommandsFile)) | 143 | if (String.IsNullOrEmpty(m_startupCommandsFile)) |
122 | { | 144 | { |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 12c2d86..e1d6f1b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1435,6 +1435,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1435 | /// <param name="map">heightmap</param> | 1435 | /// <param name="map">heightmap</param> |
1436 | public virtual void SendLayerData(float[] map) | 1436 | public virtual void SendLayerData(float[] map) |
1437 | { | 1437 | { |
1438 | DoSendLayerData((object)map); | ||
1438 | ThreadPool.QueueUserWorkItem(DoSendLayerData, map); | 1439 | ThreadPool.QueueUserWorkItem(DoSendLayerData, map); |
1439 | } | 1440 | } |
1440 | 1441 | ||
@@ -1450,16 +1451,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1450 | { | 1451 | { |
1451 | for (int y = 0; y < 16; y++) | 1452 | for (int y = 0; y < 16; y++) |
1452 | { | 1453 | { |
1453 | // For some terrains, sending more than one terrain patch at once results in a libsecondlife exception | 1454 | for (int x = 0; x < 16; x += 4) |
1454 | // see http://opensimulator.org/mantis/view.php?id=1662 | 1455 | { |
1455 | //for (int x = 0; x < 16; x += 4) | 1456 | SendLayerPacket(LLHeightFieldMoronize(map), y, x); |
1456 | //{ | ||
1457 | // SendLayerPacket(map, y, x); | ||
1458 | // Thread.Sleep(150); | ||
1459 | //} | ||
1460 | for (int x = 0; x < 16; x++) | ||
1461 | { | ||
1462 | SendLayerData(x, y, LLHeightFieldMoronize(map)); | ||
1463 | Thread.Sleep(35); | 1457 | Thread.Sleep(35); |
1464 | } | 1458 | } |
1465 | } | 1459 | } |
@@ -1476,17 +1470,54 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1476 | /// <param name="map">heightmap</param> | 1470 | /// <param name="map">heightmap</param> |
1477 | /// <param name="px">X coordinate for patches 0..12</param> | 1471 | /// <param name="px">X coordinate for patches 0..12</param> |
1478 | /// <param name="py">Y coordinate for patches 0..15</param> | 1472 | /// <param name="py">Y coordinate for patches 0..15</param> |
1479 | // private void SendLayerPacket(float[] map, int y, int x) | 1473 | private void SendLayerPacket(float[] map, int y, int x) |
1480 | // { | 1474 | { |
1481 | // int[] patches = new int[4]; | 1475 | int[] patches = new int[4]; |
1482 | // patches[0] = x + 0 + y * 16; | 1476 | patches[0] = x + 0 + y * 16; |
1483 | // patches[1] = x + 1 + y * 16; | 1477 | patches[1] = x + 1 + y * 16; |
1484 | // patches[2] = x + 2 + y * 16; | 1478 | patches[2] = x + 2 + y * 16; |
1485 | // patches[3] = x + 3 + y * 16; | 1479 | patches[3] = x + 3 + y * 16; |
1486 | 1480 | ||
1487 | // Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches); | 1481 | LayerDataPacket layerpack; |
1488 | // OutPacket(layerpack, ThrottleOutPacketType.Land); | 1482 | try |
1489 | // } | 1483 | { |
1484 | layerpack = TerrainCompressor.CreateLandPacket(map, patches); | ||
1485 | layerpack.Header.Zerocoded = true; | ||
1486 | layerpack.Header.Reliable = true; | ||
1487 | |||
1488 | if (layerpack.Length > 1000) // Oversize packet was created | ||
1489 | { | ||
1490 | for (int xa = 0 ; xa < 4 ; xa++) | ||
1491 | { | ||
1492 | // Send oversize packet in individual patches | ||
1493 | // | ||
1494 | SendLayerData(x+xa, y, map); | ||
1495 | } | ||
1496 | } | ||
1497 | else | ||
1498 | { | ||
1499 | OutPacket(layerpack, ThrottleOutPacketType.Land); | ||
1500 | } | ||
1501 | } | ||
1502 | catch (OverflowException e) | ||
1503 | { | ||
1504 | for (int xa = 0 ; xa < 4 ; xa++) | ||
1505 | { | ||
1506 | // Send oversize packet in individual patches | ||
1507 | // | ||
1508 | SendLayerData(x+xa, y, map); | ||
1509 | } | ||
1510 | } | ||
1511 | catch (IndexOutOfRangeException e) | ||
1512 | { | ||
1513 | for (int xa = 0 ; xa < 4 ; xa++) | ||
1514 | { | ||
1515 | // Bad terrain, send individual chunks | ||
1516 | // | ||
1517 | SendLayerData(x+xa, y, map); | ||
1518 | } | ||
1519 | } | ||
1520 | } | ||
1490 | 1521 | ||
1491 | /// <summary> | 1522 | /// <summary> |
1492 | /// Sends a specified patch to a client | 1523 | /// Sends a specified patch to a client |
@@ -1507,6 +1538,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1507 | 1538 | ||
1508 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches); | 1539 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches); |
1509 | layerpack.Header.Zerocoded = true; | 1540 | layerpack.Header.Zerocoded = true; |
1541 | layerpack.Header.Reliable = true; | ||
1510 | 1542 | ||
1511 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1543 | OutPacket(layerpack, ThrottleOutPacketType.Land); |
1512 | 1544 | ||
@@ -1556,7 +1588,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1556 | /// <param name="windSpeeds">16x16 array of wind speeds</param> | 1588 | /// <param name="windSpeeds">16x16 array of wind speeds</param> |
1557 | public virtual void SendWindData(Vector2[] windSpeeds) | 1589 | public virtual void SendWindData(Vector2[] windSpeeds) |
1558 | { | 1590 | { |
1559 | ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds); | 1591 | DoSendWindData((object)windSpeeds); |
1592 | // ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendWindData), (object)windSpeeds); | ||
1560 | } | 1593 | } |
1561 | 1594 | ||
1562 | /// <summary> | 1595 | /// <summary> |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index aef1b94..47c7fe4 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
147 | { | 147 | { |
148 | // The timeout should always be significantly larger than the timeout for the grid server to request | 148 | // The timeout should always be significantly larger than the timeout for the grid server to request |
149 | // the initial status of the region before confirming registration. | 149 | // the initial status of the region before confirming registration. |
150 | GridResp = GridReq.Send(serversInfo.GridURL, 90000); | 150 | GridResp = GridReq.Send(serversInfo.GridURL, 9999999); |
151 | } | 151 | } |
152 | catch (Exception e) | 152 | catch (Exception e) |
153 | { | 153 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index fcc2673..2426393 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -48,6 +48,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
48 | private int m_saydistance = 30; | 48 | private int m_saydistance = 30; |
49 | private int m_shoutdistance = 100; | 49 | private int m_shoutdistance = 100; |
50 | private int m_whisperdistance = 10; | 50 | private int m_whisperdistance = 10; |
51 | private string m_adminprefix = String.Empty; | ||
51 | private List<Scene> m_scenes = new List<Scene>(); | 52 | private List<Scene> m_scenes = new List<Scene>(); |
52 | 53 | ||
53 | internal object m_syncy = new object(); | 54 | internal object m_syncy = new object(); |
@@ -76,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
76 | m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); | 77 | m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); |
77 | m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); | 78 | m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); |
78 | m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); | 79 | m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance); |
80 | m_adminprefix = config.Configs["Chat"].GetString("admin_prefix", m_adminprefix); | ||
79 | } | 81 | } |
80 | 82 | ||
81 | public virtual void AddRegion(Scene scene) | 83 | public virtual void AddRegion(Scene scene) |
@@ -207,6 +209,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
207 | fromPos = avatar.AbsolutePosition; | 209 | fromPos = avatar.AbsolutePosition; |
208 | fromName = avatar.Name; | 210 | fromName = avatar.Name; |
209 | fromID = c.Sender.AgentId; | 211 | fromID = c.Sender.AgentId; |
212 | if (avatar.GodLevel > 100) | ||
213 | fromName = m_adminprefix + fromName; | ||
210 | 214 | ||
211 | break; | 215 | break; |
212 | 216 | ||
@@ -255,14 +259,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
255 | string fromName = c.From; | 259 | string fromName = c.From; |
256 | 260 | ||
257 | UUID fromID = UUID.Zero; | 261 | UUID fromID = UUID.Zero; |
262 | UUID ownerID = UUID.Zero; | ||
258 | ChatSourceType sourceType = ChatSourceType.Object; | 263 | ChatSourceType sourceType = ChatSourceType.Object; |
259 | if (null != c.Sender) | 264 | if (null != c.Sender) |
260 | { | 265 | { |
261 | ScenePresence avatar = (c.Scene as Scene).GetScenePresence(c.Sender.AgentId); | 266 | ScenePresence avatar = (c.Scene as Scene).GetScenePresence(c.Sender.AgentId); |
262 | fromID = c.Sender.AgentId; | 267 | fromID = c.Sender.AgentId; |
268 | ownerID = c.Sender.AgentId; | ||
263 | fromName = avatar.Name; | 269 | fromName = avatar.Name; |
264 | sourceType = ChatSourceType.Agent; | 270 | sourceType = ChatSourceType.Agent; |
265 | } | 271 | } |
272 | if (c.SenderObject != null) | ||
273 | { | ||
274 | SceneObjectPart senderObject = (SceneObjectPart)c.SenderObject; | ||
275 | fromID = senderObject.UUID; | ||
276 | ownerID = senderObject.OwnerID; | ||
277 | fromName = senderObject.Name; | ||
278 | } | ||
266 | 279 | ||
267 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); | 280 | // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); |
268 | 281 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index 20671e0..bce160a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs | |||
@@ -123,7 +123,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land | |||
123 | 123 | ||
124 | public LandData GetLandData(ulong regionHandle, uint x, uint y) | 124 | public LandData GetLandData(ulong regionHandle, uint x, uint y) |
125 | { | 125 | { |
126 | m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {2}", | 126 | m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}", |
127 | regionHandle, m_Scenes.Count); | 127 | regionHandle, m_Scenes.Count); |
128 | foreach (Scene s in m_Scenes) | 128 | foreach (Scene s in m_Scenes) |
129 | { | 129 | { |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 75b3fe6..61ef20e 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -214,7 +214,8 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
214 | 214 | ||
215 | private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) | 215 | private void handleEstateRestartSimRequest(IClientAPI remoteClient, int timeInSeconds) |
216 | { | 216 | { |
217 | m_scene.Restart(timeInSeconds); | 217 | // m_scene.Restart(timeInSeconds); |
218 | remoteClient.SendBlueBoxMessage(UUID.Zero, "System", "Restart is not available"); | ||
218 | } | 219 | } |
219 | 220 | ||
220 | private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) | 221 | private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 1a7f8f8..4fee4c9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -115,7 +115,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
115 | /// <param name="remoteClient"></param> | 115 | /// <param name="remoteClient"></param> |
116 | public void RequestPrim(uint primLocalID, IClientAPI remoteClient) | 116 | public void RequestPrim(uint primLocalID, IClientAPI remoteClient) |
117 | { | 117 | { |
118 | PacketType i = PacketType.ObjectUpdate; | ||
119 | List<EntityBase> EntityList = GetEntities(); | 118 | List<EntityBase> EntityList = GetEntities(); |
120 | 119 | ||
121 | foreach (EntityBase ent in EntityList) | 120 | foreach (EntityBase ent in EntityList) |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 8ec14c7..88452d2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
72 | scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm); | 72 | scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm); |
73 | 73 | ||
74 | ISharedRegionModule interregionComms = new RESTInterregionComms(); | 74 | ISharedRegionModule interregionComms = new RESTInterregionComms(); |
75 | interregionComms.Initialise( new IniConfigSource()); | 75 | interregionComms.Initialise(new IniConfigSource()); |
76 | interregionComms.PostInitialise(); | 76 | interregionComms.PostInitialise(); |
77 | SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); | 77 | SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms); |
78 | SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); | 78 | SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms); |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs index 22b4605..1993948 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IAvatarAttachment.cs | |||
@@ -1,3 +1,30 @@ | |||
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 | |||
1 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 28 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
2 | { | 29 | { |
3 | public interface IAvatarAttachment | 30 | public interface IAvatarAttachment |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 35b0a0f..292e345 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
71 | 71 | ||
72 | private bool CanEdit() | 72 | private bool CanEdit() |
73 | { | 73 | { |
74 | if(!m_security.CanEditObject(this)) | 74 | if (!m_security.CanEditObject(this)) |
75 | { | 75 | { |
76 | throw new SecurityException("Insufficient Permission to edit object with UUID [" + GetSOP().UUID + "]"); | 76 | throw new SecurityException("Insufficient Permission to edit object with UUID [" + GetSOP().UUID + "]"); |
77 | } | 77 | } |
@@ -672,7 +672,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
672 | get { return m_sculptType; } | 672 | get { return m_sculptType; } |
673 | set | 673 | set |
674 | { | 674 | { |
675 | if(!CanEdit()) | 675 | if (!CanEdit()) |
676 | return; | 676 | return; |
677 | 677 | ||
678 | m_sculptType = value; | 678 | m_sculptType = value; |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index b7030f1..80d7598 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -156,10 +156,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
156 | 156 | ||
157 | private const uint m_regionWidth = Constants.RegionSize; | 157 | private const uint m_regionWidth = Constants.RegionSize; |
158 | private const uint m_regionHeight = Constants.RegionSize; | 158 | private const uint m_regionHeight = Constants.RegionSize; |
159 | 159 | private bool IsLocked = false; | |
160 | private float ODE_STEPSIZE = 0.020f; | 160 | private float ODE_STEPSIZE = 0.020f; |
161 | private float metersInSpace = 29.9f; | 161 | private float metersInSpace = 29.9f; |
162 | 162 | private List<PhysicsActor> RemoveQueue; | |
163 | public float gravityx = 0f; | 163 | public float gravityx = 0f; |
164 | public float gravityy = 0f; | 164 | public float gravityy = 0f; |
165 | public float gravityz = -9.8f; | 165 | public float gravityz = -9.8f; |
@@ -376,6 +376,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
376 | // Initialize the mesh plugin | 376 | // Initialize the mesh plugin |
377 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 377 | public override void Initialise(IMesher meshmerizer, IConfigSource config) |
378 | { | 378 | { |
379 | RemoveQueue = new List<PhysicsActor>(); | ||
379 | mesher = meshmerizer; | 380 | mesher = meshmerizer; |
380 | m_config = config; | 381 | m_config = config; |
381 | // Defaults | 382 | // Defaults |
@@ -2047,13 +2048,21 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2047 | { | 2048 | { |
2048 | if (prim is OdePrim) | 2049 | if (prim is OdePrim) |
2049 | { | 2050 | { |
2050 | lock (OdeLock) | 2051 | if (!IsLocked) //Fix a deadlock situation.. have we been locked by Simulate? |
2051 | { | 2052 | { |
2052 | OdePrim p = (OdePrim) prim; | 2053 | lock (OdeLock) |
2054 | { | ||
2055 | OdePrim p = (OdePrim)prim; | ||
2053 | 2056 | ||
2054 | p.setPrimForRemoval(); | 2057 | p.setPrimForRemoval(); |
2055 | AddPhysicsActorTaint(prim); | 2058 | AddPhysicsActorTaint(prim); |
2056 | //RemovePrimThreadLocked(p); | 2059 | //RemovePrimThreadLocked(p); |
2060 | } | ||
2061 | } | ||
2062 | else | ||
2063 | { | ||
2064 | //Add the prim to a queue which will be removed when Simulate has finished what it's doing. | ||
2065 | RemoveQueue.Add(prim); | ||
2057 | } | 2066 | } |
2058 | } | 2067 | } |
2059 | } | 2068 | } |
@@ -2575,7 +2584,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2575 | DeleteRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks | 2584 | DeleteRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks |
2576 | CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks | 2585 | CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks |
2577 | } | 2586 | } |
2578 | 2587 | IsLocked = true; | |
2579 | lock (OdeLock) | 2588 | lock (OdeLock) |
2580 | { | 2589 | { |
2581 | // Process 10 frames if the sim is running normal.. | 2590 | // Process 10 frames if the sim is running normal.. |
@@ -2988,6 +2997,19 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2988 | d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); | 2997 | d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); |
2989 | } | 2998 | } |
2990 | } | 2999 | } |
3000 | IsLocked = false; | ||
3001 | if (RemoveQueue.Count > 0) | ||
3002 | { | ||
3003 | do | ||
3004 | { | ||
3005 | if (RemoveQueue[0] != null) | ||
3006 | { | ||
3007 | RemovePrimThreadLocked((OdePrim)RemoveQueue[0]); | ||
3008 | } | ||
3009 | RemoveQueue.RemoveAt(0); | ||
3010 | } | ||
3011 | while (RemoveQueue.Count > 0); | ||
3012 | } | ||
2991 | 3013 | ||
2992 | return fps; | 3014 | return fps; |
2993 | } | 3015 | } |