diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 122 |
1 files changed, 20 insertions, 102 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4ffa1a2..3034f9a 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -387,6 +387,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
387 | { | 387 | { |
388 | get { return StatsReporter.getLastReportedSimFPS(); } | 388 | get { return StatsReporter.getLastReportedSimFPS(); } |
389 | } | 389 | } |
390 | |||
391 | public float[] SimulatorStats | ||
392 | { | ||
393 | get { return StatsReporter.getLastReportedSimStats(); } | ||
394 | } | ||
390 | 395 | ||
391 | public string DefaultScriptEngine | 396 | public string DefaultScriptEngine |
392 | { | 397 | { |
@@ -618,7 +623,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
618 | startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); | 623 | startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); |
619 | m_persistAfter *= 10000000; | 624 | m_persistAfter *= 10000000; |
620 | 625 | ||
621 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); | 626 | m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine"); |
622 | 627 | ||
623 | IConfig packetConfig = m_config.Configs["PacketPool"]; | 628 | IConfig packetConfig = m_config.Configs["PacketPool"]; |
624 | if (packetConfig != null) | 629 | if (packetConfig != null) |
@@ -873,6 +878,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
873 | /// <param name="seconds">float indicating duration before restart.</param> | 878 | /// <param name="seconds">float indicating duration before restart.</param> |
874 | public virtual void Restart(float seconds) | 879 | public virtual void Restart(float seconds) |
875 | { | 880 | { |
881 | Restart(seconds, true); | ||
882 | } | ||
883 | |||
884 | /// <summary> | ||
885 | /// Given float seconds, this will restart the region. showDialog will optionally alert the users. | ||
886 | /// </summary> | ||
887 | /// <param name="seconds">float indicating duration before restart.</param> | ||
888 | public virtual void Restart(float seconds, bool showDialog) | ||
889 | { | ||
876 | // notifications are done in 15 second increments | 890 | // notifications are done in 15 second increments |
877 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request | 891 | // so .. if the number of seconds is less then 15 seconds, it's not really a restart request |
878 | // It's a 'Cancel restart' request. | 892 | // It's a 'Cancel restart' request. |
@@ -893,8 +907,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
893 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); | 907 | m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed); |
894 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); | 908 | m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes"); |
895 | m_restartTimer.Start(); | 909 | m_restartTimer.Start(); |
896 | m_dialogModule.SendNotificationToUsersInRegion( | 910 | if (showDialog) |
897 | UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes"); | 911 | { |
912 | m_dialogModule.SendNotificationToUsersInRegion( | ||
913 | UUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in " + (seconds / 60).ToString() + " Minutes"); | ||
914 | } | ||
898 | } | 915 | } |
899 | } | 916 | } |
900 | 917 | ||
@@ -2381,103 +2398,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2381 | return successYN; | 2398 | return successYN; |
2382 | } | 2399 | } |
2383 | 2400 | ||
2384 | /// <summary> | ||
2385 | /// Handle a scene object that is crossing into this region from another. | ||
2386 | /// NOTE: Unused as of 2009-02-09. Soon to be deleted. | ||
2387 | /// </summary> | ||
2388 | /// <param name="regionHandle"></param> | ||
2389 | /// <param name="primID"></param> | ||
2390 | /// <param name="objXMLData"></param> | ||
2391 | /// <param name="XMLMethod"></param> | ||
2392 | /// <returns></returns> | ||
2393 | public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod) | ||
2394 | { | ||
2395 | if (XMLMethod == 0) | ||
2396 | { | ||
2397 | m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID); | ||
2398 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); | ||
2399 | if (sceneObject.IsAttachment) | ||
2400 | sceneObject.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom; | ||
2401 | |||
2402 | return AddSceneObject(sceneObject); | ||
2403 | } | ||
2404 | else if ((XMLMethod == 100) && m_allowScriptCrossings) | ||
2405 | { | ||
2406 | m_log.Warn("[INTERREGION]: Prim state data arrived from a neighbor"); | ||
2407 | |||
2408 | XmlDocument doc = new XmlDocument(); | ||
2409 | doc.LoadXml(objXMLData); | ||
2410 | |||
2411 | XmlNodeList rootL = doc.GetElementsByTagName("ScriptData"); | ||
2412 | if (rootL.Count == 1) | ||
2413 | { | ||
2414 | XmlNode rootNode = rootL[0]; | ||
2415 | if (rootNode != null) | ||
2416 | { | ||
2417 | XmlNodeList partL = rootNode.ChildNodes; | ||
2418 | |||
2419 | foreach (XmlNode part in partL) | ||
2420 | { | ||
2421 | XmlNodeList nodeL = part.ChildNodes; | ||
2422 | |||
2423 | switch (part.Name) | ||
2424 | { | ||
2425 | case "Assemblies": | ||
2426 | foreach (XmlNode asm in nodeL) | ||
2427 | { | ||
2428 | string fn = asm.Attributes.GetNamedItem("Filename").Value; | ||
2429 | |||
2430 | Byte[] filedata = Convert.FromBase64String(asm.InnerText); | ||
2431 | string path = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString()); | ||
2432 | path = Path.Combine(path, fn); | ||
2433 | |||
2434 | if (!File.Exists(path)) | ||
2435 | { | ||
2436 | FileStream fs = File.Create(path); | ||
2437 | fs.Write(filedata, 0, filedata.Length); | ||
2438 | fs.Close(); | ||
2439 | } | ||
2440 | } | ||
2441 | break; | ||
2442 | case "ScriptStates": | ||
2443 | foreach (XmlNode st in nodeL) | ||
2444 | { | ||
2445 | string id = st.Attributes.GetNamedItem("UUID").Value; | ||
2446 | UUID uuid = new UUID(id); | ||
2447 | XmlNode state = st.ChildNodes[0]; | ||
2448 | |||
2449 | XmlDocument sdoc = new XmlDocument(); | ||
2450 | XmlNode sxmlnode = sdoc.CreateNode( | ||
2451 | XmlNodeType.XmlDeclaration, | ||
2452 | "", ""); | ||
2453 | sdoc.AppendChild(sxmlnode); | ||
2454 | |||
2455 | XmlNode newnode = sdoc.ImportNode(state, true); | ||
2456 | sdoc.AppendChild(newnode); | ||
2457 | |||
2458 | string spath = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString()); | ||
2459 | spath = Path.Combine(spath, uuid.ToString()); | ||
2460 | FileStream sfs = File.Create(spath + ".state"); | ||
2461 | ASCIIEncoding enc = new ASCIIEncoding(); | ||
2462 | Byte[] buf = enc.GetBytes(sdoc.InnerXml); | ||
2463 | sfs.Write(buf, 0, buf.Length); | ||
2464 | sfs.Close(); | ||
2465 | } | ||
2466 | break; | ||
2467 | } | ||
2468 | } | ||
2469 | } | ||
2470 | } | ||
2471 | |||
2472 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | ||
2473 | RootPrim.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); | ||
2474 | |||
2475 | return true; | ||
2476 | } | ||
2477 | |||
2478 | return true; | ||
2479 | } | ||
2480 | |||
2481 | public bool IncomingCreateObject(ISceneObject sog) | 2401 | public bool IncomingCreateObject(ISceneObject sog) |
2482 | { | 2402 | { |
2483 | //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); | 2403 | //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); |
@@ -3350,7 +3270,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3350 | m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent; | 3270 | m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent; |
3351 | //m_eventManager.OnRegionUp += OtherRegionUp; | 3271 | //m_eventManager.OnRegionUp += OtherRegionUp; |
3352 | //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 3272 | //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
3353 | m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; | ||
3354 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; | 3273 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; |
3355 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; | 3274 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; |
3356 | m_sceneGridService.KiPrimitive += SendKillObject; | 3275 | m_sceneGridService.KiPrimitive += SendKillObject; |
@@ -3374,7 +3293,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3374 | m_sceneGridService.KiPrimitive -= SendKillObject; | 3293 | m_sceneGridService.KiPrimitive -= SendKillObject; |
3375 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; | 3294 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; |
3376 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; | 3295 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; |
3377 | m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; | ||
3378 | //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; | 3296 | //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; |
3379 | //m_eventManager.OnRegionUp -= OtherRegionUp; | 3297 | //m_eventManager.OnRegionUp -= OtherRegionUp; |
3380 | m_sceneGridService.OnExpectUser -= HandleNewUserConnection; | 3298 | m_sceneGridService.OnExpectUser -= HandleNewUserConnection; |