diff options
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 25 | ||||
-rwxr-xr-x | bin/OpenSim.ini.example | 14 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 7 |
4 files changed, 58 insertions, 19 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 51312df..1149bd7 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -31,6 +31,7 @@ using System.Collections.Generic; | |||
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Text; | 33 | using System.Text; |
34 | using System.Text.RegularExpressions; | ||
34 | using System.Timers; | 35 | using System.Timers; |
35 | using log4net; | 36 | using log4net; |
36 | using Nini.Config; | 37 | using Nini.Config; |
@@ -56,7 +57,16 @@ namespace OpenSim | |||
56 | protected bool m_gui = false; | 57 | protected bool m_gui = false; |
57 | protected string m_consoleType = "local"; | 58 | protected string m_consoleType = "local"; |
58 | protected uint m_consolePort = 0; | 59 | protected uint m_consolePort = 0; |
59 | protected string m_custom_prompt; | 60 | |
61 | /// <summary> | ||
62 | /// Prompt to use for simulator command line. | ||
63 | /// </summary> | ||
64 | private string m_consolePrompt; | ||
65 | |||
66 | /// <summary> | ||
67 | /// Regex for parsing out special characters in the prompt. | ||
68 | /// </summary> | ||
69 | private Regex m_consolePromptRegex = new Regex(@"([^\\])\\(\w)", RegexOptions.Compiled); | ||
60 | 70 | ||
61 | private string m_timedScript = "disabled"; | 71 | private string m_timedScript = "disabled"; |
62 | private Timer m_scriptTimer; | 72 | private Timer m_scriptTimer; |
@@ -111,7 +121,7 @@ namespace OpenSim | |||
111 | Util.FireAndForgetMethod = asyncCallMethod; | 121 | Util.FireAndForgetMethod = asyncCallMethod; |
112 | 122 | ||
113 | stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15); | 123 | stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15); |
114 | m_custom_prompt = startupConfig.GetString("custom_prompt", "Region"); | 124 | m_consolePrompt = startupConfig.GetString("console_prompt", @"Region (\R) "); |
115 | } | 125 | } |
116 | 126 | ||
117 | if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) | 127 | if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) |
@@ -835,7 +845,22 @@ namespace OpenSim | |||
835 | 845 | ||
836 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); | 846 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); |
837 | MainConsole.Instance.Output(String.Format("Currently selected region is {0}", regionName)); | 847 | MainConsole.Instance.Output(String.Format("Currently selected region is {0}", regionName)); |
838 | m_console.DefaultPrompt = String.Format("{0} ({1}) ", m_custom_prompt, regionName); | 848 | |
849 | // m_log.DebugFormat("Original prompt is {0}", m_consolePrompt); | ||
850 | string prompt = m_consolePrompt; | ||
851 | |||
852 | // Replace "\R" with the region name | ||
853 | // Replace "\\" with "\" | ||
854 | prompt = m_consolePromptRegex.Replace(prompt, m => | ||
855 | { | ||
856 | // m_log.DebugFormat("Matched {0}", m.Groups[2].Value); | ||
857 | if (m.Groups[2].Value == "R") | ||
858 | return m.Groups[1].Value + regionName; | ||
859 | else | ||
860 | return m.Groups[0].Value; | ||
861 | }); | ||
862 | |||
863 | m_console.DefaultPrompt = prompt; | ||
839 | m_console.ConsoleScene = m_sceneManager.CurrentScene; | 864 | m_console.ConsoleScene = m_sceneManager.CurrentScene; |
840 | } | 865 | } |
841 | 866 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a3ac756..b758b8f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2119,18 +2119,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
2119 | //if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) | 2119 | //if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) |
2120 | // return; | 2120 | // return; |
2121 | 2121 | ||
2122 | bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); | 2122 | // If we somehow got here to updating the SOG and its root part is not scheduled for update, |
2123 | 2123 | // check to see if the physical position or rotation warrant an update. | |
2124 | if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) | 2124 | if (m_rootPart.UpdateFlag == UpdateRequired.NONE) |
2125 | { | 2125 | { |
2126 | m_rootPart.UpdateFlag = UpdateRequired.TERSE; | 2126 | bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); |
2127 | lastPhysGroupPos = AbsolutePosition; | ||
2128 | } | ||
2129 | 2127 | ||
2130 | if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) | 2128 | if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) |
2131 | { | 2129 | { |
2132 | m_rootPart.UpdateFlag = UpdateRequired.TERSE; | 2130 | m_rootPart.UpdateFlag = UpdateRequired.TERSE; |
2133 | lastPhysGroupRot = GroupRotation; | 2131 | lastPhysGroupPos = AbsolutePosition; |
2132 | } | ||
2133 | |||
2134 | if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) | ||
2135 | { | ||
2136 | m_rootPart.UpdateFlag = UpdateRequired.TERSE; | ||
2137 | lastPhysGroupRot = GroupRotation; | ||
2138 | } | ||
2134 | } | 2139 | } |
2135 | 2140 | ||
2136 | SceneObjectPart[] parts = m_parts.GetArray(); | 2141 | SceneObjectPart[] parts = m_parts.GetArray(); |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index c5205db..253b24d 100755 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -36,6 +36,14 @@ | |||
36 | 36 | ||
37 | 37 | ||
38 | [Startup] | 38 | [Startup] |
39 | ;# {ConsolePrompt} {} {ConsolePrompt} {} "Region (\R) " | ||
40 | ;; Console prompt | ||
41 | ;; Certain special characters can be used to customize the prompt | ||
42 | ;; Currently, these are | ||
43 | ;; \R - substitute region name | ||
44 | ;; \\ - substitute \ | ||
45 | ; ConsolePrompt = "Region (\R) " | ||
46 | |||
39 | ;# {save_crashes} {} {Save crashes to disk?} {true false} false | 47 | ;# {save_crashes} {} {Save crashes to disk?} {true false} false |
40 | ;; Set this to true if you want to log crashes to disk | 48 | ;; Set this to true if you want to log crashes to disk |
41 | ;; this can be useful when submitting bug reports. | 49 | ;; this can be useful when submitting bug reports. |
@@ -230,12 +238,6 @@ | |||
230 | ;; by scripts have changed. | 238 | ;; by scripts have changed. |
231 | ; DeleteScriptsOnStartup = true | 239 | ; DeleteScriptsOnStartup = true |
232 | 240 | ||
233 | ;; Custom prompt | ||
234 | ;; This value replaces the word "Region" in console prompt | ||
235 | ;; (usualy "Region (regionName) # " | ||
236 | ;; Useful only if you have to monitor serveral servers | ||
237 | ; custom_prompt = "MyServer1" | ||
238 | |||
239 | [SMTP] | 241 | [SMTP] |
240 | ;; The SMTP server enabled the email module to send email to external | 242 | ;; The SMTP server enabled the email module to send email to external |
241 | ;; destinations. | 243 | ;; destinations. |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 3e6a893..1c0af76 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -3,6 +3,13 @@ | |||
3 | 3 | ||
4 | 4 | ||
5 | [Startup] | 5 | [Startup] |
6 | ; Console prompt | ||
7 | ; Certain special characters can be used to customize the prompt | ||
8 | ; Currently, these are | ||
9 | ; \R - substitute region name | ||
10 | ; \\ - substtitue \ | ||
11 | ConsolePrompt = "Region (\R) " | ||
12 | |||
6 | ; Set this to true if you want to log crashes to disk | 13 | ; Set this to true if you want to log crashes to disk |
7 | ; this can be useful when submitting bug reports. | 14 | ; this can be useful when submitting bug reports. |
8 | ; However, this will only log crashes within OpenSimulator that cause the entire program to exit | 15 | ; However, this will only log crashes within OpenSimulator that cause the entire program to exit |