diff options
author | Dan Lake | 2011-11-10 15:23:16 -0800 |
---|---|---|
committer | Dan Lake | 2011-11-10 15:23:16 -0800 |
commit | 8fbaa10ade53718f0c0756bf2ecf875aca9ca3d7 (patch) | |
tree | 9f4d358822f4e6b3b7f69e2e1a7648206ceb8e6c /OpenSim | |
parent | Cleaned UpdatePermissions calls on SOP and SOG to eliminate redundant propert... (diff) | |
parent | Implement nudging support for strafing motion (diff) | |
download | opensim-SC-8fbaa10ade53718f0c0756bf2ecf875aca9ca3d7.zip opensim-SC-8fbaa10ade53718f0c0756bf2ecf875aca9ca3d7.tar.gz opensim-SC-8fbaa10ade53718f0c0756bf2ecf875aca9ca3d7.tar.bz2 opensim-SC-8fbaa10ade53718f0c0756bf2ecf875aca9ca3d7.tar.xz |
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 |
2 files changed, 32 insertions, 5 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 9fe284f..beb75a8 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/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fc5141f..e662492 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1509,7 +1509,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1509 | 1509 | ||
1510 | if ((MovementFlag & (byte)(uint)DCF) == 0) | 1510 | if ((MovementFlag & (byte)(uint)DCF) == 0) |
1511 | { | 1511 | { |
1512 | if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | 1512 | if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE || |
1513 | DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT_NUDGE) | ||
1513 | { | 1514 | { |
1514 | MovementFlag |= (byte)nudgehack; | 1515 | MovementFlag |= (byte)nudgehack; |
1515 | } | 1516 | } |
@@ -1522,7 +1523,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1522 | else | 1523 | else |
1523 | { | 1524 | { |
1524 | if ((MovementFlag & (byte)(uint)DCF) != 0 || | 1525 | if ((MovementFlag & (byte)(uint)DCF) != 0 || |
1525 | ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) | 1526 | ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE || |
1527 | DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT_NUDGE) | ||
1526 | && ((MovementFlag & (byte)nudgehack) == nudgehack)) | 1528 | && ((MovementFlag & (byte)nudgehack) == nudgehack)) |
1527 | ) // This or is for Nudge forward | 1529 | ) // This or is for Nudge forward |
1528 | { | 1530 | { |