aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorBlueWall2012-02-25 14:33:56 -0500
committerBlueWall2012-02-25 14:33:56 -0500
commit4177571a786f6ece38b29dc60328348fbe45b481 (patch)
treebc06a7f13fc5e751cfab5ef58bd3e9b612e12ba9 /OpenSim
parentMerge branch 'master' into v3_support (diff)
parentPRIM_SCULPT_FLAG_INVERT, PRIM_SCULPT_FLAG_MIRROR implemented (diff)
downloadopensim-SC_OLD-4177571a786f6ece38b29dc60328348fbe45b481.zip
opensim-SC_OLD-4177571a786f6ece38b29dc60328348fbe45b481.tar.gz
opensim-SC_OLD-4177571a786f6ece38b29dc60328348fbe45b481.tar.bz2
opensim-SC_OLD-4177571a786f6ece38b29dc60328348fbe45b481.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into v3_support
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs2
-rw-r--r--OpenSim/Framework/Watchdog.cs72
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs7
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs27
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs47
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs13
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs148
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs24
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs3
21 files changed, 276 insertions, 103 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 0dd01af..6a3135e 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -247,7 +247,7 @@ namespace OpenSim.Framework.Servers
247 string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}"; 247 string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}";
248 248
249 StringBuilder sb = new StringBuilder(); 249 StringBuilder sb = new StringBuilder();
250 Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads(); 250 Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreadsInfo();
251 251
252 sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine); 252 sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine);
253 253
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
index 2206feb..0062d4e 100644
--- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
+++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
@@ -65,6 +65,7 @@ namespace OpenSim.Framework.Servers.HttpServer
65 String.Format("PollServiceWorkerThread{0}", i), 65 String.Format("PollServiceWorkerThread{0}", i),
66 ThreadPriority.Normal, 66 ThreadPriority.Normal,
67 false, 67 false,
68 true,
68 int.MaxValue); 69 int.MaxValue);
69 } 70 }
70 71
@@ -73,6 +74,7 @@ namespace OpenSim.Framework.Servers.HttpServer
73 "PollServiceWatcherThread", 74 "PollServiceWatcherThread",
74 ThreadPriority.Normal, 75 ThreadPriority.Normal,
75 false, 76 false,
77 true,
76 1000 * 60 * 10); 78 1000 * 60 * 10);
77 } 79 }
78 80
diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs
index 2dd6ebe..e93e50e 100644
--- a/OpenSim/Framework/Watchdog.cs
+++ b/OpenSim/Framework/Watchdog.cs
@@ -72,6 +72,11 @@ namespace OpenSim.Framework
72 /// </summary> 72 /// </summary>
73 public bool IsTimedOut { get; set; } 73 public bool IsTimedOut { get; set; }
74 74
75 /// <summary>
76 /// Will this thread trigger the alarm function if it has timed out?
77 /// </summary>
78 public bool AlarmIfTimeout { get; set; }
79
75 public ThreadWatchdogInfo(Thread thread, int timeout) 80 public ThreadWatchdogInfo(Thread thread, int timeout)
76 { 81 {
77 Thread = thread; 82 Thread = thread;
@@ -112,12 +117,13 @@ namespace OpenSim.Framework
112 /// <param name="start">The method that will be executed in a new thread</param> 117 /// <param name="start">The method that will be executed in a new thread</param>
113 /// <param name="name">A name to give to the new thread</param> 118 /// <param name="name">A name to give to the new thread</param>
114 /// <param name="priority">Priority to run the thread at</param> 119 /// <param name="priority">Priority to run the thread at</param>
115 /// <param name="isBackground">True to run this thread as a background 120 /// <param name="isBackground">True to run this thread as a background thread, otherwise false</param>
116 /// thread, otherwise false</param> 121 /// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
117 /// <returns>The newly created Thread object</returns> 122 /// <returns>The newly created Thread object</returns>
118 public static Thread StartThread(ThreadStart start, string name, ThreadPriority priority, bool isBackground) 123 public static Thread StartThread(
124 ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout)
119 { 125 {
120 return StartThread(start, name, priority, isBackground, WATCHDOG_TIMEOUT_MS); 126 return StartThread(start, name, priority, isBackground, alarmIfTimeout, WATCHDOG_TIMEOUT_MS);
121 } 127 }
122 128
123 /// <summary> 129 /// <summary>
@@ -128,21 +134,21 @@ namespace OpenSim.Framework
128 /// <param name="priority">Priority to run the thread at</param> 134 /// <param name="priority">Priority to run the thread at</param>
129 /// <param name="isBackground">True to run this thread as a background 135 /// <param name="isBackground">True to run this thread as a background
130 /// thread, otherwise false</param> 136 /// thread, otherwise false</param>
131 /// <param name="timeout"> 137 /// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
132 /// Number of milliseconds to wait until we issue a warning about timeout. 138 /// <param name="timeout">Number of milliseconds to wait until we issue a warning about timeout.</param>
133 /// </para>
134 /// <returns>The newly created Thread object</returns> 139 /// <returns>The newly created Thread object</returns>
135 public static Thread StartThread( 140 public static Thread StartThread(
136 ThreadStart start, string name, ThreadPriority priority, bool isBackground, int timeout) 141 ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout, int timeout)
137 { 142 {
138 Thread thread = new Thread(start); 143 Thread thread = new Thread(start);
139 thread.Name = name; 144 thread.Name = name;
140 thread.Priority = priority; 145 thread.Priority = priority;
141 thread.IsBackground = isBackground; 146 thread.IsBackground = isBackground;
142 147
143 ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout); 148 ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout) { AlarmIfTimeout = alarmIfTimeout };
144 149
145 m_log.Debug("[WATCHDOG]: Started tracking thread \"" + twi.Thread.Name + "\" (ID " + twi.Thread.ManagedThreadId + ")"); 150 m_log.DebugFormat(
151 "[WATCHDOG]: Started tracking thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
146 152
147 lock (m_threads) 153 lock (m_threads)
148 m_threads.Add(twi.Thread.ManagedThreadId, twi); 154 m_threads.Add(twi.Thread.ManagedThreadId, twi);
@@ -224,19 +230,39 @@ namespace OpenSim.Framework
224 /// Get currently watched threads for diagnostic purposes 230 /// Get currently watched threads for diagnostic purposes
225 /// </summary> 231 /// </summary>
226 /// <returns></returns> 232 /// <returns></returns>
227 public static ThreadWatchdogInfo[] GetThreads() 233 public static ThreadWatchdogInfo[] GetThreadsInfo()
228 { 234 {
229 lock (m_threads) 235 lock (m_threads)
230 return m_threads.Values.ToArray(); 236 return m_threads.Values.ToArray();
231 } 237 }
232 238
239 /// <summary>
240 /// Return the current thread's watchdog info.
241 /// </summary>
242 /// <returns>The watchdog info. null if the thread isn't being monitored.</returns>
243 public static ThreadWatchdogInfo GetCurrentThreadInfo()
244 {
245 lock (m_threads)
246 {
247 if (m_threads.ContainsKey(Thread.CurrentThread.ManagedThreadId))
248 return m_threads[Thread.CurrentThread.ManagedThreadId];
249 }
250
251 return null;
252 }
253
254 /// <summary>
255 /// Check watched threads. Fire alarm if appropriate.
256 /// </summary>
257 /// <param name="sender"></param>
258 /// <param name="e"></param>
233 private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e) 259 private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
234 { 260 {
235 WatchdogTimeout callback = OnWatchdogTimeout; 261 WatchdogTimeout callback = OnWatchdogTimeout;
236 262
237 if (callback != null) 263 if (callback != null)
238 { 264 {
239 ThreadWatchdogInfo timedOut = null; 265 List<ThreadWatchdogInfo> callbackInfos = null;
240 266
241 lock (m_threads) 267 lock (m_threads)
242 { 268 {
@@ -246,21 +272,31 @@ namespace OpenSim.Framework
246 { 272 {
247 if (threadInfo.Thread.ThreadState == ThreadState.Stopped) 273 if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
248 { 274 {
249 timedOut = threadInfo;
250 RemoveThread(threadInfo.Thread.ManagedThreadId); 275 RemoveThread(threadInfo.Thread.ManagedThreadId);
251 break; 276
277 if (callbackInfos == null)
278 callbackInfos = new List<ThreadWatchdogInfo>();
279
280 callbackInfos.Add(threadInfo);
252 } 281 }
253 else if (!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout) 282 else if (!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
254 { 283 {
255 threadInfo.IsTimedOut = true; 284 threadInfo.IsTimedOut = true;
256 timedOut = threadInfo; 285
257 break; 286 if (threadInfo.AlarmIfTimeout)
287 {
288 if (callbackInfos == null)
289 callbackInfos = new List<ThreadWatchdogInfo>();
290
291 callbackInfos.Add(threadInfo);
292 }
258 } 293 }
259 } 294 }
260 } 295 }
261 296
262 if (timedOut != null) 297 if (callbackInfos != null)
263 callback(timedOut.Thread, timedOut.LastTick); 298 foreach (ThreadWatchdogInfo callbackInfo in callbackInfos)
299 callback(callbackInfo.Thread, callbackInfo.LastTick);
264 } 300 }
265 301
266 m_watchdogTimer.Start(); 302 m_watchdogTimer.Start();
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
index 1e22fcc..fb6b11e 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
@@ -244,8 +244,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
244 base.Start(m_recvBufferSize, m_asyncPacketHandling); 244 base.Start(m_recvBufferSize, m_asyncPacketHandling);
245 245
246 // Start the packet processing threads 246 // Start the packet processing threads
247 Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); 247 Watchdog.StartThread(
248 Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false); 248 IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false, true);
249 Watchdog.StartThread(
250 OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false, true);
251
249 m_elapsedMSSinceLastStatReport = Environment.TickCount; 252 m_elapsedMSSinceLastStatReport = Environment.TickCount;
250 } 253 }
251 254
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
index a81f36c..650069a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs
@@ -349,8 +349,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
349 { 349 {
350 try 350 try
351 { 351 {
352 m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
353
354 Dictionary<string, object> options = new Dictionary<string, object>(); 352 Dictionary<string, object> options = new Dictionary<string, object>();
355 OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; }); 353 OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; });
356 354
@@ -412,7 +410,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
412 return; 410 return;
413 } 411 }
414 412
415 m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
416 if (options.ContainsKey("home")) 413 if (options.ContainsKey("home"))
417 m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -home option if you want to produce a compatible IAR"); 414 m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -home option if you want to produce a compatible IAR");
418 415
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index f367739..a6e2548 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -1210,7 +1210,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
1210 if (homeScene.TryGetScenePresence(avatarId,out avatar)) 1210 if (homeScene.TryGetScenePresence(avatarId,out avatar))
1211 { 1211 {
1212 KillAUser ku = new KillAUser(avatar,mod); 1212 KillAUser ku = new KillAUser(avatar,mod);
1213 Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true); 1213 Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true, true);
1214 } 1214 }
1215 } 1215 }
1216 1216
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 1c503aa..f6d4b40 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -94,8 +94,11 @@ namespace OpenSim.Region.CoreModules.World.Land
94 94
95 // caches ExtendedLandData 95 // caches ExtendedLandData
96 private Cache parcelInfoCache; 96 private Cache parcelInfoCache;
97 private Dictionary<UUID, Vector3> forcedPosition = 97
98 new Dictionary<UUID, Vector3>(); 98 /// <summary>
99 /// Record positions that avatar's are currently being forced to move to due to parcel entry restrictions.
100 /// </summary>
101 private Dictionary<UUID, Vector3> forcedPosition = new Dictionary<UUID, Vector3>();
99 102
100 #region INonSharedRegionModule Members 103 #region INonSharedRegionModule Members
101 104
@@ -224,22 +227,34 @@ namespace OpenSim.Region.CoreModules.World.Land
224 //When the avatar walks into a ban line on the ground, it prevents getting stuck 227 //When the avatar walks into a ban line on the ground, it prevents getting stuck
225 agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 228 agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
226 229
227
228 //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines 230 //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines
229 if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) 231 if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2)
230 { 232 {
231 Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); 233// m_log.DebugFormat(
234// "[LAND MANAGEMENT MODULE]: Stopping force position of {0} because {1} is close enough to {2}",
235// clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]);
236
232 forcedPosition.Remove(remoteClient.AgentId); 237 forcedPosition.Remove(remoteClient.AgentId);
233 } 238 }
234 //if we are far away, teleport 239 //if we are far away, teleport
235 else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) 240 else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3)
236 { 241 {
237 Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); 242 Vector3 forcePosition = forcedPosition[remoteClient.AgentId];
238 clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]); 243// m_log.DebugFormat(
244// "[LAND MANAGEMENT MODULE]: Teleporting out {0} because {1} is too far from avatar position {2}",
245// clientAvatar.Name, clientAvatar.AbsolutePosition, forcePosition);
246
247 m_scene.RequestTeleportLocation(remoteClient, m_scene.RegionInfo.RegionHandle,
248 forcePosition, clientAvatar.Lookat, (uint)Constants.TeleportFlags.ForceRedirect);
249
239 forcedPosition.Remove(remoteClient.AgentId); 250 forcedPosition.Remove(remoteClient.AgentId);
240 } 251 }
241 else 252 else
242 { 253 {
254// m_log.DebugFormat(
255// "[LAND MANAGEMENT MODULE]: Forcing {0} from {1} to {2}",
256// clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]);
257
243 //Forces them toward the forced position we want if they aren't there yet 258 //Forces them toward the forced position we want if they aren't there yet
244 agentData.UseClientAgentPosition = true; 259 agentData.UseClientAgentPosition = true;
245 agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; 260 agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId];
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index b315d2c..74b047b 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -351,6 +351,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
351 process, 351 process,
352 string.Format("MapItemRequestThread ({0})", m_scene.RegionInfo.RegionName), 352 string.Format("MapItemRequestThread ({0})", m_scene.RegionInfo.RegionName),
353 ThreadPriority.BelowNormal, 353 ThreadPriority.BelowNormal,
354 true,
354 true); 355 true);
355 } 356 }
356 357
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6187803..9bca654 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1140,7 +1140,7 @@ namespace OpenSim.Region.Framework.Scenes
1140 1140
1141 HeartbeatThread 1141 HeartbeatThread
1142 = Watchdog.StartThread( 1142 = Watchdog.StartThread(
1143 Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false); 1143 Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
1144 } 1144 }
1145 1145
1146 /// <summary> 1146 /// <summary>
@@ -1178,6 +1178,13 @@ namespace OpenSim.Region.Framework.Scenes
1178 try 1178 try
1179 { 1179 {
1180 m_eventManager.TriggerOnRegionStarted(this); 1180 m_eventManager.TriggerOnRegionStarted(this);
1181
1182 // The first frame can take a very long time due to physics actors being added on startup. Therefore,
1183 // don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false
1184 // alarms for scenes with many objects.
1185 Update();
1186 Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
1187
1181 while (!shuttingdown) 1188 while (!shuttingdown)
1182 Update(); 1189 Update();
1183 1190
@@ -1206,7 +1213,7 @@ namespace OpenSim.Region.Framework.Scenes
1206 1213
1207 ++Frame; 1214 ++Frame;
1208 1215
1209// m_log.DebugFormat("[SCENE]: Processing frame {0}", Frame); 1216// m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
1210 1217
1211 try 1218 try
1212 { 1219 {
@@ -1361,26 +1368,10 @@ namespace OpenSim.Region.Framework.Scenes
1361 { 1368 {
1362 throw; 1369 throw;
1363 } 1370 }
1364 catch (AccessViolationException e)
1365 {
1366 m_log.ErrorFormat(
1367 "[REGION]: Failed on region {0} with exception {1}{2}",
1368 RegionInfo.RegionName, e.Message, e.StackTrace);
1369 }
1370 //catch (NullReferenceException e)
1371 //{
1372 // m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
1373 //}
1374 catch (InvalidOperationException e)
1375 {
1376 m_log.ErrorFormat(
1377 "[REGION]: Failed on region {0} with exception {1}{2}",
1378 RegionInfo.RegionName, e.Message, e.StackTrace);
1379 }
1380 catch (Exception e) 1371 catch (Exception e)
1381 { 1372 {
1382 m_log.ErrorFormat( 1373 m_log.ErrorFormat(
1383 "[REGION]: Failed on region {0} with exception {1}{2}", 1374 "[SCENE]: Failed on region {0} with exception {1}{2}",
1384 RegionInfo.RegionName, e.Message, e.StackTrace); 1375 RegionInfo.RegionName, e.Message, e.StackTrace);
1385 } 1376 }
1386 1377
@@ -1418,7 +1409,6 @@ namespace OpenSim.Region.Framework.Scenes
1418 entry.checkAtTargets(); 1409 entry.checkAtTargets();
1419 } 1410 }
1420 1411
1421
1422 /// <summary> 1412 /// <summary>
1423 /// Send out simstats data to all clients 1413 /// Send out simstats data to all clients
1424 /// </summary> 1414 /// </summary>
@@ -4699,7 +4689,10 @@ namespace OpenSim.Region.Framework.Scenes
4699 Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); 4689 Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
4700 if (nearestPoint != null) 4690 if (nearestPoint != null)
4701 { 4691 {
4702 Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString()); 4692// m_log.DebugFormat(
4693// "[SCENE]: Found a sane previous position based on velocity for {0}, sending them to {1} in {2}",
4694// avatar.Name, nearestPoint, nearestParcel.LandData.Name);
4695
4703 return nearestPoint.Value; 4696 return nearestPoint.Value;
4704 } 4697 }
4705 4698
@@ -4709,12 +4702,16 @@ namespace OpenSim.Region.Framework.Scenes
4709 nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); 4702 nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
4710 if (nearestPoint != null) 4703 if (nearestPoint != null)
4711 { 4704 {
4712 Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString()); 4705// m_log.DebugFormat(
4706// "[SCENE]: {0} had a zero velocity, sending them to {1}", avatar.Name, nearestPoint);
4707
4713 return nearestPoint.Value; 4708 return nearestPoint.Value;
4714 } 4709 }
4715 4710
4716 //Ultimate backup if we have no idea where they are 4711 //Ultimate backup if we have no idea where they are
4717 Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); 4712// m_log.DebugFormat(
4713// "[SCENE]: No idea where {0} is, sending them to {1}", avatar.Name, avatar.lastKnownAllowedPosition);
4714
4718 return avatar.lastKnownAllowedPosition; 4715 return avatar.lastKnownAllowedPosition;
4719 } 4716 }
4720 4717
@@ -5120,7 +5117,7 @@ namespace OpenSim.Region.Framework.Scenes
5120// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget); 5117// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
5121 5118
5122 Vector3 agent_control_v3 = new Vector3(); 5119 Vector3 agent_control_v3 = new Vector3();
5123 presence.HandleMoveToTargetUpdate(ref agent_control_v3); 5120 presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);
5124 presence.AddNewMovement(agent_control_v3); 5121 presence.AddNewMovement(agent_control_v3);
5125 } 5122 }
5126 } 5123 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 19c9745..4d98f00 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -156,8 +156,8 @@ namespace OpenSim.Region.Framework.Scenes
156 // that the region position is cached or performance will degrade 156 // that the region position is cached or performance will degrade
157 Utils.LongToUInts(regionHandle, out x, out y); 157 Utils.LongToUInts(regionHandle, out x, out y);
158 GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); 158 GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
159 bool v = true; 159// bool v = true;
160 if (! simulatorList.Contains(dest.ServerURI)) 160 if (!simulatorList.Contains(dest.ServerURI))
161 { 161 {
162 // we havent seen this simulator before, add it to the list 162 // we havent seen this simulator before, add it to the list
163 // and send it an update 163 // and send it an update
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9cfdf9f..40c8d06 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1048,7 +1048,7 @@ namespace OpenSim.Region.Framework.Scenes
1048 } 1048 }
1049 1049
1050 /// <summary> 1050 /// <summary>
1051 /// 1051 /// Do not call this directly. Call Scene.RequestTeleportLocation() instead.
1052 /// </summary> 1052 /// </summary>
1053 /// <param name="pos"></param> 1053 /// <param name="pos"></param>
1054 public void Teleport(Vector3 pos) 1054 public void Teleport(Vector3 pos)
@@ -1522,7 +1522,10 @@ namespace OpenSim.Region.Framework.Scenes
1522 } 1522 }
1523 else if (bAllowUpdateMoveToPosition) 1523 else if (bAllowUpdateMoveToPosition)
1524 { 1524 {
1525 if (HandleMoveToTargetUpdate(ref agent_control_v3)) 1525 // The UseClientAgentPosition is set if parcel ban is forcing the avatar to move to a
1526 // certain position. It's only check for tolerance on returning to that position is 0.2
1527 // rather than 1, at which point it removes its force target.
1528 if (HandleMoveToTargetUpdate(agentData.UseClientAgentPosition ? 0.2 : 1, ref agent_control_v3))
1526 update_movementflag = true; 1529 update_movementflag = true;
1527 } 1530 }
1528 } 1531 }
@@ -1584,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes
1584 /// </remarks> 1587 /// </remarks>
1585 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> 1588 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
1586 /// <returns>True if movement has been updated in some way. False otherwise.</returns> 1589 /// <returns>True if movement has been updated in some way. False otherwise.</returns>
1587 public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3) 1590 public bool HandleMoveToTargetUpdate(double tolerance, ref Vector3 agent_control_v3)
1588 { 1591 {
1589// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); 1592// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
1590 1593
@@ -1601,7 +1604,7 @@ namespace OpenSim.Region.Framework.Scenes
1601// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget); 1604// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
1602 1605
1603 // Check the error term of the current position in relation to the target position 1606 // Check the error term of the current position in relation to the target position
1604 if (distanceToTarget <= 1) 1607 if (distanceToTarget <= tolerance)
1605 { 1608 {
1606 // We are close enough to the target 1609 // We are close enough to the target
1607 AbsolutePosition = MoveToPositionTarget; 1610 AbsolutePosition = MoveToPositionTarget;
@@ -1777,7 +1780,7 @@ namespace OpenSim.Region.Framework.Scenes
1777// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation); 1780// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation);
1778 1781
1779 Vector3 agent_control_v3 = new Vector3(); 1782 Vector3 agent_control_v3 = new Vector3();
1780 HandleMoveToTargetUpdate(ref agent_control_v3); 1783 HandleMoveToTargetUpdate(1, ref agent_control_v3);
1781 AddNewMovement(agent_control_v3); 1784 AddNewMovement(agent_control_v3);
1782 } 1785 }
1783 1786
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index c928af7..d3c96e2 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
70 m_client = client; 70 m_client = client;
71 m_scene = scene; 71 m_scene = scene;
72 72
73 Watchdog.StartThread(InternalLoop, "IRCClientView", ThreadPriority.Normal, false); 73 Watchdog.StartThread(InternalLoop, "IRCClientView", ThreadPriority.Normal, false, true);
74 } 74 }
75 75
76 private void SendServerCommand(string command) 76 private void SendServerCommand(string command)
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
index eb39026..a7c5020 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCServer.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
57 57
58 m_listener.Start(50); 58 m_listener.Start(50);
59 59
60 Watchdog.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false); 60 Watchdog.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false, true);
61 m_baseScene = baseScene; 61 m_baseScene = baseScene;
62 } 62 }
63 63
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 75364b7..97890ee 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -1474,6 +1474,8 @@ Console.WriteLine("CreateGeom:");
1474 /// </summary> 1474 /// </summary>
1475 private void changeadd() 1475 private void changeadd()
1476 { 1476 {
1477// m_log.DebugFormat("[ODE PRIM]: Adding prim {0}", Name);
1478
1477 int[] iprimspaceArrItem = _parent_scene.calculateSpaceArrayItemFromPos(_position); 1479 int[] iprimspaceArrItem = _parent_scene.calculateSpaceArrayItemFromPos(_position);
1478 IntPtr targetspace = _parent_scene.calculateSpaceForGeom(_position); 1480 IntPtr targetspace = _parent_scene.calculateSpaceForGeom(_position);
1479 1481
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
index ee32755..14edde4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs
@@ -137,7 +137,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
137 if (cmdHandlerThread == null) 137 if (cmdHandlerThread == null)
138 { 138 {
139 // Start the thread that will be doing the work 139 // Start the thread that will be doing the work
140 cmdHandlerThread = Watchdog.StartThread(CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true); 140 cmdHandlerThread
141 = Watchdog.StartThread(
142 CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true, true);
141 } 143 }
142 } 144 }
143 145
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 61a6907..c5392b5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6376,16 +6376,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6376 } 6376 }
6377 } 6377 }
6378 6378
6379 public void llSitTarget(LSL_Vector offset, LSL_Rotation rot) 6379 protected void SitTarget(SceneObjectPart part, LSL_Vector offset, LSL_Rotation rot)
6380 { 6380 {
6381 m_host.AddScriptLPS(1);
6382 // LSL quaternions can normalize to 0, normal Quaternions can't. 6381 // LSL quaternions can normalize to 0, normal Quaternions can't.
6383 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) 6382 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
6384 rot.z = 1; // ZERO_ROTATION = 0,0,0,1 6383 rot.z = 1; // ZERO_ROTATION = 0,0,0,1
6385 6384
6386 m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z); 6385 part.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z);
6387 m_host.SitTargetOrientation = Rot2Quaternion(rot); 6386 part.SitTargetOrientation = Rot2Quaternion(rot);
6388 m_host.ParentGroup.HasGroupChanged = true; 6387 part.ParentGroup.HasGroupChanged = true;
6388 }
6389
6390 public void llSitTarget(LSL_Vector offset, LSL_Rotation rot)
6391 {
6392 m_host.AddScriptLPS(1);
6393 SitTarget(m_host, offset, rot);
6394 }
6395
6396 public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
6397 {
6398 m_host.AddScriptLPS(1);
6399 if (link == ScriptBaseClass.LINK_ROOT)
6400 SitTarget(m_host.ParentGroup.RootPart, offset, rot);
6401 else if (link == ScriptBaseClass.LINK_THIS)
6402 SitTarget(m_host, offset, rot);
6403 else
6404 {
6405 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
6406 if (null != part)
6407 {
6408 SitTarget(part, offset, rot);
6409 }
6410 }
6389 } 6411 }
6390 6412
6391 public LSL_String llAvatarOnSitTarget() 6413 public LSL_String llAvatarOnSitTarget()
@@ -7047,10 +7069,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7047 shapeBlock.PathScaleX = 100; 7069 shapeBlock.PathScaleX = 100;
7048 shapeBlock.PathScaleY = 150; 7070 shapeBlock.PathScaleY = 150;
7049 7071
7050 if (type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER && 7072 int flag = type & (ScriptBaseClass.PRIM_SCULPT_FLAG_INVERT | ScriptBaseClass.PRIM_SCULPT_FLAG_MIRROR);
7051 type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE && 7073
7052 type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE && 7074 if (type != (ScriptBaseClass.PRIM_SCULPT_TYPE_CYLINDER | flag) &&
7053 type != (int)ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS) 7075 type != (ScriptBaseClass.PRIM_SCULPT_TYPE_PLANE | flag) &&
7076 type != (ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE | flag) &&
7077 type != (ScriptBaseClass.PRIM_SCULPT_TYPE_TORUS | flag))
7054 { 7078 {
7055 // default 7079 // default
7056 type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE; 7080 type = (int)ScriptBaseClass.PRIM_SCULPT_TYPE_SPHERE;
@@ -8151,23 +8175,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8151 { 8175 {
8152 m_host.AddScriptLPS(1); 8176 m_host.AddScriptLPS(1);
8153 ScriptSleep(1000); 8177 ScriptSleep(1000);
8178 return GetPrimMediaParams(m_host, face, rules);
8179 }
8154 8180
8181 public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
8182 {
8183 m_host.AddScriptLPS(1);
8184 ScriptSleep(1000);
8185 if (link == ScriptBaseClass.LINK_ROOT)
8186 return GetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
8187 else if (link == ScriptBaseClass.LINK_THIS)
8188 return GetPrimMediaParams(m_host, face, rules);
8189 else
8190 {
8191 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
8192 if (null != part)
8193 return GetPrimMediaParams(part, face, rules);
8194 }
8195
8196 return new LSL_List();
8197 }
8198
8199 private LSL_List GetPrimMediaParams(SceneObjectPart part, int face, LSL_List rules)
8200 {
8155 // LSL Spec http://wiki.secondlife.com/wiki/LlGetPrimMediaParams says to fail silently if face is invalid 8201 // LSL Spec http://wiki.secondlife.com/wiki/LlGetPrimMediaParams says to fail silently if face is invalid
8156 // TODO: Need to correctly handle case where a face has no media (which gives back an empty list). 8202 // TODO: Need to correctly handle case where a face has no media (which gives back an empty list).
8157 // Assuming silently fail means give back an empty list. Ideally, need to check this. 8203 // Assuming silently fail means give back an empty list. Ideally, need to check this.
8158 if (face < 0 || face > m_host.GetNumberOfSides() - 1) 8204 if (face < 0 || face > part.GetNumberOfSides() - 1)
8159 return new LSL_List(); 8205 return new LSL_List();
8160 8206
8161 return GetPrimMediaParams(face, rules);
8162 }
8163
8164 private LSL_List GetPrimMediaParams(int face, LSL_List rules)
8165 {
8166 IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); 8207 IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
8167 if (null == module) 8208 if (null == module)
8168 throw new Exception("Media on a prim functions not available"); 8209 return new LSL_List();
8169 8210
8170 MediaEntry me = module.GetMediaEntry(m_host, face); 8211 MediaEntry me = module.GetMediaEntry(part, face);
8171 8212
8172 // As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams 8213 // As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams
8173 if (null == me) 8214 if (null == me)
@@ -8249,33 +8290,52 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8249 case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: 8290 case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
8250 res.Add(new LSL_Integer((int)me.ControlPermissions)); 8291 res.Add(new LSL_Integer((int)me.ControlPermissions));
8251 break; 8292 break;
8293
8294 default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS;
8252 } 8295 }
8253 } 8296 }
8254 8297
8255 return res; 8298 return res;
8256 } 8299 }
8257 8300
8258 public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) 8301 public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules)
8259 { 8302 {
8260 m_host.AddScriptLPS(1); 8303 m_host.AddScriptLPS(1);
8261 ScriptSleep(1000); 8304 ScriptSleep(1000);
8305 return SetPrimMediaParams(m_host, face, rules);
8306 }
8262 8307
8263 // LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid 8308 public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
8264 // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. 8309 {
8265 // Don't perform the media check directly 8310 m_host.AddScriptLPS(1);
8266 if (face < 0 || face > m_host.GetNumberOfSides() - 1) 8311 ScriptSleep(1000);
8267 return ScriptBaseClass.LSL_STATUS_OK; 8312 if (link == ScriptBaseClass.LINK_ROOT)
8313 return SetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
8314 else if (link == ScriptBaseClass.LINK_THIS)
8315 return SetPrimMediaParams(m_host, face, rules);
8316 else
8317 {
8318 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
8319 if (null != part)
8320 return SetPrimMediaParams(part, face, rules);
8321 }
8268 8322
8269 return SetPrimMediaParams(face, rules); 8323 return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
8270 } 8324 }
8271 8325
8272 private LSL_Integer SetPrimMediaParams(int face, LSL_List rules) 8326 private LSL_Integer SetPrimMediaParams(SceneObjectPart part, LSL_Integer face, LSL_List rules)
8273 { 8327 {
8328 // LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid
8329 // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this.
8330 // Don't perform the media check directly
8331 if (face < 0 || face > part.GetNumberOfSides() - 1)
8332 return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
8333
8274 IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); 8334 IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
8275 if (null == module) 8335 if (null == module)
8276 throw new Exception("Media on a prim functions not available"); 8336 return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;
8277 8337
8278 MediaEntry me = module.GetMediaEntry(m_host, face); 8338 MediaEntry me = module.GetMediaEntry(part, face);
8279 if (null == me) 8339 if (null == me)
8280 me = new MediaEntry(); 8340 me = new MediaEntry();
8281 8341
@@ -8354,10 +8414,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8354 case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: 8414 case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
8355 me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); 8415 me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
8356 break; 8416 break;
8417
8418 default: return ScriptBaseClass.LSL_STATUS_MALFORMED_PARAMS;
8357 } 8419 }
8358 } 8420 }
8359 8421
8360 module.SetMediaEntry(m_host, face, me); 8422 module.SetMediaEntry(part, face, me);
8361 8423
8362 return ScriptBaseClass.LSL_STATUS_OK; 8424 return ScriptBaseClass.LSL_STATUS_OK;
8363 } 8425 }
@@ -8366,18 +8428,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8366 { 8428 {
8367 m_host.AddScriptLPS(1); 8429 m_host.AddScriptLPS(1);
8368 ScriptSleep(1000); 8430 ScriptSleep(1000);
8431 return ClearPrimMedia(m_host, face);
8432 }
8369 8433
8434 public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face)
8435 {
8436 m_host.AddScriptLPS(1);
8437 ScriptSleep(1000);
8438 if (link == ScriptBaseClass.LINK_ROOT)
8439 return ClearPrimMedia(m_host.ParentGroup.RootPart, face);
8440 else if (link == ScriptBaseClass.LINK_THIS)
8441 return ClearPrimMedia(m_host, face);
8442 else
8443 {
8444 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
8445 if (null != part)
8446 return ClearPrimMedia(part, face);
8447 }
8448
8449 return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
8450 }
8451
8452 private LSL_Integer ClearPrimMedia(SceneObjectPart part, LSL_Integer face)
8453 {
8370 // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid 8454 // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid
8371 // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. 8455 // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this.
8372 // FIXME: Don't perform the media check directly 8456 // FIXME: Don't perform the media check directly
8373 if (face < 0 || face > m_host.GetNumberOfSides() - 1) 8457 if (face < 0 || face > part.GetNumberOfSides() - 1)
8374 return ScriptBaseClass.LSL_STATUS_OK; 8458 return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
8375 8459
8376 IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); 8460 IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
8377 if (null == module) 8461 if (null == module)
8378 throw new Exception("Media on a prim functions not available"); 8462 return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;
8379 8463
8380 module.ClearMediaEntry(m_host, face); 8464 module.ClearMediaEntry(part, face);
8381 8465
8382 return ScriptBaseClass.LSL_STATUS_OK; 8466 return ScriptBaseClass.LSL_STATUS_OK;
8383 } 8467 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index c55e2ae..ff1f5fd 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2740,7 +2740,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2740 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); 2740 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
2741 m_host.AddScriptLPS(1); 2741 m_host.AddScriptLPS(1);
2742 ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); 2742 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
2743 avatar.SpeedModifier = (float)SpeedModifier; 2743
2744 if (avatar != null)
2745 avatar.SpeedModifier = (float)SpeedModifier;
2744 } 2746 }
2745 2747
2746 public void osKickAvatar(string FirstName,string SurName,string alert) 2748 public void osKickAvatar(string FirstName,string SurName,string alert)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 6106a65..0f53bc3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -64,6 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
64 LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options); 64 LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options);
65 LSL_Integer llCeil(double f); 65 LSL_Integer llCeil(double f);
66 void llClearCameraParams(); 66 void llClearCameraParams();
67 LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face);
67 LSL_Integer llClearPrimMedia(LSL_Integer face); 68 LSL_Integer llClearPrimMedia(LSL_Integer face);
68 void llCloseRemoteDataChannel(string channel); 69 void llCloseRemoteDataChannel(string channel);
69 LSL_Float llCloud(LSL_Vector offset); 70 LSL_Float llCloud(LSL_Vector offset);
@@ -139,7 +140,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
139 LSL_String llGetLinkName(int linknum); 140 LSL_String llGetLinkName(int linknum);
140 LSL_Integer llGetLinkNumber(); 141 LSL_Integer llGetLinkNumber();
141 LSL_Integer llGetLinkNumberOfSides(int link); 142 LSL_Integer llGetLinkNumberOfSides(int link);
142 LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); 143 LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules);
144 LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules);
143 LSL_Integer llGetListEntryType(LSL_List src, int index); 145 LSL_Integer llGetListEntryType(LSL_List src, int index);
144 LSL_Integer llGetListLength(LSL_List src); 146 LSL_Integer llGetListLength(LSL_List src);
145 LSL_Vector llGetLocalPos(); 147 LSL_Vector llGetLocalPos();
@@ -218,6 +220,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
218 LSL_String llGetDisplayName(string id); 220 LSL_String llGetDisplayName(string id);
219 LSL_String llRequestDisplayName(string id); 221 LSL_String llRequestDisplayName(string id);
220 void llLinkParticleSystem(int linknum, LSL_List rules); 222 void llLinkParticleSystem(int linknum, LSL_List rules);
223 void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot);
221 LSL_String llList2CSV(LSL_List src); 224 LSL_String llList2CSV(LSL_List src);
222 LSL_Float llList2Float(LSL_List src, int index); 225 LSL_Float llList2Float(LSL_List src, int index);
223 LSL_Integer llList2Integer(LSL_List src, int index); 226 LSL_Integer llList2Integer(LSL_List src, int index);
@@ -334,6 +337,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
334 void llSetInventoryPermMask(string item, int mask, int value); 337 void llSetInventoryPermMask(string item, int mask, int value);
335 void llSetLinkAlpha(int linknumber, double alpha, int face); 338 void llSetLinkAlpha(int linknumber, double alpha, int face);
336 void llSetLinkColor(int linknumber, LSL_Vector color, int face); 339 void llSetLinkColor(int linknumber, LSL_Vector color, int face);
340 LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules);
337 void llSetLinkPrimitiveParams(int linknumber, LSL_List rules); 341 void llSetLinkPrimitiveParams(int linknumber, LSL_List rules);
338 void llSetLinkTexture(int linknumber, string texture, int face); 342 void llSetLinkTexture(int linknumber, string texture, int face);
339 void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate); 343 void llSetLinkTextureAnim(int linknum, int mode, int face, int sizex, int sizey, double start, double length, double rate);
@@ -344,7 +348,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
344 void llSetParcelMusicURL(string url); 348 void llSetParcelMusicURL(string url);
345 void llSetPayPrice(int price, LSL_List quick_pay_buttons); 349 void llSetPayPrice(int price, LSL_List quick_pay_buttons);
346 void llSetPos(LSL_Vector pos); 350 void llSetPos(LSL_Vector pos);
347 LSL_Integer llSetPrimMediaParams(int face, LSL_List rules); 351 LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules);
348 void llSetPrimitiveParams(LSL_List rules); 352 void llSetPrimitiveParams(LSL_List rules);
349 void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules); 353 void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules);
350 void llSetPrimURL(string url); 354 void llSetPrimURL(string url);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index bb498b5..5a53e15 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -378,6 +378,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
378 public const int PRIM_SCULPT_TYPE_TORUS = 2; 378 public const int PRIM_SCULPT_TYPE_TORUS = 2;
379 public const int PRIM_SCULPT_TYPE_PLANE = 3; 379 public const int PRIM_SCULPT_TYPE_PLANE = 3;
380 public const int PRIM_SCULPT_TYPE_CYLINDER = 4; 380 public const int PRIM_SCULPT_TYPE_CYLINDER = 4;
381 public const int PRIM_SCULPT_FLAG_INVERT = 64;
382 public const int PRIM_SCULPT_FLAG_MIRROR = 128;
381 383
382 public const int MASK_BASE = 0; 384 public const int MASK_BASE = 0;
383 public const int MASK_OWNER = 1; 385 public const int MASK_OWNER = 1;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 83550a5..f8e3c36 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -1688,6 +1688,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1688 m_LSL_Functions.llSitTarget(offset, rot); 1688 m_LSL_Functions.llSitTarget(offset, rot);
1689 } 1689 }
1690 1690
1691 public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
1692 {
1693 m_LSL_Functions.llLinkSitTarget(link, offset, rot);
1694 }
1695
1691 public void llSleep(double sec) 1696 public void llSleep(double sec)
1692 { 1697 {
1693 m_LSL_Functions.llSleep(sec); 1698 m_LSL_Functions.llSleep(sec);
@@ -1882,17 +1887,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
1882 { 1887 {
1883 return m_LSL_Functions.llGetPrimMediaParams(face, rules); 1888 return m_LSL_Functions.llGetPrimMediaParams(face, rules);
1884 } 1889 }
1885 1890
1891 public LSL_List llGetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
1892 {
1893 return m_LSL_Functions.llGetLinkMedia(link, face, rules);
1894 }
1895
1886 public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) 1896 public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules)
1887 { 1897 {
1888 return m_LSL_Functions.llSetPrimMediaParams(face, rules); 1898 return m_LSL_Functions.llSetPrimMediaParams(face, rules);
1889 } 1899 }
1890 1900
1901 public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
1902 {
1903 return m_LSL_Functions.llSetLinkMedia(link, face, rules);
1904 }
1905
1891 public LSL_Integer llClearPrimMedia(LSL_Integer face) 1906 public LSL_Integer llClearPrimMedia(LSL_Integer face)
1892 { 1907 {
1893 return m_LSL_Functions.llClearPrimMedia(face); 1908 return m_LSL_Functions.llClearPrimMedia(face);
1894 } 1909 }
1895 1910
1911 public LSL_Integer llClearLinkMedia(LSL_Integer link, LSL_Integer face)
1912 {
1913 return m_LSL_Functions.llClearLinkMedia(link, face);
1914 }
1915
1896 public void print(string str) 1916 public void print(string str)
1897 { 1917 {
1898 m_LSL_Functions.print(str); 1918 m_LSL_Functions.print(str);
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index f627e37..ad272f7 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -83,6 +83,9 @@ namespace OpenSim.Region.UserStatistics
83 { 83 {
84 if (m_scenes.Count == 0) 84 if (m_scenes.Count == 0)
85 { 85 {
86 if (Util.IsWindows())
87 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
88
86 //IConfig startupConfig = config.Configs["Startup"]; 89 //IConfig startupConfig = config.Configs["Startup"];
87 90
88 dbConn = new SqliteConnection("URI=file:LocalUserStatistics.db,version=3"); 91 dbConn = new SqliteConnection("URI=file:LocalUserStatistics.db,version=3");