diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-15 13:10:21 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-15 13:10:21 -0400 |
commit | 30ce56e7219b3d2ed16acb322cecec781c3776c5 (patch) | |
tree | 3ab732fc9c8775a3fab0a705b4496ea21c1ab128 /OpenSim/Region | |
parent | * part one of adding physics combining (diff) | |
parent | * whoops, missing a / (diff) | |
download | opensim-SC_OLD-30ce56e7219b3d2ed16acb322cecec781c3776c5.zip opensim-SC_OLD-30ce56e7219b3d2ed16acb322cecec781c3776c5.tar.gz opensim-SC_OLD-30ce56e7219b3d2ed16acb322cecec781c3776c5.tar.bz2 opensim-SC_OLD-30ce56e7219b3d2ed16acb322cecec781c3776c5.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
26 files changed, 989 insertions, 225 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index ad157c6..df80290 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -36,25 +36,47 @@ using OpenSim.Framework.Console; | |||
36 | 36 | ||
37 | namespace OpenSim | 37 | namespace OpenSim |
38 | { | 38 | { |
39 | /// <summary> | ||
40 | /// Starting class for the OpenSimulator Region | ||
41 | /// </summary> | ||
39 | public class Application | 42 | public class Application |
40 | { | 43 | { |
44 | /// <summary> | ||
45 | /// Text Console Logger | ||
46 | /// </summary> | ||
41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
42 | 48 | ||
49 | /// <summary> | ||
50 | /// Path to the main ini Configuration file | ||
51 | /// </summary> | ||
43 | public static string iniFilePath = ""; | 52 | public static string iniFilePath = ""; |
44 | 53 | ||
54 | /// <summary> | ||
55 | /// Save Crashes in the bin/crashes folder. Configurable with m_crashDir | ||
56 | /// </summary> | ||
45 | public static bool m_saveCrashDumps = false; | 57 | public static bool m_saveCrashDumps = false; |
58 | |||
59 | /// <summary> | ||
60 | /// Directory to save crash reports to. Relative to bin/ | ||
61 | /// </summary> | ||
46 | public static string m_crashDir = "crashes"; | 62 | public static string m_crashDir = "crashes"; |
47 | 63 | ||
64 | /// <summary> | ||
65 | /// Instance of the OpenSim class. This could be OpenSim or OpenSimBackground depending on the configuration | ||
66 | /// </summary> | ||
48 | protected static OpenSimBase m_sim = null; | 67 | protected static OpenSimBase m_sim = null; |
49 | 68 | ||
50 | //could move our main function into OpenSimMain and kill this class | 69 | //could move our main function into OpenSimMain and kill this class |
51 | public static void Main(string[] args) | 70 | public static void Main(string[] args) |
52 | { | 71 | { |
53 | // First line | 72 | // First line, hook the appdomain to the crash reporter |
54 | AppDomain.CurrentDomain.UnhandledException += | 73 | AppDomain.CurrentDomain.UnhandledException += |
55 | new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); | 74 | new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); |
56 | 75 | ||
76 | // Add the arguments supplied when running the application to the configuration | ||
57 | ArgvConfigSource configSource = new ArgvConfigSource(args); | 77 | ArgvConfigSource configSource = new ArgvConfigSource(args); |
78 | |||
79 | // Configure Log4Net | ||
58 | configSource.AddSwitch("Startup", "logconfig"); | 80 | configSource.AddSwitch("Startup", "logconfig"); |
59 | string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); | 81 | string logConfigFile = configSource.Configs["Startup"].GetString("logconfig", String.Empty); |
60 | if (logConfigFile != String.Empty) | 82 | if (logConfigFile != String.Empty) |
@@ -69,6 +91,8 @@ namespace OpenSim | |||
69 | m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); | 91 | m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); |
70 | } | 92 | } |
71 | 93 | ||
94 | // Check if the system is compatible with OpenSimulator. | ||
95 | // Ensures that the minimum system requirements are met | ||
72 | m_log.Info("Performing compatibility checks... "); | 96 | m_log.Info("Performing compatibility checks... "); |
73 | string supported = String.Empty; | 97 | string supported = String.Empty; |
74 | if (Util.IsEnvironmentSupported(ref supported)) | 98 | if (Util.IsEnvironmentSupported(ref supported)) |
@@ -80,6 +104,7 @@ namespace OpenSim | |||
80 | m_log.Warn("Environment is unsupported (" + supported + ")\n"); | 104 | m_log.Warn("Environment is unsupported (" + supported + ")\n"); |
81 | } | 105 | } |
82 | 106 | ||
107 | // Configure nIni aliases and localles | ||
83 | Culture.SetCurrentCulture(); | 108 | Culture.SetCurrentCulture(); |
84 | 109 | ||
85 | 110 | ||
@@ -99,8 +124,13 @@ namespace OpenSim | |||
99 | configSource.AddConfig("StandAlone"); | 124 | configSource.AddConfig("StandAlone"); |
100 | configSource.AddConfig("Network"); | 125 | configSource.AddConfig("Network"); |
101 | 126 | ||
127 | // Check if we're running in the background or not | ||
102 | bool background = configSource.Configs["Startup"].GetBoolean("background", false); | 128 | bool background = configSource.Configs["Startup"].GetBoolean("background", false); |
129 | |||
130 | // Check if we're saving crashes | ||
103 | m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); | 131 | m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); |
132 | |||
133 | // load Crash directory config | ||
104 | m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); | 134 | m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); |
105 | 135 | ||
106 | if (background) | 136 | if (background) |
@@ -118,6 +148,7 @@ namespace OpenSim | |||
118 | { | 148 | { |
119 | try | 149 | try |
120 | { | 150 | { |
151 | // Block thread here for input | ||
121 | MainConsole.Instance.Prompt(); | 152 | MainConsole.Instance.Prompt(); |
122 | } | 153 | } |
123 | catch (Exception e) | 154 | catch (Exception e) |
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 3a65242..c3e7b86 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -37,12 +37,32 @@ using OpenSim.Framework; | |||
37 | 37 | ||
38 | namespace OpenSim | 38 | namespace OpenSim |
39 | { | 39 | { |
40 | /// <summary> | ||
41 | /// Loads the Configuration files into nIni | ||
42 | /// </summary> | ||
40 | public class ConfigurationLoader | 43 | public class ConfigurationLoader |
41 | { | 44 | { |
45 | /// <summary> | ||
46 | /// Various Config settings the region needs to start | ||
47 | /// Physics Engine, Mesh Engine, GridMode, PhysicsPrim allowed, Neighbor, | ||
48 | /// StorageDLL, Storage Connection String, Estate connection String, Client Stack | ||
49 | /// Standalone settings. | ||
50 | /// </summary> | ||
42 | protected ConfigSettings m_configSettings; | 51 | protected ConfigSettings m_configSettings; |
52 | |||
53 | /// <summary> | ||
54 | /// A source of Configuration data | ||
55 | /// </summary> | ||
43 | protected OpenSimConfigSource m_config; | 56 | protected OpenSimConfigSource m_config; |
57 | |||
58 | /// <summary> | ||
59 | /// Grid Service Information. This refers to classes and addresses of the grid service | ||
60 | /// </summary> | ||
44 | protected NetworkServersInfo m_networkServersInfo; | 61 | protected NetworkServersInfo m_networkServersInfo; |
45 | 62 | ||
63 | /// <summary> | ||
64 | /// Console logger | ||
65 | /// </summary> | ||
46 | private static readonly ILog m_log = | 66 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 67 | LogManager.GetLogger( |
48 | MethodBase.GetCurrentMethod().DeclaringType); | 68 | MethodBase.GetCurrentMethod().DeclaringType); |
@@ -51,6 +71,13 @@ namespace OpenSim | |||
51 | { | 71 | { |
52 | } | 72 | } |
53 | 73 | ||
74 | /// <summary> | ||
75 | /// Loads the region configuration | ||
76 | /// </summary> | ||
77 | /// <param name="argvSource">Parameters passed into the process when started</param> | ||
78 | /// <param name="configSettings"></param> | ||
79 | /// <param name="networkInfo"></param> | ||
80 | /// <returns>A configuration that gets passed to modules</returns> | ||
54 | public OpenSimConfigSource LoadConfigSettings( | 81 | public OpenSimConfigSource LoadConfigSettings( |
55 | IConfigSource argvSource, out ConfigSettings configSettings, | 82 | IConfigSource argvSource, out ConfigSettings configSettings, |
56 | out NetworkServersInfo networkInfo) | 83 | out NetworkServersInfo networkInfo) |
@@ -169,15 +196,22 @@ namespace OpenSim | |||
169 | return m_config; | 196 | return m_config; |
170 | } | 197 | } |
171 | 198 | ||
199 | /// <summary> | ||
200 | /// Adds the included files as ini configuration files | ||
201 | /// </summary> | ||
202 | /// <param name="sources">List of URL strings or filename strings</param> | ||
172 | private void AddIncludes(List<string> sources) | 203 | private void AddIncludes(List<string> sources) |
173 | { | 204 | { |
205 | //loop over config sources | ||
174 | foreach (IConfig config in m_config.Source.Configs) | 206 | foreach (IConfig config in m_config.Source.Configs) |
175 | { | 207 | { |
208 | // Look for Include-* in the key name | ||
176 | string[] keys = config.GetKeys(); | 209 | string[] keys = config.GetKeys(); |
177 | foreach (string k in keys) | 210 | foreach (string k in keys) |
178 | { | 211 | { |
179 | if (k.StartsWith("Include-")) | 212 | if (k.StartsWith("Include-")) |
180 | { | 213 | { |
214 | // read the config file to be included. | ||
181 | string file = config.GetString(k); | 215 | string file = config.GetString(k); |
182 | if (IsUri(file)) | 216 | if (IsUri(file)) |
183 | { | 217 | { |
@@ -199,7 +233,11 @@ namespace OpenSim | |||
199 | } | 233 | } |
200 | } | 234 | } |
201 | } | 235 | } |
202 | 236 | /// <summary> | |
237 | /// Check if we can convert the string to a URI | ||
238 | /// </summary> | ||
239 | /// <param name="file">String uri to the remote resource</param> | ||
240 | /// <returns>true if we can convert the string to a Uri object</returns> | ||
203 | bool IsUri(string file) | 241 | bool IsUri(string file) |
204 | { | 242 | { |
205 | Uri configUri; | 243 | Uri configUri; |
@@ -253,7 +291,7 @@ namespace OpenSim | |||
253 | /// <summary> | 291 | /// <summary> |
254 | /// Setup a default config values in case they aren't present in the ini file | 292 | /// Setup a default config values in case they aren't present in the ini file |
255 | /// </summary> | 293 | /// </summary> |
256 | /// <returns></returns> | 294 | /// <returns>A Configuration source containing the default configuration</returns> |
257 | private static IConfigSource DefaultConfig() | 295 | private static IConfigSource DefaultConfig() |
258 | { | 296 | { |
259 | IConfigSource defaultConfig = new IniConfigSource(); | 297 | IConfigSource defaultConfig = new IniConfigSource(); |
@@ -322,6 +360,9 @@ namespace OpenSim | |||
322 | return defaultConfig; | 360 | return defaultConfig; |
323 | } | 361 | } |
324 | 362 | ||
363 | /// <summary> | ||
364 | /// Read initial region settings from the ConfigSource | ||
365 | /// </summary> | ||
325 | protected virtual void ReadConfigSettings() | 366 | protected virtual void ReadConfigSettings() |
326 | { | 367 | { |
327 | IConfig startupConfig = m_config.Source.Configs["Startup"]; | 368 | IConfig startupConfig = m_config.Source.Configs["Startup"]; |
diff --git a/OpenSim/Region/Application/IApplicationPlugin.cs b/OpenSim/Region/Application/IApplicationPlugin.cs index 1e1dae0..6e6d48c 100644 --- a/OpenSim/Region/Application/IApplicationPlugin.cs +++ b/OpenSim/Region/Application/IApplicationPlugin.cs | |||
@@ -29,12 +29,24 @@ using OpenSim.Framework; | |||
29 | 29 | ||
30 | namespace OpenSim | 30 | namespace OpenSim |
31 | { | 31 | { |
32 | /// <summary> | ||
33 | /// OpenSimulator Application Plugin framework interface | ||
34 | /// </summary> | ||
32 | public interface IApplicationPlugin : IPlugin | 35 | public interface IApplicationPlugin : IPlugin |
33 | { | 36 | { |
37 | /// <summary> | ||
38 | /// Initialize the Plugin | ||
39 | /// </summary> | ||
40 | /// <param name="openSim">The Application instance</param> | ||
34 | void Initialise(OpenSimBase openSim); | 41 | void Initialise(OpenSimBase openSim); |
42 | |||
43 | /// <summary> | ||
44 | /// Called when the application loading is completed | ||
45 | /// </summary> | ||
35 | void PostInitialise(); | 46 | void PostInitialise(); |
36 | } | 47 | } |
37 | 48 | ||
49 | |||
38 | public class ApplicationPluginInitialiser : PluginInitialiserBase | 50 | public class ApplicationPluginInitialiser : PluginInitialiserBase |
39 | { | 51 | { |
40 | private OpenSimBase server; | 52 | private OpenSimBase server; |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index aeb6f57..390cfcd 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -146,6 +146,9 @@ namespace OpenSim | |||
146 | ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); | 146 | ChangeSelectedRegion("region", new string[] {"change", "region", "root"}); |
147 | } | 147 | } |
148 | 148 | ||
149 | /// <summary> | ||
150 | /// Register standard set of region console commands | ||
151 | /// </summary> | ||
149 | private void RegisterConsoleCommands() | 152 | private void RegisterConsoleCommands() |
150 | { | 153 | { |
151 | m_console.Commands.AddCommand("region", false, "clear assets", | 154 | m_console.Commands.AddCommand("region", false, "clear assets", |
@@ -332,6 +335,11 @@ namespace OpenSim | |||
332 | base.ShutdownSpecific(); | 335 | base.ShutdownSpecific(); |
333 | } | 336 | } |
334 | 337 | ||
338 | /// <summary> | ||
339 | /// Timer to run a specific text file as console commands. Configured in in the main ini file | ||
340 | /// </summary> | ||
341 | /// <param name="sender"></param> | ||
342 | /// <param name="e"></param> | ||
335 | private void RunAutoTimerScript(object sender, EventArgs e) | 343 | private void RunAutoTimerScript(object sender, EventArgs e) |
336 | { | 344 | { |
337 | if (m_timedScript != "disabled") | 345 | if (m_timedScript != "disabled") |
@@ -342,6 +350,11 @@ namespace OpenSim | |||
342 | 350 | ||
343 | #region Console Commands | 351 | #region Console Commands |
344 | 352 | ||
353 | /// <summary> | ||
354 | /// Kicks users off the region | ||
355 | /// </summary> | ||
356 | /// <param name="module"></param> | ||
357 | /// <param name="cmdparams">name of avatar to kick</param> | ||
345 | private void KickUserCommand(string module, string[] cmdparams) | 358 | private void KickUserCommand(string module, string[] cmdparams) |
346 | { | 359 | { |
347 | if (cmdparams.Length < 4) | 360 | if (cmdparams.Length < 4) |
@@ -401,6 +414,10 @@ namespace OpenSim | |||
401 | } | 414 | } |
402 | } | 415 | } |
403 | 416 | ||
417 | /// <summary> | ||
418 | /// Opens a file and uses it as input to the console command parser. | ||
419 | /// </summary> | ||
420 | /// <param name="fileName">name of file to use as input to the console</param> | ||
404 | private static void PrintFileToConsole(string fileName) | 421 | private static void PrintFileToConsole(string fileName) |
405 | { | 422 | { |
406 | if (File.Exists(fileName)) | 423 | if (File.Exists(fileName)) |
@@ -419,12 +436,22 @@ namespace OpenSim | |||
419 | m_log.Info("Not implemented."); | 436 | m_log.Info("Not implemented."); |
420 | } | 437 | } |
421 | 438 | ||
439 | /// <summary> | ||
440 | /// Force resending of all updates to all clients in active region(s) | ||
441 | /// </summary> | ||
442 | /// <param name="module"></param> | ||
443 | /// <param name="args"></param> | ||
422 | private void HandleForceUpdate(string module, string[] args) | 444 | private void HandleForceUpdate(string module, string[] args) |
423 | { | 445 | { |
424 | m_log.Info("Updating all clients"); | 446 | m_log.Info("Updating all clients"); |
425 | m_sceneManager.ForceCurrentSceneClientUpdate(); | 447 | m_sceneManager.ForceCurrentSceneClientUpdate(); |
426 | } | 448 | } |
427 | 449 | ||
450 | /// <summary> | ||
451 | /// Edits the scale of a primative with the name specified | ||
452 | /// </summary> | ||
453 | /// <param name="module"></param> | ||
454 | /// <param name="args">0,1, name, x, y, z</param> | ||
428 | private void HandleEditScale(string module, string[] args) | 455 | private void HandleEditScale(string module, string[] args) |
429 | { | 456 | { |
430 | if (args.Length == 6) | 457 | if (args.Length == 6) |
@@ -437,6 +464,11 @@ namespace OpenSim | |||
437 | } | 464 | } |
438 | } | 465 | } |
439 | 466 | ||
467 | /// <summary> | ||
468 | /// Creates a new region based on the parameters specified. This will ask the user questions on the console | ||
469 | /// </summary> | ||
470 | /// <param name="module"></param> | ||
471 | /// <param name="cmd">0,1,region name, region XML file</param> | ||
440 | private void HandleCreateRegion(string module, string[] cmd) | 472 | private void HandleCreateRegion(string module, string[] cmd) |
441 | { | 473 | { |
442 | if (cmd.Length < 4) | 474 | if (cmd.Length < 4) |
@@ -473,16 +505,32 @@ namespace OpenSim | |||
473 | } | 505 | } |
474 | } | 506 | } |
475 | 507 | ||
508 | /// <summary> | ||
509 | /// Enable logins | ||
510 | /// </summary> | ||
511 | /// <param name="module"></param> | ||
512 | /// <param name="cmd"></param> | ||
476 | private void HandleLoginEnable(string module, string[] cmd) | 513 | private void HandleLoginEnable(string module, string[] cmd) |
477 | { | 514 | { |
478 | ProcessLogin(true); | 515 | ProcessLogin(true); |
479 | } | 516 | } |
480 | 517 | ||
518 | |||
519 | /// <summary> | ||
520 | /// Disable logins | ||
521 | /// </summary> | ||
522 | /// <param name="module"></param> | ||
523 | /// <param name="cmd"></param> | ||
481 | private void HandleLoginDisable(string module, string[] cmd) | 524 | private void HandleLoginDisable(string module, string[] cmd) |
482 | { | 525 | { |
483 | ProcessLogin(false); | 526 | ProcessLogin(false); |
484 | } | 527 | } |
485 | 528 | ||
529 | /// <summary> | ||
530 | /// Log login status to the console | ||
531 | /// </summary> | ||
532 | /// <param name="module"></param> | ||
533 | /// <param name="cmd"></param> | ||
486 | private void HandleLoginStatus(string module, string[] cmd) | 534 | private void HandleLoginStatus(string module, string[] cmd) |
487 | { | 535 | { |
488 | if (m_commsManager.GridService.RegionLoginsEnabled == false) | 536 | if (m_commsManager.GridService.RegionLoginsEnabled == false) |
@@ -492,6 +540,12 @@ namespace OpenSim | |||
492 | m_log.Info("[ Login ] Login are enabled"); | 540 | m_log.Info("[ Login ] Login are enabled"); |
493 | } | 541 | } |
494 | 542 | ||
543 | |||
544 | /// <summary> | ||
545 | /// Change and load configuration file data. | ||
546 | /// </summary> | ||
547 | /// <param name="module"></param> | ||
548 | /// <param name="cmd"></param> | ||
495 | private void HandleConfig(string module, string[] cmd) | 549 | private void HandleConfig(string module, string[] cmd) |
496 | { | 550 | { |
497 | List<string> args = new List<string>(cmd); | 551 | List<string> args = new List<string>(cmd); |
@@ -557,6 +611,12 @@ namespace OpenSim | |||
557 | } | 611 | } |
558 | } | 612 | } |
559 | 613 | ||
614 | |||
615 | /// <summary> | ||
616 | /// Load, Unload, and list Region modules in use | ||
617 | /// </summary> | ||
618 | /// <param name="module"></param> | ||
619 | /// <param name="cmd"></param> | ||
560 | private void HandleModules(string module, string[] cmd) | 620 | private void HandleModules(string module, string[] cmd) |
561 | { | 621 | { |
562 | List<string> args = new List<string>(cmd); | 622 | List<string> args = new List<string>(cmd); |
@@ -797,6 +857,11 @@ namespace OpenSim | |||
797 | } | 857 | } |
798 | 858 | ||
799 | // see BaseOpenSimServer | 859 | // see BaseOpenSimServer |
860 | /// <summary> | ||
861 | /// Many commands list objects for debugging. Some of the types are listed here | ||
862 | /// </summary> | ||
863 | /// <param name="mod"></param> | ||
864 | /// <param name="cmd"></param> | ||
800 | public override void HandleShow(string mod, string[] cmd) | 865 | public override void HandleShow(string mod, string[] cmd) |
801 | { | 866 | { |
802 | base.HandleShow(mod, cmd); | 867 | base.HandleShow(mod, cmd); |
@@ -902,6 +967,10 @@ namespace OpenSim | |||
902 | } | 967 | } |
903 | } | 968 | } |
904 | 969 | ||
970 | /// <summary> | ||
971 | /// print UDP Queue data for each client | ||
972 | /// </summary> | ||
973 | /// <returns></returns> | ||
905 | private string GetQueuesReport() | 974 | private string GetQueuesReport() |
906 | { | 975 | { |
907 | string report = String.Empty; | 976 | string report = String.Empty; |
@@ -1010,6 +1079,11 @@ namespace OpenSim | |||
1010 | m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword); | 1079 | m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword); |
1011 | } | 1080 | } |
1012 | 1081 | ||
1082 | /// <summary> | ||
1083 | /// Use XML2 format to serialize data to a file | ||
1084 | /// </summary> | ||
1085 | /// <param name="module"></param> | ||
1086 | /// <param name="cmdparams"></param> | ||
1013 | protected void SavePrimsXml2(string module, string[] cmdparams) | 1087 | protected void SavePrimsXml2(string module, string[] cmdparams) |
1014 | { | 1088 | { |
1015 | if (cmdparams.Length > 5) | 1089 | if (cmdparams.Length > 5) |
@@ -1022,6 +1096,11 @@ namespace OpenSim | |||
1022 | } | 1096 | } |
1023 | } | 1097 | } |
1024 | 1098 | ||
1099 | /// <summary> | ||
1100 | /// Use XML format to serialize data to a file | ||
1101 | /// </summary> | ||
1102 | /// <param name="module"></param> | ||
1103 | /// <param name="cmdparams"></param> | ||
1025 | protected void SaveXml(string module, string[] cmdparams) | 1104 | protected void SaveXml(string module, string[] cmdparams) |
1026 | { | 1105 | { |
1027 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); | 1106 | m_log.Error("[CONSOLE]: PLEASE NOTE, save-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use save-xml2, please file a mantis detailing the reason."); |
@@ -1036,6 +1115,11 @@ namespace OpenSim | |||
1036 | } | 1115 | } |
1037 | } | 1116 | } |
1038 | 1117 | ||
1118 | /// <summary> | ||
1119 | /// Loads data and region objects from XML format. | ||
1120 | /// </summary> | ||
1121 | /// <param name="module"></param> | ||
1122 | /// <param name="cmdparams"></param> | ||
1039 | protected void LoadXml(string module, string[] cmdparams) | 1123 | protected void LoadXml(string module, string[] cmdparams) |
1040 | { | 1124 | { |
1041 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); | 1125 | m_log.Error("[CONSOLE]: PLEASE NOTE, load-xml is DEPRECATED and may be REMOVED soon. If you are using this and there is some reason you can't use load-xml2, please file a mantis detailing the reason."); |
@@ -1079,7 +1163,11 @@ namespace OpenSim | |||
1079 | } | 1163 | } |
1080 | } | 1164 | } |
1081 | } | 1165 | } |
1082 | 1166 | /// <summary> | |
1167 | /// Serialize region data to XML2Format | ||
1168 | /// </summary> | ||
1169 | /// <param name="module"></param> | ||
1170 | /// <param name="cmdparams"></param> | ||
1083 | protected void SaveXml2(string module, string[] cmdparams) | 1171 | protected void SaveXml2(string module, string[] cmdparams) |
1084 | { | 1172 | { |
1085 | if (cmdparams.Length > 2) | 1173 | if (cmdparams.Length > 2) |
@@ -1092,6 +1180,11 @@ namespace OpenSim | |||
1092 | } | 1180 | } |
1093 | } | 1181 | } |
1094 | 1182 | ||
1183 | /// <summary> | ||
1184 | /// Load region data from Xml2Format | ||
1185 | /// </summary> | ||
1186 | /// <param name="module"></param> | ||
1187 | /// <param name="cmdparams"></param> | ||
1095 | protected void LoadXml2(string module, string[] cmdparams) | 1188 | protected void LoadXml2(string module, string[] cmdparams) |
1096 | { | 1189 | { |
1097 | if (cmdparams.Length > 2) | 1190 | if (cmdparams.Length > 2) |
diff --git a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs index 99a4057..381070e 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGCommunicationsGridMode.cs | |||
@@ -40,9 +40,6 @@ namespace OpenSim.Region.Communications.Hypergrid | |||
40 | { | 40 | { |
41 | public class HGCommunicationsGridMode : CommunicationsManager // CommunicationsOGS1 | 41 | public class HGCommunicationsGridMode : CommunicationsManager // CommunicationsOGS1 |
42 | { | 42 | { |
43 | private static readonly ILog m_log | ||
44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
46 | IHyperlink m_osw = null; | 43 | IHyperlink m_osw = null; |
47 | public IHyperlink HGServices | 44 | public IHyperlink HGServices |
48 | { | 45 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 28b4d64..470a386 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
74 | /// <summary> | 74 | /// <summary> |
75 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). | 75 | /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). |
76 | /// </summary> | 76 | /// </summary> |
77 | //[Test] | 77 | [Test] |
78 | public void TestSaveIarV0_1() | 78 | public void TestSaveIarV0_1() |
79 | { | 79 | { |
80 | TestHelper.InMethod(); | 80 | TestHelper.InMethod(); |
@@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
82 | 82 | ||
83 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 83 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
84 | 84 | ||
85 | Scene scene = SceneSetupHelpers.SetupScene(""); | 85 | Scene scene = SceneSetupHelpers.SetupScene("Inventory"); |
86 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule); | 86 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule); |
87 | CommunicationsManager cm = scene.CommsManager; | 87 | CommunicationsManager cm = scene.CommsManager; |
88 | 88 | ||
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
222 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 222 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
223 | /// an account exists with the creator name. | 223 | /// an account exists with the creator name. |
224 | /// </summary> | 224 | /// </summary> |
225 | //[Test] | 225 | [Test] |
226 | public void TestLoadIarV0_1ExistingUsers() | 226 | public void TestLoadIarV0_1ExistingUsers() |
227 | { | 227 | { |
228 | TestHelper.InMethod(); | 228 | TestHelper.InMethod(); |
@@ -262,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
262 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); | 262 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(); |
263 | 263 | ||
264 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 264 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene |
265 | Scene scene = SceneSetupHelpers.SetupScene(); | 265 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); |
266 | IUserAdminService userAdminService = scene.CommsManager.UserAdminService; | 266 | IUserAdminService userAdminService = scene.CommsManager.UserAdminService; |
267 | 267 | ||
268 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 268 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
@@ -276,16 +276,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
276 | 276 | ||
277 | CachedUserInfo userInfo | 277 | CachedUserInfo userInfo |
278 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | 278 | = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); |
279 | //userInfo.FetchInventory(); | 279 | |
280 | /* | ||
281 | for (int i = 0 ; i < 50 ; i++) | ||
282 | { | ||
283 | if (userInfo.HasReceivedInventory == true) | ||
284 | break; | ||
285 | Thread.Sleep(200); | ||
286 | } | ||
287 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); | ||
288 | */ | ||
289 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); | 280 | InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); |
290 | Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); | 281 | Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); |
291 | Assert.That( | 282 | Assert.That( |
@@ -395,17 +386,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
395 | userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager, InventoryReceived); | 386 | userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager, InventoryReceived); |
396 | Monitor.Wait(this, 60000); | 387 | Monitor.Wait(this, 60000); |
397 | } | 388 | } |
398 | |||
399 | //userInfo.FetchInventory(); | ||
400 | /* | ||
401 | for (int i = 0 ; i < 50 ; i++) | ||
402 | { | ||
403 | if (userInfo.HasReceivedInventory == true) | ||
404 | break; | ||
405 | Thread.Sleep(200); | ||
406 | } | ||
407 | Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); | ||
408 | */ | ||
409 | 389 | ||
410 | Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); | 390 | Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); |
411 | 391 | ||
@@ -429,22 +409,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
429 | 409 | ||
430 | Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); | 410 | Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); |
431 | 411 | ||
432 | try | 412 | new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) |
433 | { | 413 | .ReplicateArchivePathToUserInventory( |
434 | new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) | 414 | itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); |
435 | .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); | 415 | |
436 | 416 | Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); | |
437 | Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); | 417 | InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); |
438 | InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); | 418 | Assert.That(folder1, Is.Not.Null, "Could not find folder a"); |
439 | Assert.That(folder1, Is.Not.Null, "Could not find folder a"); | 419 | InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); |
440 | InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); | 420 | Assert.That(folder2, Is.Not.Null, "Could not find folder b"); |
441 | Assert.That(folder2, Is.Not.Null, "Could not find folder b"); | ||
442 | } | ||
443 | catch (NullReferenceException e) | ||
444 | { | ||
445 | // Non fatal for now until we resolve the race condition | ||
446 | Console.WriteLine("Test failed with {0}", e); | ||
447 | } | ||
448 | } | 421 | } |
449 | } | 422 | } |
450 | } | 423 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs index d3324e4..0f58788 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Globalization; | 30 | using System.Globalization; |
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using log4net; | 32 | using log4net; |
@@ -41,6 +42,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles | |||
41 | { | 42 | { |
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
43 | private Scene m_scene; | 44 | private Scene m_scene; |
45 | private IProfileModule m_profileModule = null; | ||
44 | 46 | ||
45 | public AvatarProfilesModule() | 47 | public AvatarProfilesModule() |
46 | { | 48 | { |
@@ -56,6 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles | |||
56 | 58 | ||
57 | public void PostInitialise() | 59 | public void PostInitialise() |
58 | { | 60 | { |
61 | m_profileModule = m_scene.RequestModuleInterface<IProfileModule>(); | ||
59 | } | 62 | } |
60 | 63 | ||
61 | public void Close() | 64 | public void Close() |
@@ -108,6 +111,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles | |||
108 | charterMember = Utils.StringToBytes(profile.CustomType); | 111 | charterMember = Utils.StringToBytes(profile.CustomType); |
109 | } | 112 | } |
110 | 113 | ||
114 | if (m_profileModule != null) | ||
115 | { | ||
116 | Hashtable profileData = m_profileModule.GetProfileData(remoteClient.AgentId); | ||
117 | if (profileData["ProfileUrl"] != null) | ||
118 | profile.ProfileUrl = profileData["ProfileUrl"].ToString(); | ||
119 | } | ||
111 | remoteClient.SendAvatarProperties(profile.ID, profile.AboutText, | 120 | remoteClient.SendAvatarProperties(profile.ID, profile.AboutText, |
112 | Util.ToDateTime(profile.Created).ToString("M/d/yyyy", CultureInfo.InvariantCulture), | 121 | Util.ToDateTime(profile.Created).ToString("M/d/yyyy", CultureInfo.InvariantCulture), |
113 | charterMember, profile.FirstLifeAboutText, (uint)(profile.UserFlags & 0xff), | 122 | charterMember, profile.FirstLifeAboutText, (uint)(profile.UserFlags & 0xff), |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs new file mode 100644 index 0000000..375faf5 --- /dev/null +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -0,0 +1,206 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | |||
31 | using OpenMetaverse; | ||
32 | using Nini.Config; | ||
33 | using log4net; | ||
34 | |||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | |||
38 | |||
39 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | ||
40 | { | ||
41 | public abstract class BaseInventoryConnector : IInventoryService | ||
42 | { | ||
43 | protected InventoryCache m_cache; | ||
44 | |||
45 | protected virtual void Init(IConfigSource source) | ||
46 | { | ||
47 | m_cache = new InventoryCache(); | ||
48 | m_cache.Init(source, this); | ||
49 | } | ||
50 | |||
51 | /// <summary> | ||
52 | /// Create the entire inventory for a given user | ||
53 | /// </summary> | ||
54 | /// <param name="user"></param> | ||
55 | /// <returns></returns> | ||
56 | public abstract bool CreateUserInventory(UUID user); | ||
57 | |||
58 | /// <summary> | ||
59 | /// Gets the skeleton of the inventory -- folders only | ||
60 | /// </summary> | ||
61 | /// <param name="userId"></param> | ||
62 | /// <returns></returns> | ||
63 | public abstract List<InventoryFolderBase> GetInventorySkeleton(UUID userId); | ||
64 | |||
65 | /// <summary> | ||
66 | /// Synchronous inventory fetch. | ||
67 | /// </summary> | ||
68 | /// <param name="userID"></param> | ||
69 | /// <returns></returns> | ||
70 | public abstract InventoryCollection GetUserInventory(UUID userID); | ||
71 | |||
72 | /// <summary> | ||
73 | /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the | ||
74 | /// inventory has been received | ||
75 | /// </summary> | ||
76 | /// <param name="userID"></param> | ||
77 | /// <param name="callback"></param> | ||
78 | public abstract void GetUserInventory(UUID userID, InventoryReceiptCallback callback); | ||
79 | |||
80 | /// <summary> | ||
81 | /// Retrieve the root inventory folder for the given user. | ||
82 | /// </summary> | ||
83 | /// <param name="userID"></param> | ||
84 | /// <returns>null if no root folder was found</returns> | ||
85 | public abstract InventoryFolderBase GetRootFolder(UUID userID); | ||
86 | |||
87 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); | ||
88 | |||
89 | /// <summary> | ||
90 | /// Gets the user folder for the given folder-type | ||
91 | /// </summary> | ||
92 | /// <param name="userID"></param> | ||
93 | /// <param name="type"></param> | ||
94 | /// <returns></returns> | ||
95 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | ||
96 | { | ||
97 | return m_cache.GetFolderForType(userID, type); | ||
98 | } | ||
99 | |||
100 | /// <summary> | ||
101 | /// Gets everything (folders and items) inside a folder | ||
102 | /// </summary> | ||
103 | /// <param name="userId"></param> | ||
104 | /// <param name="folderID"></param> | ||
105 | /// <returns></returns> | ||
106 | public abstract InventoryCollection GetFolderContent(UUID userID, UUID folderID); | ||
107 | |||
108 | /// <summary> | ||
109 | /// Gets the items inside a folder | ||
110 | /// </summary> | ||
111 | /// <param name="userID"></param> | ||
112 | /// <param name="folderID"></param> | ||
113 | /// <returns></returns> | ||
114 | public abstract List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID); | ||
115 | |||
116 | /// <summary> | ||
117 | /// Add a new folder to the user's inventory | ||
118 | /// </summary> | ||
119 | /// <param name="folder"></param> | ||
120 | /// <returns>true if the folder was successfully added</returns> | ||
121 | public abstract bool AddFolder(InventoryFolderBase folder); | ||
122 | |||
123 | /// <summary> | ||
124 | /// Update a folder in the user's inventory | ||
125 | /// </summary> | ||
126 | /// <param name="folder"></param> | ||
127 | /// <returns>true if the folder was successfully updated</returns> | ||
128 | public abstract bool UpdateFolder(InventoryFolderBase folder); | ||
129 | |||
130 | /// <summary> | ||
131 | /// Move an inventory folder to a new location | ||
132 | /// </summary> | ||
133 | /// <param name="folder">A folder containing the details of the new location</param> | ||
134 | /// <returns>true if the folder was successfully moved</returns> | ||
135 | public abstract bool MoveFolder(InventoryFolderBase folder); | ||
136 | |||
137 | /// <summary> | ||
138 | /// Purge an inventory folder of all its items and subfolders. | ||
139 | /// </summary> | ||
140 | /// <param name="folder"></param> | ||
141 | /// <returns>true if the folder was successfully purged</returns> | ||
142 | public abstract bool PurgeFolder(InventoryFolderBase folder); | ||
143 | |||
144 | /// <summary> | ||
145 | /// Add a new item to the user's inventory. | ||
146 | /// If the given item has to parent folder, it tries to find the most | ||
147 | /// suitable folder for it. | ||
148 | /// </summary> | ||
149 | /// <param name="item"></param> | ||
150 | /// <returns>true if the item was successfully added</returns> | ||
151 | public bool AddItem(InventoryItemBase item) | ||
152 | { | ||
153 | if (item.Folder == UUID.Zero) | ||
154 | { | ||
155 | InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType); | ||
156 | if (f != null) | ||
157 | item.Folder = f.ID; | ||
158 | else | ||
159 | { | ||
160 | f = GetRootFolder(item.Owner); | ||
161 | if (f != null) | ||
162 | item.Folder = f.ID; | ||
163 | else | ||
164 | return false; | ||
165 | } | ||
166 | } | ||
167 | |||
168 | return AddItemPlain(item); | ||
169 | } | ||
170 | |||
171 | protected abstract bool AddItemPlain(InventoryItemBase item); | ||
172 | |||
173 | /// <summary> | ||
174 | /// Update an item in the user's inventory | ||
175 | /// </summary> | ||
176 | /// <param name="item"></param> | ||
177 | /// <returns>true if the item was successfully updated</returns> | ||
178 | public abstract bool UpdateItem(InventoryItemBase item); | ||
179 | |||
180 | /// <summary> | ||
181 | /// Delete an item from the user's inventory | ||
182 | /// </summary> | ||
183 | /// <param name="item"></param> | ||
184 | /// <returns>true if the item was successfully deleted</returns> | ||
185 | public abstract bool DeleteItem(InventoryItemBase item); | ||
186 | |||
187 | public abstract InventoryItemBase QueryItem(InventoryItemBase item); | ||
188 | |||
189 | public abstract InventoryFolderBase QueryFolder(InventoryFolderBase folder); | ||
190 | |||
191 | /// <summary> | ||
192 | /// Does the given user have an inventory structure? | ||
193 | /// </summary> | ||
194 | /// <param name="userID"></param> | ||
195 | /// <returns></returns> | ||
196 | public abstract bool HasInventoryForUser(UUID userID); | ||
197 | |||
198 | /// <summary> | ||
199 | /// Get the active gestures of the agent. | ||
200 | /// </summary> | ||
201 | /// <param name="userId"></param> | ||
202 | /// <returns></returns> | ||
203 | public abstract List<InventoryItemBase> GetActiveGestures(UUID userId); | ||
204 | |||
205 | } | ||
206 | } | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index d4168fe..62b9bed 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | 41 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
43 | { | 43 | { |
44 | public class HGInventoryBroker : InventoryCache, ISharedRegionModule, IInventoryService | 44 | public class HGInventoryBroker : BaseInventoryConnector, ISharedRegionModule, IInventoryService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -138,7 +138,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | public override void AddRegion(Scene scene) | 141 | public void AddRegion(Scene scene) |
142 | { | 142 | { |
143 | if (!m_Enabled) | 143 | if (!m_Enabled) |
144 | return; | 144 | return; |
@@ -156,12 +156,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
156 | } | 156 | } |
157 | 157 | ||
158 | scene.RegisterModuleInterface<IInventoryService>(this); | 158 | scene.RegisterModuleInterface<IInventoryService>(this); |
159 | base.AddRegion(scene); | 159 | m_cache.AddRegion(scene); |
160 | } | 160 | } |
161 | 161 | ||
162 | public override void RemoveRegion(Scene scene) | 162 | public void RemoveRegion(Scene scene) |
163 | { | 163 | { |
164 | base.RemoveRegion(scene); | 164 | if (!m_Enabled) |
165 | return; | ||
166 | |||
167 | m_cache.RemoveRegion(scene); | ||
165 | } | 168 | } |
166 | 169 | ||
167 | public void RegionLoaded(Scene scene) | 170 | public void RegionLoaded(Scene scene) |
@@ -175,17 +178,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
175 | 178 | ||
176 | #region IInventoryService | 179 | #region IInventoryService |
177 | 180 | ||
178 | public bool CreateUserInventory(UUID userID) | 181 | public override bool CreateUserInventory(UUID userID) |
179 | { | 182 | { |
180 | return m_GridService.CreateUserInventory(userID); | 183 | return m_GridService.CreateUserInventory(userID); |
181 | } | 184 | } |
182 | 185 | ||
183 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | 186 | public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId) |
184 | { | 187 | { |
185 | return m_GridService.GetInventorySkeleton(userId); | 188 | return m_GridService.GetInventorySkeleton(userId); |
186 | } | 189 | } |
187 | 190 | ||
188 | public InventoryCollection GetUserInventory(UUID userID) | 191 | public override InventoryCollection GetUserInventory(UUID userID) |
189 | { | 192 | { |
190 | if (IsLocalGridUser(userID)) | 193 | if (IsLocalGridUser(userID)) |
191 | return m_GridService.GetUserInventory(userID); | 194 | return m_GridService.GetUserInventory(userID); |
@@ -193,7 +196,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
193 | return null; | 196 | return null; |
194 | } | 197 | } |
195 | 198 | ||
196 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | 199 | public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) |
197 | { | 200 | { |
198 | if (IsLocalGridUser(userID)) | 201 | if (IsLocalGridUser(userID)) |
199 | m_GridService.GetUserInventory(userID, callback); | 202 | m_GridService.GetUserInventory(userID, callback); |
@@ -220,7 +223,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
220 | // } | 223 | // } |
221 | //} | 224 | //} |
222 | 225 | ||
223 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 226 | public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
224 | { | 227 | { |
225 | if (IsLocalGridUser(userID)) | 228 | if (IsLocalGridUser(userID)) |
226 | return m_GridService.GetFolderContent(userID, folderID); | 229 | return m_GridService.GetFolderContent(userID, folderID); |
@@ -271,12 +274,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
271 | return new Dictionary<AssetType, InventoryFolderBase>(); | 274 | return new Dictionary<AssetType, InventoryFolderBase>(); |
272 | } | 275 | } |
273 | 276 | ||
274 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 277 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
275 | { | 278 | { |
276 | return new List<InventoryItemBase>(); | 279 | return new List<InventoryItemBase>(); |
277 | } | 280 | } |
278 | 281 | ||
279 | public bool AddFolder(InventoryFolderBase folder) | 282 | public override bool AddFolder(InventoryFolderBase folder) |
280 | { | 283 | { |
281 | if (folder == null) | 284 | if (folder == null) |
282 | return false; | 285 | return false; |
@@ -291,7 +294,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
291 | } | 294 | } |
292 | } | 295 | } |
293 | 296 | ||
294 | public bool UpdateFolder(InventoryFolderBase folder) | 297 | public override bool UpdateFolder(InventoryFolderBase folder) |
295 | { | 298 | { |
296 | if (folder == null) | 299 | if (folder == null) |
297 | return false; | 300 | return false; |
@@ -306,7 +309,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
306 | } | 309 | } |
307 | } | 310 | } |
308 | 311 | ||
309 | public bool MoveFolder(InventoryFolderBase folder) | 312 | public override bool MoveFolder(InventoryFolderBase folder) |
310 | { | 313 | { |
311 | if (folder == null) | 314 | if (folder == null) |
312 | return false; | 315 | return false; |
@@ -321,7 +324,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
321 | } | 324 | } |
322 | } | 325 | } |
323 | 326 | ||
324 | public bool PurgeFolder(InventoryFolderBase folder) | 327 | public override bool PurgeFolder(InventoryFolderBase folder) |
325 | { | 328 | { |
326 | if (folder == null) | 329 | if (folder == null) |
327 | return false; | 330 | return false; |
@@ -336,7 +339,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
336 | } | 339 | } |
337 | } | 340 | } |
338 | 341 | ||
339 | public bool AddItem(InventoryItemBase item) | 342 | // public bool AddItem(InventoryItemBase item) inherited |
343 | // Uses AddItemPlain | ||
344 | |||
345 | protected override bool AddItemPlain(InventoryItemBase item) | ||
340 | { | 346 | { |
341 | if (item == null) | 347 | if (item == null) |
342 | return false; | 348 | return false; |
@@ -351,7 +357,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
351 | } | 357 | } |
352 | } | 358 | } |
353 | 359 | ||
354 | public bool UpdateItem(InventoryItemBase item) | 360 | public override bool UpdateItem(InventoryItemBase item) |
355 | { | 361 | { |
356 | if (item == null) | 362 | if (item == null) |
357 | return false; | 363 | return false; |
@@ -366,7 +372,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
366 | } | 372 | } |
367 | } | 373 | } |
368 | 374 | ||
369 | public bool DeleteItem(InventoryItemBase item) | 375 | public override bool DeleteItem(InventoryItemBase item) |
370 | { | 376 | { |
371 | if (item == null) | 377 | if (item == null) |
372 | return false; | 378 | return false; |
@@ -381,7 +387,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
381 | } | 387 | } |
382 | } | 388 | } |
383 | 389 | ||
384 | public InventoryItemBase QueryItem(InventoryItemBase item) | 390 | public override InventoryItemBase QueryItem(InventoryItemBase item) |
385 | { | 391 | { |
386 | if (item == null) | 392 | if (item == null) |
387 | return null; | 393 | return null; |
@@ -396,7 +402,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
396 | } | 402 | } |
397 | } | 403 | } |
398 | 404 | ||
399 | public InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 405 | public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) |
400 | { | 406 | { |
401 | if (folder == null) | 407 | if (folder == null) |
402 | return null; | 408 | return null; |
@@ -411,17 +417,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
411 | } | 417 | } |
412 | } | 418 | } |
413 | 419 | ||
414 | public bool HasInventoryForUser(UUID userID) | 420 | public override bool HasInventoryForUser(UUID userID) |
415 | { | 421 | { |
416 | return false; | 422 | return false; |
417 | } | 423 | } |
418 | 424 | ||
419 | public InventoryFolderBase GetRootFolder(UUID userID) | 425 | public override InventoryFolderBase GetRootFolder(UUID userID) |
420 | { | 426 | { |
421 | return null; | 427 | return null; |
422 | } | 428 | } |
423 | 429 | ||
424 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | 430 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
425 | { | 431 | { |
426 | return new List<InventoryItemBase>(); | 432 | return new List<InventoryItemBase>(); |
427 | } | 433 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index b4785f4..c16e92e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Reflection; | 30 | using System.Reflection; |
4 | 31 | ||
@@ -12,21 +39,23 @@ using log4net; | |||
12 | 39 | ||
13 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
14 | { | 41 | { |
15 | public abstract class InventoryCache | 42 | public class InventoryCache |
16 | { | 43 | { |
17 | private static readonly ILog m_log = | 44 | private static readonly ILog m_log = |
18 | LogManager.GetLogger( | 45 | LogManager.GetLogger( |
19 | MethodBase.GetCurrentMethod().DeclaringType); | 46 | MethodBase.GetCurrentMethod().DeclaringType); |
20 | 47 | ||
48 | protected BaseInventoryConnector m_Connector; | ||
21 | protected List<Scene> m_Scenes; | 49 | protected List<Scene> m_Scenes; |
22 | 50 | ||
23 | // The cache proper | 51 | // The cache proper |
24 | protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache; | 52 | protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache; |
25 | 53 | ||
26 | protected virtual void Init(IConfigSource source) | 54 | public virtual void Init(IConfigSource source, BaseInventoryConnector connector) |
27 | { | 55 | { |
28 | m_Scenes = new List<Scene>(); | 56 | m_Scenes = new List<Scene>(); |
29 | m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>(); | 57 | m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>(); |
58 | m_Connector = connector; | ||
30 | } | 59 | } |
31 | 60 | ||
32 | public virtual void AddRegion(Scene scene) | 61 | public virtual void AddRegion(Scene scene) |
@@ -59,9 +88,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
59 | } | 88 | } |
60 | 89 | ||
61 | // If not, go get them and place them in the cache | 90 | // If not, go get them and place them in the cache |
62 | Dictionary<AssetType, InventoryFolderBase> folders = GetSystemFolders(presence.UUID); | 91 | Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(presence.UUID); |
63 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, fetched system folders for {0} {1}: count {2}", | 92 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}", |
64 | presence.Firstname, presence.Lastname, folders.Count); | 93 | presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count); |
65 | if (folders.Count > 0) | 94 | if (folders.Count > 0) |
66 | lock (m_InventoryCache) | 95 | lock (m_InventoryCache) |
67 | m_InventoryCache.Add(presence.UUID, folders); | 96 | m_InventoryCache.Add(presence.UUID, folders); |
@@ -69,28 +98,32 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
69 | 98 | ||
70 | void OnClientClosed(UUID clientID, Scene scene) | 99 | void OnClientClosed(UUID clientID, Scene scene) |
71 | { | 100 | { |
72 | ScenePresence sp = null; | 101 | if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache |
73 | foreach (Scene s in m_Scenes) | ||
74 | { | 102 | { |
75 | s.TryGetAvatar(clientID, out sp); | 103 | ScenePresence sp = null; |
76 | if ((sp != null) && !sp.IsChildAgent) | 104 | foreach (Scene s in m_Scenes) |
77 | { | 105 | { |
78 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache", | 106 | s.TryGetAvatar(clientID, out sp); |
79 | scene.RegionInfo.RegionName, clientID); | 107 | if ((sp != null) && !sp.IsChildAgent && (s != scene)) |
80 | return; | 108 | { |
109 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache", | ||
110 | scene.RegionInfo.RegionName, clientID); | ||
111 | return; | ||
112 | } | ||
81 | } | 113 | } |
82 | } | ||
83 | 114 | ||
84 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders", | 115 | // Drop system folders |
85 | scene.RegionInfo.RegionName, clientID); | 116 | lock (m_InventoryCache) |
86 | // Drop system folders | 117 | if (m_InventoryCache.ContainsKey(clientID)) |
87 | lock (m_InventoryCache) | 118 | { |
88 | if (m_InventoryCache.ContainsKey(clientID)) | 119 | m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders", |
89 | m_InventoryCache.Remove(clientID); | 120 | scene.RegionInfo.RegionName, clientID); |
90 | 121 | ||
122 | m_InventoryCache.Remove(clientID); | ||
123 | } | ||
124 | } | ||
91 | } | 125 | } |
92 | 126 | ||
93 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); | ||
94 | 127 | ||
95 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 128 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) |
96 | { | 129 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 98e30ce..6efe903 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | 41 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
43 | { | 43 | { |
44 | public class LocalInventoryServicesConnector : InventoryCache, ISharedRegionModule, IInventoryService | 44 | public class LocalInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
124 | { | 124 | { |
125 | } | 125 | } |
126 | 126 | ||
127 | public override void AddRegion(Scene scene) | 127 | public void AddRegion(Scene scene) |
128 | { | 128 | { |
129 | if (!m_Enabled) | 129 | if (!m_Enabled) |
130 | return; | 130 | return; |
@@ -141,12 +141,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
141 | // "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); | 141 | // "[INVENTORY CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName); |
142 | 142 | ||
143 | scene.RegisterModuleInterface<IInventoryService>(this); | 143 | scene.RegisterModuleInterface<IInventoryService>(this); |
144 | base.AddRegion(scene); | 144 | m_cache.AddRegion(scene); |
145 | } | 145 | } |
146 | 146 | ||
147 | public override void RemoveRegion(Scene scene) | 147 | public void RemoveRegion(Scene scene) |
148 | { | 148 | { |
149 | base.RemoveRegion(scene); | 149 | if (!m_Enabled) |
150 | return; | ||
151 | |||
152 | m_cache.RemoveRegion(scene); | ||
150 | } | 153 | } |
151 | 154 | ||
152 | public void RegionLoaded(Scene scene) | 155 | public void RegionLoaded(Scene scene) |
@@ -160,22 +163,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
160 | 163 | ||
161 | #region IInventoryService | 164 | #region IInventoryService |
162 | 165 | ||
163 | public bool CreateUserInventory(UUID user) | 166 | public override bool CreateUserInventory(UUID user) |
164 | { | 167 | { |
165 | return m_InventoryService.CreateUserInventory(user); | 168 | return m_InventoryService.CreateUserInventory(user); |
166 | } | 169 | } |
167 | 170 | ||
168 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | 171 | public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId) |
169 | { | 172 | { |
170 | return m_InventoryService.GetInventorySkeleton(userId); | 173 | return m_InventoryService.GetInventorySkeleton(userId); |
171 | } | 174 | } |
172 | 175 | ||
173 | public InventoryCollection GetUserInventory(UUID id) | 176 | public override InventoryCollection GetUserInventory(UUID id) |
174 | { | 177 | { |
175 | return m_InventoryService.GetUserInventory(id); | 178 | return m_InventoryService.GetUserInventory(id); |
176 | } | 179 | } |
177 | 180 | ||
178 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | 181 | public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) |
179 | { | 182 | { |
180 | m_InventoryService.GetUserInventory(userID, callback); | 183 | m_InventoryService.GetUserInventory(userID, callback); |
181 | } | 184 | } |
@@ -207,13 +210,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
207 | return new Dictionary<AssetType, InventoryFolderBase>(); | 210 | return new Dictionary<AssetType, InventoryFolderBase>(); |
208 | } | 211 | } |
209 | 212 | ||
210 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 213 | public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
211 | { | 214 | { |
212 | return m_InventoryService.GetFolderContent(userID, folderID); | 215 | return m_InventoryService.GetFolderContent(userID, folderID); |
213 | } | 216 | } |
214 | 217 | ||
215 | 218 | ||
216 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 219 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
217 | { | 220 | { |
218 | return m_InventoryService.GetFolderItems(userID, folderID); | 221 | return m_InventoryService.GetFolderItems(userID, folderID); |
219 | } | 222 | } |
@@ -223,7 +226,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
223 | /// </summary> | 226 | /// </summary> |
224 | /// <param name="folder"></param> | 227 | /// <param name="folder"></param> |
225 | /// <returns>true if the folder was successfully added</returns> | 228 | /// <returns>true if the folder was successfully added</returns> |
226 | public bool AddFolder(InventoryFolderBase folder) | 229 | public override bool AddFolder(InventoryFolderBase folder) |
227 | { | 230 | { |
228 | return m_InventoryService.AddFolder(folder); | 231 | return m_InventoryService.AddFolder(folder); |
229 | } | 232 | } |
@@ -233,7 +236,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
233 | /// </summary> | 236 | /// </summary> |
234 | /// <param name="folder"></param> | 237 | /// <param name="folder"></param> |
235 | /// <returns>true if the folder was successfully updated</returns> | 238 | /// <returns>true if the folder was successfully updated</returns> |
236 | public bool UpdateFolder(InventoryFolderBase folder) | 239 | public override bool UpdateFolder(InventoryFolderBase folder) |
237 | { | 240 | { |
238 | return m_InventoryService.UpdateFolder(folder); | 241 | return m_InventoryService.UpdateFolder(folder); |
239 | } | 242 | } |
@@ -243,7 +246,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
243 | /// </summary> | 246 | /// </summary> |
244 | /// <param name="folder">A folder containing the details of the new location</param> | 247 | /// <param name="folder">A folder containing the details of the new location</param> |
245 | /// <returns>true if the folder was successfully moved</returns> | 248 | /// <returns>true if the folder was successfully moved</returns> |
246 | public bool MoveFolder(InventoryFolderBase folder) | 249 | public override bool MoveFolder(InventoryFolderBase folder) |
247 | { | 250 | { |
248 | return m_InventoryService.MoveFolder(folder); | 251 | return m_InventoryService.MoveFolder(folder); |
249 | } | 252 | } |
@@ -253,17 +256,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
253 | /// </summary> | 256 | /// </summary> |
254 | /// <param name="folder"></param> | 257 | /// <param name="folder"></param> |
255 | /// <returns>true if the folder was successfully purged</returns> | 258 | /// <returns>true if the folder was successfully purged</returns> |
256 | public bool PurgeFolder(InventoryFolderBase folder) | 259 | public override bool PurgeFolder(InventoryFolderBase folder) |
257 | { | 260 | { |
258 | return m_InventoryService.PurgeFolder(folder); | 261 | return m_InventoryService.PurgeFolder(folder); |
259 | } | 262 | } |
260 | 263 | ||
261 | /// <summary> | 264 | /// <summary> |
262 | /// Add a new item to the user's inventory | 265 | /// Add a new item to the user's inventory, plain |
266 | /// Called by base class AddItem | ||
263 | /// </summary> | 267 | /// </summary> |
264 | /// <param name="item"></param> | 268 | /// <param name="item"></param> |
265 | /// <returns>true if the item was successfully added</returns> | 269 | /// <returns>true if the item was successfully added</returns> |
266 | public bool AddItem(InventoryItemBase item) | 270 | protected override bool AddItemPlain(InventoryItemBase item) |
267 | { | 271 | { |
268 | return m_InventoryService.AddItem(item); | 272 | return m_InventoryService.AddItem(item); |
269 | } | 273 | } |
@@ -273,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
273 | /// </summary> | 277 | /// </summary> |
274 | /// <param name="item"></param> | 278 | /// <param name="item"></param> |
275 | /// <returns>true if the item was successfully updated</returns> | 279 | /// <returns>true if the item was successfully updated</returns> |
276 | public bool UpdateItem(InventoryItemBase item) | 280 | public override bool UpdateItem(InventoryItemBase item) |
277 | { | 281 | { |
278 | return m_InventoryService.UpdateItem(item); | 282 | return m_InventoryService.UpdateItem(item); |
279 | } | 283 | } |
@@ -283,17 +287,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
283 | /// </summary> | 287 | /// </summary> |
284 | /// <param name="item"></param> | 288 | /// <param name="item"></param> |
285 | /// <returns>true if the item was successfully deleted</returns> | 289 | /// <returns>true if the item was successfully deleted</returns> |
286 | public bool DeleteItem(InventoryItemBase item) | 290 | public override bool DeleteItem(InventoryItemBase item) |
287 | { | 291 | { |
288 | return m_InventoryService.DeleteItem(item); | 292 | return m_InventoryService.DeleteItem(item); |
289 | } | 293 | } |
290 | 294 | ||
291 | public InventoryItemBase QueryItem(InventoryItemBase item) | 295 | public override InventoryItemBase QueryItem(InventoryItemBase item) |
292 | { | 296 | { |
293 | return m_InventoryService.QueryItem(item); | 297 | return m_InventoryService.QueryItem(item); |
294 | } | 298 | } |
295 | 299 | ||
296 | public InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 300 | public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) |
297 | { | 301 | { |
298 | return m_InventoryService.QueryFolder(folder); | 302 | return m_InventoryService.QueryFolder(folder); |
299 | } | 303 | } |
@@ -303,7 +307,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
303 | /// </summary> | 307 | /// </summary> |
304 | /// <param name="userID"></param> | 308 | /// <param name="userID"></param> |
305 | /// <returns></returns> | 309 | /// <returns></returns> |
306 | public bool HasInventoryForUser(UUID userID) | 310 | public override bool HasInventoryForUser(UUID userID) |
307 | { | 311 | { |
308 | return m_InventoryService.HasInventoryForUser(userID); | 312 | return m_InventoryService.HasInventoryForUser(userID); |
309 | } | 313 | } |
@@ -313,12 +317,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
313 | /// </summary> | 317 | /// </summary> |
314 | /// <param name="userID"></param> | 318 | /// <param name="userID"></param> |
315 | /// <returns>null if no root folder was found</returns> | 319 | /// <returns>null if no root folder was found</returns> |
316 | public InventoryFolderBase GetRootFolder(UUID userID) | 320 | public override InventoryFolderBase GetRootFolder(UUID userID) |
317 | { | 321 | { |
318 | return m_InventoryService.GetRootFolder(userID); | 322 | return m_InventoryService.GetRootFolder(userID); |
319 | } | 323 | } |
320 | 324 | ||
321 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | 325 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
322 | { | 326 | { |
323 | return m_InventoryService.GetActiveGestures(userId); | 327 | return m_InventoryService.GetActiveGestures(userId); |
324 | } | 328 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index dceda38..f87aab9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -40,7 +40,7 @@ using OpenMetaverse; | |||
40 | 40 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
42 | { | 42 | { |
43 | public class RemoteInventoryServicesConnector : InventoryCache, ISharedRegionModule, IInventoryService | 43 | public class RemoteInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService |
44 | { | 44 | { |
45 | private static readonly ILog m_log = | 45 | private static readonly ILog m_log = |
46 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
102 | { | 102 | { |
103 | } | 103 | } |
104 | 104 | ||
105 | public override void AddRegion(Scene scene) | 105 | public void AddRegion(Scene scene) |
106 | { | 106 | { |
107 | if (!m_Enabled) | 107 | if (!m_Enabled) |
108 | return; | 108 | return; |
@@ -117,12 +117,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
117 | } | 117 | } |
118 | 118 | ||
119 | scene.RegisterModuleInterface<IInventoryService>(this); | 119 | scene.RegisterModuleInterface<IInventoryService>(this); |
120 | base.AddRegion(scene); | 120 | m_cache.AddRegion(scene); |
121 | } | 121 | } |
122 | 122 | ||
123 | public override void RemoveRegion(Scene scene) | 123 | public void RemoveRegion(Scene scene) |
124 | { | 124 | { |
125 | base.RemoveRegion(scene); | 125 | if (!m_Enabled) |
126 | return; | ||
127 | |||
128 | m_cache.RemoveRegion(scene); | ||
126 | } | 129 | } |
127 | 130 | ||
128 | public void RegionLoaded(Scene scene) | 131 | public void RegionLoaded(Scene scene) |
@@ -138,22 +141,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
138 | 141 | ||
139 | #region IInventoryService | 142 | #region IInventoryService |
140 | 143 | ||
141 | public bool CreateUserInventory(UUID user) | 144 | public override bool CreateUserInventory(UUID user) |
142 | { | 145 | { |
143 | return false; | 146 | return false; |
144 | } | 147 | } |
145 | 148 | ||
146 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | 149 | public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId) |
147 | { | 150 | { |
148 | return new List<InventoryFolderBase>(); | 151 | return new List<InventoryFolderBase>(); |
149 | } | 152 | } |
150 | 153 | ||
151 | public InventoryCollection GetUserInventory(UUID userID) | 154 | public override InventoryCollection GetUserInventory(UUID userID) |
152 | { | 155 | { |
153 | return null; | 156 | return null; |
154 | } | 157 | } |
155 | 158 | ||
156 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | 159 | public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) |
157 | { | 160 | { |
158 | UUID sessionID = GetSessionID(userID); | 161 | UUID sessionID = GetSessionID(userID); |
159 | try | 162 | try |
@@ -180,7 +183,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
180 | return m_RemoteConnector.GetSystemFolders(userID.ToString(), sessionID); | 183 | return m_RemoteConnector.GetSystemFolders(userID.ToString(), sessionID); |
181 | } | 184 | } |
182 | 185 | ||
183 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 186 | public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
184 | { | 187 | { |
185 | UUID sessionID = GetSessionID(userID); | 188 | UUID sessionID = GetSessionID(userID); |
186 | try | 189 | try |
@@ -199,12 +202,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
199 | return nullCollection; | 202 | return nullCollection; |
200 | } | 203 | } |
201 | 204 | ||
202 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 205 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
203 | { | 206 | { |
204 | return new List<InventoryItemBase>(); | 207 | return new List<InventoryItemBase>(); |
205 | } | 208 | } |
206 | 209 | ||
207 | public bool AddFolder(InventoryFolderBase folder) | 210 | public override bool AddFolder(InventoryFolderBase folder) |
208 | { | 211 | { |
209 | if (folder == null) | 212 | if (folder == null) |
210 | return false; | 213 | return false; |
@@ -213,7 +216,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
213 | return m_RemoteConnector.AddFolder(folder.Owner.ToString(), folder, sessionID); | 216 | return m_RemoteConnector.AddFolder(folder.Owner.ToString(), folder, sessionID); |
214 | } | 217 | } |
215 | 218 | ||
216 | public bool UpdateFolder(InventoryFolderBase folder) | 219 | public override bool UpdateFolder(InventoryFolderBase folder) |
217 | { | 220 | { |
218 | if (folder == null) | 221 | if (folder == null) |
219 | return false; | 222 | return false; |
@@ -222,7 +225,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
222 | return m_RemoteConnector.UpdateFolder(folder.Owner.ToString(), folder, sessionID); | 225 | return m_RemoteConnector.UpdateFolder(folder.Owner.ToString(), folder, sessionID); |
223 | } | 226 | } |
224 | 227 | ||
225 | public bool MoveFolder(InventoryFolderBase folder) | 228 | public override bool MoveFolder(InventoryFolderBase folder) |
226 | { | 229 | { |
227 | if (folder == null) | 230 | if (folder == null) |
228 | return false; | 231 | return false; |
@@ -231,7 +234,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
231 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); | 234 | return m_RemoteConnector.MoveFolder(folder.Owner.ToString(), folder, sessionID); |
232 | } | 235 | } |
233 | 236 | ||
234 | public bool PurgeFolder(InventoryFolderBase folder) | 237 | public override bool PurgeFolder(InventoryFolderBase folder) |
235 | { | 238 | { |
236 | if (folder == null) | 239 | if (folder == null) |
237 | return false; | 240 | return false; |
@@ -240,7 +243,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
240 | return m_RemoteConnector.PurgeFolder(folder.Owner.ToString(), folder, sessionID); | 243 | return m_RemoteConnector.PurgeFolder(folder.Owner.ToString(), folder, sessionID); |
241 | } | 244 | } |
242 | 245 | ||
243 | public bool AddItem(InventoryItemBase item) | 246 | // public bool AddItem(InventoryItemBase item) inherited |
247 | // Uses AddItemPlain | ||
248 | |||
249 | protected override bool AddItemPlain(InventoryItemBase item) | ||
244 | { | 250 | { |
245 | if (item == null) | 251 | if (item == null) |
246 | return false; | 252 | return false; |
@@ -249,7 +255,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
249 | return m_RemoteConnector.AddItem(item.Owner.ToString(), item, sessionID); | 255 | return m_RemoteConnector.AddItem(item.Owner.ToString(), item, sessionID); |
250 | } | 256 | } |
251 | 257 | ||
252 | public bool UpdateItem(InventoryItemBase item) | 258 | public override bool UpdateItem(InventoryItemBase item) |
253 | { | 259 | { |
254 | if (item == null) | 260 | if (item == null) |
255 | return false; | 261 | return false; |
@@ -258,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
258 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); | 264 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); |
259 | } | 265 | } |
260 | 266 | ||
261 | public bool DeleteItem(InventoryItemBase item) | 267 | public override bool DeleteItem(InventoryItemBase item) |
262 | { | 268 | { |
263 | if (item == null) | 269 | if (item == null) |
264 | return false; | 270 | return false; |
@@ -267,7 +273,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
267 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); | 273 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); |
268 | } | 274 | } |
269 | 275 | ||
270 | public InventoryItemBase QueryItem(InventoryItemBase item) | 276 | public override InventoryItemBase QueryItem(InventoryItemBase item) |
271 | { | 277 | { |
272 | if (item == null) | 278 | if (item == null) |
273 | return null; | 279 | return null; |
@@ -276,7 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
276 | return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); | 282 | return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); |
277 | } | 283 | } |
278 | 284 | ||
279 | public InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 285 | public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) |
280 | { | 286 | { |
281 | if (folder == null) | 287 | if (folder == null) |
282 | return null; | 288 | return null; |
@@ -285,17 +291,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
285 | return m_RemoteConnector.QueryFolder(folder.Owner.ToString(), folder, sessionID); | 291 | return m_RemoteConnector.QueryFolder(folder.Owner.ToString(), folder, sessionID); |
286 | } | 292 | } |
287 | 293 | ||
288 | public bool HasInventoryForUser(UUID userID) | 294 | public override bool HasInventoryForUser(UUID userID) |
289 | { | 295 | { |
290 | return false; | 296 | return false; |
291 | } | 297 | } |
292 | 298 | ||
293 | public InventoryFolderBase GetRootFolder(UUID userID) | 299 | public override InventoryFolderBase GetRootFolder(UUID userID) |
294 | { | 300 | { |
295 | return null; | 301 | return null; |
296 | } | 302 | } |
297 | 303 | ||
298 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | 304 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
299 | { | 305 | { |
300 | return new List<InventoryItemBase>(); | 306 | return new List<InventoryItemBase>(); |
301 | } | 307 | } |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 1d4d6d7..7bbe045 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -429,7 +429,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
429 | private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null; | 429 | private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null; |
430 | private ParcelPrimCountTainted handlerParcelPrimCountTainted = null; | 430 | private ParcelPrimCountTainted handlerParcelPrimCountTainted = null; |
431 | private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null; | 431 | private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null; |
432 | private ScriptTimerEvent handlerScriptTimerEvent = null; | 432 | // TODO: unused: private ScriptTimerEvent handlerScriptTimerEvent = null; |
433 | private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null; | 433 | private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null; |
434 | 434 | ||
435 | private ScriptColliding handlerCollidingStart = null; | 435 | private ScriptColliding handlerCollidingStart = null; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 9251aa6..113918d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -622,8 +622,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
622 | "[AGENT INVENTORY]: Failed to move folder {0} to {1} for user {2}", | 622 | "[AGENT INVENTORY]: Failed to move folder {0} to {1} for user {2}", |
623 | folderID, parentID, remoteClient.Name); | 623 | folderID, parentID, remoteClient.Name); |
624 | } | 624 | } |
625 | } | ||
626 | |||
627 | public void HandleMoveInventoryFolder2(IClientAPI remoteClient, UUID folderID, UUID parentID) | ||
628 | { | ||
629 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | ||
630 | folder = InventoryService.QueryFolder(folder); | ||
631 | if (folder != null) | ||
632 | { | ||
633 | folder.ParentID = parentID; | ||
634 | if (!InventoryService.MoveFolder(folder)) | ||
635 | m_log.WarnFormat("[AGENT INVENTORY]: could not move folder {0}", folderID); | ||
636 | else | ||
637 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} moved to parent {1}", folderID, parentID); | ||
638 | } | ||
639 | else | ||
640 | { | ||
641 | m_log.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID); | ||
642 | } | ||
625 | } | 643 | } |
626 | 644 | ||
627 | /// <summary> | 645 | /// <summary> |
628 | /// This should delete all the items and folders in the given directory. | 646 | /// This should delete all the items and folders in the given directory. |
629 | /// </summary> | 647 | /// </summary> |
@@ -647,6 +665,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
647 | "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}", | 665 | "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}", |
648 | remoteClient.Name, remoteClient.AgentId); | 666 | remoteClient.Name, remoteClient.AgentId); |
649 | } | 667 | } |
668 | } | ||
669 | |||
670 | public void HandlePurgeInventoryDescendents2(IClientAPI remoteClient, UUID folderID) | ||
671 | { | ||
672 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | ||
673 | |||
674 | if (InventoryService.PurgeFolder(folder)) | ||
675 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); | ||
676 | else | ||
677 | m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID); | ||
650 | } | 678 | } |
679 | |||
651 | } | 680 | } |
652 | } | 681 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7f1936e..18d7bad 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1038,6 +1038,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1038 | } | 1038 | } |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | /// <summary> | ||
1042 | /// Send out simstats data to all clients | ||
1043 | /// </summary> | ||
1044 | /// <param name="stats">Stats on the Simulator's performance</param> | ||
1041 | private void SendSimStatsPackets(SimStats stats) | 1045 | private void SendSimStatsPackets(SimStats stats) |
1042 | { | 1046 | { |
1043 | List<ScenePresence> StatSendAgents = GetScenePresences(); | 1047 | List<ScenePresence> StatSendAgents = GetScenePresences(); |
@@ -1050,6 +1054,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1050 | } | 1054 | } |
1051 | } | 1055 | } |
1052 | 1056 | ||
1057 | /// <summary> | ||
1058 | /// Recount SceneObjectPart in parcel aabb | ||
1059 | /// </summary> | ||
1053 | private void UpdateLand() | 1060 | private void UpdateLand() |
1054 | { | 1061 | { |
1055 | if (LandChannel != null) | 1062 | if (LandChannel != null) |
@@ -1061,11 +1068,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1061 | } | 1068 | } |
1062 | } | 1069 | } |
1063 | 1070 | ||
1071 | /// <summary> | ||
1072 | /// Update the terrain if it needs to be updated. | ||
1073 | /// </summary> | ||
1064 | private void UpdateTerrain() | 1074 | private void UpdateTerrain() |
1065 | { | 1075 | { |
1066 | EventManager.TriggerTerrainTick(); | 1076 | EventManager.TriggerTerrainTick(); |
1067 | } | 1077 | } |
1068 | 1078 | ||
1079 | /// <summary> | ||
1080 | /// Back up queued up changes | ||
1081 | /// </summary> | ||
1069 | private void UpdateStorageBackup() | 1082 | private void UpdateStorageBackup() |
1070 | { | 1083 | { |
1071 | if (!m_backingup) | 1084 | if (!m_backingup) |
@@ -1078,6 +1091,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1078 | } | 1091 | } |
1079 | } | 1092 | } |
1080 | 1093 | ||
1094 | /// <summary> | ||
1095 | /// Sends out the OnFrame event to the modules | ||
1096 | /// </summary> | ||
1081 | private void UpdateEvents() | 1097 | private void UpdateEvents() |
1082 | { | 1098 | { |
1083 | m_eventManager.TriggerOnFrame(); | 1099 | m_eventManager.TriggerOnFrame(); |
@@ -1133,6 +1149,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1133 | } | 1149 | } |
1134 | } | 1150 | } |
1135 | 1151 | ||
1152 | /// <summary> | ||
1153 | /// Synchronous force backup. For deletes and links/unlinks | ||
1154 | /// </summary> | ||
1155 | /// <param name="group">Object to be backed up</param> | ||
1136 | public void ForceSceneObjectBackup(SceneObjectGroup group) | 1156 | public void ForceSceneObjectBackup(SceneObjectGroup group) |
1137 | { | 1157 | { |
1138 | if (group != null) | 1158 | if (group != null) |
@@ -1141,6 +1161,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1141 | } | 1161 | } |
1142 | } | 1162 | } |
1143 | 1163 | ||
1164 | /// <summary> | ||
1165 | /// Return object to avatar Message | ||
1166 | /// </summary> | ||
1167 | /// <param name="agentID">Avatar Unique Id</param> | ||
1168 | /// <param name="objectName">Name of object returned</param> | ||
1169 | /// <param name="location">Location of object returned</param> | ||
1170 | /// <param name="reason">Reasion for object return</param> | ||
1144 | public void AddReturn(UUID agentID, string objectName, Vector3 location, string reason) | 1171 | public void AddReturn(UUID agentID, string objectName, Vector3 location, string reason) |
1145 | { | 1172 | { |
1146 | lock (m_returns) | 1173 | lock (m_returns) |
@@ -1167,6 +1194,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1167 | 1194 | ||
1168 | #region Load Terrain | 1195 | #region Load Terrain |
1169 | 1196 | ||
1197 | /// <summary> | ||
1198 | /// Store the terrain in the persistant data store | ||
1199 | /// </summary> | ||
1170 | public void SaveTerrain() | 1200 | public void SaveTerrain() |
1171 | { | 1201 | { |
1172 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); | 1202 | m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); |
@@ -1269,6 +1299,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1269 | 1299 | ||
1270 | #region Load Land | 1300 | #region Load Land |
1271 | 1301 | ||
1302 | /// <summary> | ||
1303 | /// Loads all Parcel data from the datastore for region identified by regionID | ||
1304 | /// </summary> | ||
1305 | /// <param name="regionID">Unique Identifier of the Region to load parcel data for</param> | ||
1272 | public void loadAllLandObjectsFromStorage(UUID regionID) | 1306 | public void loadAllLandObjectsFromStorage(UUID regionID) |
1273 | { | 1307 | { |
1274 | m_log.Info("[SCENE]: Loading land objects from storage"); | 1308 | m_log.Info("[SCENE]: Loading land objects from storage"); |
@@ -1322,6 +1356,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1322 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); | 1356 | m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); |
1323 | } | 1357 | } |
1324 | 1358 | ||
1359 | |||
1360 | /// <summary> | ||
1361 | /// Gets a new rez location based on the raycast and the size of the object that is being rezzed. | ||
1362 | /// </summary> | ||
1363 | /// <param name="RayStart"></param> | ||
1364 | /// <param name="RayEnd"></param> | ||
1365 | /// <param name="RayTargetID"></param> | ||
1366 | /// <param name="rot"></param> | ||
1367 | /// <param name="bypassRayCast"></param> | ||
1368 | /// <param name="RayEndIsIntersection"></param> | ||
1369 | /// <param name="frontFacesOnly"></param> | ||
1370 | /// <param name="scale"></param> | ||
1371 | /// <param name="FaceCenter"></param> | ||
1372 | /// <returns></returns> | ||
1325 | public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) | 1373 | public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter) |
1326 | { | 1374 | { |
1327 | Vector3 pos = Vector3.Zero; | 1375 | Vector3 pos = Vector3.Zero; |
@@ -1412,6 +1460,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1412 | } | 1460 | } |
1413 | } | 1461 | } |
1414 | 1462 | ||
1463 | |||
1464 | /// <summary> | ||
1465 | /// Create a New SceneObjectGroup/Part by raycasting | ||
1466 | /// </summary> | ||
1467 | /// <param name="ownerID"></param> | ||
1468 | /// <param name="groupID"></param> | ||
1469 | /// <param name="RayEnd"></param> | ||
1470 | /// <param name="rot"></param> | ||
1471 | /// <param name="shape"></param> | ||
1472 | /// <param name="bypassRaycast"></param> | ||
1473 | /// <param name="RayStart"></param> | ||
1474 | /// <param name="RayTargetID"></param> | ||
1475 | /// <param name="RayEndIsIntersection"></param> | ||
1415 | public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, | 1476 | public virtual void AddNewPrim(UUID ownerID, UUID groupID, Vector3 RayEnd, Quaternion rot, PrimitiveBaseShape shape, |
1416 | byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, | 1477 | byte bypassRaycast, Vector3 RayStart, UUID RayTargetID, |
1417 | byte RayEndIsIntersection) | 1478 | byte RayEndIsIntersection) |
@@ -1829,6 +1890,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1829 | return true; | 1890 | return true; |
1830 | } | 1891 | } |
1831 | 1892 | ||
1893 | /// <summary> | ||
1894 | /// Attachment rezzing | ||
1895 | /// </summary> | ||
1896 | /// <param name="userID">Agent Unique ID</param> | ||
1897 | /// <param name="itemID">Object ID</param> | ||
1898 | /// <returns>False</returns> | ||
1832 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) | 1899 | public virtual bool IncomingCreateObject(UUID userID, UUID itemID) |
1833 | { | 1900 | { |
1834 | ScenePresence sp = GetScenePresence(userID); | 1901 | ScenePresence sp = GetScenePresence(userID); |
@@ -1841,6 +1908,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1841 | return false; | 1908 | return false; |
1842 | } | 1909 | } |
1843 | 1910 | ||
1911 | /// <summary> | ||
1912 | /// Adds a Scene Object group to the Scene. | ||
1913 | /// Verifies that the creator of the object is not banned from the simulator. | ||
1914 | /// Checks if the item is an Attachment | ||
1915 | /// </summary> | ||
1916 | /// <param name="sceneObject"></param> | ||
1917 | /// <returns>True if the SceneObjectGroup was added, False if it was not</returns> | ||
1844 | public bool AddSceneObject(SceneObjectGroup sceneObject) | 1918 | public bool AddSceneObject(SceneObjectGroup sceneObject) |
1845 | { | 1919 | { |
1846 | // If the user is banned, we won't let any of their objects | 1920 | // If the user is banned, we won't let any of their objects |
@@ -1933,6 +2007,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1933 | 2007 | ||
1934 | #region Add/Remove Avatar Methods | 2008 | #region Add/Remove Avatar Methods |
1935 | 2009 | ||
2010 | /// <summary> | ||
2011 | /// Adding a New Client and Create a Presence for it. | ||
2012 | /// </summary> | ||
2013 | /// <param name="client"></param> | ||
1936 | public override void AddNewClient(IClientAPI client) | 2014 | public override void AddNewClient(IClientAPI client) |
1937 | { | 2015 | { |
1938 | SubscribeToClientEvents(client); | 2016 | SubscribeToClientEvents(client); |
@@ -1977,6 +2055,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1977 | EventManager.TriggerOnNewClient(client); | 2055 | EventManager.TriggerOnNewClient(client); |
1978 | } | 2056 | } |
1979 | 2057 | ||
2058 | /// <summary> | ||
2059 | /// Register for events from the client | ||
2060 | /// </summary> | ||
2061 | /// <param name="client">The IClientAPI of the connected client</param> | ||
1980 | protected virtual void SubscribeToClientEvents(IClientAPI client) | 2062 | protected virtual void SubscribeToClientEvents(IClientAPI client) |
1981 | { | 2063 | { |
1982 | client.OnRegionHandShakeReply += SendLayerData; | 2064 | client.OnRegionHandShakeReply += SendLayerData; |
@@ -2019,12 +2101,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2019 | client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; | 2101 | client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; |
2020 | client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; | 2102 | client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; |
2021 | client.OnObjectPermissions += HandleObjectPermissionsUpdate; | 2103 | client.OnObjectPermissions += HandleObjectPermissionsUpdate; |
2104 | |||
2022 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; | 2105 | client.OnCreateNewInventoryItem += CreateNewInventoryItem; |
2023 | client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; | 2106 | client.OnCreateNewInventoryFolder += HandleCreateInventoryFolder; |
2024 | client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; | 2107 | client.OnUpdateInventoryFolder += HandleUpdateInventoryFolder; |
2025 | client.OnMoveInventoryFolder += HandleMoveInventoryFolder; | 2108 | client.OnMoveInventoryFolder += HandleMoveInventoryFolder; // 2; //!! |
2026 | client.OnFetchInventoryDescendents += HandleFetchInventoryDescendents; | 2109 | client.OnFetchInventoryDescendents += HandleFetchInventoryDescendents; |
2027 | client.OnPurgeInventoryDescendents += HandlePurgeInventoryDescendents; | 2110 | client.OnPurgeInventoryDescendents += HandlePurgeInventoryDescendents; // 2; //!! |
2028 | client.OnFetchInventory += HandleFetchInventory; | 2111 | client.OnFetchInventory += HandleFetchInventory; |
2029 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; | 2112 | client.OnUpdateInventoryItem += UpdateInventoryItemAsset; |
2030 | client.OnCopyInventoryItem += CopyInventoryItem; | 2113 | client.OnCopyInventoryItem += CopyInventoryItem; |
@@ -2036,6 +2119,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2036 | client.OnRemoveTaskItem += RemoveTaskInventory; | 2119 | client.OnRemoveTaskItem += RemoveTaskInventory; |
2037 | client.OnUpdateTaskInventory += UpdateTaskInventory; | 2120 | client.OnUpdateTaskInventory += UpdateTaskInventory; |
2038 | client.OnMoveTaskItem += ClientMoveTaskInventoryItem; | 2121 | client.OnMoveTaskItem += ClientMoveTaskInventoryItem; |
2122 | |||
2039 | client.OnGrabObject += ProcessObjectGrab; | 2123 | client.OnGrabObject += ProcessObjectGrab; |
2040 | client.OnDeGrabObject += ProcessObjectDeGrab; | 2124 | client.OnDeGrabObject += ProcessObjectDeGrab; |
2041 | client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; | 2125 | client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; |
@@ -2068,8 +2152,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2068 | /// <summary> | 2152 | /// <summary> |
2069 | /// Teleport an avatar to their home region | 2153 | /// Teleport an avatar to their home region |
2070 | /// </summary> | 2154 | /// </summary> |
2071 | /// <param name="agentId"></param> | 2155 | /// <param name="agentId">The avatar's Unique ID</param> |
2072 | /// <param name="client"></param> | 2156 | /// <param name="client">The IClientAPI for the client</param> |
2073 | public virtual void TeleportClientHome(UUID agentId, IClientAPI client) | 2157 | public virtual void TeleportClientHome(UUID agentId, IClientAPI client) |
2074 | { | 2158 | { |
2075 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); | 2159 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); |
@@ -2097,6 +2181,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
2097 | } | 2181 | } |
2098 | } | 2182 | } |
2099 | 2183 | ||
2184 | /// <summary> | ||
2185 | /// Duplicates object specified by localID at position raycasted against RayTargetObject using | ||
2186 | /// RayEnd and RayStart to determine what the angle of the ray is | ||
2187 | /// </summary> | ||
2188 | /// <param name="localID">ID of object to duplicate</param> | ||
2189 | /// <param name="dupeFlags"></param> | ||
2190 | /// <param name="AgentID">Agent doing the duplication</param> | ||
2191 | /// <param name="GroupID">Group of new object</param> | ||
2192 | /// <param name="RayTargetObj">The target of the Ray</param> | ||
2193 | /// <param name="RayEnd">The ending of the ray (farthest away point)</param> | ||
2194 | /// <param name="RayStart">The Beginning of the ray (closest point)</param> | ||
2195 | /// <param name="BypassRaycast">Bool to bypass raycasting</param> | ||
2196 | /// <param name="RayEndIsIntersection">The End specified is the place to add the object</param> | ||
2197 | /// <param name="CopyCenters">Position the object at the center of the face that it's colliding with</param> | ||
2198 | /// <param name="CopyRotates">Rotate the object the same as the localID object</param> | ||
2100 | public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, | 2199 | public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, UUID AgentID, UUID GroupID, |
2101 | UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, | 2200 | UUID RayTargetObj, Vector3 RayEnd, Vector3 RayStart, |
2102 | bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) | 2201 | bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) |
@@ -2168,6 +2267,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2168 | } | 2267 | } |
2169 | } | 2268 | } |
2170 | 2269 | ||
2270 | /// <summary> | ||
2271 | /// Sets the Home Point. The GridService uses this to know where to put a user when they log-in | ||
2272 | /// </summary> | ||
2273 | /// <param name="remoteClient"></param> | ||
2274 | /// <param name="regionHandle"></param> | ||
2275 | /// <param name="position"></param> | ||
2276 | /// <param name="lookAt"></param> | ||
2277 | /// <param name="flags"></param> | ||
2171 | public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) | 2278 | public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) |
2172 | { | 2279 | { |
2173 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); | 2280 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); |
@@ -2338,6 +2445,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2338 | } | 2445 | } |
2339 | } | 2446 | } |
2340 | 2447 | ||
2448 | /// <summary> | ||
2449 | /// Removes region from an avatar's known region list. This coincides with child agents. For each child agent, there will be a known region entry. | ||
2450 | /// | ||
2451 | /// </summary> | ||
2452 | /// <param name="avatarID"></param> | ||
2453 | /// <param name="regionslst"></param> | ||
2341 | public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List<ulong> regionslst) | 2454 | public void HandleRemoveKnownRegionsFromAvatar(UUID avatarID, List<ulong> regionslst) |
2342 | { | 2455 | { |
2343 | ScenePresence av = GetScenePresence(avatarID); | 2456 | ScenePresence av = GetScenePresence(avatarID); |
@@ -2353,12 +2466,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2353 | } | 2466 | } |
2354 | } | 2467 | } |
2355 | 2468 | ||
2469 | /// <summary> | ||
2470 | /// Closes all endpoints with the circuitcode provided. | ||
2471 | /// </summary> | ||
2472 | /// <param name="circuitcode">Circuit Code of the endpoint to close</param> | ||
2356 | public override void CloseAllAgents(uint circuitcode) | 2473 | public override void CloseAllAgents(uint circuitcode) |
2357 | { | 2474 | { |
2358 | // Called by ClientView to kill all circuit codes | 2475 | // Called by ClientView to kill all circuit codes |
2359 | ClientManager.CloseAllAgents(circuitcode); | 2476 | ClientManager.CloseAllAgents(circuitcode); |
2360 | } | 2477 | } |
2361 | 2478 | ||
2479 | /// <summary> | ||
2480 | /// Inform all other ScenePresences on this Scene that someone else has changed position on the minimap. | ||
2481 | /// </summary> | ||
2362 | public void NotifyMyCoarseLocationChange() | 2482 | public void NotifyMyCoarseLocationChange() |
2363 | { | 2483 | { |
2364 | ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); | 2484 | ForEachScenePresence(delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); |
@@ -2453,9 +2573,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2453 | /// The return bool should allow for connections to be refused, but as not all calling paths | 2573 | /// The return bool should allow for connections to be refused, but as not all calling paths |
2454 | /// take proper notice of it let, we allowed banned users in still. | 2574 | /// take proper notice of it let, we allowed banned users in still. |
2455 | /// </summary> | 2575 | /// </summary> |
2456 | /// <param name="regionHandle"></param> | 2576 | /// <param name="agent">CircuitData of the agent who is connecting</param> |
2457 | /// <param name="agent"></param> | 2577 | /// <param name="reason">Outputs the reason for the false response on this string</param> |
2458 | /// <param name="reason"></param> | 2578 | /// <returns>True if the region accepts this agent. False if it does not. False will |
2579 | /// also return a reason.</returns> | ||
2459 | public bool NewUserConnection(AgentCircuitData agent, out string reason) | 2580 | public bool NewUserConnection(AgentCircuitData agent, out string reason) |
2460 | { | 2581 | { |
2461 | // Don't disable this log message - it's too helpful | 2582 | // Don't disable this log message - it's too helpful |
@@ -2528,6 +2649,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2528 | return true; | 2649 | return true; |
2529 | } | 2650 | } |
2530 | 2651 | ||
2652 | /// <summary> | ||
2653 | /// Verifies that the user has a session on the Grid | ||
2654 | /// </summary> | ||
2655 | /// <param name="agent">Circuit Data of the Agent we're verifying</param> | ||
2656 | /// <param name="reason">Outputs the reason for the false response on this string</param> | ||
2657 | /// <returns>True if the user has a session on the grid. False if it does not. False will | ||
2658 | /// also return a reason.</returns> | ||
2531 | public virtual bool AuthenticateUser(AgentCircuitData agent, out string reason) | 2659 | public virtual bool AuthenticateUser(AgentCircuitData agent, out string reason) |
2532 | { | 2660 | { |
2533 | reason = String.Empty; | 2661 | reason = String.Empty; |
@@ -2540,6 +2668,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2540 | return result; | 2668 | return result; |
2541 | } | 2669 | } |
2542 | 2670 | ||
2671 | /// <summary> | ||
2672 | /// Verify if the user can connect to this region. Checks the banlist and ensures that the region is set for public access | ||
2673 | /// </summary> | ||
2674 | /// <param name="agent">The circuit data for the agent</param> | ||
2675 | /// <param name="reason">outputs the reason to this string</param> | ||
2676 | /// <returns>True if the region accepts this agent. False if it does not. False will | ||
2677 | /// also return a reason.</returns> | ||
2543 | protected virtual bool AuthorizeUser(AgentCircuitData agent, out string reason) | 2678 | protected virtual bool AuthorizeUser(AgentCircuitData agent, out string reason) |
2544 | { | 2679 | { |
2545 | reason = String.Empty; | 2680 | reason = String.Empty; |
@@ -2598,16 +2733,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
2598 | return true; | 2733 | return true; |
2599 | } | 2734 | } |
2600 | 2735 | ||
2736 | /// <summary> | ||
2737 | /// Update an AgentCircuitData object with new information | ||
2738 | /// </summary> | ||
2739 | /// <param name="data">Information to update the AgentCircuitData with</param> | ||
2601 | public void UpdateCircuitData(AgentCircuitData data) | 2740 | public void UpdateCircuitData(AgentCircuitData data) |
2602 | { | 2741 | { |
2603 | m_authenticateHandler.UpdateAgentData(data); | 2742 | m_authenticateHandler.UpdateAgentData(data); |
2604 | } | 2743 | } |
2605 | 2744 | ||
2745 | /// <summary> | ||
2746 | /// Change the Circuit Code for the user's Circuit Data | ||
2747 | /// </summary> | ||
2748 | /// <param name="oldcc">The old Circuit Code. Must match a previous circuit code</param> | ||
2749 | /// <param name="newcc">The new Circuit Code. Must not be an already existing circuit code</param> | ||
2750 | /// <returns>True if we successfully changed it. False if we did not</returns> | ||
2606 | public bool ChangeCircuitCode(uint oldcc, uint newcc) | 2751 | public bool ChangeCircuitCode(uint oldcc, uint newcc) |
2607 | { | 2752 | { |
2608 | return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); | 2753 | return m_authenticateHandler.TryChangeCiruitCode(oldcc, newcc); |
2609 | } | 2754 | } |
2610 | 2755 | ||
2756 | /// <summary> | ||
2757 | /// The Grid has requested that we log-off a user. Log them off. | ||
2758 | /// </summary> | ||
2759 | /// <param name="AvatarID">Unique ID of the avatar to log-off</param> | ||
2760 | /// <param name="RegionSecret">SecureSessionID of the user, or the RegionSecret text when logging on to the grid</param> | ||
2761 | /// <param name="message">message to display to the user. Reason for being logged off</param> | ||
2611 | public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message) | 2762 | public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message) |
2612 | { | 2763 | { |
2613 | ScenePresence loggingOffUser = null; | 2764 | ScenePresence loggingOffUser = null; |
@@ -2673,6 +2824,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2673 | } | 2824 | } |
2674 | } | 2825 | } |
2675 | 2826 | ||
2827 | /// <summary> | ||
2828 | /// We've got an update about an agent that sees into this region, | ||
2829 | /// send it to ScenePresence for processing It's the full data. | ||
2830 | /// </summary> | ||
2831 | /// <param name="cAgentData">Agent that contains all of the relevant things about an agent. | ||
2832 | /// Appearance, animations, position, etc.</param> | ||
2833 | /// <returns>true if we handled it.</returns> | ||
2676 | public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) | 2834 | public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) |
2677 | { | 2835 | { |
2678 | // m_log.DebugFormat( | 2836 | // m_log.DebugFormat( |
@@ -2690,6 +2848,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2690 | return false; | 2848 | return false; |
2691 | } | 2849 | } |
2692 | 2850 | ||
2851 | /// <summary> | ||
2852 | /// We've got an update about an agent that sees into this region, | ||
2853 | /// send it to ScenePresence for processing It's only positional data | ||
2854 | /// </summary> | ||
2855 | /// <param name="cAgentData">AgentPosition that contains agent positional data so we can know what to send</param> | ||
2856 | /// <returns>true if we handled it.</returns> | ||
2693 | public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) | 2857 | public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) |
2694 | { | 2858 | { |
2695 | //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); | 2859 | //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 0140faa..c1e39a9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -48,6 +48,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
48 | 48 | ||
49 | public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst); | 49 | public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst); |
50 | 50 | ||
51 | /// <summary> | ||
52 | /// Class that Region communications runs through | ||
53 | /// </summary> | ||
51 | public class SceneCommunicationService //one instance per region | 54 | public class SceneCommunicationService //one instance per region |
52 | { | 55 | { |
53 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 56 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -60,15 +63,46 @@ namespace OpenSim.Region.Framework.Scenes | |||
60 | 63 | ||
61 | protected List<UUID> m_agentsInTransit; | 64 | protected List<UUID> m_agentsInTransit; |
62 | 65 | ||
66 | /// <summary> | ||
67 | /// An agent is crossing into this region | ||
68 | /// </summary> | ||
63 | public event AgentCrossing OnAvatarCrossingIntoRegion; | 69 | public event AgentCrossing OnAvatarCrossingIntoRegion; |
70 | |||
71 | /// <summary> | ||
72 | /// A user will arrive shortly, set up appropriate credentials so it can connect | ||
73 | /// </summary> | ||
64 | public event ExpectUserDelegate OnExpectUser; | 74 | public event ExpectUserDelegate OnExpectUser; |
75 | |||
76 | /// <summary> | ||
77 | /// A Prim will arrive shortly | ||
78 | /// </summary> | ||
65 | public event ExpectPrimDelegate OnExpectPrim; | 79 | public event ExpectPrimDelegate OnExpectPrim; |
66 | public event CloseAgentConnection OnCloseAgentConnection; | 80 | public event CloseAgentConnection OnCloseAgentConnection; |
81 | |||
82 | /// <summary> | ||
83 | /// A new prim has arrived | ||
84 | /// </summary> | ||
67 | public event PrimCrossing OnPrimCrossingIntoRegion; | 85 | public event PrimCrossing OnPrimCrossingIntoRegion; |
86 | |||
87 | /// <summary> | ||
88 | /// A New Region is up and available | ||
89 | /// </summary> | ||
68 | public event RegionUp OnRegionUp; | 90 | public event RegionUp OnRegionUp; |
91 | |||
92 | /// <summary> | ||
93 | /// We have a child agent for this avatar and we're getting a status update about it | ||
94 | /// </summary> | ||
69 | public event ChildAgentUpdate OnChildAgentUpdate; | 95 | public event ChildAgentUpdate OnChildAgentUpdate; |
70 | //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; | 96 | //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; |
97 | |||
98 | /// <summary> | ||
99 | /// Time to log one of our users off. Grid Service sends this mostly | ||
100 | /// </summary> | ||
71 | public event LogOffUser OnLogOffUser; | 101 | public event LogOffUser OnLogOffUser; |
102 | |||
103 | /// <summary> | ||
104 | /// A region wants land data from us! | ||
105 | /// </summary> | ||
72 | public event GetLandData OnGetLandData; | 106 | public event GetLandData OnGetLandData; |
73 | 107 | ||
74 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; | 108 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; |
@@ -123,11 +157,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
123 | } | 157 | } |
124 | } | 158 | } |
125 | 159 | ||
160 | /// <summary> | ||
161 | /// Returns a region with the name closest to string provided | ||
162 | /// </summary> | ||
163 | /// <param name="name">Partial Region Name for matching</param> | ||
164 | /// <returns>Region Information for the region</returns> | ||
126 | public RegionInfo RequestClosestRegion(string name) | 165 | public RegionInfo RequestClosestRegion(string name) |
127 | { | 166 | { |
128 | return m_commsProvider.GridService.RequestClosestRegion(name); | 167 | return m_commsProvider.GridService.RequestClosestRegion(name); |
129 | } | 168 | } |
130 | 169 | ||
170 | /// <summary> | ||
171 | /// This region is shutting down, de-register all events! | ||
172 | /// De-Register region from Grid! | ||
173 | /// </summary> | ||
131 | public void Close() | 174 | public void Close() |
132 | { | 175 | { |
133 | if (regionCommsHost != null) | 176 | if (regionCommsHost != null) |
@@ -159,10 +202,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
159 | #region CommsManager Event handlers | 202 | #region CommsManager Event handlers |
160 | 203 | ||
161 | /// <summary> | 204 | /// <summary> |
162 | /// | 205 | /// A New User will arrive shortly, Informs the scene that there's a new user on the way |
163 | /// </summary> | 206 | /// </summary> |
164 | /// <param name="regionHandle"></param> | 207 | /// <param name="agent">Data we need to ensure that the agent can connect</param> |
165 | /// <param name="agent"></param> | ||
166 | /// | 208 | /// |
167 | protected void NewUserConnection(AgentCircuitData agent) | 209 | protected void NewUserConnection(AgentCircuitData agent) |
168 | { | 210 | { |
@@ -174,6 +216,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
174 | } | 216 | } |
175 | } | 217 | } |
176 | 218 | ||
219 | /// <summary> | ||
220 | /// The Grid has requested us to log-off the user | ||
221 | /// </summary> | ||
222 | /// <param name="AgentID">Unique ID of agent to log-off</param> | ||
223 | /// <param name="RegionSecret">The secret string that the region establishes with the grid when registering</param> | ||
224 | /// <param name="message">The message to send to the user that tells them why they were logged off</param> | ||
177 | protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message) | 225 | protected void GridLogOffUser(UUID AgentID, UUID RegionSecret, string message) |
178 | { | 226 | { |
179 | handlerLogOffUser = OnLogOffUser; | 227 | handlerLogOffUser = OnLogOffUser; |
@@ -183,6 +231,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
183 | } | 231 | } |
184 | } | 232 | } |
185 | 233 | ||
234 | /// <summary> | ||
235 | /// A New Region is now available. Inform the scene that there is a new region available. | ||
236 | /// </summary> | ||
237 | /// <param name="region">Information about the new region that is available</param> | ||
238 | /// <returns>True if the event was handled</returns> | ||
186 | protected bool newRegionUp(RegionInfo region) | 239 | protected bool newRegionUp(RegionInfo region) |
187 | { | 240 | { |
188 | handlerRegionUp = OnRegionUp; | 241 | handlerRegionUp = OnRegionUp; |
@@ -194,6 +247,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
194 | return true; | 247 | return true; |
195 | } | 248 | } |
196 | 249 | ||
250 | /// <summary> | ||
251 | /// Inform the scene that we've got an update about a child agent that we have | ||
252 | /// </summary> | ||
253 | /// <param name="cAgentData"></param> | ||
254 | /// <returns></returns> | ||
197 | protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData) | 255 | protected bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData) |
198 | { | 256 | { |
199 | handlerChildAgentUpdate = OnChildAgentUpdate; | 257 | handlerChildAgentUpdate = OnChildAgentUpdate; |
@@ -204,6 +262,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
204 | return true; | 262 | return true; |
205 | } | 263 | } |
206 | 264 | ||
265 | |||
207 | protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) | 266 | protected void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) |
208 | { | 267 | { |
209 | handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; | 268 | handlerAvatarCrossingIntoRegion = OnAvatarCrossingIntoRegion; |
@@ -213,6 +272,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
213 | } | 272 | } |
214 | } | 273 | } |
215 | 274 | ||
275 | /// <summary> | ||
276 | /// We have a new prim from a neighbor | ||
277 | /// </summary> | ||
278 | /// <param name="primID">unique ID for the primative</param> | ||
279 | /// <param name="objXMLData">XML2 encoded data of the primative</param> | ||
280 | /// <param name="XMLMethod">An Int that represents the version of the XMLMethod</param> | ||
281 | /// <returns>True if the prim was accepted, false if it was not</returns> | ||
216 | protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod) | 282 | protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod) |
217 | { | 283 | { |
218 | handlerExpectPrim = OnExpectPrim; | 284 | handlerExpectPrim = OnExpectPrim; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 61dfa52..3646811 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1098,30 +1098,29 @@ if (m_shape != null) { | |||
1098 | } | 1098 | } |
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | private void handleTimerAccounting(uint localID, double interval) | 1101 | // TODO: unused: |
1102 | { | 1102 | // private void handleTimerAccounting(uint localID, double interval) |
1103 | if (localID == LocalId) | 1103 | // { |
1104 | { | 1104 | // if (localID == LocalId) |
1105 | 1105 | // { | |
1106 | float sec = (float)interval; | 1106 | // float sec = (float)interval; |
1107 | if (m_parentGroup != null) | 1107 | // if (m_parentGroup != null) |
1108 | { | 1108 | // { |
1109 | if (sec == 0) | 1109 | // if (sec == 0) |
1110 | { | 1110 | // { |
1111 | if (m_parentGroup.scriptScore + 0.001f >= float.MaxValue - 0.001) | 1111 | // if (m_parentGroup.scriptScore + 0.001f >= float.MaxValue - 0.001) |
1112 | m_parentGroup.scriptScore = 0; | 1112 | // m_parentGroup.scriptScore = 0; |
1113 | 1113 | // | |
1114 | m_parentGroup.scriptScore += 0.001f; | 1114 | // m_parentGroup.scriptScore += 0.001f; |
1115 | return; | 1115 | // return; |
1116 | } | 1116 | // } |
1117 | 1117 | // | |
1118 | if (m_parentGroup.scriptScore + (0.001f / sec) >= float.MaxValue - (0.001f / sec)) | 1118 | // if (m_parentGroup.scriptScore + (0.001f / sec) >= float.MaxValue - (0.001f / sec)) |
1119 | m_parentGroup.scriptScore = 0; | 1119 | // m_parentGroup.scriptScore = 0; |
1120 | m_parentGroup.scriptScore += (0.001f / sec); | 1120 | // m_parentGroup.scriptScore += (0.001f / sec); |
1121 | } | 1121 | // } |
1122 | 1122 | // } | |
1123 | } | 1123 | // } |
1124 | } | ||
1125 | 1124 | ||
1126 | #endregion Private Methods | 1125 | #endregion Private Methods |
1127 | 1126 | ||
@@ -1248,7 +1247,6 @@ if (m_shape != null) { | |||
1248 | } | 1247 | } |
1249 | } | 1248 | } |
1250 | 1249 | ||
1251 | |||
1252 | /// <summary> | 1250 | /// <summary> |
1253 | /// hook to the physics scene to apply angular impulse | 1251 | /// hook to the physics scene to apply angular impulse |
1254 | /// This is sent up to the group, which then finds the root prim | 1252 | /// This is sent up to the group, which then finds the root prim |
@@ -1809,7 +1807,6 @@ if (m_shape != null) { | |||
1809 | m_parentGroup.SetHoverHeight(0f, PIDHoverType.Ground, 0f); | 1807 | m_parentGroup.SetHoverHeight(0f, PIDHoverType.Ground, 0f); |
1810 | } | 1808 | } |
1811 | 1809 | ||
1812 | |||
1813 | public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient) | 1810 | public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient) |
1814 | { | 1811 | { |
1815 | } | 1812 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 1836447..88452d2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -113,6 +113,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
113 | agent.InventoryFolder = UUID.Zero; | 113 | agent.InventoryFolder = UUID.Zero; |
114 | agent.startpos = Vector3.Zero; | 114 | agent.startpos = Vector3.Zero; |
115 | agent.CapsPath = GetRandomCapsObjectPath(); | 115 | agent.CapsPath = GetRandomCapsObjectPath(); |
116 | agent.ChildrenCapSeeds = new Dictionary<ulong, string>(); | ||
116 | 117 | ||
117 | string reason; | 118 | string reason; |
118 | scene.NewUserConnection(agent, out reason); | 119 | scene.NewUserConnection(agent, out reason); |
@@ -147,7 +148,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
147 | TestHelper.InMethod(); | 148 | TestHelper.InMethod(); |
148 | 149 | ||
149 | string reason; | 150 | string reason; |
151 | |||
152 | if (acd1 == null) | ||
153 | fixNullPresence(); | ||
154 | |||
150 | scene.NewUserConnection(acd1, out reason); | 155 | scene.NewUserConnection(acd1, out reason); |
156 | if (testclient == null) | ||
157 | testclient = new TestClient(acd1, scene); | ||
151 | scene.AddNewClient(testclient); | 158 | scene.AddNewClient(testclient); |
152 | 159 | ||
153 | ScenePresence presence = scene.GetScenePresence(agent1); | 160 | ScenePresence presence = scene.GetScenePresence(agent1); |
@@ -162,6 +169,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
162 | 169 | ||
163 | Assert.That(neighbours.Count, Is.EqualTo(2)); | 170 | Assert.That(neighbours.Count, Is.EqualTo(2)); |
164 | } | 171 | } |
172 | public void fixNullPresence() | ||
173 | { | ||
174 | string firstName = "testfirstname"; | ||
175 | |||
176 | AgentCircuitData agent = new AgentCircuitData(); | ||
177 | agent.AgentID = agent1; | ||
178 | agent.firstname = firstName; | ||
179 | agent.lastname = "testlastname"; | ||
180 | agent.SessionID = UUID.Zero; | ||
181 | agent.SecureSessionID = UUID.Zero; | ||
182 | agent.circuitcode = 123; | ||
183 | agent.BaseFolder = UUID.Zero; | ||
184 | agent.InventoryFolder = UUID.Zero; | ||
185 | agent.startpos = Vector3.Zero; | ||
186 | agent.CapsPath = GetRandomCapsObjectPath(); | ||
187 | |||
188 | acd1 = agent; | ||
189 | } | ||
165 | 190 | ||
166 | [Test] | 191 | [Test] |
167 | public void T013_TestRemoveNeighbourRegion() | 192 | public void T013_TestRemoveNeighbourRegion() |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs index ed2d317..23eab90 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs | |||
@@ -38,6 +38,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion; | |||
38 | using OpenSim.Tests.Common; | 38 | using OpenSim.Tests.Common; |
39 | using OpenSim.Tests.Common.Mock; | 39 | using OpenSim.Tests.Common.Mock; |
40 | using OpenSim.Tests.Common.Setup; | 40 | using OpenSim.Tests.Common.Setup; |
41 | using System.Threading; | ||
41 | 42 | ||
42 | namespace OpenSim.Region.Framework.Scenes.Tests | 43 | namespace OpenSim.Region.Framework.Scenes.Tests |
43 | { | 44 | { |
@@ -55,56 +56,130 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
55 | public void TestSimpleNotNeighboursTeleport() | 56 | public void TestSimpleNotNeighboursTeleport() |
56 | { | 57 | { |
57 | TestHelper.InMethod(); | 58 | TestHelper.InMethod(); |
59 | ThreadRunResults results = new ThreadRunResults(); | ||
60 | results.Result = false; | ||
61 | results.Message = "Test did not run"; | ||
62 | TestRunning testClass = new TestRunning(results); | ||
58 | 63 | ||
64 | Thread testThread = new Thread(testClass.run); | ||
65 | |||
66 | try | ||
67 | { | ||
68 | // Seems kind of redundant to start a thread and then join it, however.. We need to protect against | ||
69 | // A thread abort exception in the simulator code. | ||
70 | testThread.Start(); | ||
71 | testThread.Join(); | ||
72 | } | ||
73 | catch (ThreadAbortException) | ||
74 | { | ||
75 | |||
76 | } | ||
77 | Assert.That(testClass.results.Result, Is.EqualTo(true), testClass.results.Message); | ||
59 | // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); | 78 | // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); |
79 | } | ||
80 | |||
81 | } | ||
82 | |||
83 | public class ThreadRunResults | ||
84 | { | ||
85 | public bool Result = false; | ||
86 | public string Message = string.Empty; | ||
87 | } | ||
88 | |||
89 | public class TestRunning | ||
90 | { | ||
91 | public ThreadRunResults results; | ||
92 | public TestRunning(ThreadRunResults t) | ||
93 | { | ||
94 | results = t; | ||
95 | } | ||
96 | public void run(object o) | ||
97 | { | ||
60 | 98 | ||
99 | //results.Result = true; | ||
61 | log4net.Config.XmlConfigurator.Configure(); | 100 | log4net.Config.XmlConfigurator.Configure(); |
62 | 101 | ||
63 | UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); | 102 | UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100"); |
64 | UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); | 103 | UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200"); |
65 | TestCommunicationsManager cm = new TestCommunicationsManager(); | 104 | TestCommunicationsManager cm = new TestCommunicationsManager(); |
66 | 105 | ||
67 | // shared module | 106 | // shared module |
68 | ISharedRegionModule interregionComms = new RESTInterregionComms(); | 107 | ISharedRegionModule interregionComms = new RESTInterregionComms(); |
69 | 108 | ||
70 | Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm); | 109 | Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm); |
71 | SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); | 110 | SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms); |
72 | sceneA.RegisterRegionWithGrid(); | 111 | sceneA.RegisterRegionWithGrid(); |
73 | 112 | ||
74 | Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); | 113 | Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); |
75 | SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); | 114 | SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); |
76 | sceneB.RegisterRegionWithGrid(); | 115 | sceneB.RegisterRegionWithGrid(); |
77 | 116 | ||
78 | UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); | 117 | UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); |
79 | TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); | 118 | TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); |
80 | 119 | ||
81 | ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>(); | 120 | ICapabilitiesModule sceneACapsModule = sceneA.RequestModuleInterface<ICapabilitiesModule>(); |
121 | |||
122 | results.Result = (sceneACapsModule.GetCapsPath(agentId) == client.CapsSeedUrl); | ||
82 | 123 | ||
124 | if (!results.Result) | ||
125 | { | ||
126 | results.Message = "Incorrect caps object path set up in sceneA"; | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | /* | ||
83 | Assert.That( | 131 | Assert.That( |
84 | sceneACapsModule.GetCapsPath(agentId), | 132 | sceneACapsModule.GetCapsPath(agentId), |
85 | Is.EqualTo(client.CapsSeedUrl), | 133 | Is.EqualTo(client.CapsSeedUrl), |
86 | "Incorrect caps object path set up in sceneA"); | 134 | "Incorrect caps object path set up in sceneA"); |
87 | 135 | */ | |
88 | // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. | 136 | // FIXME: This is a hack to get the test working - really the normal OpenSim mechanisms should be used. |
89 | client.TeleportTargetScene = sceneB; | ||
90 | client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); | ||
91 | 137 | ||
92 | Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); | 138 | |
93 | Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); | 139 | client.TeleportTargetScene = sceneB; |
140 | client.Teleport(sceneB.RegionInfo.RegionHandle, new Vector3(100, 100, 100), new Vector3(40, 40, 40)); | ||
141 | |||
142 | results.Result = (sceneB.GetScenePresence(agentId) != null); | ||
143 | if (!results.Result) | ||
144 | { | ||
145 | results.Message = "Client does not have an agent in sceneB"; | ||
146 | return; | ||
147 | } | ||
148 | |||
149 | //Assert.That(sceneB.GetScenePresence(agentId), Is.Not.Null, "Client does not have an agent in sceneB"); | ||
94 | 150 | ||
151 | //Assert.That(sceneA.GetScenePresence(agentId), Is.Null, "Client still had an agent in sceneA"); | ||
152 | |||
153 | results.Result = (sceneA.GetScenePresence(agentId) == null); | ||
154 | if (!results.Result) | ||
155 | { | ||
156 | results.Message = "Client still had an agent in sceneA"; | ||
157 | return; | ||
158 | } | ||
159 | |||
95 | ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>(); | 160 | ICapabilitiesModule sceneBCapsModule = sceneB.RequestModuleInterface<ICapabilitiesModule>(); |
96 | 161 | ||
162 | |||
163 | results.Result = ("http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + | ||
164 | "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/" == client.CapsSeedUrl); | ||
165 | if (!results.Result) | ||
166 | { | ||
167 | results.Message = "Incorrect caps object path set up in sceneB"; | ||
168 | return; | ||
169 | } | ||
170 | |||
97 | // Temporary assertion - caps url construction should at least be doable through a method. | 171 | // Temporary assertion - caps url construction should at least be doable through a method. |
172 | /* | ||
98 | Assert.That( | 173 | Assert.That( |
99 | "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/", | 174 | "http://" + sceneB.RegionInfo.ExternalHostName + ":" + sceneB.RegionInfo.HttpPort + "/CAPS/" + sceneBCapsModule.GetCapsPath(agentId) + "0000/", |
100 | Is.EqualTo(client.CapsSeedUrl), | 175 | Is.EqualTo(client.CapsSeedUrl), |
101 | "Incorrect caps object path set up in sceneB"); | 176 | "Incorrect caps object path set up in sceneB"); |
102 | 177 | */ | |
103 | // This assertion will currently fail since we don't remove the caps paths when no longer needed | 178 | // This assertion will currently fail since we don't remove the caps paths when no longer needed |
104 | //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path"); | 179 | //Assert.That(sceneACapsModule.GetCapsPath(agentId), Is.Null, "sceneA still had a caps object path"); |
105 | 180 | ||
106 | // TODO: Check that more of everything is as it should be | 181 | // TODO: Check that more of everything is as it should be |
107 | 182 | ||
108 | // TODO: test what happens if we try to teleport to a region that doesn't exist | 183 | // TODO: test what happens if we try to teleport to a region that doesn't exist |
109 | } | 184 | } |
110 | } | 185 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 81f200a..00163f6 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -304,12 +304,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
304 | public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f); | 304 | public d.Vector3 xyz = new d.Vector3(128.1640f, 128.3079f, 25.7600f); |
305 | public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); | 305 | public d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); |
306 | 306 | ||
307 | private uint heightmapWidth = m_regionWidth + 1; | 307 | // TODO: unused: private uint heightmapWidth = m_regionWidth + 1; |
308 | private uint heightmapHeight = m_regionHeight + 1; | 308 | // TODO: unused: private uint heightmapHeight = m_regionHeight + 1; |
309 | 309 | // TODO: unused: private uint heightmapWidthSamples; | |
310 | private uint heightmapWidthSamples; | 310 | // TODO: unused: private uint heightmapHeightSamples; |
311 | |||
312 | private uint heightmapHeightSamples; | ||
313 | 311 | ||
314 | private volatile int m_global_contactcount = 0; | 312 | private volatile int m_global_contactcount = 0; |
315 | 313 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index ff85b96..691732a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -125,9 +125,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
125 | 125 | ||
126 | if (lease.CurrentState == LeaseState.Initial) | 126 | if (lease.CurrentState == LeaseState.Initial) |
127 | { | 127 | { |
128 | lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); | 128 | lease.InitialLeaseTime = TimeSpan.FromMinutes(0); |
129 | lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); | 129 | // lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); |
130 | lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); | 130 | // lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); |
131 | } | 131 | } |
132 | return lease; | 132 | return lease; |
133 | } | 133 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6539bda..6e3a3ab 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -166,9 +166,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
166 | 166 | ||
167 | if (lease.CurrentState == LeaseState.Initial) | 167 | if (lease.CurrentState == LeaseState.Initial) |
168 | { | 168 | { |
169 | lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); | 169 | lease.InitialLeaseTime = TimeSpan.FromMinutes(0); |
170 | lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); | 170 | // lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); |
171 | lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); | 171 | // lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); |
172 | } | 172 | } |
173 | return lease; | 173 | return lease; |
174 | } | 174 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index d119a77..838cafb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |||
@@ -42,16 +42,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
42 | public partial class ScriptBaseClass : MarshalByRefObject, IScript | 42 | public partial class ScriptBaseClass : MarshalByRefObject, IScript |
43 | { | 43 | { |
44 | private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>(); | 44 | private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>(); |
45 | private ScriptSponsor m_sponser; | 45 | // private ScriptSponsor m_sponser; |
46 | 46 | ||
47 | public override Object InitializeLifetimeService() | 47 | public override Object InitializeLifetimeService() |
48 | { | 48 | { |
49 | ILease lease = (ILease)base.InitializeLifetimeService(); | 49 | ILease lease = (ILease)base.InitializeLifetimeService(); |
50 | if (lease.CurrentState == LeaseState.Initial) | 50 | if (lease.CurrentState == LeaseState.Initial) |
51 | { | 51 | { |
52 | lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); | 52 | // Infinite |
53 | lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); | 53 | lease.InitialLeaseTime = TimeSpan.FromMinutes(0); |
54 | lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); | 54 | // lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); |
55 | // lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); | ||
55 | } | 56 | } |
56 | return lease; | 57 | return lease; |
57 | } | 58 | } |
@@ -79,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
79 | } | 80 | } |
80 | } | 81 | } |
81 | 82 | ||
82 | m_sponser = new ScriptSponsor(); | 83 | // m_sponser = new ScriptSponsor(); |
83 | } | 84 | } |
84 | 85 | ||
85 | private Executor m_Executor = null; | 86 | private Executor m_Executor = null; |
@@ -112,7 +113,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
112 | return; | 113 | return; |
113 | 114 | ||
114 | ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject); | 115 | ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject); |
115 | lease.Register(m_sponser); | 116 | // lease.Register(m_sponser); |
116 | 117 | ||
117 | MethodInfo mi = inits[api]; | 118 | MethodInfo mi = inits[api]; |
118 | 119 | ||
@@ -126,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
126 | 127 | ||
127 | public void Close() | 128 | public void Close() |
128 | { | 129 | { |
129 | m_sponser.Close(); | 130 | // m_sponser.Close(); |
130 | } | 131 | } |
131 | 132 | ||
132 | public Dictionary<string, object> GetVars() | 133 | public Dictionary<string, object> GetVars() |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 4211ced..225126d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -53,7 +53,7 @@ using OpenSim.Region.ScriptEngine.Interfaces; | |||
53 | 53 | ||
54 | namespace OpenSim.Region.ScriptEngine.Shared.Instance | 54 | namespace OpenSim.Region.ScriptEngine.Shared.Instance |
55 | { | 55 | { |
56 | public class ScriptInstance : MarshalByRefObject, IScriptInstance, ISponsor | 56 | public class ScriptInstance : MarshalByRefObject, IScriptInstance |
57 | { | 57 | { |
58 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 58 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
59 | 59 | ||
@@ -261,7 +261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
261 | "SecondLife.Script"); | 261 | "SecondLife.Script"); |
262 | 262 | ||
263 | ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); | 263 | ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); |
264 | lease.Register(this); | 264 | // lease.Register(this); |
265 | } | 265 | } |
266 | catch (Exception) | 266 | catch (Exception) |
267 | { | 267 | { |
@@ -1006,10 +1006,5 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1006 | { | 1006 | { |
1007 | return true; | 1007 | return true; |
1008 | } | 1008 | } |
1009 | |||
1010 | public TimeSpan Renewal(ILease lease) | ||
1011 | { | ||
1012 | return lease.InitialLeaseTime; | ||
1013 | } | ||
1014 | } | 1009 | } |
1015 | } | 1010 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs index aac52a4..045abb4 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs | |||
@@ -40,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests | |||
40 | /// <summary> | 40 | /// <summary> |
41 | /// Scene presence tests | 41 | /// Scene presence tests |
42 | /// </summary> | 42 | /// </summary> |
43 | /// Commented out XEngineTests that don't do anything | ||
44 | /* | ||
43 | [TestFixture] | 45 | [TestFixture] |
44 | public class XEngineTest | 46 | public class XEngineTest |
45 | { | 47 | { |
@@ -65,4 +67,5 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests | |||
65 | xengine.RegionLoaded(scene); | 67 | xengine.RegionLoaded(scene); |
66 | } | 68 | } |
67 | } | 69 | } |
70 | */ | ||
68 | } | 71 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 3ef5ae8..76218c8 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -729,8 +729,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
729 | item.Name, startParam, postOnRez, | 729 | item.Name, startParam, postOnRez, |
730 | stateSource, m_MaxScriptQueue); | 730 | stateSource, m_MaxScriptQueue); |
731 | 731 | ||
732 | m_log.DebugFormat("[XEngine] Loaded script {0}.{1}", | 732 | m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}", |
733 | part.ParentGroup.RootPart.Name, item.Name); | 733 | part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString()); |
734 | 734 | ||
735 | instance.AppDomain = appDomain; | 735 | instance.AppDomain = appDomain; |
736 | instance.LineMap = linemap; | 736 | instance.LineMap = linemap; |