aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs7
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs33
-rw-r--r--OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs33
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs4
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs12
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs4
9 files changed, 113 insertions, 30 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 58f9368..1cdd868 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -172,6 +172,13 @@ namespace OpenSim
172 if (userStatsURI != String.Empty) 172 if (userStatsURI != String.Empty)
173 MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this)); 173 MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this));
174 174
175 if (managedStatsURI != String.Empty)
176 {
177 string urlBase = String.Format("/{0}/", managedStatsURI);
178 MainServer.Instance.AddHTTPHandler(urlBase, StatsManager.HandleStatsRequest);
179 m_log.InfoFormat("[OPENSIM] Enabling remote managed stats fetch. URL = {0}", urlBase);
180 }
181
175 if (m_console is RemoteConsole) 182 if (m_console is RemoteConsole)
176 { 183 {
177 if (m_consolePort == 0) 184 if (m_consolePort == 0)
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f0c088a..b032e7f 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -75,6 +75,7 @@ namespace OpenSim
75 protected int proxyOffset = 0; 75 protected int proxyOffset = 0;
76 76
77 public string userStatsURI = String.Empty; 77 public string userStatsURI = String.Empty;
78 public string managedStatsURI = String.Empty;
78 79
79 protected bool m_autoCreateClientStack = true; 80 protected bool m_autoCreateClientStack = true;
80 81
@@ -188,6 +189,7 @@ namespace OpenSim
188 CreatePIDFile(pidFile); 189 CreatePIDFile(pidFile);
189 190
190 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 191 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
192 managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty);
191 } 193 }
192 194
193 // Load the simulation data service 195 // Load the simulation data service
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index e775a81..f0d8181 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -327,7 +327,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
327 private PriorityQueue m_entityProps; 327 private PriorityQueue m_entityProps;
328 private Prioritizer m_prioritizer; 328 private Prioritizer m_prioritizer;
329 private bool m_disableFacelights = false; 329 private bool m_disableFacelights = false;
330 330 private volatile bool m_justEditedTerrain = false;
331 /// <value> 331 /// <value>
332 /// List used in construction of data blocks for an object update packet. This is to stop us having to 332 /// List used in construction of data blocks for an object update packet. This is to stop us having to
333 /// continually recreate it. 333 /// continually recreate it.
@@ -1245,9 +1245,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1245 LLHeightFieldMoronize(map); 1245 LLHeightFieldMoronize(map);
1246 1246
1247 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches); 1247 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1248 layerpack.Header.Reliable = true; 1248
1249 // When a user edits the terrain, so much data is sent, the data queues up fast and presents a sub optimal editing experience.
1250 // To alleviate this issue, when the user edits the terrain, we start skipping the queues until they're done editing the terrain.
1251 // We also make them unreliable because it's extremely likely that multiple packets will be sent for a terrain patch area
1252 // invalidating previous packets for that area.
1249 1253
1250 OutPacket(layerpack, ThrottleOutPacketType.Land); 1254 // It's possible for an editing user to flood themselves with edited packets but the majority of use cases are such that only a
1255 // tiny percentage of users will be editing the terrain. Other, non-editing users will see the edits much slower.
1256
1257 // One last note on this topic, by the time users are going to be editing the terrain, it's extremely likely that the sim will
1258 // have rezzed already and therefore this is not likely going to cause any additional issues with lost packets, objects or terrain
1259 // patches.
1260
1261 // m_justEditedTerrain is volatile, so test once and duplicate two affected statements so we only have one cache miss.
1262 if (m_justEditedTerrain)
1263 {
1264 layerpack.Header.Reliable = false;
1265 OutPacket(layerpack,
1266 ThrottleOutPacketType.Unknown );
1267 }
1268 else
1269 {
1270 layerpack.Header.Reliable = true;
1271 OutPacket(layerpack,
1272 ThrottleOutPacketType.Land);
1273 }
1251 } 1274 }
1252 catch (Exception e) 1275 catch (Exception e)
1253 { 1276 {
@@ -6269,6 +6292,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6269 //m_log.Info("[LAND]: LAND:" + modify.ToString()); 6292 //m_log.Info("[LAND]: LAND:" + modify.ToString());
6270 if (modify.ParcelData.Length > 0) 6293 if (modify.ParcelData.Length > 0)
6271 { 6294 {
6295 // Note: the ModifyTerrain event handler sends out updated packets before the end of this event. Therefore,
6296 // a simple boolean value should work and perhaps queue up just a few terrain patch packets at the end of the edit.
6297 m_justEditedTerrain = true; // Prevent terrain packet (Land layer) from being queued, make it unreliable
6272 if (OnModifyTerrain != null) 6298 if (OnModifyTerrain != null)
6273 { 6299 {
6274 for (int i = 0; i < modify.ParcelData.Length; i++) 6300 for (int i = 0; i < modify.ParcelData.Length; i++)
@@ -6284,6 +6310,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6284 } 6310 }
6285 } 6311 }
6286 } 6312 }
6313 m_justEditedTerrain = false; // Queue terrain packet (Land layer) if necessary, make it reliable again
6287 } 6314 }
6288 6315
6289 return true; 6316 return true;
diff --git a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
index a515346..6da2222 100644
--- a/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
@@ -45,6 +45,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 private static string LogHeader = "[MODULE COMMS]";
48 49
49 private Dictionary<string,object> m_constants = new Dictionary<string,object>(); 50 private Dictionary<string,object> m_constants = new Dictionary<string,object>();
50 51
@@ -148,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
148 MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true); 149 MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true);
149 if (mi == null) 150 if (mi == null)
150 { 151 {
151 m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", meth); 152 m_log.WarnFormat("{0} Failed to register method {1}", LogHeader, meth);
152 return; 153 return;
153 } 154 }
154 155
@@ -165,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
165 { 166 {
166// m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name); 167// m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name);
167 168
168 Type delegateType; 169 Type delegateType = typeof(void);
169 List<Type> typeArgs = mi.GetParameters() 170 List<Type> typeArgs = mi.GetParameters()
170 .Select(p => p.ParameterType) 171 .Select(p => p.ParameterType)
171 .ToList(); 172 .ToList();
@@ -176,8 +177,16 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
176 } 177 }
177 else 178 else
178 { 179 {
179 typeArgs.Add(mi.ReturnType); 180 try
180 delegateType = Expression.GetFuncType(typeArgs.ToArray()); 181 {
182 typeArgs.Add(mi.ReturnType);
183 delegateType = Expression.GetFuncType(typeArgs.ToArray());
184 }
185 catch (Exception e)
186 {
187 m_log.ErrorFormat("{0} Failed to create function signature. Most likely more than 5 parameters. Method={1}. Error={2}",
188 LogHeader, mi.Name, e);
189 }
181 } 190 }
182 191
183 Delegate fcall; 192 Delegate fcall;
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
index 4d49794..173b603 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs
@@ -76,6 +76,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.", 76 " that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.",
77 consoleSetTerrainHeights); 77 consoleSetTerrainHeights);
78 78
79 m_module.Scene.AddCommand("Regions", m_module, "set water height",
80 "set water height <height> [<x>] [<y>]",
81 "Sets the water height in meters. If <x> and <y> are specified, it will only set it on regions with a matching coordinate. " +
82 "Specify -1 in <x> or <y> to wildcard that coordinate.",
83 consoleSetWaterHeight);
84
85
79 m_module.Scene.AddCommand( 86 m_module.Scene.AddCommand(
80 "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand); 87 "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand);
81 } 88 }
@@ -121,7 +128,29 @@ namespace OpenSim.Region.CoreModules.World.Estate
121 } 128 }
122 } 129 }
123 } 130 }
124 131 protected void consoleSetWaterHeight(string module, string[] args)
132 {
133 string heightstring = args[3];
134
135 int x = (args.Length > 4 ? int.Parse(args[4]) : -1);
136 int y = (args.Length > 5 ? int.Parse(args[5]) : -1);
137
138 if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x)
139 {
140 if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y)
141 {
142 double selectedheight = double.Parse(heightstring);
143
144 m_log.Debug("[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName + " to " +
145 string.Format(" {0}", selectedheight));
146 m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight;
147
148 m_module.Scene.RegionInfo.RegionSettings.Save();
149 m_module.TriggerRegionInfoChange();
150 m_module.sendRegionHandshakeToAll();
151 }
152 }
153 }
125 protected void consoleSetTerrainHeights(string module, string[] args) 154 protected void consoleSetTerrainHeights(string module, string[] args)
126 { 155 {
127 string num = args[3]; 156 string num = args[3];
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a3ea7d9..a3bd388 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4325,24 +4325,25 @@ namespace OpenSim.Region.Framework.Scenes
4325 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); 4325 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
4326 if (childAgentUpdate != null) 4326 if (childAgentUpdate != null)
4327 { 4327 {
4328 if (childAgentUpdate.ControllingClient.SessionId == cAgentData.SessionID) 4328 if (childAgentUpdate.ControllingClient.SessionId != cAgentData.SessionID)
4329 // Only warn for now
4330 m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}. Neighbor running older version?",
4331 childAgentUpdate.UUID, cAgentData.SessionID);
4332
4333 // I can't imagine *yet* why we would get an update if the agent is a root agent..
4334 // however to avoid a race condition crossing borders..
4335 if (childAgentUpdate.IsChildAgent)
4329 { 4336 {
4330 // I can't imagine *yet* why we would get an update if the agent is a root agent.. 4337 uint rRegionX = (uint)(cAgentData.RegionHandle >> 40);
4331 // however to avoid a race condition crossing borders.. 4338 uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8);
4332 if (childAgentUpdate.IsChildAgent) 4339 uint tRegionX = RegionInfo.RegionLocX;
4333 { 4340 uint tRegionY = RegionInfo.RegionLocY;
4334 uint rRegionX = (uint)(cAgentData.RegionHandle >> 40); 4341 //Send Data to ScenePresence
4335 uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8); 4342 childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY);
4336 uint tRegionX = RegionInfo.RegionLocX; 4343 // Not Implemented:
4337 uint tRegionY = RegionInfo.RegionLocY; 4344 //TODO: Do we need to pass the message on to one of our neighbors?
4338 //Send Data to ScenePresence
4339 childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY);
4340 // Not Implemented:
4341 //TODO: Do we need to pass the message on to one of our neighbors?
4342 }
4343 } 4345 }
4344 else 4346
4345 m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}", childAgentUpdate.UUID, cAgentData.SessionID);
4346 return true; 4347 return true;
4347 } 4348 }
4348 4349
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index bdcdf03..aac80f7 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -309,9 +309,9 @@ namespace OpenSim.Region.Framework.Scenes
309 /// <summary> 309 /// <summary>
310 /// In the V1 teleport protocol, the destination simulator sends ReleaseAgent to this address. 310 /// In the V1 teleport protocol, the destination simulator sends ReleaseAgent to this address.
311 /// </summary> 311 /// </summary>
312 string m_callbackURI; 312 private string m_callbackURI;
313 313
314 UUID m_originRegionID; 314 public UUID m_originRegionID;
315 315
316 /// <summary> 316 /// <summary>
317 /// Used by the entity transfer module to signal when the presence should not be closed because a subsequent 317 /// Used by the entity transfer module to signal when the presence should not be closed because a subsequent
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 58a417e..9af3dce 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -96,8 +96,8 @@ public sealed class BSCharacter : BSPhysObject
96 m_moveActor = new BSActorAvatarMove(PhysScene, this, AvatarMoveActorName); 96 m_moveActor = new BSActorAvatarMove(PhysScene, this, AvatarMoveActorName);
97 PhysicalActors.Add(AvatarMoveActorName, m_moveActor); 97 PhysicalActors.Add(AvatarMoveActorName, m_moveActor);
98 98
99 DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5}", 99 DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5},pos={6}",
100 LocalID, _size, Scale, Density, _avatarVolume, RawMass); 100 LocalID, _size, Scale, Density, _avatarVolume, RawMass, pos);
101 101
102 // do actual creation in taint time 102 // do actual creation in taint time
103 PhysScene.TaintedObject("BSCharacter.create", delegate() 103 PhysScene.TaintedObject("BSCharacter.create", delegate()
@@ -190,6 +190,10 @@ public sealed class BSCharacter : BSPhysObject
190 } 190 }
191 191
192 set { 192 set {
193 // This is how much the avatar size is changing. Positive means getting bigger.
194 // The avatar altitude must be adjusted for this change.
195 float heightChange = value.Z - _size.Z;
196
193 _size = value; 197 _size = value;
194 // Old versions of ScenePresence passed only the height. If width and/or depth are zero, 198 // Old versions of ScenePresence passed only the height. If width and/or depth are zero,
195 // replace with the default values. 199 // replace with the default values.
@@ -207,6 +211,10 @@ public sealed class BSCharacter : BSPhysObject
207 { 211 {
208 PhysScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale); 212 PhysScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale);
209 UpdatePhysicalMassProperties(RawMass, true); 213 UpdatePhysicalMassProperties(RawMass, true);
214
215 // Adjust the avatar's position to account for the increase/decrease in size
216 ForcePosition = new OMV.Vector3(RawPosition.X, RawPosition.Y, RawPosition.Z + heightChange / 2f);
217
210 // Make sure this change appears as a property update event 218 // Make sure this change appears as a property update event
211 PhysScene.PE.PushUpdate(PhysBody); 219 PhysScene.PE.PushUpdate(PhysBody);
212 } 220 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 4520171..fcb892a 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -570,9 +570,9 @@ public static class BSParam
570 new ParameterDefn<float>("AvatarHeightLowFudge", "A fudge factor to make small avatars stand on the ground", 570 new ParameterDefn<float>("AvatarHeightLowFudge", "A fudge factor to make small avatars stand on the ground",
571 -0.2f ), 571 -0.2f ),
572 new ParameterDefn<float>("AvatarHeightMidFudge", "A fudge distance to adjust average sized avatars to be standing on ground", 572 new ParameterDefn<float>("AvatarHeightMidFudge", "A fudge distance to adjust average sized avatars to be standing on ground",
573 0.1f ), 573 0.2f ),
574 new ParameterDefn<float>("AvatarHeightHighFudge", "A fudge factor to make tall avatars stand on the ground", 574 new ParameterDefn<float>("AvatarHeightHighFudge", "A fudge factor to make tall avatars stand on the ground",
575 0.1f ), 575 0.2f ),
576 new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", 576 new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions",
577 0.1f ), 577 0.1f ),
578 new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground", 578 new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground",