aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-29 00:13:29 +0100
committerJustin Clark-Casey (justincc)2014-07-29 00:13:29 +0100
commitf6f7585ec583788b11960cf5a1ac36409e6583aa (patch)
treee5e7e8f12244b5e2d679158204aca0e6c24073d4
parentBulletSim: rearrange code for sensing whether shapes have been (diff)
downloadopensim-SC_OLD-f6f7585ec583788b11960cf5a1ac36409e6583aa.zip
opensim-SC_OLD-f6f7585ec583788b11960cf5a1ac36409e6583aa.tar.gz
opensim-SC_OLD-f6f7585ec583788b11960cf5a1ac36409e6583aa.tar.bz2
opensim-SC_OLD-f6f7585ec583788b11960cf5a1ac36409e6583aa.tar.xz
Add a "debug scene set child-repri <double>" command that allows child reprioritization distance to be changed on the fly.
This governs when child agent position changes are sent to neighbouring regions. Corresponding config parameter is ChildReprioritizationDistance in [InterestManagement] in OpenSim.ini For test purposes.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Console/ConsoleUtil.cs44
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs44
4 files changed, 79 insertions, 21 deletions
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs
index 744f652..44f6dc1 100644
--- a/OpenSim/Framework/Console/ConsoleUtil.cs
+++ b/OpenSim/Framework/Console/ConsoleUtil.cs
@@ -156,7 +156,7 @@ namespace OpenSim.Framework.Console
156 } 156 }
157 157
158 /// <summary> 158 /// <summary>
159 /// Convert a console integer to an int, automatically complaining if a console is given. 159 /// Convert a console input to a bool, automatically complaining if a console is given.
160 /// </summary> 160 /// </summary>
161 /// <param name='console'>Can be null if no console is available.</param> 161 /// <param name='console'>Can be null if no console is available.</param>
162 /// <param name='rawConsoleVector'>/param> 162 /// <param name='rawConsoleVector'>/param>
@@ -176,7 +176,7 @@ namespace OpenSim.Framework.Console
176 } 176 }
177 177
178 /// <summary> 178 /// <summary>
179 /// Convert a console integer to an int, automatically complaining if a console is given. 179 /// Convert a console input to an int, automatically complaining if a console is given.
180 /// </summary> 180 /// </summary>
181 /// <param name='console'>Can be null if no console is available.</param> 181 /// <param name='console'>Can be null if no console is available.</param>
182 /// <param name='rawConsoleInt'>/param> 182 /// <param name='rawConsoleInt'>/param>
@@ -196,6 +196,46 @@ namespace OpenSim.Framework.Console
196 } 196 }
197 197
198 /// <summary> 198 /// <summary>
199 /// Convert a console input to a float, automatically complaining if a console is given.
200 /// </summary>
201 /// <param name='console'>Can be null if no console is available.</param>
202 /// <param name='rawConsoleInput'>/param>
203 /// <param name='i'></param>
204 /// <returns></returns>
205 public static bool TryParseConsoleFloat(ICommandConsole console, string rawConsoleInput, out float i)
206 {
207 if (!float.TryParse(rawConsoleInput, out i))
208 {
209 if (console != null)
210 console.OutputFormat("ERROR: {0} is not a valid float", rawConsoleInput);
211
212 return false;
213 }
214
215 return true;
216 }
217
218 /// <summary>
219 /// Convert a console input to a double, automatically complaining if a console is given.
220 /// </summary>
221 /// <param name='console'>Can be null if no console is available.</param>
222 /// <param name='rawConsoleInput'>/param>
223 /// <param name='i'></param>
224 /// <returns></returns>
225 public static bool TryParseConsoleDouble(ICommandConsole console, string rawConsoleInput, out double i)
226 {
227 if (!double.TryParse(rawConsoleInput, out i))
228 {
229 if (console != null)
230 console.OutputFormat("ERROR: {0} is not a valid double", rawConsoleInput);
231
232 return false;
233 }
234
235 return true;
236 }
237
238 /// <summary>
199 /// Convert a console integer to a natural int, automatically complaining if a console is given. 239 /// Convert a console integer to a natural int, automatically complaining if a console is given.
200 /// </summary> 240 /// </summary>
201 /// <param name='console'>Can be null if no console is available.</param> 241 /// <param name='console'>Can be null if no console is available.</param>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 27929c6..f87ae47 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -413,7 +413,6 @@ namespace OpenSim.Region.Framework.Scenes
413 private bool m_reprioritizationEnabled = true; 413 private bool m_reprioritizationEnabled = true;
414 private double m_reprioritizationInterval = 5000.0; 414 private double m_reprioritizationInterval = 5000.0;
415 private double m_rootReprioritizationDistance = 10.0; 415 private double m_rootReprioritizationDistance = 10.0;
416 private double m_childReprioritizationDistance = 20.0;
417 416
418 private Timer m_mapGenerationTimer = new Timer(); 417 private Timer m_mapGenerationTimer = new Timer();
419 private bool m_generateMaptiles; 418 private bool m_generateMaptiles;
@@ -650,7 +649,7 @@ namespace OpenSim.Region.Framework.Scenes
650 public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } } 649 public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } }
651 public double ReprioritizationInterval { get { return m_reprioritizationInterval; } } 650 public double ReprioritizationInterval { get { return m_reprioritizationInterval; } }
652 public double RootReprioritizationDistance { get { return m_rootReprioritizationDistance; } } 651 public double RootReprioritizationDistance { get { return m_rootReprioritizationDistance; } }
653 public double ChildReprioritizationDistance { get { return m_childReprioritizationDistance; } } 652 public double ChildReprioritizationDistance { get; set; }
654 653
655 public AgentCircuitManager AuthenticateHandler 654 public AgentCircuitManager AuthenticateHandler
656 { 655 {
@@ -1002,7 +1001,8 @@ namespace OpenSim.Region.Framework.Scenes
1002 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); 1001 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
1003 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); 1002 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
1004 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); 1003 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
1005 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0); 1004 ChildReprioritizationDistance
1005 = interestConfig.GetDouble("ChildReprioritizationDistance", ChildReprioritizationDistance);
1006 } 1006 }
1007 1007
1008 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme); 1008 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
@@ -1023,6 +1023,8 @@ namespace OpenSim.Region.Framework.Scenes
1023 PeriodicBackup = true; 1023 PeriodicBackup = true;
1024 UseBackup = true; 1024 UseBackup = true;
1025 1025
1026 ChildReprioritizationDistance = 20.0;
1027
1026 m_eventManager = new EventManager(); 1028 m_eventManager = new EventManager();
1027 1029
1028 m_permissions = new ScenePermissions(this); 1030 m_permissions = new ScenePermissions(this);
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 45c3348..bfa3b9a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -150,6 +150,10 @@ namespace OpenSim.Region.Framework.Scenes
150 150
151 public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence) 151 public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence)
152 { 152 {
153// m_log.DebugFormat(
154// "[SCENE COMMUNICATION SERVICE]: Sending child agent position updates for {0} in {1}",
155// presence.Name, m_scene.Name);
156
153 // This assumes that we know what our neighbors are. 157 // This assumes that we know what our neighbors are.
154 try 158 try
155 { 159 {
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index 5fb74b0..5347945 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -93,28 +93,30 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
93 "Debug", this, "debug scene get", 93 "Debug", this, "debug scene get",
94 "debug scene get", 94 "debug scene get",
95 "List current scene options.", 95 "List current scene options.",
96 "If active is false then main scene update and maintenance loops are suspended.\n" 96 "active - if false then main scene update and maintenance loops are suspended.\n"
97 + "If animations is true then extra animations debug information is logged.\n" 97 + "animations - if true then extra animations debug information is logged.\n"
98 + "If collisions is false then collisions with other objects are turned off.\n" 98 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
99 + "If pbackup is false then periodic scene backup is turned off.\n" 99 + "collisions - if false then collisions with other objects are turned off.\n"
100 + "If physics is false then all physics objects are non-physical.\n" 100 + "pbackup - if false then periodic scene backup is turned off.\n"
101 + "If scripting is false then no scripting operations happen.\n" 101 + "physics - if false then all physics objects are non-physical.\n"
102 + "If teleport is true then some extra teleport debug information is logged.\n" 102 + "scripting - if false then no scripting operations happen.\n"
103 + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.", 103 + "teleport - if true then some extra teleport debug information is logged.\n"
104 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
104 HandleDebugSceneGetCommand); 105 HandleDebugSceneGetCommand);
105 106
106 scene.AddCommand( 107 scene.AddCommand(
107 "Debug", this, "debug scene set", 108 "Debug", this, "debug scene set",
108 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", 109 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false",
109 "Turn on scene debugging options.", 110 "Turn on scene debugging options.",
110 "If active is false then main scene update and maintenance loops are suspended.\n" 111 "active - if false then main scene update and maintenance loops are suspended.\n"
111 + "If animations is true then extra animations debug information is logged.\n" 112 + "animations - if true then extra animations debug information is logged.\n"
112 + "If collisions is false then collisions with other objects are turned off.\n" 113 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
113 + "If pbackup is false then periodic scene backup is turned off.\n" 114 + "collisions - if false then collisions with other objects are turned off.\n"
114 + "If physics is false then all physics objects are non-physical.\n" 115 + "pbackup - if false then periodic scene backup is turned off.\n"
115 + "If scripting is false then no scripting operations happen.\n" 116 + "physics - if false then all physics objects are non-physical.\n"
116 + "If teleport is true then some extra teleport debug information is logged.\n" 117 + "scripting - if false then no scripting operations happen.\n"
117 + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.", 118 + "teleport - if true then some extra teleport debug information is logged.\n"
119 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
118 HandleDebugSceneSetCommand); 120 HandleDebugSceneSetCommand);
119 } 121 }
120 122
@@ -138,6 +140,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
138 ConsoleDisplayList cdl = new ConsoleDisplayList(); 140 ConsoleDisplayList cdl = new ConsoleDisplayList();
139 cdl.AddRow("active", m_scene.Active); 141 cdl.AddRow("active", m_scene.Active);
140 cdl.AddRow("animations", m_scene.DebugAnimations); 142 cdl.AddRow("animations", m_scene.DebugAnimations);
143 cdl.AddRow("child-repri", m_scene.ChildReprioritizationDistance);
141 cdl.AddRow("pbackup", m_scene.PeriodicBackup); 144 cdl.AddRow("pbackup", m_scene.PeriodicBackup);
142 cdl.AddRow("physics", m_scene.PhysicsEnabled); 145 cdl.AddRow("physics", m_scene.PhysicsEnabled);
143 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 146 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
@@ -186,6 +189,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
186 m_scene.DebugAnimations = active; 189 m_scene.DebugAnimations = active;
187 } 190 }
188 191
192 if (options.ContainsKey("child-repri"))
193 {
194 double childRepriDistance;
195
196 // FIXME: This can only come from the console at the moment but might not always be true.
197 if (ConsoleUtil.TryParseConsoleDouble(MainConsole.Instance, options["child-repri"], out childRepriDistance))
198 m_scene.ChildReprioritizationDistance = childRepriDistance;
199 }
200
189 if (options.ContainsKey("pbackup")) 201 if (options.ContainsKey("pbackup"))
190 { 202 {
191 bool active; 203 bool active;