aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs44
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs37
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs18
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs17
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs35
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs10
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs2
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs21
11 files changed, 149 insertions, 47 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index ef5efdd..d76ff47 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
167 // sanity check: 167 // sanity check:
168 if (c.Sender == null) 168 if (c.Sender == null)
169 { 169 {
170 m_log.ErrorFormat("[CHAT] OnChatFromClient from {0} has empty Sender field!", sender); 170 m_log.ErrorFormat("[CHAT]: OnChatFromClient from {0} has empty Sender field!", sender);
171 return; 171 return;
172 } 172 }
173 173
@@ -220,17 +220,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
220 if (message.Length >= 1000) // libomv limit 220 if (message.Length >= 1000) // libomv limit
221 message = message.Substring(0, 1000); 221 message = message.Substring(0, 1000);
222 222
223 // m_log.DebugFormat("[CHAT]: DCTA: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, c.Type, sourceType); 223// m_log.DebugFormat(
224// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}",
225// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType);
224 226
227 HashSet<UUID> receiverIDs = new HashSet<UUID>();
228
225 foreach (Scene s in m_scenes) 229 foreach (Scene s in m_scenes)
226 { 230 {
227 s.ForEachScenePresence( 231 s.ForEachScenePresence(
228 delegate(ScenePresence presence) 232 delegate(ScenePresence presence)
229 { 233 {
230 TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType); 234 if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
235 receiverIDs.Add(presence.UUID);
231 } 236 }
232 ); 237 );
233 } 238 }
239
240 (scene as Scene).EventManager.TriggerOnChatToClients(
241 fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully);
234 } 242 }
235 243
236 static private Vector3 CenterOfRegion = new Vector3(128, 128, 30); 244 static private Vector3 CenterOfRegion = new Vector3(128, 128, 30);
@@ -269,6 +277,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
269 277
270 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); 278 // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
271 279
280 HashSet<UUID> receiverIDs = new HashSet<UUID>();
281
272 ((Scene)c.Scene).ForEachScenePresence( 282 ((Scene)c.Scene).ForEachScenePresence(
273 delegate(ScenePresence presence) 283 delegate(ScenePresence presence)
274 { 284 {
@@ -286,16 +296,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
286 296
287 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, 297 client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
288 (byte)sourceType, (byte)ChatAudibleLevel.Fully); 298 (byte)sourceType, (byte)ChatAudibleLevel.Fully);
299 receiverIDs.Add(presence.UUID);
289 }); 300 });
301
302 (c.Scene as Scene).EventManager.TriggerOnChatToClients(
303 fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully);
290 } 304 }
291 305
292 306 /// <summary>
293 protected virtual void TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, 307 /// Try to send a message to the given presence
308 /// </summary>
309 /// <param name="presence">The receiver</param>
310 /// <param name="fromPos"></param>
311 /// <param name="regionPos">/param>
312 /// <param name="fromAgentID"></param>
313 /// <param name="fromName"></param>
314 /// <param name="type"></param>
315 /// <param name="message"></param>
316 /// <param name="src"></param>
317 /// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a
318 /// precondition</returns>
319 protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
294 UUID fromAgentID, string fromName, ChatTypeEnum type, 320 UUID fromAgentID, string fromName, ChatTypeEnum type,
295 string message, ChatSourceType src) 321 string message, ChatSourceType src)
296 { 322 {
297 // don't send stuff to child agents 323 // don't send stuff to child agents
298 if (presence.IsChildAgent) return; 324 if (presence.IsChildAgent) return false;
299 325
300 Vector3 fromRegionPos = fromPos + regionPos; 326 Vector3 fromRegionPos = fromPos + regionPos;
301 Vector3 toRegionPos = presence.AbsolutePosition + 327 Vector3 toRegionPos = presence.AbsolutePosition +
@@ -308,12 +334,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
308 type == ChatTypeEnum.Say && dis > m_saydistance || 334 type == ChatTypeEnum.Say && dis > m_saydistance ||
309 type == ChatTypeEnum.Shout && dis > m_shoutdistance) 335 type == ChatTypeEnum.Shout && dis > m_shoutdistance)
310 { 336 {
311 return; 337 return false;
312 } 338 }
313 339
314 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView 340 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
315 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, 341 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
316 fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); 342 fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully);
343
344 return true;
317 } 345 }
318 } 346 }
319} 347}
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index c1df827..5500557 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -33,6 +33,7 @@ using System.Reflection;
33using System.Threading; 33using System.Threading;
34using System.Text; 34using System.Text;
35using System.Xml; 35using System.Xml;
36using System.Xml.Linq;
36using log4net; 37using log4net;
37using OpenMetaverse; 38using OpenMetaverse;
38using OpenSim.Framework; 39using OpenSim.Framework;
@@ -50,6 +51,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
50 { 51 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 53
54 /// <summary>
55 /// The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version
56 /// bumps here should be compatible.
57 /// </summary>
58 public static int MAX_MAJOR_VERSION = 0;
59
53 protected TarArchiveReader archive; 60 protected TarArchiveReader archive;
54 61
55 private UserAccount m_userInfo; 62 private UserAccount m_userInfo;
@@ -133,7 +140,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
133 140
134 while ((data = archive.ReadEntry(out filePath, out entryType)) != null) 141 while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
135 { 142 {
136 if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) 143 if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
144 {
145 LoadControlFile(filePath, data);
146 }
147 else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
137 { 148 {
138 if (LoadAsset(filePath, data)) 149 if (LoadAsset(filePath, data))
139 successfulAssetRestores++; 150 successfulAssetRestores++;
@@ -461,5 +472,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
461 return false; 472 return false;
462 } 473 }
463 } 474 }
475
476 /// <summary>
477 /// Load control file
478 /// </summary>
479 /// <param name="path"></param>
480 /// <param name="data"></param>
481 protected void LoadControlFile(string path, byte[] data)
482 {
483 XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data));
484 XElement archiveElement = doc.Element("archive");
485 int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value);
486 int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value);
487 string version = string.Format("{0}.{1}", majorVersion, minorVersion);
488
489 if (majorVersion > MAX_MAJOR_VERSION)
490 {
491 throw new Exception(
492 string.Format(
493 "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below",
494 majorVersion, MAX_MAJOR_VERSION));
495 }
496
497 m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
498 }
464 } 499 }
465} \ No newline at end of file 500} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index bae5a7a..249a8b4 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -123,9 +123,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
123 123
124 try 124 try
125 { 125 {
126 // We're almost done. Just need to write out the control file now
127 m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
128 m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
129 m_archiveWriter.Close(); 126 m_archiveWriter.Close();
130 } 127 }
131 catch (Exception e) 128 catch (Exception e)
@@ -216,7 +213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
216 public void Execute() 213 public void Execute()
217 { 214 {
218 try 215 try
219 { 216 {
220 InventoryFolderBase inventoryFolder = null; 217 InventoryFolderBase inventoryFolder = null;
221 InventoryItemBase inventoryItem = null; 218 InventoryItemBase inventoryItem = null;
222 InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID); 219 InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID);
@@ -277,6 +274,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
277 274
278 m_archiveWriter = new TarArchiveWriter(m_saveStream); 275 m_archiveWriter = new TarArchiveWriter(m_saveStream);
279 276
277 // Write out control file. This has to be done first so that subsequent loaders will see this file first
278 // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
279 m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile());
280 m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
281
280 if (inventoryFolder != null) 282 if (inventoryFolder != null)
281 { 283 {
282 m_log.DebugFormat( 284 m_log.DebugFormat(
@@ -399,13 +401,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
399 /// <returns></returns> 401 /// <returns></returns>
400 public static string Create0p1ControlFile() 402 public static string Create0p1ControlFile()
401 { 403 {
404 int majorVersion = 0, minorVersion = 1;
405
406 m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);
407
402 StringWriter sw = new StringWriter(); 408 StringWriter sw = new StringWriter();
403 XmlTextWriter xtw = new XmlTextWriter(sw); 409 XmlTextWriter xtw = new XmlTextWriter(sw);
404 xtw.Formatting = Formatting.Indented; 410 xtw.Formatting = Formatting.Indented;
405 xtw.WriteStartDocument(); 411 xtw.WriteStartDocument();
406 xtw.WriteStartElement("archive"); 412 xtw.WriteStartElement("archive");
407 xtw.WriteAttributeString("major_version", "0"); 413 xtw.WriteAttributeString("major_version", majorVersion.ToString());
408 xtw.WriteAttributeString("minor_version", "1"); 414 xtw.WriteAttributeString("minor_version", minorVersion.ToString());
409 xtw.WriteEndElement(); 415 xtw.WriteEndElement();
410 416
411 xtw.Flush(); 417 xtw.Flush();
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index f1f5258..117b2fd 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 53 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54 54
55 /// <summary> 55 /// <summary>
56 /// The maximum major version of OAR that we can read. Minor versions shouldn't need a number since version 56 /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version
57 /// bumps here should be compatible. 57 /// bumps here should be compatible.
58 /// </summary> 58 /// </summary>
59 public static int MAX_MAJOR_VERSION = 0; 59 public static int MAX_MAJOR_VERSION = 0;
@@ -481,17 +481,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
481 /// </summary> 481 /// </summary>
482 /// <param name="path"></param> 482 /// <param name="path"></param>
483 /// <param name="data"></param> 483 /// <param name="data"></param>
484 private void LoadControlFile(string path, byte[] data) 484 protected void LoadControlFile(string path, byte[] data)
485 { 485 {
486 //Create the XmlNamespaceManager. 486 XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
487 NameTable nt = new NameTable();
488 XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
489
490 // Create the XmlParserContext.
491 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); 487 XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
492 488 XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
493 XmlTextReader xtr
494 = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
495 489
496 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; 490 RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
497 491
@@ -530,10 +524,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
530 currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString(); 524 currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString();
531 } 525 }
532 } 526 }
533
534 } 527 }
535 528
536 currentRegionSettings.Save(); 529 currentRegionSettings.Save();
537 } 530 }
538 } 531 }
539} 532} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index 43789af..1687d06 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -171,7 +171,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
171 171
172 m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); 172 m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time.");
173 173
174 // Write out control file 174 // Write out control file. This has to be done first so that subsequent loaders will see this file first
175 // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
175 archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile(options)); 176 archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile(options));
176 m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); 177 m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
177 178
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 437b91a..4feb3fc 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -293,6 +293,17 @@ namespace OpenSim.Region.Framework.Scenes
293 public event ChatFromClientEvent OnChatFromClient; 293 public event ChatFromClientEvent OnChatFromClient;
294 294
295 /// <summary> 295 /// <summary>
296 /// ChatToClientsEvent is triggered via ChatModule (or
297 /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
298 /// received chat message if they satisfy various conditions (within audible range, etc.)
299 /// </summary>
300 public delegate void ChatToClientsEvent(
301 UUID senderID, HashSet<UUID> receiverIDs,
302 string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
303 ChatSourceType src, ChatAudibleLevel level);
304 public event ChatToClientsEvent OnChatToClients;
305
306 /// <summary>
296 /// ChatBroadcastEvent is called via Scene when a broadcast chat message 307 /// ChatBroadcastEvent is called via Scene when a broadcast chat message
297 /// from world comes in 308 /// from world comes in
298 /// </summary> 309 /// </summary>
@@ -1603,6 +1614,30 @@ namespace OpenSim.Region.Framework.Scenes
1603 } 1614 }
1604 } 1615 }
1605 } 1616 }
1617
1618 public void TriggerOnChatToClients(
1619 UUID senderID, HashSet<UUID> receiverIDs,
1620 string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
1621 ChatSourceType src, ChatAudibleLevel level)
1622 {
1623 ChatToClientsEvent handler = OnChatToClients;
1624 if (handler != null)
1625 {
1626 foreach (ChatToClientsEvent d in handler.GetInvocationList())
1627 {
1628 try
1629 {
1630 d(senderID, receiverIDs, message, type, fromPos, fromName, src, level);
1631 }
1632 catch (Exception e)
1633 {
1634 m_log.ErrorFormat(
1635 "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}",
1636 e.Message, e.StackTrace);
1637 }
1638 }
1639 }
1640 }
1606 1641
1607 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) 1642 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
1608 { 1643 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2750168..ef18d02 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -599,8 +599,6 @@ namespace OpenSim.Region.Framework.Scenes
599 StatsReporter.OnSendStatsResult += SendSimStatsPackets; 599 StatsReporter.OnSendStatsResult += SendSimStatsPackets;
600 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; 600 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
601 601
602 StatsReporter.SetObjectCapacity(RegionInfo.ObjectCapacity);
603
604 // Old 602 // Old
605 /* 603 /*
606 m_simulatorVersion = simulatorVersion 604 m_simulatorVersion = simulatorVersion
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index fd23294..87dcdee 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes
108 private int m_activeScripts = 0; 108 private int m_activeScripts = 0;
109 private int m_scriptLinesPerSecond = 0; 109 private int m_scriptLinesPerSecond = 0;
110 110
111 private int objectCapacity = 45000; 111 private int m_objectCapacity = 45000;
112 112
113 private Scene m_scene; 113 private Scene m_scene;
114 114
@@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes
124 m_scene = scene; 124 m_scene = scene;
125 ReportingRegion = scene.RegionInfo; 125 ReportingRegion = scene.RegionInfo;
126 126
127 m_objectCapacity = scene.RegionInfo.ObjectCapacity;
127 m_report.AutoReset = true; 128 m_report.AutoReset = true;
128 m_report.Interval = statsUpdatesEveryMS; 129 m_report.Interval = statsUpdatesEveryMS;
129 m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); 130 m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat);
@@ -271,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes
271 272
272 SimStats simStats 273 SimStats simStats
273 = new SimStats( 274 = new SimStats(
274 ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID); 275 ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID);
275 276
276 handlerSendStatResult = OnSendStatsResult; 277 handlerSendStatResult = OnSendStatsResult;
277 if (handlerSendStatResult != null) 278 if (handlerSendStatResult != null)
@@ -435,11 +436,6 @@ namespace OpenSim.Region.Framework.Scenes
435 m_activeScripts = count; 436 m_activeScripts = count;
436 } 437 }
437 438
438 public void SetObjectCapacity(int objects)
439 {
440 objectCapacity = objects;
441 }
442
443 /// <summary> 439 /// <summary>
444 /// This is for llGetRegionFPS 440 /// This is for llGetRegionFPS
445 /// </summary> 441 /// </summary>
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
index 7e1b5ac..b84a34d 100644
--- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
@@ -83,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
83 83
84 // private int m_stipend = 1000; 84 // private int m_stipend = 1000;
85 85
86// private int ObjectCapacity = 45000;
87 private int ObjectCount = 0; 86 private int ObjectCount = 0;
88 private int PriceEnergyUnit = 0; 87 private int PriceEnergyUnit = 0;
89 private int PriceGroupCreate = 0; 88 private int PriceGroupCreate = 0;
@@ -135,7 +134,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
135 134
136 public void AddRegion(Scene scene) 135 public void AddRegion(Scene scene)
137 { 136 {
138 // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter.
139 if (m_enabled) 137 if (m_enabled)
140 { 138 {
141 scene.RegisterModuleInterface<IMoneyModule>(this); 139 scene.RegisterModuleInterface<IMoneyModule>(this);
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 72dce6d..1257804 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -349,6 +349,7 @@ namespace OpenSim.Region.Physics.Meshing
349 349
350 OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3(); 350 OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3();
351 OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3(); 351 OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3();
352 ushort faceIndexOffset = (ushort)coords.Count;
352 353
353 byte[] posBytes = subMeshMap["Position"].AsBinary(); 354 byte[] posBytes = subMeshMap["Position"].AsBinary();
354 for (int i = 0; i < posBytes.Length; i += 6) 355 for (int i = 0; i < posBytes.Length; i += 6)
@@ -368,9 +369,9 @@ namespace OpenSim.Region.Physics.Meshing
368 byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary(); 369 byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary();
369 for (int i = 0; i < triangleBytes.Length; i += 6) 370 for (int i = 0; i < triangleBytes.Length; i += 6)
370 { 371 {
371 ushort v1 = Utils.BytesToUInt16(triangleBytes, i); 372 ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset);
372 ushort v2 = Utils.BytesToUInt16(triangleBytes, i + 2); 373 ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset);
373 ushort v3 = Utils.BytesToUInt16(triangleBytes, i + 4); 374 ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset);
374 Face f = new Face(v1, v2, v3); 375 Face f = new Face(v1, v2, v3);
375 faces.Add(f); 376 faces.Add(f);
376 } 377 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 8bf9482..59a3618 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6892,7 +6892,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6892 6892
6893 public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) 6893 public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
6894 { 6894 {
6895 llSetLinkPrimitiveParams(linknumber, rules); 6895 m_host.AddScriptLPS(1);
6896
6897 List<SceneObjectPart> parts = GetLinkParts(linknumber);
6898
6899 foreach (SceneObjectPart part in parts)
6900 SetPrimParams(part, rules);
6896 } 6901 }
6897 6902
6898 protected void SetPrimParams(SceneObjectPart part, LSL_List rules) 6903 protected void SetPrimParams(SceneObjectPart part, LSL_List rules)
@@ -8404,6 +8409,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8404 8409
8405 for (j = 0; j < seplen; j++) 8410 for (j = 0; j < seplen; j++)
8406 { 8411 {
8412 if (separray[j].ToString() == String.Empty)
8413 active[j] = false;
8414
8407 if (active[j]) 8415 if (active[j])
8408 { 8416 {
8409 // scan all of the markers 8417 // scan all of the markers
@@ -8432,6 +8440,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8432 { 8440 {
8433 for (j = seplen; (j < mlen) && (offset[best] > beginning); j++) 8441 for (j = seplen; (j < mlen) && (offset[best] > beginning); j++)
8434 { 8442 {
8443 if (spcarray[j-seplen].ToString() == String.Empty)
8444 active[j] = false;
8445
8435 if (active[j]) 8446 if (active[j])
8436 { 8447 {
8437 // scan all of the markers 8448 // scan all of the markers
@@ -9090,10 +9101,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9090 // do that one last, it will cause a ParcelPropertiesUpdate 9101 // do that one last, it will cause a ParcelPropertiesUpdate
9091 landObject.SetMediaUrl(url); 9102 landObject.SetMediaUrl(url);
9092 9103
9093 // now send to all (non-child) agents 9104 // now send to all (non-child) agents in the parcel
9094 World.ForEachScenePresence(delegate(ScenePresence sp) 9105 World.ForEachScenePresence(delegate(ScenePresence sp)
9095 { 9106 {
9096 if (!sp.IsChildAgent) 9107 if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID))
9097 { 9108 {
9098 sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, 9109 sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL,
9099 landData.MediaID, 9110 landData.MediaID,
@@ -9123,10 +9134,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9123 // the commandList contained a start/stop/... command, too 9134 // the commandList contained a start/stop/... command, too
9124 if (presence == null) 9135 if (presence == null)
9125 { 9136 {
9126 // send to all (non-child) agents 9137 // send to all (non-child) agents in the parcel
9127 World.ForEachScenePresence(delegate(ScenePresence sp) 9138 World.ForEachScenePresence(delegate(ScenePresence sp)
9128 { 9139 {
9129 if (!sp.IsChildAgent) 9140 if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID))
9130 { 9141 {
9131 sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? 9142 sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this?
9132 (ParcelMediaCommandEnum)commandToSend, 9143 (ParcelMediaCommandEnum)commandToSend,