From 74b3ce857228ae948d99ad4b6ef35f35e7742b2c Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 16 Jan 2010 04:57:49 +0000 Subject: [PATCH 01/81] Let monitor data be requested using either the short form of the name or the full, namespace qualified version. --- .../Region/CoreModules/Framework/Monitoring/MonitorModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index 96d65d7676..f15f8f6de1 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs @@ -87,7 +87,10 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring foreach (IMonitor monitor in m_monitors) { - if (monitor.ToString() == monID) + string elemName = monitor.ToString(); + if (elemName.StartsWith(monitor.GetType().Namespace)) + elemName = elemName.Substring(monitor.GetType().Namespace.Length + 1); + if (elemName == monID || monitor.ToString() == monID) { Hashtable ereply3 = new Hashtable(); From 3ff28e7a8f6a7816dd76307c36153ba8f393dea1 Mon Sep 17 00:00:00 2001 From: CasperW Date: Mon, 18 Jan 2010 17:56:27 +0100 Subject: [PATCH 02/81] Fix a major security problem with osSetDynamicTexture which allowed the deletion of /any/ asset. --- .../DynamicTexture/DynamicTextureModule.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index f51d0c2464..679c871441 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -358,11 +358,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - scene.AssetService.Delete(oldID.ToString()); + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } From 2257431cba74f8a184c65e3d4ebc7c1befbd349c Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 18 Jan 2010 17:35:49 +0000 Subject: [PATCH 03/81] Comment the asset deletion handler. It can be abused and is not currently needed. --- OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs index 3f33da628b..f33bb90fde 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs @@ -63,7 +63,7 @@ namespace OpenSim.Server.Handlers.Asset if (p.Length > 0) { - result = m_AssetService.Delete(p[0]); + // result = m_AssetService.Delete(p[0]); } XmlSerializer xs = new XmlSerializer(typeof(bool)); From c89a9912cc8cb7cc92af153fb8250da52da7a084 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 19 Jan 2010 19:58:50 +0000 Subject: [PATCH 04/81] Add OpenSim.Server.ini.example documentation for the new AllowDuplicateNames grid service setting --- bin/OpenSim.Server.ini.example | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/OpenSim.Server.ini.example b/bin/OpenSim.Server.ini.example index d4e05af5d0..372923b5eb 100644 --- a/bin/OpenSim.Server.ini.example +++ b/bin/OpenSim.Server.ini.example @@ -80,4 +80,7 @@ LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=grid;" Realm = "regions" + +; If true, duplicate region names are allowed on the grid. If false, no duplicate names are allowed +; Default is false ; AllowDuplicateNames = "True" From c211a120a5045c4b1ccaac7bfe7db13f75804cc3 Mon Sep 17 00:00:00 2001 From: mbowman Date: Tue, 19 Jan 2010 15:50:30 -0800 Subject: [PATCH 05/81] Console output no longer requires loglevel to be set to info; you can run the simulator with log level WARN or ERROR and see the output of console commands Signed-off-by: Melanie --- OpenSim/Framework/Console/ConsoleBase.cs | 2 +- .../Framework/Console/ConsolePluginCommand.cs | 2 +- OpenSim/Region/Application/OpenSim.cs | 127 +++++++++--------- bin/OpenSim.exe.config | 2 +- 4 files changed, 69 insertions(+), 64 deletions(-) mode change 100644 => 100755 OpenSim/Framework/Console/ConsoleBase.cs mode change 100644 => 100755 OpenSim/Framework/Console/ConsolePluginCommand.cs mode change 100644 => 100755 OpenSim/Region/Application/OpenSim.cs mode change 100644 => 100755 bin/OpenSim.exe.config diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs old mode 100644 new mode 100755 index 0a51266064..b70d1dbdc6 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -73,7 +73,7 @@ namespace OpenSim.Framework.Console public virtual void Output(string text) { - System.Console.Write(text); + System.Console.WriteLine(text); } public string CmdPrompt(string p) diff --git a/OpenSim/Framework/Console/ConsolePluginCommand.cs b/OpenSim/Framework/Console/ConsolePluginCommand.cs old mode 100644 new mode 100755 index a2f31ea5db..f4d3687450 --- a/OpenSim/Framework/Console/ConsolePluginCommand.cs +++ b/OpenSim/Framework/Console/ConsolePluginCommand.cs @@ -124,7 +124,7 @@ namespace OpenSim.Framework.Console /// public void ShowHelp(ConsoleBase console) { - console.Output(String.Join(" ", m_cmdText) + " - " + m_helpText); + console.Output(String.Join(" ", m_cmdText) + " - " + m_helpText + "\n"); } /// diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs old mode 100644 new mode 100755 index e09d730b33..eccd2765cc --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -425,7 +425,7 @@ namespace OpenSim if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) { - m_log.Info( + MainConsole.Instance.Output( String.Format( "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName)); @@ -440,7 +440,7 @@ namespace OpenSim presence.Scene.IncomingCloseAgent(presence.UUID); } } - m_log.Info(""); + MainConsole.Instance.Output(""); } /// @@ -487,7 +487,7 @@ namespace OpenSim private void HandleClearAssets(string module, string[] args) { - m_log.Info("Not implemented."); + MainConsole.Instance.Output("Not implemented."); } /// @@ -497,7 +497,7 @@ namespace OpenSim /// private void HandleForceUpdate(string module, string[] args) { - m_log.Info("Updating all clients"); + MainConsole.Instance.Output("Updating all clients"); m_sceneManager.ForceCurrentSceneClientUpdate(); } @@ -514,7 +514,7 @@ namespace OpenSim } else { - m_log.Info("Argument error: edit scale "); + MainConsole.Instance.Output("Argument error: edit scale "); } } @@ -527,7 +527,7 @@ namespace OpenSim { if (cmd.Length < 4) { - m_log.Error("Usage: create region "); + MainConsole.Instance.Output("Usage: create region "); return; } if (cmd[3].EndsWith(".xml")) @@ -554,7 +554,7 @@ namespace OpenSim } else { - m_log.Error("Usage: create region "); + MainConsole.Instance.Output("Usage: create region "); return; } } @@ -578,8 +578,8 @@ namespace OpenSim case "set": if (cmdparams.Length < 4) { - m_log.Error("SYNTAX: " + n + " SET SECTION KEY VALUE"); - m_log.Error("EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5"); + MainConsole.Instance.Output(String.Format("SYNTAX: {0} SET SECTION KEY VALUE",n)); + MainConsole.Instance.Output(String.Format("EXAMPLE: {0} SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5",n)); } else { @@ -592,8 +592,7 @@ namespace OpenSim c.Set(cmdparams[2], _value); m_config.Source.Merge(source); - m_log.Error(n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " + - _value); + MainConsole.Instance.Output(String.Format("{0} {0} {1} {2} {3}",n,cmdparams[1],cmdparams[2],_value)); } } break; @@ -601,21 +600,21 @@ namespace OpenSim case "get": if (cmdparams.Length < 3) { - m_log.Error("SYNTAX: " + n + " GET SECTION KEY"); - m_log.Error("EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads"); + MainConsole.Instance.Output(String.Format("SYNTAX: {0} GET SECTION KEY",n)); + MainConsole.Instance.Output(String.Format("EXAMPLE: {0} GET ScriptEngine.DotNetEngine NumberOfScriptThreads",n)); } else { IConfig c = m_config.Source.Configs[cmdparams[1]]; if (c == null) { - m_log.Info("Section \"" + cmdparams[1] + "\" does not exist."); + MainConsole.Instance.Output(String.Format("Section \"{0}\" does not exist.",cmdparams[1])); break; } else { - m_log.Info(n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " + - c.GetString(cmdparams[2])); + MainConsole.Instance.Output(String.Format("{0} GET {1} {2} : {3}",n,cmdparams[1],cmdparams[2], + c.GetString(cmdparams[2]))); } } @@ -624,17 +623,17 @@ namespace OpenSim case "save": if (cmdparams.Length < 2) { - m_log.Error("SYNTAX: " + n + " SAVE FILE"); + MainConsole.Instance.Output("SYNTAX: " + n + " SAVE FILE"); return; } if (Application.iniFilePath == cmdparams[1]) { - m_log.Error("FILE can not be "+Application.iniFilePath); + MainConsole.Instance.Output("FILE can not be " + Application.iniFilePath); return; } - m_log.Info("Saving configuration file: " + cmdparams[1]); + MainConsole.Instance.Output("Saving configuration file: " + cmdparams[1]); m_config.Save(cmdparams[1]); break; } @@ -660,7 +659,7 @@ namespace OpenSim case "list": foreach (IRegionModule irm in m_moduleLoader.GetLoadedSharedModules) { - m_log.Info("Shared region module: " + irm.Name); + MainConsole.Instance.Output(String.Format("Shared region module: {0}", irm.Name)); } break; case "unload": @@ -670,7 +669,7 @@ namespace OpenSim { if (rm.Name.ToLower() == cmdparams[1].ToLower()) { - m_log.Info("Unloading module: " + rm.Name); + MainConsole.Instance.Output(String.Format("Unloading module: {0}", rm.Name)); m_moduleLoader.UnloadModule(rm); } } @@ -681,7 +680,7 @@ namespace OpenSim { foreach (Scene s in new ArrayList(m_sceneManager.Scenes)) { - m_log.Info("Loading module: " + cmdparams[1]); + MainConsole.Instance.Output(String.Format("Loading module: {0}", cmdparams[1])); m_moduleLoader.LoadRegionModules(cmdparams[1], s); } } @@ -726,7 +725,7 @@ namespace OpenSim if (m_sceneManager.TryGetScene(regRemoveName, out removeScene)) RemoveRegion(removeScene, false); else - m_log.Error("no region with that name"); + MainConsole.Instance.Output("no region with that name"); break; case "delete-region": @@ -736,7 +735,7 @@ namespace OpenSim if (m_sceneManager.TryGetScene(regDeleteName, out killScene)) RemoveRegion(killScene, true); else - m_log.Error("no region with that name"); + MainConsole.Instance.Output("no region with that name"); break; case "restart": @@ -746,7 +745,7 @@ namespace OpenSim case "Add-InventoryHost": if (cmdparams.Length > 0) { - m_log.Info("Not implemented."); + MainConsole.Instance.Output("Not implemented."); } break; @@ -764,15 +763,15 @@ namespace OpenSim string newRegionName = CombineParams(cmdparams, 2); if (!m_sceneManager.TrySetCurrentScene(newRegionName)) - m_log.Error("Couldn't select region " + newRegionName); + MainConsole.Instance.Output(String.Format("Couldn't select region {0}", newRegionName)); } else { - m_log.Error("Usage: change region "); + MainConsole.Instance.Output("Usage: change region "); } string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); - m_log.Info(String.Format("Currently selected region is {0}", regionName)); + MainConsole.Instance.Output(String.Format("Currently selected region is {0}", regionName)); m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); m_console.ConsoleScene = m_sceneManager.CurrentScene; } @@ -789,7 +788,7 @@ namespace OpenSim } else { - m_log.Info("Create user is not available in grid mode, use the user server."); + MainConsole.Instance.Output("Create user is not available in grid mode, use the user server."); } } @@ -805,7 +804,7 @@ namespace OpenSim } else { - m_log.Info("Reset user password is not available in grid mode, use the user-server."); + MainConsole.Instance.Output("Reset user password is not available in grid mode, use the user-server."); } } @@ -830,9 +829,9 @@ namespace OpenSim } else { - m_log.Error("packet debug should be 0..255"); + MainConsole.Instance.Output("packet debug should be 0..255"); } - m_log.Info("New packet debug: " + newDebug.ToString()); + MainConsole.Instance.Output(String.Format("New packet debug: {0}", newDebug)); } break; @@ -842,7 +841,7 @@ namespace OpenSim { if (m_sceneManager.CurrentScene == null) { - m_log.Info("Please use 'change region ' first"); + MainConsole.Instance.Output("Please use 'change region ' first"); } else { @@ -851,7 +850,7 @@ namespace OpenSim bool physicsOn = !Convert.ToBoolean(args[4]); m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); - m_log.Info( + MainConsole.Instance.Output( String.Format( "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", !scriptingOn, !collisionsOn, !physicsOn)); @@ -859,13 +858,13 @@ namespace OpenSim } else { - m_log.Error("debug scene (where inside <> is true/false)"); + MainConsole.Instance.Output("debug scene (where inside <> is true/false)"); } break; default: - m_log.Error("Unknown debug"); + MainConsole.Instance.Output("Unknown debug"); break; } } @@ -887,7 +886,7 @@ namespace OpenSim switch (showParams[0]) { case "assets": - m_log.Info("Not implemented."); + MainConsole.Instance.Output("Not implemented."); break; case "users": @@ -901,9 +900,9 @@ namespace OpenSim agents = m_sceneManager.GetCurrentSceneAvatars(); } - m_log.Info(String.Format("\nAgents connected: {0}\n", agents.Count)); + MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count)); - m_log.Info( + MainConsole.Instance.Output( String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", "Firstname", "Lastname", "Agent ID", "Root/Child", "Region", "Position")); @@ -921,7 +920,7 @@ namespace OpenSim regionName = regionInfo.RegionName; } - m_log.Info( + MainConsole.Instance.Output( String.Format( "{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", presence.Firstname, @@ -932,7 +931,7 @@ namespace OpenSim presence.AbsolutePosition.ToString())); } - m_log.Info(String.Empty); + MainConsole.Instance.Output(String.Empty); break; case "connections": @@ -950,25 +949,30 @@ namespace OpenSim } ); - m_log.Info(connections.ToString()); + MainConsole.Instance.Output(connections.ToString()); break; case "modules": - m_log.Info("The currently loaded shared modules are:"); + MainConsole.Instance.Output("The currently loaded shared modules are:"); foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) { - m_log.Info("Shared Module: " + module.Name); + MainConsole.Instance.Output("Shared Module: " + module.Name); } + + MainConsole.Instance.Output(""); break; case "regions": m_sceneManager.ForEachScene( delegate(Scene scene) { - m_log.Info("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " + - scene.RegionInfo.RegionLocX + " , Region YLoc: " + - scene.RegionInfo.RegionLocY + " , Region Port: " + - scene.RegionInfo.InternalEndPoint.Port.ToString()); + MainConsole.Instance.Output(String.Format( + "Region Name: {0}, Region XLoc: {1}, Region YLoc: {2}, Region Port: {3}", + scene.RegionInfo.RegionName, + scene.RegionInfo.RegionLocX, + scene.RegionInfo.RegionLocY, + scene.RegionInfo.InternalEndPoint.Port)); + }); break; @@ -993,8 +997,10 @@ namespace OpenSim { rating = "PG"; } - m_log.Info("Region Name: " + scene.RegionInfo.RegionName + " , Region Rating: " + - rating); + MainConsole.Instance.Output(String.Format( + "Region Name: {0}, Region Rating {1}", + scene.RegionInfo.RegionName, + rating)); }); break; } @@ -1015,7 +1021,7 @@ namespace OpenSim if (client is IStatsCollector) { report = report + client.FirstName + - " " + client.LastName + "\n"; + " " + client.LastName; IStatsCollector stats = (IStatsCollector) client; @@ -1032,7 +1038,7 @@ namespace OpenSim "Texture", "Asset"); report = report + stats.Report() + - "\n\n"; + "\n"; } }); }); @@ -1091,7 +1097,7 @@ namespace OpenSim } else { - m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName); + MainConsole.Instance.Output(string.Format("A user with the name {0} {1} already exists!", firstName, lastName)); } } @@ -1144,7 +1150,7 @@ namespace OpenSim /// protected void SaveXml(string module, string[] cmdparams) { - 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."); + MainConsole.Instance.Output("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."); if (cmdparams.Length > 0) { @@ -1163,7 +1169,7 @@ namespace OpenSim /// protected void LoadXml(string module, string[] cmdparams) { - 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."); + MainConsole.Instance.Output("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."); Vector3 loadOffset = new Vector3(0, 0, 0); if (cmdparams.Length > 2) @@ -1186,8 +1192,7 @@ namespace OpenSim { loadOffset.Z = (float) Convert.ToDecimal(cmdparams[6]); } - m_log.Error("loadOffsets = <" + loadOffset.X + "," + loadOffset.Y + "," + - loadOffset.Z + ">"); + MainConsole.Instance.Output(String.Format("loadOffsets = <{0},{1},{2}>",loadOffset.X,loadOffset.Y,loadOffset.Z)); } } m_sceneManager.LoadCurrentSceneFromXml(cmdparams[0], generateNewIDS, loadOffset); @@ -1200,7 +1205,7 @@ namespace OpenSim } catch (FileNotFoundException) { - m_log.Error("Default xml not found. Usage: load-xml "); + MainConsole.Instance.Output("Default xml not found. Usage: load-xml "); } } } @@ -1236,7 +1241,7 @@ namespace OpenSim } catch (FileNotFoundException) { - m_log.Error("Specified xml not found. Usage: load xml2 "); + MainConsole.Instance.Output("Specified xml not found. Usage: load xml2 "); } } else @@ -1247,7 +1252,7 @@ namespace OpenSim } catch (FileNotFoundException) { - m_log.Error("Default xml not found. Usage: load xml2 "); + MainConsole.Instance.Output("Default xml not found. Usage: load xml2 "); } } } @@ -1264,7 +1269,7 @@ namespace OpenSim } catch (Exception e) { - m_log.Error(e.Message); + MainConsole.Instance.Output(e.Message); } } diff --git a/bin/OpenSim.exe.config b/bin/OpenSim.exe.config old mode 100644 new mode 100755 index c2d93c0449..3c7adf5419 --- a/bin/OpenSim.exe.config +++ b/bin/OpenSim.exe.config @@ -12,7 +12,7 @@ - + From 14e62c096d571a47abffd1a954c1a949300f156c Mon Sep 17 00:00:00 2001 From: Revolution Date: Thu, 21 Jan 2010 18:12:40 -0600 Subject: [PATCH 06/81] Fixes llSetDamage. Patch from Revolution --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 85454258ed..39a2c656cf 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3236,17 +3236,15 @@ namespace OpenSim.Region.Framework.Scenes uint killerObj = 0; foreach (uint localid in coldata.Keys) { - if (coldata[localid].PenetrationDepth <= 0.10f || m_invulnerable) - continue; - //if (localid == 0) - //continue; - - SceneObjectPart part = m_scene.GetSceneObjectPart(localid); + SceneObjectPart part = Scene.GetSceneObjectPart(localid); if (part != null && part.ParentGroup.Damage != -1.0f) Health -= part.ParentGroup.Damage; else - Health -= coldata[localid].PenetrationDepth * 5.0f; + { + if (coldata[localid].PenetrationDepth >= 0.10f) + Health -= coldata[localid].PenetrationDepth * 5.0f; + } if (Health <= 0.0f) { From e61f42ad3a4a315d4eb56107bb6ead7092035bff Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Jan 2010 23:59:04 -0800 Subject: [PATCH 07/81] add a target position to agent updates to ScenePresence to support alternative client protocols --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 39a2c656cf..1c183f3310 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1276,6 +1276,12 @@ namespace OpenSim.Region.Framework.Scenes if (m_allowMovement) { + if (agentData.UseClientAgentPosition) + { + m_moveToPositionInProgress = (agentData.ClientAgentPosition - AbsolutePosition).Length() > 0.2f; + m_moveToPositionTarget = agentData.ClientAgentPosition; + } + int i = 0; bool update_rotation = false; @@ -1382,7 +1388,7 @@ namespace OpenSim.Region.Framework.Scenes if (bAllowUpdateMoveToPosition && (m_moveToPositionInProgress && !m_autopilotMoving)) { //Check the error term of the current position in relation to the target position - if (Util.GetDistanceTo(AbsolutePosition, m_moveToPositionTarget) <= 1.5f) + if (Util.GetDistanceTo(AbsolutePosition, m_moveToPositionTarget) <= 0.5f) { // we are close enough to the target m_moveToPositionTarget = Vector3.Zero; From 5f5fdc36248788b97c1283f65e2188fa1d60a361 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 22 Jan 2010 16:22:23 +0000 Subject: [PATCH 08/81] Allow oar loading to work even if an estate module is not present Write bare bones unit test for region setting loads --- .../World/Archiver/ArchiveReadRequest.cs | 6 +- .../World/Archiver/Tests/ArchiverTests.cs | 70 +++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 52add238c6..8ed1913c30 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -423,9 +423,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; - + IEstateModule estateModule = m_scene.RequestModuleInterface(); - estateModule.sendRegionHandshakeToAll(); + + if (estateModule != null) + estateModule.sendRegionHandshakeToAll(); return true; } diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index edac4a4e8b..4f7a1372ac 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -36,6 +36,7 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Serialization; +using OpenSim.Framework.Serialization.External; using OpenSim.Region.CoreModules.World.Serialiser; using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.Framework.Scenes; @@ -269,6 +270,75 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); } + /// + /// Test loading the region settings of a V0.2 OpenSim Region Archive. + /// + [Test] + public void TestLoadOarV0_2RegionSettings() + { + TestHelper.InMethod(); + //log4net.Config.XmlConfigurator.Configure(); + + SerialiserModule serialiserModule = new SerialiserModule(); + ArchiverModule archiverModule = new ArchiverModule(); + Scene scene = SceneSetupHelpers.SetupScene(); + SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); + + MemoryStream archiveWriteStream = new MemoryStream(); + TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); + + tar.WriteDir(ArchiveConstants.TERRAINS_PATH); + tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); + + RegionSettings rs = new RegionSettings(); + rs.AgentLimit = 17; + rs.AllowDamage = true; + rs.AllowLandJoinDivide = true; + rs.AllowLandResell = true; + rs.BlockFly = true; + rs.BlockShowInSearch = true; + rs.BlockTerraform = true; + rs.DisableCollisions = true; + rs.DisablePhysics = true; + rs.DisableScripts = true; + rs.Elevation1NW = 15.9; + rs.Elevation1NE = 45.3; + rs.Elevation1SE = 49; + rs.Elevation1SW = 1.9; + rs.Elevation2NW = 4.5; + rs.Elevation2NE = 19.2; + rs.Elevation2SE = 9.2; + rs.Elevation2SW = 2.1; + rs.FixedSun = true; + rs.ObjectBonus = 1.4; + rs.RestrictPushing = true; + rs.TerrainLowerLimit = 0.4; + rs.TerrainRaiseLimit = 17.9; + rs.TerrainTexture1 = UUID.Parse("00000000-0000-0000-0000-000000000020"); + rs.TerrainTexture2 = UUID.Parse("00000000-0000-0000-0000-000000000040"); + rs.TerrainTexture3 = UUID.Parse("00000000-0000-0000-0000-000000000060"); + rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); + rs.UseEstateSun = true; + rs.WaterHeight = 23; + + tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); + + tar.Close(); + + MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); + + lock (this) + { + scene.EventManager.OnOarFileLoaded += LoadCompleted; + archiverModule.DearchiveRegion(archiveReadStream); + } + + Assert.That(m_lastErrorMessage, Is.Null); + RegionSettings loadedRs = scene.RegionInfo.RegionSettings; + + Assert.That(loadedRs.AgentLimit, Is.EqualTo(17)); + } + /// /// Test merging a V0.2 OpenSim Region Archive into an existing scene /// From 2308b375a773d3c00d85f49e78ef7691720d002a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 22 Jan 2010 16:26:42 +0000 Subject: [PATCH 09/81] minor: remove warning from LLClientView --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 515d0ea1c2..4b5e4c4d5c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -9091,8 +9091,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool HandleSendPostcard(IClientAPI client, Packet packet) { - SendPostcardPacket SendPostcard = - (SendPostcardPacket)packet; +// SendPostcardPacket SendPostcard = +// (SendPostcardPacket)packet; SendPostcard handlerSendPostcard = OnSendPostcard; if (handlerSendPostcard != null) { From a0e4665077748430ebcb7c02917036fc59794975 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 22 Jan 2010 17:17:25 +0000 Subject: [PATCH 10/81] complete assertion checks of all other oar loaded region settings --- .../World/Archiver/Tests/ArchiverTests.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 4f7a1372ac..9e9ceddf42 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -337,6 +337,34 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests RegionSettings loadedRs = scene.RegionInfo.RegionSettings; Assert.That(loadedRs.AgentLimit, Is.EqualTo(17)); + Assert.That(loadedRs.AllowDamage, Is.True); + Assert.That(loadedRs.AllowLandJoinDivide, Is.True); + Assert.That(loadedRs.AllowLandResell, Is.True); + Assert.That(loadedRs.BlockFly, Is.True); + Assert.That(loadedRs.BlockShowInSearch, Is.True); + Assert.That(loadedRs.BlockTerraform, Is.True); + Assert.That(loadedRs.DisableCollisions, Is.True); + Assert.That(loadedRs.DisablePhysics, Is.True); + Assert.That(loadedRs.DisableScripts, Is.True); + Assert.That(loadedRs.Elevation1NW, Is.EqualTo(15.9)); + Assert.That(loadedRs.Elevation1NE, Is.EqualTo(45.3)); + Assert.That(loadedRs.Elevation1SE, Is.EqualTo(49)); + Assert.That(loadedRs.Elevation1SW, Is.EqualTo(1.9)); + Assert.That(loadedRs.Elevation2NW, Is.EqualTo(4.5)); + Assert.That(loadedRs.Elevation2NE, Is.EqualTo(19.2)); + Assert.That(loadedRs.Elevation2SE, Is.EqualTo(9.2)); + Assert.That(loadedRs.Elevation2SW, Is.EqualTo(2.1)); + Assert.That(loadedRs.FixedSun, Is.True); + Assert.That(loadedRs.ObjectBonus, Is.EqualTo(1.4)); + Assert.That(loadedRs.RestrictPushing, Is.True); + Assert.That(loadedRs.TerrainLowerLimit, Is.EqualTo(0.4)); + Assert.That(loadedRs.TerrainRaiseLimit, Is.EqualTo(17.9)); + Assert.That(loadedRs.TerrainTexture1, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000020"))); + Assert.That(loadedRs.TerrainTexture2, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000040"))); + Assert.That(loadedRs.TerrainTexture3, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000060"))); + Assert.That(loadedRs.TerrainTexture4, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000080"))); + Assert.That(loadedRs.UseEstateSun, Is.True); + Assert.That(loadedRs.WaterHeight, Is.EqualTo(23)); } /// From 1df69be9a6d7a1c7c0a5446c11fe9fde2c2b88f7 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 22 Jan 2010 20:32:34 +0000 Subject: [PATCH 11/81] Add first part of test for checking restore of task inventory items on oar load Passes but not yet complete --- .../World/Archiver/Tests/ArchiverTests.cs | 50 +++++++++++++++++- .../Archiver/Tests/Resources/test-sound.wav | Bin 0 -> 211648 bytes prebuild.xml | 1 + 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 OpenSim/Region/CoreModules/World/Archiver/Tests/Resources/test-sound.wav diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 9e9ceddf42..1200105817 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests // Also check that direct entries which will also have a file entry containing that directory doesn't // upset load tar.WriteDir(ArchiveConstants.TERRAINS_PATH); - + tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); string part1Name = "object1"; @@ -235,6 +235,45 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); part1.Name = part1Name; SceneObjectGroup object1 = new SceneObjectGroup(part1); + + // Let's put some inventory items into our object + UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); + Type type = GetType(); + Assembly assembly = type.Assembly; + string soundDataResourceName = null; + string[] names = assembly.GetManifestResourceNames(); + foreach (string name in names) + { + if (name.EndsWith(".Resources.test-sound.wav")) + soundDataResourceName = name; + } + Assert.That(soundDataResourceName, Is.Not.Null); + + byte[] soundData; + Console.WriteLine("Loading " + soundDataResourceName); + using (Stream resource = assembly.GetManifestResourceStream(soundDataResourceName)) + { + using (BinaryReader br = new BinaryReader(resource)) + { + // FIXME: Use the inspector insteadthere are so many forums and lists already, though admittedly none of them are suitable for cross virtual-enivornemnt discussion + soundData = br.ReadBytes(99999999); + UUID soundUuid = UUID.Parse("00000000-0000-0000-0000-000000000001"); + string soundAssetFileName + = ArchiveConstants.ASSETS_PATH + soundUuid + + ArchiveConstants.ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SoundWAV]; + tar.WriteFile(soundAssetFileName, soundData); + + /* + AssetBase soundAsset = AssetHelpers.CreateAsset(soundUuid, soundData); + scene.AssetService.Store(soundAsset); + asset1FileName = ArchiveConstants.ASSETS_PATH + soundUuid + ".wav"; + */ + + TaskInventoryItem item1 = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid }; + part1.Inventory.AddInventoryItem(item1, true); + } + } + scene.AddNewSceneObject(object1, false); string object1FileName = string.Format( @@ -266,6 +305,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That( object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); + // Need to implement a method to get the task inventory item by name (since the uuid will have changed on load) + /* + TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItem(soundItemUuid); + Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); + AssetBase loadedSoundAsset = scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); + Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); + Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); + */ + // Temporary Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); } diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/Resources/test-sound.wav b/OpenSim/Region/CoreModules/World/Archiver/Tests/Resources/test-sound.wav new file mode 100755 index 0000000000000000000000000000000000000000..b45ee54d354c075cec2c681e057265bee4c8ccef GIT binary patch literal 211648 zcmeF)f2iH{xi9#&w{aWOG)-epnv_gtz5mVsCyOL|ul4=$`8=QJc|Y&x$LG85{9m?hd;5k1e-#s&$9WAeSzVYw>w?`J$|Nry7AYbP5fdnemRn`icnKAs#Kzc#*Oa^Gm(%*vU&Mh{J9C$~-JC*K`CHac2AT{GD+ zd2Mw2%$k|Cqa)+%$Ip(pPZrI*G;_nus?qWB*Tz2`KQXy}^yKLF(TT}hlMg0~Mw>^Q zMvF#=CI=_yCM!p4M@vShC&wpeCyQ%*OGfjPGxh#xw0JaEqnw|dp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>U6l_52m4nlsa&s2x>f&QjaCxPz@T#-2&zh)rU-~3`PV{0c zUghuAFsk?AW2i*|`b6Ij8{2=wM&Z?7k@J5_Z0!r&v)juYvOjr@x5GjC0UnVLi4YvN zDj|CY1&u^vPnMt@^|SA zVc7xTYIg+ZKO+44u$jt4d+u=?c3W9md}ro;X$Mthy5Pnf*KdQ>YvzM$9#~pURaXLU zT+R<@`SQxD88E1dt6a&BLEndsp;b7~uGS2?V{Vw#-mM*lWC3|rIRXap3I0*94X;&y zN~u=Qff~hfIFo1Y(c7#NuMT7L3DoB(?L}_Aw_dgSQmcu%Q7pk(c|Q| z-3_b=?X4bf#n`5>@P_U#E5JJzE%M7a+WAz>tAkTd^;KZIo~B$?QbqW(a&d9Un}aJq%*5Z>Sm4U2z&Gc;=VnIzi|O4yoq5-LqXn-V&St*<=A7}P zxtb4VCi=&jM>yMF+Mb->o_lA!PbFU;PB54SrrDgN_l%}=)* z+r8;<{Bn5l`1#?J?Va<-|6M;nnfdAm$4AGPk0*y)+t=sco!=VUzc%v@Z%uqXdr@(> wSHR5GKQlG{-b}&YpLqFrdvzw}zuIP!|8VX2`yBnvoc-N7=Ci{y$G;E%1B^v8RsaA1 literal 0 HcmV?d00001 diff --git a/prebuild.xml b/prebuild.xml index 7881cd7ebf..0ab7414f4c 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -3271,6 +3271,7 @@ + From ec3c31e61e5e540f822891110df9bc978655bbaf Mon Sep 17 00:00:00 2001 From: Revolution Date: Fri, 22 Jan 2010 18:09:33 -0600 Subject: [PATCH 12/81] Updates all IRegionModules to the new style region modules. Signed-off-by: Melanie --- .../LoadRegions/LoadRegionsPlugin.cs | 4 +- OpenSim/Client/MXP/MXPModule.cs | 38 ++- .../AssetTransactionModule.cs | 35 ++- .../Agent/Capabilities/CapabilitiesModule.cs | 2 +- .../CoreModules/Agent/IPBan/IPBanModule.cs | 40 ++- .../TextureDownload/TextureDownloadModule.cs | 33 ++- .../Agent/TextureSender/J2KDecoderModule.cs | 33 ++- .../CoreModules/Agent/Xfer/XferModule.cs | 30 +- .../AvatarFactory/AvatarFactoryModule.cs | 31 ++- .../CoreModules/Avatar/Combat/CombatModule.cs | 32 ++- .../CoreModules/Avatar/Dialog/DialogModule.cs | 32 ++- .../Avatar/Friends/FriendsModule.cs | 54 +++- .../Avatar/Gestures/GesturesModule.cs | 30 +- .../CoreModules/Avatar/Gods/GodsModule.cs | 28 +- .../CoreModules/Avatar/Groups/GroupsModule.cs | 35 ++- .../InstantMessage/InstantMessageModule.cs | 53 ++-- .../InstantMessage/MessageTransferModule.cs | 54 ++-- .../Avatar/InstantMessage/MuteListModule.cs | 48 ++-- .../InstantMessage/OfflineMessageModule.cs | 76 ++++-- .../Avatar/InstantMessage/PresenceModule.cs | 65 +++-- .../Archiver/InventoryArchiverModule.cs | 35 ++- .../Transfer/InventoryTransferModule.cs | 65 +++-- .../CoreModules/Avatar/Lure/LureModule.cs | 61 ++++- .../Avatar/ObjectCaps/ObjectAdd.cs | 55 ++-- .../Avatar/Profiles/AvatarProfilesModule.cs | 32 ++- .../EventQueue/EventQueueGetModule.cs | 42 +-- .../Framework/Monitoring/MonitorModule.cs | 103 ++++--- .../Hypergrid/HGStandaloneLoginModule.cs | 83 +++--- .../Region/CoreModules/InterGrid/OGSRadmin.cs | 31 +-- .../InterGrid/OpenGridProtocolModule.cs | 104 ++++--- .../DynamicTexture/DynamicTextureModule.cs | 60 ++-- .../Scripting/EMailModules/EmailModule.cs | 32 ++- .../HttpRequest/ScriptsHttpRequests.cs | 36 ++- .../Scripting/LSLHttp/UrlModule.cs | 2 + .../LoadImageURL/LoadImageURLModule.cs | 37 ++- .../VectorRender/VectorRenderModule.cs | 41 ++- .../Scripting/WorldComm/WorldCommModule.cs | 39 ++- .../Scripting/XMLRPC/XMLRPCModule.cs | 51 +++- .../Asset/AssetServiceInConnectorModule.cs | 2 +- .../Grid/HypergridServiceInConnectorModule.cs | 2 +- .../InventoryServiceInConnectorModule.cs | 2 +- .../Land/LandServiceInConnectorModule.cs | 2 +- .../NeighbourServiceInConnectorModule.cs | 2 +- .../SimulationServiceInConnectorModule.cs | 2 +- .../Interregion/LocalInterregionComms.cs | 4 +- .../Interregion/RESTInterregionComms.cs | 16 +- .../World/Archiver/ArchiverModule.cs | 1 + .../CoreModules/World/Cloud/CloudModule.cs | 30 +- .../World/Estate/EstateManagementModule.cs | 58 ++-- .../World/Permissions/PermissionsModule.cs | 256 +++++++++++------- .../CoreModules/World/Sound/SoundModule.cs | 33 ++- .../Region/CoreModules/World/Sun/SunModule.cs | 150 +++++----- .../World/Vegetation/VegetationModule.cs | 27 +- .../CoreModules/World/Wind/WindModule.cs | 47 ++-- .../World/WorldMap/MapImageModule.cs | 30 +- .../World/WorldMap/MapSearchModule.cs | 35 ++- .../DataSnapshot/DataSnapshotManager.cs | 59 ++-- .../Framework/Interfaces/ICloudModule.cs | 2 +- .../Framework/Interfaces/IEmailModule.cs | 2 +- .../Framework/Interfaces/IEstateModule.cs | 2 +- .../Region/Framework/Interfaces/ISunModule.cs | 2 +- .../Framework/Interfaces/IWindModule.cs | 2 +- .../InternetRelayClientView/IRCStackModule.cs | 32 ++- .../FreeSwitchVoice/FreeSwitchVoiceModule.cs | 72 +++-- .../ContentManagementModule.cs | 47 ++-- .../Scripting/Minimodule/MRMModule.cs | 64 +++-- .../RegionReadyModule/RegionReadyModule.cs | 6 +- .../ScriptModuleCommsModule.cs | 1 + .../XmlRpcGridRouterModule.cs | 28 +- .../XmlRpcRouterModule/XmlRpcRouterModule.cs | 32 ++- .../FreeswitchServiceInConnectorModule.cs | 2 +- .../SvnSerialiser/SvnBackupModule.cs | 28 +- .../OptionalModules/World/NPC/NPCModule.cs | 28 +- .../TreePopulator/TreePopulatorModule.cs | 41 +-- .../Region/UserStatistics/WebStatsModule.cs | 33 ++- .../Tests/Common/Setup/SceneSetupHelpers.cs | 9 +- 76 files changed, 1899 insertions(+), 954 deletions(-) diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 6fd3d301a5..64863c5176 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -99,7 +99,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source); RegionInfo[] regionsToLoad = regionLoader.LoadRegions(); - m_log.Info("[LOADREGIONSPLUGIN]: Loading specific shared modules..."); + /*m_log.Info("[LOADREGIONSPLUGIN]: Loading specific shared modules..."); m_log.Info("[LOADREGIONSPLUGIN]: DynamicTextureModule..."); m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule()); m_log.Info("[LOADREGIONSPLUGIN]: InstantMessageModule..."); @@ -111,7 +111,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule..."); m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule()); m_log.Info("[LOADREGIONSPLUGIN]: Done."); - + */ if (!CheckRegionsForSanity(regionsToLoad)) { m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations"); diff --git a/OpenSim/Client/MXP/MXPModule.cs b/OpenSim/Client/MXP/MXPModule.cs index 0b442cca15..47417ab477 100644 --- a/OpenSim/Client/MXP/MXPModule.cs +++ b/OpenSim/Client/MXP/MXPModule.cs @@ -31,6 +31,7 @@ using System.Reflection; using System.Text; using System.Timers; using log4net; +using Mono.Addins; using MXP; using Nini.Config; using OpenMetaverse; @@ -44,7 +45,8 @@ namespace OpenSim.Client.MXP /** * MXP Client Module which adds MXP support to client / region communication. */ - public class MXPModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MXPModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -57,15 +59,23 @@ namespace OpenSim.Client.MXP private readonly Dictionary m_scenes = new Dictionary(); private bool m_shutdown; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID)) - m_scenes.Add(scene.RegionInfo.RegionID, scene); - m_config = source; } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID)) + m_scenes.Add(scene.RegionInfo.RegionID, scene); + } + + public void RegionLoaded(Scene scene) { if (m_config.Configs["MXP"] != null) { @@ -76,7 +86,7 @@ namespace OpenSim.Client.MXP m_port = con.GetInt("Port", m_port); - m_server = new MXPPacketServer(m_port, m_scenes,m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate",true)); + m_server = new MXPPacketServer(m_port, m_scenes, m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate", true)); m_ticker = new Timer(100); m_ticker.AutoReset = false; @@ -89,6 +99,14 @@ namespace OpenSim.Client.MXP } } + public void RemoveRegion(Scene scene) + { + } + + public void PostInitialise() + { + } + void ticker_Elapsed(object sender, ElapsedEventArgs e) { try @@ -121,11 +139,5 @@ namespace OpenSim.Client.MXP { get { return "MXP ClientStack Module"; } } - - public bool IsSharedModule - { - get { return true; } - } - } } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 1077f4a22f..7012037834 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,7 +36,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { - public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class AssetTransactionModule : ISharedRegionModule, IAgentAssetTransactions { private readonly Dictionary RegisteredScenes = new Dictionary(); private bool m_dumpAssetsToFile = false; @@ -59,9 +61,14 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction //m_log.Debug("creating AgentAssetTransactionModule"); } - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + + } + + public void AddRegion(Scene scene) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -79,6 +86,23 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_scene = scene; } + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) + RegisteredScenes.Remove(scene.RegionInfo.RegionID); + scene.UnregisterModuleInterface(this); + scene.EventManager.OnNewClient -= NewClient; + } + public void PostInitialise() { } @@ -92,11 +116,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction get { return "AgentTransactionModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index 2a1355b9ef..886173fb45 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities public void RemoveRegion(Scene scene) { - m_scene.UnregisterModuleInterface(this); + scene.UnregisterModuleInterface(this); } public void PostInitialise() {} diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs index bfe2a716af..f7f2eff487 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; +using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; @@ -36,21 +37,27 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.IPBan { - public class IPBanModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class IPBanModule : ISharedRegionModule { - #region Implementation of IRegionModule + #region Implementation of ISharedRegionModule private List m_bans = new List(); + private Dictionary SceneBanners = new Dictionary(); - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - new SceneBanner(scene, m_bans); + } + + public void AddRegion(Scene scene) + { + SceneBanners.Add(scene, new SceneBanner(scene, m_bans)); lock (m_bans) { foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) { - if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) + if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) m_bans.Add(ban.BannedHostIPMask); if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) m_bans.Add(ban.BannedHostNameMask); @@ -58,7 +65,12 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { if (File.Exists("bans.txt")) { @@ -70,9 +82,18 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } + public void RemoveRegion(Scene scene) + { + if(SceneBanners.ContainsKey(scene)) + SceneBanners.Remove(scene); + } + + public void PostInitialise() + { + } + public void Close() { - } public string Name @@ -80,11 +101,6 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan get { return "IPBanModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index 71ff28c8b5..c4d84cb51a 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Reflection; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,7 +42,8 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Agent.TextureDownload { - public class TextureDownloadModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class TextureDownloadModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -65,11 +67,14 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload { } - #region IRegionModule Members + #region INonSharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + } + + public void AddRegion(Scene scene) { - if (m_scene == null) { //m_log.Debug("Creating Texture download module"); @@ -90,8 +95,21 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload } } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if(m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnNewClient -= NewClient; + scene.EventManager.OnRemovePresence -= EventManager_OnRemovePresence; } public void Close() @@ -103,11 +121,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload get { return "TextureDownloadModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index 7ac8bed012..ff87493831 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -32,6 +32,7 @@ using System.Reflection; using System.Text; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -45,7 +46,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender { public delegate void J2KDecodeDelegate(UUID assetID); - public class J2KDecoderModule : IRegionModule, IJ2KDecoder + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -58,16 +60,19 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// Reference to a scene (doesn't matter which one as long as it can load the cache module) private Scene m_scene; - #region IRegionModule + #region ISharedRegionModule public string Name { get { return "J2KDecoderModule"; } } - public bool IsSharedModule { get { return true; } } - + public J2KDecoderModule() { } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { if (m_scene == null) m_scene = scene; @@ -75,16 +80,30 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender scene.RegisterModuleInterface(this); } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { m_cache = m_scene.RequestModuleInterface(); } + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } + + public void PostInitialise() + { + } + public void Close() { } - #endregion IRegionModule + #endregion #region IJ2KDecoder diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index ef7dce812e..d062361b99 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,7 +36,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.Xfer { - public class XferModule : IRegionModule, IXfer + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class XferModule : INonSharedRegionModule, IXfer { private Scene m_scene; private Dictionary Requests = new Dictionary(); @@ -52,9 +54,13 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer public DateTime timeStamp; } - #region IRegionModule Members + #region INonSharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; @@ -62,8 +68,19 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer m_scene.RegisterModuleInterface(this); } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnNewClient -= NewClient; + scene.UnregisterModuleInterface(this); } public void Close() @@ -75,11 +92,6 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer get { return "XferModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion #region IXfer Members diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 35c59aa6d7..6bbbd56569 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -28,6 +28,7 @@ using System; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,7 +39,8 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { - public class AvatarFactoryModule : IAvatarFactory, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class AvatarFactoryModule : IAvatarFactory, ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene = null; @@ -75,7 +77,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return appearance; } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { scene.RegisterModuleInterface(this); scene.EventManager.OnNewClient += NewClient; @@ -84,9 +95,18 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_scene = scene; } - } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnNewClient -= NewClient; + } + public void PostInitialise() { } @@ -100,11 +120,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory get { return "Default Avatar Factory"; } } - public bool IsSharedModule - { - get { return false; } - } - public void NewClient(IClientAPI client) { client.OnAvatarNowWearing += AvatarIsWearing; diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index 61b6d65cc7..b7d12aa7e7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -34,7 +35,8 @@ using OpenMetaverse; namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule { - public class CombatModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class CombatModule : ISharedRegionModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -53,7 +55,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule /// /// /// - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { lock (m_scenel) { @@ -71,6 +83,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnAvatarKilled -= KillAvatar; + scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + m_scenel.Remove(scene.RegionInfo.RegionHandle); + } + public void PostInitialise() { } @@ -84,11 +107,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule get { return "CombatModule"; } } - public bool IsSharedModule - { - get { return true; } - } - private void KillAvatar(uint killerObjectLocalID, ScenePresence DeadAvatar) { if (killerObjectLocalID == 0) diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 72ec869c48..ecffc7ab66 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -25,9 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,28 +39,46 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Dialog { - public class DialogModule : IRegionModule, IDialogModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class DialogModule : ISharedRegionModule, IDialogModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); - + m_scene.AddCommand( this, "alert", "alert ", "Send an alert to a user", HandleAlertConsoleCommand); m_scene.AddCommand( this, "alert general", "alert general ", "Send an alert to everyone", HandleAlertConsoleCommand); } - - public void PostInitialise() {} + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } + + public void PostInitialise() { } public void Close() {} public string Name { get { return "Dialog Module"; } } - public bool IsSharedModule { get { return false; } } public void SendAlertToUser(IClientAPI client, string message) { diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 086d4fe69a..7254180ab9 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -81,7 +82,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends - Terminate Friendship messages (single) */ - public class FriendsModule : IRegionModule, IFriendsModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class FriendsModule : ISharedRegionModule, IFriendsModule { private class Transaction { @@ -111,9 +113,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private IGridService m_gridServices = null; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + + } + + public void PostInitialise() + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { lock (m_scenes) { @@ -128,9 +144,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) m_scenes[scene.RegionInfo.RegionHandle] = scene; } - + scene.RegisterModuleInterface(this); - + scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; @@ -138,17 +154,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends scene.EventManager.OnClientClosed += ClientClosed; } - public void PostInitialise() + public void RegionLoaded(Scene scene) { if (m_scenes.Count > 0) { - m_TransferModule = m_initialScene.RequestModuleInterface(); - m_gridServices = m_initialScene.GridService; + m_TransferModule = scene.RequestModuleInterface(); + m_gridServices = scene.GridService; } if (m_TransferModule == null) m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); } + public void RemoveRegion(Scene scene) + { + MainServer.Instance.RemoveXmlRPCHandler("presence_update_bulk"); + MainServer.Instance.RemoveXmlRPCHandler("terminate_friend"); + + if (m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) + m_scenes.Remove(scene.RegionInfo.RegionHandle); + + scene.UnregisterModuleInterface(this); + + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + scene.EventManager.OnMakeChildAgent -= MakeChildAgent; + scene.EventManager.OnClientClosed -= ClientClosed; + } + public void Close() { } @@ -158,11 +191,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends get { return "FriendsModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion #region IInterregionFriendsComms diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 8ce509239d..c306f94e06 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs @@ -25,8 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,23 +39,41 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gestures { - public class GesturesModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class GesturesModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; - m_scene.EventManager.OnNewClient += OnNewClient; } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if(m_scene == scene) + m_scene = null; + scene.EventManager.OnNewClient -= OnNewClient; + } - public void PostInitialise() {} public void Close() {} public string Name { get { return "Gestures Module"; } } - public bool IsSharedModule { get { return false; } } private void OnNewClient(IClientAPI client) { diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 50171a391e..3914f2efd1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -25,7 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -34,7 +36,8 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gods { - public class GodsModule : IRegionModule, IGodsModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class GodsModule : INonSharedRegionModule, IGodsModule { /// Special UUID for actions that apply to all agents private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); @@ -42,17 +45,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods protected Scene m_scene; protected IDialogModule m_dialogModule; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; m_dialogModule = m_scene.RequestModuleInterface(); m_scene.RegisterModuleInterface(this); } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } - public void PostInitialise() {} public void Close() {} public string Name { get { return "Gods Module"; } } - public bool IsSharedModule { get { return false; } } public void RequestGodlikePowers( UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index 31363e5705..7ff8d3000d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs @@ -25,9 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +38,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Groups { - public class GroupsModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class GroupsModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -55,9 +58,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups private static GroupMembershipData osGroup = new GroupMembershipData(); - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; @@ -76,7 +79,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups if (groupsConfig.GetString("Module", "Default") != "Default") return; } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { lock (m_SceneList) { if (!m_SceneList.Contains(scene)) @@ -99,6 +110,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (m_SceneList.Contains(scene)) + m_SceneList.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnClientClosed -= OnClientClosed; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + } + public void PostInitialise() { } @@ -123,11 +147,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups get { return "GroupsModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion private void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index 9a6874909b..e1bde4b3b6 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -24,9 +24,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +39,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class InstantMessageModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class InstantMessageModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -47,11 +51,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private readonly List m_scenes = new List(); - #region IRegionModule Members + #region ISharedRegionModule Members private IMessageTransferModule m_TransferModule = null; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -62,7 +66,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } m_enabled = true; + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { lock (m_scenes) { if (!m_scenes.Contains(scene)) @@ -74,6 +86,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } + public void RegionLoaded(Scene scene) + { + if (!m_enabled) + return; + + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + + "IM will not work!"); + } + + public void RemoveRegion(Scene scene) + { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnClientConnect -= OnClientConnect; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + } + void OnClientConnect(IClientCore client) { IClientIM clientIM; @@ -85,15 +118,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public void PostInitialise() { - if (!m_enabled) - return; - - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ - "IM will not work!"); } public void Close() @@ -105,11 +129,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "InstantMessageModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion public void OnInstantMessage(IClientAPI client, GridInstantMessage im) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index e5159b3817..16bdfddea7 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -40,7 +41,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class MessageTransferModule : IRegionModule, IMessageTransferModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MessageTransferModule : ISharedRegionModule, IMessageTransferModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -50,8 +52,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage protected Dictionary m_UserRegionMap = new Dictionary(); public event UndeliveredMessage OnUndeliveredMessage; + private bool m_enabled = true; - public virtual void Initialise(Scene scene, IConfigSource config) + public virtual void Initialise(IConfigSource config) { IConfig cnf = config.Configs["Messaging"]; if (cnf != null && cnf.GetString( @@ -59,29 +62,51 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage "MessageTransferModule") { m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration"); - return; + m_enabled = false; } cnf = config.Configs["Startup"]; if (cnf != null) m_Gridmode = cnf.GetBoolean("gridmode", false); + } - // m_Enabled = true; + public Type ReplaceableInterface + { + get { return null; } + } - lock (m_Scenes) + public void AddRegion(Scene scene) + { + if (m_enabled) { - if (m_Scenes.Count == 0) + lock (m_Scenes) { - MainServer.Instance.AddXmlRPCHandler( - "grid_instant_message", processXMLRPCGridInstantMessage); - } + if (m_Scenes.Count == 0) + { + MainServer.Instance.AddXmlRPCHandler( + "grid_instant_message", processXMLRPCGridInstantMessage); + } - m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); - scene.RegisterModuleInterface(this); - m_Scenes.Add(scene); + m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); + scene.RegisterModuleInterface(this); + m_Scenes.Add(scene); + } } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (m_Scenes.Contains(scene)) + m_Scenes.Remove(scene); + MainServer.Instance.RemoveXmlRPCHandler( + "grid_instant_message"); + scene.UnregisterModuleInterface(this); + } + public virtual void PostInitialise() { } @@ -95,11 +120,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "MessageTransferModule"; } } - public virtual bool IsSharedModule - { - get { return true; } - } - public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result) { UUID toAgentID = new UUID(im.toAgentID); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 2d4a635056..3570495796 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +40,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.MuteList { - public class MuteListModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MuteListModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -47,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList private List m_SceneList = new List(); private string m_RestURL = String.Empty; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (!enabled) return; @@ -66,19 +68,24 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList enabled = false; return; } + m_RestURL = cnf.GetString("MuteListURL", ""); + if (m_RestURL == "") + { + m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); + enabled = false; + return; + } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { lock (m_SceneList) { - if (m_SceneList.Count == 0) - { - m_RestURL = cnf.GetString("MuteListURL", ""); - if (m_RestURL == "") - { - m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); - enabled = false; - return; - } - } if (!m_SceneList.Contains(scene)) m_SceneList.Add(scene); @@ -86,6 +93,18 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (m_SceneList.Contains(scene)) + m_SceneList.Remove(scene); + + scene.EventManager.OnNewClient -= OnNewClient; + } + public void PostInitialise() { if (!enabled) @@ -102,11 +121,6 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList get { return "MuteListModule"; } } - public bool IsSharedModule - { - get { return true; } - } - public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 450897c77e..6c4d0bfcf4 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,7 +41,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class OfflineMessageModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class OfflineMessageModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -49,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private string m_RestURL = String.Empty; private bool m_ForwardOfflineGroupMessages = true; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (!enabled) return; @@ -83,14 +85,23 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } } - if (!m_SceneList.Contains(scene)) - m_SceneList.Add(scene); - - scene.EventManager.OnNewClient += OnNewClient; } } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (!m_SceneList.Contains(scene)) + m_SceneList.Add(scene); + + scene.EventManager.OnNewClient += OnNewClient; + } + + public void RegionLoaded(Scene scene) { if (!enabled) return; @@ -120,16 +131,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_log.Debug("[OFFLINE MESSAGING] Offline messages enabled"); } + public void RemoveRegion(Scene scene) + { + if (m_SceneList.Contains(scene)) + m_SceneList.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; + } + + public void PostInitialise() + { + } + public string Name { get { return "OfflineMessageModule"; } } - public bool IsSharedModule - { - get { return true; } - } - public void Close() { } @@ -163,24 +180,27 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private void RetrieveInstantMessages(IClientAPI client) { - m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId); - - Listmsglist = SynchronousRestObjectPoster.BeginPostObject>( - "POST", m_RestURL+"/RetrieveMessages/", client.AgentId); - - foreach (GridInstantMessage im in msglist) + if (m_RestURL != "") { - // client.SendInstantMessage(im); + m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId); - // Send through scene event manager so all modules get a chance - // to look at this message before it gets delivered. - // - // Needed for proper state management for stored group - // invitations - // - Scene s = FindScene(client.AgentId); - if (s != null) - s.EventManager.TriggerIncomingInstantMessage(im); + List msglist = SynchronousRestObjectPoster.BeginPostObject>( + "POST", m_RestURL + "/RetrieveMessages/", client.AgentId); + + foreach (GridInstantMessage im in msglist) + { + // client.SendInstantMessage(im); + + // Send through scene event manager so all modules get a chance + // to look at this message before it gets delivered. + // + // Needed for proper state management for stored group + // invitations + // + Scene s = FindScene(client.AgentId); + if (s != null) + s.EventManager.TriggerIncomingInstantMessage(im); + } } } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index f5ab45466c..f5498f42e1 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs @@ -24,11 +24,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +using System; using System.Collections; using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -39,7 +42,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - public class PresenceModule : IRegionModule, IPresenceModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class PresenceModule : ISharedRegionModule, IPresenceModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -59,7 +63,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public event PresenceChange OnPresenceChange; public event BulkPresenceData OnBulkPresenceData; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { lock (m_Scenes) { @@ -78,28 +82,38 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_Gridmode = cnf.GetBoolean("gridmode", false); m_Enabled = true; - - m_initialScene = scene; } + } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (m_Enabled) + { + m_initialScene = scene; if (m_Gridmode) NotifyMessageServerOfStartup(scene); m_Scenes.Add(scene); + + scene.RegisterModuleInterface(this); + + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; + scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; } - - scene.RegisterModuleInterface(this); - - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; - scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; } - public void PostInitialise() + public void RegionLoaded(Scene scene) { } - public void Close() + public void RemoveRegion(Scene scene) { if (!m_Gridmode || !m_Enabled) return; @@ -116,11 +130,23 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } - lock (m_Scenes) - { - foreach (Scene scene in m_Scenes) - NotifyMessageServerOfShutdown(scene); - } + NotifyMessageServerOfShutdown(scene); + if(m_Scenes.Contains(scene)) + m_Scenes.Remove(scene); + + scene.UnregisterModuleInterface(this); + + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; + scene.EventManager.OnMakeChildAgent -= OnMakeChildAgent; + } + + public void PostInitialise() + { + } + + public void Close() + { } public string Name @@ -128,11 +154,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "PresenceModule"; } } - public bool IsSharedModule - { - get { return true; } - } - public void RequestBulkPresenceData(UUID[] users) { if (OnBulkPresenceData != null) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index ecd60bdaad..a04ab22588 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,10 +42,11 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] /// /// This module loads and saves OpenSimulator inventory archives /// - public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule + public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -82,18 +84,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver DisablePresenceChecks = disablePresenceChecks; } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { if (m_scenes.Count == 0) { scene.RegisterModuleInterface(this); OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted; - + scene.AddCommand( this, "load iar", "load iar []", - "Load user inventory archive.", HandleLoadInvConsoleCommand); - + "Load user inventory archive.", HandleLoadInvConsoleCommand); + scene.AddCommand( this, "save iar", "save iar []", @@ -101,10 +113,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_aScene = scene; } - + m_scenes[scene.RegionInfo.RegionID] = scene; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + if(m_scenes.ContainsKey(scene.RegionInfo.RegionID)) + m_scenes.Remove(scene.RegionInfo.RegionID); + } + public void PostInitialise() {} public void Close() {} diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index d9a021fc02..44906b4afa 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +40,8 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { - public class InventoryTransferModule : IInventoryTransferModule, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -50,10 +52,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer new Dictionary(); private IMessageTransferModule m_TransferModule = null; + private bool m_enabled = true; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -62,29 +65,59 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (config.Configs["Messaging"].GetString( "InventoryTransferModule", "InventoryTransferModule") != "InventoryTransferModule") - return; + m_enabled = false; } + } - if (!m_Scenelist.Contains(scene)) + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (m_enabled) { - m_Scenelist.Add(scene); + if (!m_Scenelist.Contains(scene)) + { + m_Scenelist.Add(scene); - scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnClientClosed += ClientLoggedOut; - scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnClientClosed += ClientLoggedOut; + scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; + } } } + public void RegionLoaded(Scene scene) + { + if (m_enabled) + { + if (m_Scenelist.Count > 0) + { + m_TransferModule = m_Scenelist[0].RequestModuleInterface(); + if (m_TransferModule == null) + m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); + } + } + } + + public void RemoveRegion(Scene scene) + { + if (m_Scenelist.Contains(scene)) + m_Scenelist.Remove(scene); + + scene.UnregisterModuleInterface(this); + + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnClientClosed -= ClientLoggedOut; + scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + } + public void PostInitialise() { - if (m_Scenelist.Count > 0) - { - m_TransferModule = m_Scenelist[0].RequestModuleInterface(); - if (m_TransferModule == null) - m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); - } } public void Close() diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index 261bd6c609..973d27fd24 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,36 +38,72 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Lure { - public class LureModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class LureModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); + private bool m_enabled = true; + private IMessageTransferModule m_TransferModule = null; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (config.Configs["Messaging"] != null) { if (config.Configs["Messaging"].GetString( "LureModule", "LureModule") != "LureModule") - return; + m_enabled = false; } + } - lock (m_scenes) + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (m_enabled) { - if (!m_scenes.Contains(scene)) + lock (m_scenes) { - m_scenes.Add(scene); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnIncomingInstantMessage += - OnGridInstantMessage; + if (!m_scenes.Contains(scene)) + { + m_scenes.Add(scene); + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnIncomingInstantMessage += + OnGridInstantMessage; + } } } } + public void RegionLoaded(Scene scene) + { + if (m_enabled) + { + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + + "lures will not work!"); + } + } + + public void RemoveRegion(Scene scene) + { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; + scene.EventManager.OnIncomingInstantMessage -= + OnGridInstantMessage; + } + void OnNewClient(IClientAPI client) { client.OnInstantMessage += OnInstantMessage; @@ -76,12 +113,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure public void PostInitialise() { - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ - "lures will not work!"); } public void Close() diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index 63a93aa026..748b42c5f3 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -41,24 +42,54 @@ using Caps=OpenSim.Framework.Capabilities.Caps; namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { - public class ObjectAdd : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class ObjectAdd : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene pScene, IConfigSource pSource) + public void Initialise(IConfigSource pSource) { - m_scene = pScene; + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + m_scene = scene; m_scene.EventManager.OnRegisterCaps += RegisterCaps; } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnRegisterCaps -= RegisterCaps; + } + public void PostInitialise() { } + public void Close() + { + + } + + public string Name + { + get { return "ObjectAddModule"; } + } + public void RegisterCaps(UUID agentID, Caps caps) { UUID capuuid = UUID.Random(); @@ -348,22 +379,6 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps Array.Reverse(resultbytes); return String.Format("{0}",Convert.ToBase64String(resultbytes)); } - - public void Close() - { - - } - - public string Name - { - get { return "ObjectAddModule"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion } } diff --git a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs index 8cf58c6df0..7fcb0e13cf 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs @@ -30,6 +30,7 @@ using System.Collections; using System.Globalization; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,20 +39,17 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Profiles { - public class AvatarProfilesModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class AvatarProfilesModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; private IProfileModule m_profileModule = null; private bool m_enabled = true; - public AvatarProfilesModule() - { - } + #region INonSharedRegionModule Members - #region IRegionModule Members - - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig profileConfig = config.Configs["Profile"]; if (profileConfig != null) @@ -62,18 +60,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles return; } } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; } - public void PostInitialise() + public void RegionLoaded(Scene scene) { if (!m_enabled) return; m_profileModule = m_scene.RequestModuleInterface(); } + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnNewClient -= NewClient; + } + public void Close() { } @@ -83,11 +94,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles get { return "AvatarProfilesModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 0c6cb1bdfa..1ee6f0d322 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Packets; @@ -52,11 +53,13 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue public OSDMap body; } - public class EventQueueGetModule : IEventQueue, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class EventQueueGetModule : IEventQueue, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene = null; private IConfigSource m_gConfig; + private IConfig m_startupConfig; bool enabledYN = false; private Dictionary m_ids = new Dictionary(); @@ -65,23 +68,31 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue private Dictionary m_QueueUUIDAvatarMapping = new Dictionary(); private Dictionary m_AvatarQueueUUIDMapping = new Dictionary(); - #region IRegionModule methods - public virtual void Initialise(Scene scene, IConfigSource config) + #region INonSharedRegionModule methods + public virtual void Initialise(IConfigSource config) { m_gConfig = config; - IConfig startupConfig = m_gConfig.Configs["Startup"]; + m_startupConfig = m_gConfig.Configs["Startup"]; + } - ReadConfigAndPopulate(scene, startupConfig, "Startup"); + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + ReadConfigAndPopulate(scene, m_startupConfig, "Startup"); if (enabledYN) { m_scene = scene; scene.RegisterModuleInterface(this); - + // Register fallback handler // Why does EQG Fail on region crossings! - + //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); scene.EventManager.OnNewClient += OnNewClient; @@ -99,7 +110,14 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue { m_gConfig = null; } - + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { } private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) @@ -107,10 +125,6 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue enabledYN = startupConfig.GetBoolean("EventQueue", true); } - public void PostInitialise() - { - } - public virtual void Close() { } @@ -120,10 +134,6 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue get { return "EventQueueGetModule"; } } - public bool IsSharedModule - { - get { return false; } - } #endregion /// diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index f15f8f6de1..0135d3359b 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs @@ -25,10 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +41,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Framework.Monitoring { - public class MonitorModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MonitorModule : INonSharedRegionModule { private Scene m_scene; private readonly List m_monitors = new List(); @@ -62,9 +65,19 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring } } - #region Implementation of IRegionModule + #region Implementation of INonSharedRegionModule - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; @@ -77,6 +90,51 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage); } + public void RegionLoaded(Scene scene) + { + m_monitors.Add(new AgentCountMonitor(m_scene)); + m_monitors.Add(new ChildAgentCountMonitor(m_scene)); + m_monitors.Add(new GCMemoryMonitor()); + m_monitors.Add(new ObjectCountMonitor(m_scene)); + m_monitors.Add(new PhysicsFrameMonitor(m_scene)); + m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); + m_monitors.Add(new PWSMemoryMonitor()); + m_monitors.Add(new ThreadCountMonitor()); + m_monitors.Add(new TotalFrameMonitor(m_scene)); + m_monitors.Add(new EventFrameMonitor(m_scene)); + m_monitors.Add(new LandFrameMonitor(m_scene)); + m_monitors.Add(new LastFrameTimeMonitor(m_scene)); + + m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); + + foreach (IAlert alert in m_alerts) + { + alert.OnTriggerAlert += OnTriggerAlert; + } + } + + public void RemoveRegion(Scene scene) + { + MainServer.Instance.RemoveHTTPHandler("", "/monitorstats/" + m_scene.RegionInfo.RegionID + "/"); + m_monitors.Clear(); + + foreach (IAlert alert in m_alerts) + { + alert.OnTriggerAlert -= OnTriggerAlert; + } + m_alerts.Clear(); + } + + public void Close() + { + + } + + public string Name + { + get { return "Region Health Monitoring Module"; } + } + public Hashtable StatsPage(Hashtable request) { // If request was for a specific monitor @@ -132,49 +190,10 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring return ereply; } - public void PostInitialise() - { - m_monitors.Add(new AgentCountMonitor(m_scene)); - m_monitors.Add(new ChildAgentCountMonitor(m_scene)); - m_monitors.Add(new GCMemoryMonitor()); - m_monitors.Add(new ObjectCountMonitor(m_scene)); - m_monitors.Add(new PhysicsFrameMonitor(m_scene)); - m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); - m_monitors.Add(new PWSMemoryMonitor()); - m_monitors.Add(new ThreadCountMonitor()); - m_monitors.Add(new TotalFrameMonitor(m_scene)); - m_monitors.Add(new EventFrameMonitor(m_scene)); - m_monitors.Add(new LandFrameMonitor(m_scene)); - m_monitors.Add(new LastFrameTimeMonitor(m_scene)); - - m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); - - foreach (IAlert alert in m_alerts) - { - alert.OnTriggerAlert += OnTriggerAlert; - } - } - void OnTriggerAlert(System.Type reporter, string reason, bool fatal) { m_log.Error("[Monitor] " + reporter.Name + " for " + m_scene.RegionInfo.RegionName + " reports " + reason + " (Fatal: " + fatal + ")"); } - - public void Close() - { - - } - - public string Name - { - get { return "Region Health Monitoring Module"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion } } diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs index 0b54746f19..f9c594b800 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Text.RegularExpressions; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using Nwc.XmlRpc; @@ -46,7 +47,8 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Hypergrid { - public class HGStandaloneLoginModule : IRegionModule, ILoginServiceToRegionsConnector + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class HGStandaloneLoginModule : ISharedRegionModule, ILoginServiceToRegionsConnector { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -56,47 +58,58 @@ namespace OpenSim.Region.CoreModules.Hypergrid protected bool m_enabled = false; // Module is only enabled if running in standalone mode protected HGLoginAuthService m_loginService; + private bool authenticate = true; + private string welcomeMessage = "Welcome to OpenSim"; + private IConfig startupConfig; + private IConfig standaloneConfig; + + #region ISharedRegionModule Members - #region IRegionModule Members + public void Initialise(IConfigSource source) + { + startupConfig = source.Configs["Startup"]; + standaloneConfig = source.Configs["StandAlone"]; + if (standaloneConfig != null) + { + authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); + welcomeMessage = standaloneConfig.GetString("welcome_message"); + } + m_enabled = !startupConfig.GetBoolean("gridmode", false); + } - public void Initialise(Scene scene, IConfigSource source) + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) { if (m_firstScene == null) { m_firstScene = scene; - IConfig startupConfig = source.Configs["Startup"]; - if (startupConfig != null) - { - m_enabled = !startupConfig.GetBoolean("gridmode", false); - } - if (m_enabled) { m_log.Debug("[HGLogin]: HGlogin module enabled"); - bool authenticate = true; - string welcomeMessage = "Welcome to OpenSim"; - IConfig standaloneConfig = source.Configs["StandAlone"]; - if (standaloneConfig != null) - { - authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); - welcomeMessage = standaloneConfig.GetString("welcome_message"); - } //TODO: fix casting. LibraryRootFolder rootFolder = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; - + IHttpServer httpServer = MainServer.Instance; //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference - m_loginService + m_loginService = new HGLoginAuthService( - (UserManagerBase)m_firstScene.CommsManager.UserAdminService, - welcomeMessage, - m_firstScene.CommsManager.InterServiceInventoryService, - m_firstScene.CommsManager.NetworkServersInfo, - authenticate, - rootFolder, + (UserManagerBase)m_firstScene.CommsManager.UserAdminService, + welcomeMessage, + m_firstScene.CommsManager.InterServiceInventoryService, + m_firstScene.CommsManager.NetworkServersInfo, + authenticate, + rootFolder, this); httpServer.AddXmlRPCHandler("hg_login", m_loginService.XmlRpcLoginMethod); @@ -113,6 +126,19 @@ namespace OpenSim.Region.CoreModules.Hypergrid } } + public void RemoveRegion(Scene scene) + { + if (scene == m_firstScene) + { + IHttpServer httpServer = MainServer.Instance; + httpServer.RemoveXmlRPCHandler("hg_login"); + httpServer.RemoveXmlRPCHandler("check_auth_session"); + httpServer.RemoveXmlRPCHandler("get_avatar_appearance"); + httpServer.RemoveXmlRPCHandler("update_avatar_appearance"); + } + m_scenes.Remove(scene); + } + public void PostInitialise() { @@ -128,11 +154,6 @@ namespace OpenSim.Region.CoreModules.Hypergrid get { return "HGStandaloneLoginModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion protected void AddScene(Scene scene) diff --git a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs index 0f2ba324e0..45340241cb 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Text; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -42,7 +43,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.InterGrid { - public class OGSRadmin : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class OGSRadmin : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); @@ -56,7 +58,6 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OGS Supporting RAdmin"; } } - public void Initialise(IConfigSource source) { m_settings = source; @@ -67,6 +68,11 @@ namespace OpenSim.Region.CoreModules.InterGrid } + public Type ReplaceableInterface + { + get { return null; } + } + public void AddRegion(Scene scene) { lock (m_scenes) @@ -77,14 +83,10 @@ namespace OpenSim.Region.CoreModules.InterGrid { lock (m_scenes) m_scenes.Remove(scene); + MainServer.Instance.RemoveXmlRPCHandler("grid_message"); } public void RegionLoaded(Scene scene) - { - - } - - public void PostInitialise() { if (m_settings.Configs["Startup"].GetBoolean("gridmode", false)) { @@ -93,21 +95,8 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - #endregion - - #region IRegionModule - - public void Initialise(Scene scene, IConfigSource source) + public void PostInitialise() { - m_settings = source; - - lock (m_scenes) - m_scenes.Add(scene); - } - - public bool IsSharedModule - { - get { return true; } } #endregion diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index 10a3232019..8bb0fa9bd2 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -35,6 +35,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Web; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -75,8 +76,9 @@ namespace OpenSim.Region.CoreModules.InterGrid public bool visible_to_parent; public string teleported_into_region; } - - public class OpenGridProtocolModule : IRegionModule + + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class OpenGridProtocolModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_scene = new List(); @@ -92,21 +94,22 @@ namespace OpenSim.Region.CoreModules.InterGrid private bool httpSSL = false; private uint httpsslport = 0; private bool GridMode = false; + private bool m_enabled = false; + private IConfig cfg = null; + private IConfig httpcfg = null; + private IConfig startupcfg = null; + + #region ISharedRegionModule Members - #region IRegionModule Members - - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - bool enabled = false; - IConfig cfg = null; - IConfig httpcfg = null; - IConfig startupcfg = null; try { cfg = config.Configs["OpenGridProtocol"]; - } catch (NullReferenceException) + } + catch (NullReferenceException) { - enabled = false; + m_enabled = false; } try @@ -128,15 +131,15 @@ namespace OpenSim.Region.CoreModules.InterGrid if (startupcfg != null) { - GridMode = enabled = startupcfg.GetBoolean("gridmode", false); + GridMode = m_enabled = startupcfg.GetBoolean("gridmode", false); } if (cfg != null) { - enabled = cfg.GetBoolean("ogp_enabled", false); + m_enabled = cfg.GetBoolean("ogp_enabled", false); LastNameSuffix = cfg.GetString("ogp_lastname_suffix", "_EXTERNAL"); FirstNamePrefix = cfg.GetString("ogp_firstname_prefix", ""); - if (enabled) + if (m_enabled) { m_log.Warn("[OGP]: Open Grid Protocol is on, Listening for Clients on /agent/"); lock (m_scene) @@ -165,35 +168,61 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - // can't pick the region 'agent' because it would conflict with our agent domain handler - // a zero length region name would conflict with are base region seed cap - if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) - { - MainServer.Instance.AddLLSDHandler( - "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), - ProcessRegionDomainSeed); - } + } + } + } + } - if (!m_scene.Contains(scene)) - m_scene.Add(scene); - } - } - } - lock (m_scene) + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + if (m_enabled) { - if (m_scene.Count == 1) + lock (m_scene) { - if (httpcfg != null) + if (m_scene.Count == 1) { - httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); - httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); - if (httpsCN.Length == 0) - httpsCN = scene.RegionInfo.ExternalHostName; - httpsslport = (uint)httpcfg.GetInt("http_listener_sslport",((int)scene.RegionInfo.HttpPort + 1)); + if (httpcfg != null) + { + httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); + httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); + if (httpsCN.Length == 0) + httpsCN = scene.RegionInfo.ExternalHostName; + httpsslport = (uint)httpcfg.GetInt("http_listener_sslport", ((int)scene.RegionInfo.HttpPort + 1)); + } } } + // can't pick the region 'agent' because it would conflict with our agent domain handler + // a zero length region name would conflict with are base region seed cap + if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) + { + MainServer.Instance.AddLLSDHandler( + "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), + ProcessRegionDomainSeed); + } + + if (!m_scene.Contains(scene)) + m_scene.Add(scene); } } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + MainServer.Instance.RemoveLLSDHandler( + "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), + ProcessRegionDomainSeed); + + if (m_scene.Contains(scene)) + m_scene.Remove(scene); + } public void PostInitialise() { @@ -209,11 +238,6 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OpenGridProtocolModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 679c871441..40b715955a 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -40,7 +41,8 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { - public class DynamicTextureModule : IRegionModule, IDynamicTextureManager + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -210,9 +212,14 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture #endregion - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + + } + + public void AddRegion(Scene scene) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -221,6 +228,24 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture } } + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) + { + RegisteredScenes.Remove(scene.RegionInfo.RegionID); + scene.UnregisterModuleInterface(this); + } + } + public void PostInitialise() { } @@ -234,11 +259,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture get { return "DynamicTextureModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion #region Nested type: DynamicTextureUpdater @@ -358,18 +378,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); - if (oldAsset != null) - { - if (oldAsset.Temporary == true) - { - scene.AssetService.Delete(oldID.ToString()); - } - } + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 83f004dc60..d6ed468814 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs @@ -32,6 +32,7 @@ using System.Text.RegularExpressions; using DotNetOpenMail; using DotNetOpenMail.SmtpAuth; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,6 +41,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.EmailModules { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EmailModule : IEmailModule { // @@ -94,7 +96,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules } } - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { m_Config = config; IConfig SMTPConfig; @@ -136,7 +138,16 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Enabled = false; return; } + m_log.Info("[EMAIL] Activated DefaultEmailModule"); + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { // It's a go! if (m_Enabled) { @@ -155,8 +166,20 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } + } + } - m_log.Info("[EMAIL] Activated DefaultEmailModule"); + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + + if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle)) + { + m_Scenes.Remove(scene.RegionInfo.RegionHandle); } } @@ -173,11 +196,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules get { return "DefaultEmailModule"; } } - public bool IsSharedModule - { - get { return true; } - } - /// /// Delay function using thread in seconds /// diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index d78931a524..e331b8d3e8 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -31,6 +31,7 @@ using System.IO; using System.Net; using System.Text; using System.Threading; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -84,7 +85,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.HttpRequest { - public class HttpRequestModule : IRegionModule, IHttpRequestModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class HttpRequestModule : ISharedRegionModule, IHttpRequestModule { private object HttpListLock = new object(); private int httpTimeout = 30000; @@ -229,18 +231,35 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest #endregion - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); + + m_pendingRequests = new Dictionary(); + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); + } - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); + public Type ReplaceableInterface + { + get { return null; } + } - m_pendingRequests = new Dictionary(); + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); } public void PostInitialise() @@ -256,11 +275,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest get { return m_name; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion } diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 9b565ed85b..6ce55a90c6 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -126,6 +126,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void RemoveRegion(Scene scene) { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnScriptReset -= OnScriptReset; } public void Close() diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index c23cea539a..35ce2cbf2c 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -29,6 +29,7 @@ using System; using System.Drawing; using System.IO; using System.Net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -39,7 +40,8 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL { - public class LoadImageURLModule : IRegionModule, IDynamicTextureRender + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class LoadImageURLModule : ISharedRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -97,20 +99,28 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL #endregion - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) + { + m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); + } + + public void AddRegion(Scene scene) { if (m_scene == null) { m_scene = scene; } - - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -119,6 +129,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL } } + public void RemoveRegion(Scene scene) + { + } + + public void PostInitialise() + { + } + public void Close() { } @@ -128,11 +146,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL get { return m_name; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion private void MakeHttpRequest(string url, UUID requestID) diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index d57a8e5979..71b01a16bc 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -31,6 +31,7 @@ using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -43,7 +44,8 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.VectorRender { - public class VectorRenderModule : IRegionModule, IDynamicTextureRender + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class VectorRenderModule : ISharedRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -110,15 +112,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender #endregion - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - if (m_scene == null) - { - m_scene = scene; - } - if (m_graph == null) { Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); @@ -133,7 +130,20 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName); } - public void PostInitialise() + public void AddRegion(Scene scene) + { + if (m_scene == null) + { + m_scene = scene; + } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -142,6 +152,14 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender } } + public void RemoveRegion(Scene scene) + { + } + + public void PostInitialise() + { + } + public void Close() { } @@ -151,11 +169,6 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender get { return m_name; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion private void Draw(string data, UUID id, string extraParams) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 60df2e7273..acd8dbf0f0 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -85,7 +86,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.WorldComm { - public class WorldCommModule : IRegionModule, IWorldComm + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class WorldCommModule : INonSharedRegionModule, IWorldComm { // private static readonly ILog m_log = // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -98,9 +100,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm private int m_saydistance = 30; private int m_shoutdistance = 100; - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { // wrap this in a try block so that defaults will work if // the config file doesn't specify otherwise. @@ -120,17 +122,33 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (maxlisteners < 1) maxlisteners = int.MaxValue; if (maxhandles < 1) maxhandles = int.MaxValue; - m_scene = scene; - m_scene.RegisterModuleInterface(this); m_listenerManager = new ListenerManager(maxlisteners, maxhandles); - m_scene.EventManager.OnChatFromClient += DeliverClientMessage; - m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; m_pendingQ = new Queue(); m_pending = Queue.Synchronized(m_pendingQ); } - public void PostInitialise() + public void AddRegion(Scene scene) { + m_scene = scene; + m_scene.RegisterModuleInterface(this); + m_scene.EventManager.OnChatFromClient += DeliverClientMessage; + m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnChatFromClient -= DeliverClientMessage; + scene.EventManager.OnChatBroadcast -= DeliverClientMessage; } public void Close() @@ -142,11 +160,6 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm get { return "WorldCommModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion #region IWorldComm Members diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index 27b64bffc0..a9147fb601 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -32,6 +32,7 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -76,7 +77,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { - public class XMLRPCModule : IRegionModule, IXMLRPC + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class XMLRPCModule : ISharedRegionModule, IXMLRPC { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -94,9 +96,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC private int RemoteReplyScriptWait = 300; private object XMLRPCListLock = new object(); - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { // We need to create these early because the scripts might be calling // But since this gets called for every region, we need to make sure they @@ -116,7 +118,14 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { } } + } + public void PostInitialise() + { + } + + public void AddRegion(Scene scene) + { if (!m_scenes.Contains(scene)) { m_scenes.Add(scene); @@ -125,7 +134,12 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } } - public void PostInitialise() + public Type ReplaceableInterface + { + get { return null; } + } + private Dictionary m_HttpServers = new Dictionary(); + public void RegionLoaded(Scene scene) { if (IsEnabled()) { @@ -133,9 +147,31 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC // Attach xmlrpc handlers m_log.Info("[REMOTE_DATA]: " + "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); - BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); + BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.Start(); + m_HttpServers.Add(scene, httpServer); + } + } + + public void RemoveRegion(Scene scene) + { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.UnregisterModuleInterface(this); + if (IsEnabled()) + { + // Start http server + // Attach xmlrpc handlers + if (m_HttpServers.ContainsKey(scene)) + { + BaseHttpServer httpServer; + m_HttpServers.TryGetValue(scene, out httpServer); + m_log.Info("[REMOTE_DATA]: " + + "Stopping XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); + httpServer.RemoveXmlRPCHandler("llRemoteData"); + httpServer.Stop(); + } } } @@ -148,11 +184,6 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC get { return m_name; } } - public bool IsSharedModule - { - get { return true; } - } - public int Port { get { return m_remoteDataPort; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs index 879cc70903..d3e2db7cde 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset private IConfigSource m_Config; bool m_Registered = false; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs index b12d778f87..a895a3fa0b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid bool m_Registered = false; HypergridServiceInConnector m_HypergridHandler; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs index 54c6d89073..4c74725ed9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory private IConfigSource m_Config; bool m_Registered = false; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index bce160a92a..dcc6decc3c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land private IConfigSource m_Config; private List m_Scenes = new List(); - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs index 8a903701fa..a5c5ef637f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour private IConfigSource m_Config; private List m_Scenes = new List(); - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs index f28a31849a..c2cea1640e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation private IConfigSource m_Config; bool m_Registered = false; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index d68c683143..71d7993ab4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion #endregion /* Events */ - #region IRegionModule + #region ISharedRegionModule public void Initialise(IConfigSource config) { @@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } } - #endregion /* IRegionModule */ + #endregion #region IInterregionComms diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 44458d175f..24d35e10cc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion protected bool m_safemode; protected IPAddress m_thisIP; - #region IRegionModule + #region ISharedRegionModule public virtual void Initialise(IConfigSource config) { @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion MainServer.Instance.AddHTTPHandler("/object/", ObjectHandler); } - #endregion /* IRegionModule */ + #endregion #region IInterregionComms @@ -436,12 +436,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } OSDMap resp = new OSDMap(2); - string reason = String.Empty; - uint teleportFlags = 0; - if (args.ContainsKey("teleport_flags")) - { - teleportFlags = args["teleport_flags"].AsUInteger(); - } + string reason = String.Empty; + uint teleportFlags = 0; + if (args.ContainsKey("teleport_flags")) + { + teleportFlags = args["teleport_flags"].AsUInteger(); + } // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index fc8d4e1d04..c738b65773 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -81,6 +81,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver public void RemoveRegion(Scene scene) { + scene.UnregisterModuleInterface(this); } public void Close() diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index 5fa3dc2191..a2cfce6d38 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,6 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class CloudModule : ICloudModule { // private static readonly log4net.ILog m_log @@ -48,7 +50,7 @@ namespace OpenSim.Region.CoreModules private float m_cloudDensity = 1.0F; private float[] cloudCover = new float[16 * 16]; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig cloudConfig = config.Configs["Cloud"]; @@ -58,10 +60,17 @@ namespace OpenSim.Region.CoreModules m_cloudDensity = cloudConfig.GetFloat("density", 0.5F); m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { if (m_enabled) { - m_scene = scene; scene.EventManager.OnNewClient += CloudsToClient; @@ -71,9 +80,18 @@ namespace OpenSim.Region.CoreModules GenerateCloudCover(); m_ready = true; - } + } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnNewClient -= CloudsToClient; + scene.UnregisterModuleInterface(this); + scene.EventManager.OnFrame -= CloudUpdate; } public void PostInitialise() @@ -96,12 +114,6 @@ namespace OpenSim.Region.CoreModules get { return "CloudModule"; } } - public bool IsSharedModule - { - get { return false; } - } - - public float CloudCover(int x, int y, int z) { float cover = 0f; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 695cced293..39836aeeee 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -30,6 +30,7 @@ using System.IO; using System.Reflection; using System.Security; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,6 +39,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Estate { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EstateManagementModule : IEstateModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -898,7 +900,16 @@ namespace OpenSim.Region.CoreModules.World.Estate #region IRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); @@ -920,6 +931,29 @@ namespace OpenSim.Region.CoreModules.World.Estate consoleSetTerrainHeights); } + public void RegionLoaded(Scene scene) + { + // Sets up the sun module based on the saved Estate and Region Settings + // DO NOT REMOVE or the sun will stop working + TriggerEstateToolsSunUpdate(); + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnNewClient -= EventManager_OnNewClient; + scene.EventManager.OnRequestChangeWaterHeight -= changeWaterHeight; + } + + public void Close() + { + } + + public string Name + { + get { return "EstateManagementModule"; } + } + #region Console Commands public void consoleSetTerrainTexture(string module, string[] args) @@ -1006,28 +1040,6 @@ namespace OpenSim.Region.CoreModules.World.Estate } #endregion - - public void PostInitialise() - { - // Sets up the sun module based no the saved Estate and Region Settings - // DO NOT REMOVE or the sun will stop working - TriggerEstateToolsSunUpdate(); - } - - public void Close() - { - } - - public string Name - { - get { return "EstateManagementModule"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion #region Other Functions diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index f66f01f0d3..68e8485daf 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -89,7 +90,8 @@ enum GroupPowers : long namespace OpenSim.Region.CoreModules.World.Permissions { - public class PermissionsModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class PermissionsModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -148,12 +150,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions #endregion - #region IRegionModule Members + #region INonSharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - m_scene = scene; - IConfig myConfig = config.Configs["Startup"]; string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); @@ -177,74 +177,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); else - m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); - - //Register functions with Scene External Checks! - m_scene.Permissions.OnBypassPermissions += BypassPermissions; - m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions; - m_scene.Permissions.OnPropagatePermissions += PropagatePermissions; - m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags; - m_scene.Permissions.OnAbandonParcel += CanAbandonParcel; - m_scene.Permissions.OnReclaimParcel += CanReclaimParcel; - m_scene.Permissions.OnDeedParcel += CanDeedParcel; - m_scene.Permissions.OnDeedObject += CanDeedObject; - m_scene.Permissions.OnIsGod += IsGod; - m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; - m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnInstantMessage += CanInstantMessage; - m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED - m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED - m_scene.Permissions.OnMoveObject += CanMoveObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnObjectEntry += CanObjectEntry; - m_scene.Permissions.OnReturnObject += CanReturnObject; //NOT YET IMPLEMENTED - m_scene.Permissions.OnRezObject += CanRezObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; - m_scene.Permissions.OnRunScript += CanRunScript; //NOT YET IMPLEMENTED - m_scene.Permissions.OnCompileScript += CanCompileScript; - m_scene.Permissions.OnSellParcel += CanSellParcel; - m_scene.Permissions.OnTakeObject += CanTakeObject; - m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; - m_scene.Permissions.OnTerraformLand += CanTerraformLand; - m_scene.Permissions.OnLinkObject += CanLinkObject; //NOT YET IMPLEMENTED - m_scene.Permissions.OnDelinkObject += CanDelinkObject; //NOT YET IMPLEMENTED - m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED - - m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED - m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED - m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED - m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED - - m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE - m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnResetScript += CanResetScript; - - m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED - - m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED - m_scene.Permissions.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED - - m_scene.AddCommand(this, "bypass permissions", - "bypass permissions ", - "Bypass permission checks", - HandleBypassPermissions); - - m_scene.AddCommand(this, "force permissions", - "force permissions ", - "Force permissions on or off", - HandleForcePermissions); - - m_scene.AddCommand(this, "debug permissions", - "debug permissions ", - "Enable permissions debugging", - HandleDebugPermissions); - + m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); string grant = myConfig.GetString("GrantLSL",""); if (grant.Length > 0) { @@ -292,6 +225,158 @@ namespace OpenSim.Region.CoreModules.World.Permissions } + public void AddRegion(Scene scene) + { + m_scene = scene; + + //Register functions with Scene External Checks! + m_scene.Permissions.OnBypassPermissions += BypassPermissions; + m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions; + m_scene.Permissions.OnPropagatePermissions += PropagatePermissions; + m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags; + m_scene.Permissions.OnAbandonParcel += CanAbandonParcel; + m_scene.Permissions.OnReclaimParcel += CanReclaimParcel; + m_scene.Permissions.OnDeedParcel += CanDeedParcel; + m_scene.Permissions.OnDeedObject += CanDeedObject; + m_scene.Permissions.OnIsGod += IsGod; + m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; + m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnInstantMessage += CanInstantMessage; + m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED + m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED + m_scene.Permissions.OnMoveObject += CanMoveObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnObjectEntry += CanObjectEntry; + m_scene.Permissions.OnReturnObject += CanReturnObject; //NOT YET IMPLEMENTED + m_scene.Permissions.OnRezObject += CanRezObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; + m_scene.Permissions.OnRunScript += CanRunScript; //NOT YET IMPLEMENTED + m_scene.Permissions.OnCompileScript += CanCompileScript; + m_scene.Permissions.OnSellParcel += CanSellParcel; + m_scene.Permissions.OnTakeObject += CanTakeObject; + m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; + m_scene.Permissions.OnTerraformLand += CanTerraformLand; + m_scene.Permissions.OnLinkObject += CanLinkObject; //NOT YET IMPLEMENTED + m_scene.Permissions.OnDelinkObject += CanDelinkObject; //NOT YET IMPLEMENTED + m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED + + m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED + m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED + m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED + m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED + + m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE + m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnResetScript += CanResetScript; + + m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED + + m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED + m_scene.Permissions.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED + + m_scene.AddCommand(this, "bypass permissions", + "bypass permissions ", + "Bypass permission checks", + HandleBypassPermissions); + + m_scene.AddCommand(this, "force permissions", + "force permissions ", + "Force permissions on or off", + HandleForcePermissions); + + m_scene.AddCommand(this, "debug permissions", + "debug permissions ", + "Enable permissions debugging", + HandleDebugPermissions); + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + m_friendsModule = m_scene.RequestModuleInterface(); + + if (m_friendsModule == null) + m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); + else + m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); + } + + public void RemoveRegion(Scene scene) + { + scene.Permissions.OnBypassPermissions -= BypassPermissions; + scene.Permissions.OnSetBypassPermissions -= SetBypassPermissions; + scene.Permissions.OnPropagatePermissions -= PropagatePermissions; + scene.Permissions.OnGenerateClientFlags -= GenerateClientFlags; + scene.Permissions.OnAbandonParcel -= CanAbandonParcel; + scene.Permissions.OnReclaimParcel -= CanReclaimParcel; + scene.Permissions.OnDeedParcel -= CanDeedParcel; + scene.Permissions.OnDeedObject -= CanDeedObject; + scene.Permissions.OnIsGod -= IsGod; + scene.Permissions.OnDuplicateObject -= CanDuplicateObject; + scene.Permissions.OnDeleteObject -= CanDeleteObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnEditObject -= CanEditObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnEditParcel -= CanEditParcel; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnInstantMessage -= CanInstantMessage; + scene.Permissions.OnInventoryTransfer -= CanInventoryTransfer; //NOT YET IMPLEMENTED + scene.Permissions.OnIssueEstateCommand -= CanIssueEstateCommand; //FULLY IMPLEMENTED + scene.Permissions.OnMoveObject -= CanMoveObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnObjectEntry -= CanObjectEntry; + scene.Permissions.OnReturnObject -= CanReturnObject; //NOT YET IMPLEMENTED + scene.Permissions.OnRezObject -= CanRezObject; //MAYBE FULLY IMPLEMENTED + scene.Permissions.OnRunConsoleCommand -= CanRunConsoleCommand; + scene.Permissions.OnRunScript -= CanRunScript; //NOT YET IMPLEMENTED + scene.Permissions.OnCompileScript -= CanCompileScript; + scene.Permissions.OnSellParcel -= CanSellParcel; + scene.Permissions.OnTakeObject -= CanTakeObject; + scene.Permissions.OnTakeCopyObject -= CanTakeCopyObject; + scene.Permissions.OnTerraformLand -= CanTerraformLand; + scene.Permissions.OnLinkObject -= CanLinkObject; //NOT YET IMPLEMENTED + scene.Permissions.OnDelinkObject -= CanDelinkObject; //NOT YET IMPLEMENTED + scene.Permissions.OnBuyLand -= CanBuyLand; //NOT YET IMPLEMENTED + + scene.Permissions.OnViewNotecard -= CanViewNotecard; //NOT YET IMPLEMENTED + scene.Permissions.OnViewScript -= CanViewScript; //NOT YET IMPLEMENTED + scene.Permissions.OnEditNotecard -= CanEditNotecard; //NOT YET IMPLEMENTED + scene.Permissions.OnEditScript -= CanEditScript; //NOT YET IMPLEMENTED + + scene.Permissions.OnCreateObjectInventory -= CanCreateObjectInventory; //NOT IMPLEMENTED HERE + scene.Permissions.OnEditObjectInventory -= CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED + scene.Permissions.OnCopyObjectInventory -= CanCopyObjectInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnDeleteObjectInventory -= CanDeleteObjectInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnResetScript -= CanResetScript; + + scene.Permissions.OnCreateUserInventory -= CanCreateUserInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnCopyUserInventory -= CanCopyUserInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnEditUserInventory -= CanEditUserInventory; //NOT YET IMPLEMENTED + scene.Permissions.OnDeleteUserInventory -= CanDeleteUserInventory; //NOT YET IMPLEMENTED + + scene.Permissions.OnTeleport -= CanTeleport; //NOT YET IMPLEMENTED + scene.Permissions.OnUseObjectReturn -= CanUseObjectReturn; //NOT YET IMPLEMENTED + } + + public void PostInitialise() + { + } + + public void Close() + { + } + + public string Name + { + get { return "PermissionsModule"; } + } + public void HandleBypassPermissions(string module, string[] args) { if (m_scene.ConsoleScene() != null && @@ -362,31 +447,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_log.InfoFormat("[PERMISSIONS] Set permissions debugging to {0} in {1}", m_debugPermissions, m_scene.RegionInfo.RegionName); } } - - public void PostInitialise() - { - m_friendsModule = m_scene.RequestModuleInterface(); - - if (m_friendsModule == null) - m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); - else - m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); - } - - public void Close() - { - } - - public string Name - { - get { return "PermissionsModule"; } - } - - public bool IsSharedModule - { - get { return false; } - } - #endregion #region Helper Functions diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 37f1f2eb9f..ed7bfe1a01 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -26,6 +26,7 @@ */ using System; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -34,26 +35,44 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Sound { - public class SoundModule : IRegionModule, ISoundModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class SoundModule : INonSharedRegionModule, ISoundModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { m_scene = scene; - + m_scene.EventManager.OnNewClient += OnNewClient; - + m_scene.RegisterModuleInterface(this); } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnNewClient -= OnNewClient; + scene.UnregisterModuleInterface(this); + } - public void PostInitialise() {} public void Close() {} public string Name { get { return "Sound Module"; } } - public bool IsSharedModule { get { return false; } } - + private void OnNewClient(IClientAPI client) { client.OnSoundTrigger += TriggerSound; diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index 0712a7fabc..948c47ce10 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,6 +38,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class SunModule : ISunModule { /// @@ -278,27 +280,12 @@ namespace OpenSim.Region.CoreModules return GetCurrentSunHour() + 6.0f; } - #region IRegion Methods + #region INonSharedRegionModule Methods // Called immediately after the module is loaded for a given region // i.e. Immediately after instance creation. - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - m_scene = scene; - m_frame = 0; - - // This one puts an entry in the main help screen - m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); - - // This one enables the ability to type just "sun" without any parameters - m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); - foreach (KeyValuePair kvp in GetParamList()) - { - m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); - } - - - TimeZone local = TimeZone.CurrentTimeZone; TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset); @@ -346,57 +333,6 @@ namespace OpenSim.Region.CoreModules // m_latitude = d_latitude; // m_longitude = d_longitude; } - - switch (m_RegionMode) - { - case "T1": - default: - case "SL": - // Time taken to complete a cycle (day and season) - - SecondsPerSunCycle = (uint) (m_DayLengthHours * 60 * 60); - SecondsPerYear = (uint) (SecondsPerSunCycle*m_YearLengthDays); - - // Ration of real-to-virtual time - - // VWTimeRatio = 24/m_day_length; - - // Speed of rotation needed to complete a cycle in the - // designated period (day and season) - - SunSpeed = m_SunCycle/SecondsPerSunCycle; - SeasonSpeed = m_SeasonalCycle/SecondsPerYear; - - // Horizon translation - - HorizonShift = m_HorizonShift; // Z axis translation - // HoursToRadians = (SunCycle/24)*VWTimeRatio; - - // Insert our event handling hooks - - scene.EventManager.OnFrame += SunUpdate; - scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; - scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; - scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; - - ready = true; - - m_log.Debug("[SUN]: Mode is " + m_RegionMode); - m_log.Debug("[SUN]: Initialization completed. Day is " + SecondsPerSunCycle + " seconds, and year is " + m_YearLengthDays + " days"); - m_log.Debug("[SUN]: Axis offset is " + m_HorizonShift); - m_log.Debug("[SUN]: Percentage of time for daylight " + m_DayTimeSunHourScale); - m_log.Debug("[SUN]: Positional data updated every " + m_UpdateInterval + " frames"); - - break; - } - - scene.RegisterModuleInterface(this); - - } - - - public void PostInitialise() - { } public void Close() @@ -415,10 +351,84 @@ namespace OpenSim.Region.CoreModules get { return "SunModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return false; } + get { return null; } } + + public void AddRegion(Scene scene) + { + m_scene = scene; + m_frame = 0; + + // This one puts an entry in the main help screen + m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); + + // This one enables the ability to type just "sun" without any parameters + m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); + foreach (KeyValuePair kvp in GetParamList()) + { + m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); + } + switch (m_RegionMode) + { + case "T1": + default: + case "SL": + // Time taken to complete a cycle (day and season) + + SecondsPerSunCycle = (uint)(m_DayLengthHours * 60 * 60); + SecondsPerYear = (uint)(SecondsPerSunCycle * m_YearLengthDays); + + // Ration of real-to-virtual time + + // VWTimeRatio = 24/m_day_length; + + // Speed of rotation needed to complete a cycle in the + // designated period (day and season) + + SunSpeed = m_SunCycle / SecondsPerSunCycle; + SeasonSpeed = m_SeasonalCycle / SecondsPerYear; + + // Horizon translation + + HorizonShift = m_HorizonShift; // Z axis translation + // HoursToRadians = (SunCycle/24)*VWTimeRatio; + + // Insert our event handling hooks + + scene.EventManager.OnFrame += SunUpdate; + scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; + scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; + scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; + + ready = true; + + m_log.Debug("[SUN]: Mode is " + m_RegionMode); + m_log.Debug("[SUN]: Initialization completed. Day is " + SecondsPerSunCycle + " seconds, and year is " + m_YearLengthDays + " days"); + m_log.Debug("[SUN]: Axis offset is " + m_HorizonShift); + m_log.Debug("[SUN]: Percentage of time for daylight " + m_DayTimeSunHourScale); + m_log.Debug("[SUN]: Positional data updated every " + m_UpdateInterval + " frames"); + + break; + } + + scene.RegisterModuleInterface(this); + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.RegisterModuleInterface(this); + scene.EventManager.OnFrame -= SunUpdate; + scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; + scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; + scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; + } + #endregion #region EventManager Events diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index c2ad7b8c38..0b487ed442 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs @@ -28,6 +28,7 @@ using System; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +37,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Vegetation { - public class VegetationModule : IRegionModule, IVegetationModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class VegetationModule : INonSharedRegionModule, IVegetationModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -45,17 +47,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; public PCode[] CreationCapabilities { get { return creationCapabilities; } } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } public void PostInitialise() {} public void Close() {} public string Name { get { return "Vegetation Module"; } } - public bool IsSharedModule { get { return false; } } - + public SceneObjectGroup AddTree( UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree) { diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 3283c1ffa7..cd3706d7b3 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -55,17 +55,19 @@ namespace OpenSim.Region.CoreModules private IWindModelPlugin m_activeWindPlugin = null; private const string m_dWindPluginName = "SimpleRandomWind"; + private string m_desiredWindPlugin = "SimpleRandomWind"; private Dictionary m_availableWindPlugins = new Dictionary(); // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m private Vector2[] windSpeeds = new Vector2[16 * 16]; + private IConfig windConfig; #region IRegion Methods - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - IConfig windConfig = config.Configs["Wind"]; - string desiredWindPlugin = m_dWindPluginName; + windConfig = config.Configs["Wind"]; + m_desiredWindPlugin = m_dWindPluginName; if (windConfig != null) { @@ -76,10 +78,18 @@ namespace OpenSim.Region.CoreModules // Determine which wind model plugin is desired if (windConfig.Contains("wind_plugin")) { - desiredWindPlugin = windConfig.GetString("wind_plugin"); + m_desiredWindPlugin = windConfig.GetString("wind_plugin"); } } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { if (m_enabled) { m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate); @@ -95,30 +105,30 @@ namespace OpenSim.Region.CoreModules } // Check for desired plugin - if (m_availableWindPlugins.ContainsKey(desiredWindPlugin)) + if (m_availableWindPlugins.ContainsKey(m_desiredWindPlugin)) { - m_activeWindPlugin = m_availableWindPlugins[desiredWindPlugin]; + m_activeWindPlugin = m_availableWindPlugins[m_desiredWindPlugin]; - m_log.InfoFormat("[WIND] {0} plugin found, initializing.", desiredWindPlugin); + m_log.InfoFormat("[WIND] {0} plugin found, initializing.", m_desiredWindPlugin); if (windConfig != null) { m_activeWindPlugin.Initialise(); m_activeWindPlugin.WindConfig(m_scene, windConfig); } - } + } // if the plug-in wasn't found, default to no wind. if (m_activeWindPlugin == null) { - m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", desiredWindPlugin); + m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", m_desiredWindPlugin); m_log.ErrorFormat("[WIND] Defaulting to no wind."); } // This one puts an entry in the main help screen m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind [value] - Get or Update Wind paramaters", null); - + // This one enables the ability to type just the base command without any parameters m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand); @@ -127,7 +137,7 @@ namespace OpenSim.Region.CoreModules { m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand); m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand); - + foreach (KeyValuePair kvp in windPlugin.WindParams()) { m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand); @@ -149,13 +159,19 @@ namespace OpenSim.Region.CoreModules m_ready = true; } - } - public void PostInitialise() + public void RegionLoaded(Scene scene) { } + public void RemoveRegion(Scene scene) + { + scene.EventManager.OnFrame -= WindUpdate; + scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion; + scene.UnregisterModuleInterface(this); + } + public void Close() { if (m_enabled) @@ -182,11 +198,6 @@ namespace OpenSim.Region.CoreModules get { return "WindModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 285d36a3d6..6bda1e9e6d 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Drawing; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -59,7 +60,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public face[] trns; } - public class MapImageModule : IMapImageGenerator, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MapImageModule : IMapImageGenerator, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -128,23 +130,36 @@ namespace OpenSim.Region.CoreModules.World.WorldMap #endregion - #region IRegionModule Members + #region INonSharedRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - m_scene = scene; m_config = source; IConfig startupConfig = m_config.Configs["Startup"]; if (startupConfig.GetString("MapImageModule", "MapImageModule") != "MapImageModule") return; + } + public void AddRegion(Scene scene) + { + m_scene = scene; m_scene.RegisterModuleInterface(this); } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); } public void Close() @@ -156,11 +171,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapImageModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion // TODO: unused: diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index be46fa55b2..dd336735a3 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -24,9 +24,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,7 +41,8 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.WorldMap { - public class MapSearchModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MapSearchModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -46,8 +50,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap Scene m_scene = null; // only need one for communication with GridService List m_scenes = new List(); - #region IRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + #region ISharedRegionModule Members + public void Initialise(IConfigSource source) + { + } + + public void AddRegion(Scene scene) { if (m_scene == null) { @@ -58,6 +66,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap scene.EventManager.OnNewClient += OnNewClient; } + public Type ReplaceableInterface + { + get { return null; } + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if(m_scenes.Contains(scene)) + m_scenes.Remove(scene); + scene.EventManager.OnNewClient -= OnNewClient; + } + public void PostInitialise() { } @@ -73,11 +97,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapSearchModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion private void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index 4df9094644..b0cefc3047 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -33,6 +33,7 @@ using System.Net; using System.Reflection; using System.Xml; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -43,7 +44,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.DataSnapshot { - public class DataSnapshotManager : IRegionModule, IDataSnapshot + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class DataSnapshotManager : ISharedRegionModule, IDataSnapshot { #region Class members //Information from config @@ -89,7 +91,7 @@ namespace OpenSim.Region.DataSnapshot #region IRegionModule - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (!m_configLoaded) { @@ -140,24 +142,29 @@ namespace OpenSim.Region.DataSnapshot return; } } - - if (m_enabled) - { - //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer - new DataRequestHandler(scene, this); - - m_hostname = scene.RegionInfo.ExternalHostName; - m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); - - MakeEverythingStale(); - - if (m_dataServices != "" && m_dataServices != "noservices") - NotifyDataServices(m_dataServices, "online"); - } } + } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { if (m_enabled) { + //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer + new DataRequestHandler(scene, this); + + m_hostname = scene.RegionInfo.ExternalHostName; + m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); + + MakeEverythingStale(); + + if (m_dataServices != "" && m_dataServices != "noservices") + NotifyDataServices(m_dataServices, "online"); + m_log.Info("[DATASNAPSHOT]: Scene added to module."); m_snapStore.AddScene(scene); @@ -191,22 +198,27 @@ namespace OpenSim.Region.DataSnapshot } else { - m_log.Warn("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else)."); + m_log.Info("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else)."); } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + m_snapStore.RemoveScene(scene); + } + public void Close() { if (m_enabled && m_dataServices != "" && m_dataServices != "noservices") NotifyDataServices(m_dataServices, "offline"); } - - public bool IsSharedModule - { - get { return true; } - } - public string Name { get { return "External Data Generator"; } @@ -214,7 +226,6 @@ namespace OpenSim.Region.DataSnapshot public void PostInitialise() { - } #endregion diff --git a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs index f8a5bad347..879114b18c 100644 --- a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs @@ -28,7 +28,7 @@ namespace OpenSim.Region.Framework.Interfaces { - public interface ICloudModule : IRegionModule + public interface ICloudModule : INonSharedRegionModule { /// /// Retrieves the cloud density at the given region coordinates diff --git a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs index 3a2c4231cf..bdad0b4061 100644 --- a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs @@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Interfaces public int numLeft; } - public interface IEmailModule : IRegionModule + public interface IEmailModule : ISharedRegionModule { void SendEmail(UUID objectID, string address, string subject, string body); Email GetNextEmail(UUID objectID, string sender, string subject); diff --git a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs index 890fa31df0..347818cf42 100644 --- a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface IEstateModule : IRegionModule + public interface IEstateModule : INonSharedRegionModule { uint GetRegionFlags(); bool IsManager(UUID avatarID); diff --git a/OpenSim/Region/Framework/Interfaces/ISunModule.cs b/OpenSim/Region/Framework/Interfaces/ISunModule.cs index 819ae11d3c..8231716f2e 100644 --- a/OpenSim/Region/Framework/Interfaces/ISunModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ISunModule.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface ISunModule : IRegionModule + public interface ISunModule : INonSharedRegionModule { double GetSunParameter(string param); diff --git a/OpenSim/Region/Framework/Interfaces/IWindModule.cs b/OpenSim/Region/Framework/Interfaces/IWindModule.cs index 10ecc325c8..4a26a717db 100644 --- a/OpenSim/Region/Framework/Interfaces/IWindModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IWindModule.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface IWindModule : IRegionModule + public interface IWindModule : INonSharedRegionModule { /// diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs index cfe1278786..ec040dbbf2 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs @@ -25,9 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Net; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -35,24 +37,23 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server; namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView { - public class IRCStackModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class IRCStackModule : INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IRCServer m_server; // private Scene m_scene; + private int portNo; - #region Implementation of IRegionModule + #region Implementation of ISharedRegionModule - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { if (null != source.Configs["IRCd"] && source.Configs["IRCd"].GetBoolean("Enabled",false)) { - int portNo = source.Configs["IRCd"].GetInt("Port",6666); -// m_scene = scene; - m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); - m_server.OnNewIRCClient += m_server_OnNewIRCClient; + portNo = source.Configs["IRCd"].GetInt("Port",6666); } } @@ -68,9 +69,20 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView m_log.Info("[IRCd] Added user to Scene"); } - public void PostInitialise() + public void AddRegion(Scene scene) { + if (portNo != null) + { + m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); + m_server.OnNewIRCClient += m_server_OnNewIRCClient; + } + } + public void RegionLoaded(Scene scene) + { + } + public void RemoveRegion(Scene scene) + { } public void Close() @@ -83,9 +95,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView get { return "IRCClientStackModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return false; } + get { return null; } } #endregion diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index b04b076629..23ae307910 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -38,6 +38,7 @@ using System.Collections.Generic; using System.Reflection; using OpenMetaverse; using log4net; +using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenSim.Framework; @@ -53,7 +54,8 @@ using System.Text.RegularExpressions; namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { - public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -108,9 +110,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice private IConfig m_config; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - m_scene = scene; m_config = config.Configs["FreeSwitchVoice"]; if (null == m_config) @@ -224,17 +225,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice return; } } + } - if (m_pluginEnabled) + public void AddRegion(Scene scene) + { + m_scene = scene; + if (m_pluginEnabled) { // we need to capture scene in an anonymous method // here as we need it later in the callbacks scene.EventManager.OnRegisterCaps += delegate(UUID agentID, Caps caps) - { - OnRegisterCaps(scene, agentID, caps); - }; - - + { + OnRegisterCaps(scene, agentID, caps); + }; + + try { @@ -254,21 +259,53 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); } } - + } - } - - public void PostInitialise() - { if (m_pluginEnabled) { m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); - + // register the voice interface for this module, so the script engine can call us m_scene.RegisterModuleInterface(this); } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (UseProxy) + { + MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/", m_freeSwitchAPIPrefix)); + } + else + { + MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix)); + + MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix)); + + MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix)); + + MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix)); + } + scene.EventManager.OnRegisterCaps -= delegate(UUID agentID, Caps caps) + { + OnRegisterCaps(scene, agentID, caps); + }; + scene.UnregisterModuleInterface(this); + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void PostInitialise() + { + } + public void Close() { } @@ -277,11 +314,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { get { return "FreeSwitchVoiceModule"; } } - - public bool IsSharedModule - { - get { return true; } - } // // implementation of IVoiceModule, called by osSetParcelSIPAddress script function diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs index 3d1c346dc8..6769d59bc6 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -38,6 +38,7 @@ using System.Threading; using OpenMetaverse; +using Mono.Addins; using Nini.Config; using OpenSim; @@ -50,7 +51,8 @@ using log4net; namespace OpenSim.Region.OptionalModules.ContentManagement { - public class ContentManagementModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class ContentManagementModule : ISharedRegionModule { #region Static Fields @@ -60,22 +62,20 @@ namespace OpenSim.Region.OptionalModules.ContentManagement #region Fields - bool initialised = false; - CMController m_control = null; - bool m_enabled = false; - CMModel m_model = null; - bool m_posted = false; - CMView m_view = null; + private bool initialised = false; + private CMController m_control = null; + private bool m_enabled = false; + private CMModel m_model = null; + private bool m_posted = false; + private CMView m_view = null; + private string databaseDir = "./"; + private string database = "FileSystemDatabase"; + private int channel = 345; #endregion Fields #region Public Properties - public bool IsSharedModule - { - get { return true; } - } - public string Name { get { return "ContentManagementModule"; } @@ -89,11 +89,8 @@ namespace OpenSim.Region.OptionalModules.ContentManagement { } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - string databaseDir = "./"; - string database = "FileSystemDatabase"; - int channel = 345; try { if (source.Configs["CMS"] == null) @@ -115,13 +112,15 @@ namespace OpenSim.Region.OptionalModules.ContentManagement m_log.ErrorFormat("[Content Management]: Exception thrown while reading parameters from configuration file. Message: " + e); m_enabled = false; } + } + public void AddRegion(Scene scene) + { if (!m_enabled) { m_log.Info("[Content Management]: Content Management System is not Enabled."); return; } - lock (this) { if (!initialised) //only init once @@ -142,6 +141,18 @@ namespace OpenSim.Region.OptionalModules.ContentManagement } } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } public void PostInitialise() { diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index 4521f8ef6a..f24bcdc1e7 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -38,6 +38,7 @@ using System.Security.Policy; using System.Text; using log4net; using Microsoft.CSharp; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -46,7 +47,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - public class MRMModule : IRegionModule, IMRMModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class MRMModule : INonSharedRegionModule, IMRMModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; @@ -62,12 +64,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule private IConfig m_config; + private bool m_hidden = true; + public void RegisterExtension(T instance) { m_extensions[typeof (T)] = instance; } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { if (source.Configs["MRM"] != null) { @@ -76,19 +80,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule if (source.Configs["MRM"].GetBoolean("Enabled", false)) { m_log.Info("[MRM] Enabling MRM Module"); - m_scene = scene; - + // when hidden, we don't listen for client initiated script events // only making the MRM engine available for region modules - if (!source.Configs["MRM"].GetBoolean("Hidden", false)) - { - scene.EventManager.OnRezScript += EventManager_OnRezScript; - scene.EventManager.OnStopScript += EventManager_OnStopScript; - } - - scene.EventManager.OnFrame += EventManager_OnFrame; - - scene.RegisterModuleInterface(this); + m_hidden = source.Configs["MRM"].GetBoolean("Hidden", false); } else { @@ -101,6 +96,39 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule } } + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + if (!m_hidden) + { + scene.EventManager.OnRezScript += EventManager_OnRezScript; + scene.EventManager.OnStopScript += EventManager_OnStopScript; + } + scene.EventManager.OnFrame += EventManager_OnFrame; + + scene.RegisterModuleInterface(this); + } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + if (!m_hidden) + { + scene.EventManager.OnRezScript -= EventManager_OnRezScript; + scene.EventManager.OnStopScript -= EventManager_OnStopScript; + } + scene.EventManager.OnFrame -= EventManager_OnFrame; + + scene.UnregisterModuleInterface(this); + } + void EventManager_OnStopScript(uint localID, UUID itemID) { if (m_scripts.ContainsKey(itemID)) @@ -302,11 +330,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule mmb.InitMiniModule(world, host, itemID); } - public void PostInitialise() - { - - } - public void Close() { foreach (KeyValuePair pair in m_scripts) @@ -320,11 +343,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule get { return "MiniRegionModule"; } } - public bool IsSharedModule - { - get { return false; } - } - /// /// Stolen from ScriptEngine Common /// diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index c653e98401..999756a93f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs @@ -100,10 +100,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady if (!m_enabled) return; - m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; - m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; + scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; + scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; - m_scene = null; + scene = null; } public void Close() diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 44c9ada221..df01938d5f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs @@ -58,6 +58,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms public void RemoveRegion(Scene scene) { + scene.UnregisterModuleInterface(this); } public void RegionLoaded(Scene scene) diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs index d18ac0a90c..f2a0e53558 100644 --- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; @@ -49,7 +50,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule public string uri; } - public class XmlRpcGridRouter : IRegionModule, IXmlRpcRouter + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class XmlRpcGridRouter : INonSharedRegionModule, IXmlRpcRouter { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -59,7 +61,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule private bool m_Enabled = false; private string m_ServerURI = String.Empty; - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { IConfig startupConfig = config.Configs["Startup"]; if (startupConfig == null) @@ -75,13 +77,26 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule return; } - scene.RegisterModuleInterface(this); m_Enabled = true; } } - public void PostInitialise() + public void AddRegion(Scene scene) { + scene.RegisterModuleInterface(this); + } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } + + public Type ReplaceableInterface + { + get { return null; } } public void Close() @@ -93,11 +108,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule get { return "XmlRpcGridRouterModule"; } } - public bool IsSharedModule - { - get { return false; } - } - public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) { if (!m_Channels.ContainsKey(itemID)) diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs index 32659c8e5d..4d39345302 100644 --- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs @@ -29,6 +29,7 @@ using System; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; @@ -39,11 +40,12 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule { - public class XmlRpcRouter : IRegionModule, IXmlRpcRouter + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class XmlRpcRouter : INonSharedRegionModule, IXmlRpcRouter { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - public void Initialise(Scene scene, IConfigSource config) + private bool m_enabled = false; + public void Initialise(IConfigSource config) { IConfig startupConfig = config.Configs["Startup"]; if (startupConfig == null) @@ -52,12 +54,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule if (startupConfig.GetString("XmlRpcRouterModule", "XmlRpcRouterModule") == "XmlRpcRouterModule") { - scene.RegisterModuleInterface(this); + m_enabled = true; } } - - public void PostInitialise() + public void AddRegion(Scene scene) { + scene.RegisterModuleInterface(this); + } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } + + public Type ReplaceableInterface + { + get { return null; } } public void Close() @@ -69,11 +84,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule get { return "XmlRpcRouterModule"; } } - public bool IsSharedModule - { - get { return false; } - } - public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) { scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri}); diff --git a/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs b/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs index 97fa63cb45..801f1f8f50 100644 --- a/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Freeswitch private IConfigSource m_Config; bool m_Registered = false; - #region IRegionModule interface + #region ISharedRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs index 3490a8baef..fa5878d5c5 100644 --- a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs +++ b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs @@ -31,6 +31,7 @@ using System.IO; using System.Reflection; using System.Timers; using log4net; +using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.CoreModules.World.Serialiser; @@ -42,7 +43,8 @@ using Slash = System.IO.Path; namespace OpenSim.Region.Modules.SvnSerialiser { - public class SvnBackupModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class SvnBackupModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -200,9 +202,9 @@ namespace OpenSim.Region.Modules.SvnSerialiser #endregion - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { m_scenes = new List(); m_timer = new Timer(); @@ -225,7 +227,10 @@ namespace OpenSim.Region.Modules.SvnSerialiser catch (Exception) { } + } + public void AddRegion(Scene scene) + { lock (m_scenes) { m_scenes.Add(scene); @@ -236,6 +241,18 @@ namespace OpenSim.Region.Modules.SvnSerialiser scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + } + + public Type ReplaceableInterface + { + get { return null; } + } public void PostInitialise() { @@ -277,11 +294,6 @@ namespace OpenSim.Region.Modules.SvnSerialiser get { return "SvnBackupModule"; } } - public bool IsSharedModule - { - get { return true; } - } - #endregion private void EventManager_OnPluginConsole(string[] args) diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index ac39a532ae..521d01a7d4 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -25,9 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using System.Threading; using OpenMetaverse; +using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -37,7 +39,8 @@ using Timer=System.Timers.Timer; namespace OpenSim.Region.OptionalModules.World.NPC { - public class NPCModule : IRegionModule, INPCModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class NPCModule : ISharedRegionModule, INPCModule { // private const bool m_enabled = false; @@ -134,15 +137,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { m_createMutex = new Mutex(false); m_timer = new Timer(500); m_timer.Elapsed += m_timer_Elapsed; m_timer.Start(); - - scene.RegisterModuleInterface(this); } void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) @@ -173,6 +174,19 @@ namespace OpenSim.Region.OptionalModules.World.NPC } } + public void AddRegion(Scene scene) + { + scene.RegisterModuleInterface(this); + } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + } + public void PostInitialise() { } @@ -186,9 +200,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC get { return "NPCModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return true; } - } + get { return null; } + } } } diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index e3fbb6ee09..b59d07adde 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs @@ -31,6 +31,7 @@ using System.Reflection; using System.Timers; using OpenMetaverse; using log4net; +using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.CoreModules.Framework.InterfaceCommander; @@ -46,7 +47,8 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator /// /// Version 2.02 - Still hacky /// - public class TreePopulatorModule : IRegionModule, ICommandableModule, IVegetationModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class TreePopulatorModule : INonSharedRegionModule, ICommandableModule, IVegetationModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly Commander m_commander = new Commander("tree"); @@ -168,15 +170,10 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator #endregion - #region IRegionModule Members + #region ISharedRegionModule Members - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - - m_scene = scene; - m_scene.RegisterModuleInterface(this); - m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; - // ini file settings try { @@ -196,12 +193,18 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator m_log.Debug("[TREES]: ini failure for update_rate - using default"); } - InstallCommands(); - m_log.Debug("[TREES]: Initialised tree module"); } - public void PostInitialise() + public void AddRegion(Scene scene) + { + m_scene = scene; + m_scene.RegisterModuleInterface(this); + m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; + InstallCommands(); + } + + public void RegionLoaded(Scene scene) { ReloadCopse(); if (m_copse.Count > 0) @@ -211,6 +214,17 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator activeizeTreeze(true); } + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole; + } + + public Type ReplaceableInterface + { + get { return null; } + } + public void Close() { } @@ -220,11 +234,6 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator get { return "TreePopulatorModule"; } } - public bool IsSharedModule - { - get { return false; } - } - #endregion //-------------------------------------------------------------- diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index a03cc4cf50..9b53d06bb9 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs @@ -34,6 +34,7 @@ using System.Reflection; using System.Text; using System.Threading; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -52,7 +53,8 @@ using OSDMap = OpenMetaverse.StructuredData.OSDMap; namespace OpenSim.Region.UserStatistics { - public class WebStatsModule : IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class WebStatsModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -70,7 +72,7 @@ namespace OpenSim.Region.UserStatistics private string m_loglines = String.Empty; private volatile int lastHit = 12000; - public virtual void Initialise(Scene scene, IConfigSource config) + public virtual void Initialise(IConfigSource config) { IConfig cnfg; try @@ -82,11 +84,17 @@ namespace OpenSim.Region.UserStatistics { enabled = false; } - + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { if (!enabled) - { return; - } lock (m_scene) { @@ -130,7 +138,7 @@ namespace OpenSim.Region.UserStatistics MainServer.Instance.AddHTTPHandler("/SStats/", HandleStatsRequest); MainServer.Instance.AddHTTPHandler("/CAPS/VS/", HandleUnknownCAPSRequest); } - + m_scene.Add(scene); if (m_simstatsCounters.ContainsKey(scene.RegionInfo.RegionID)) m_simstatsCounters.Remove(scene.RegionInfo.RegionID); @@ -140,6 +148,14 @@ namespace OpenSim.Region.UserStatistics } } + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + } + public void ReceiveClassicSimStatsPacket(SimStats stats) { if (!enabled) @@ -308,11 +324,6 @@ namespace OpenSim.Region.UserStatistics get { return "ViewerStatsModule"; } } - public bool IsSharedModule - { - get { return true; } - } - public void OnRegisterCaps(UUID agentID, Caps caps) { m_log.DebugFormat("[VC]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index b13e8dd208..20f2bca301 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -161,10 +161,11 @@ namespace OpenSim.Tests.Common.Setup capsModule.Initialise(new IniConfigSource()); testScene.AddRegionModule(capsModule.Name, capsModule); capsModule.AddRegion(testScene); - - IRegionModule godsModule = new GodsModule(); - godsModule.Initialise(testScene, new IniConfigSource()); - testScene.AddModule(godsModule.Name, godsModule); + + INonSharedRegionModule godsModule = new GodsModule(); + godsModule.Initialise(new IniConfigSource()); + testScene.AddRegionModule(godsModule.Name, godsModule); + godsModule.AddRegion(testScene); realServices = realServices.ToLower(); // IConfigSource config = new IniConfigSource(); From 316503c3984ea5333e6d13fb3d4d2f308a618424 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 23 Jan 2010 15:40:34 +0000 Subject: [PATCH 13/81] Added some prebuild refs needed for mono building --- prebuild.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prebuild.xml b/prebuild.xml index 0ab7414f4c..46a10578de 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -2242,6 +2242,7 @@ + @@ -2302,6 +2303,7 @@ + @@ -2812,6 +2814,7 @@ + From fe06f0dd05fa783a6d3d7e7aa2b5614c9825e8fe Mon Sep 17 00:00:00 2001 From: Revolution Date: Sat, 23 Jan 2010 20:29:02 -0600 Subject: [PATCH 14/81] Fixes Region Crossings on a prim. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1c183f3310..5562e51ee4 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2779,7 +2779,15 @@ namespace OpenSim.Region.Framework.Scenes protected void CrossToNewRegion() { InTransit(); - m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); + try + { + m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); + } + catch(Exception ex) + { + m_scene.CrossAgentToNewRegion(this, false); + } + } public void InTransit() From 19d4867af7ee6c8f3005b116a545319cda8e1b25 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 26 Jan 2010 07:40:33 +1100 Subject: [PATCH 15/81] * Quick fix to Remote Console session ID handling. --- OpenSim/Framework/Console/RemoteConsole.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index c27072c2c4..9fdd1b8a14 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -302,6 +302,12 @@ namespace OpenSim.Framework.Console if (!UUID.TryParse(post["ID"].ToString(), out id)) return reply; + lock(m_Connections) + { + if(!m_Connections.ContainsKey(id)) + return reply; + } + if (post["COMMAND"] == null || post["COMMAND"].ToString() == String.Empty) return reply; From 38cfc9366ce264d2aeb6409df48be7cecc348952 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 25 Jan 2010 21:51:58 +0000 Subject: [PATCH 16/81] Fix a problem where llDie() calls were sometimes leaving dead objects behind. When an object was deleted, the remove script instance call was aggregating the scripting events as normal. This would queue a full update of the prim before the viewer was notifed of the deletion of that prim (QuitPacket) On some occasions, the QuitPacket would be sent before the full update was dequeued and sent. In principle, you would think that a viewer would ignore updates for deleted prims. But it appears that in the Linden viewer (1.23.5), a prim update that arrives after the prim was deleted instead makes the deleted prim persist in the viewer. Such prims have no properties and cannot be removed from the viewer except by a relog. This change stops the prim event aggregation call if it's being deleted anyway, hence removing the spurious viewer-confusing update. --- .../ClientStack/LindenUDP/LLClientView.cs | 18 ++++++++++++++++ .../Framework/Interfaces/IEntityInventory.cs | 12 +++++++++-- .../Framework/Scenes/Scene.Inventory.cs | 4 +++- OpenSim/Region/Framework/Scenes/Scene.cs | 8 +++++-- .../Scenes/SceneObjectGroup.Inventory.cs | 8 +++++-- .../Framework/Scenes/SceneObjectPart.cs | 12 ++++++++++- .../Scenes/SceneObjectPartInventory.cs | 21 ++++++++++++++----- .../Region/ScriptEngine/XEngine/XEngine.cs | 9 +++----- 8 files changed, 73 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4b5e4c4d5c..1d364d4178 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1465,6 +1465,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendKillObject(ulong regionHandle, uint localID) { +// m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, localID, regionHandle); + KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); // TODO: don't create new blocks if recycling an old packet kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; @@ -3472,6 +3474,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendPrimitiveToClient(SendPrimitiveData data) { +// string text = data.text; +// if (text.IndexOf("\n") >= 0) +// text = text.Remove(text.IndexOf("\n")); +// m_log.DebugFormat( +// "[CLIENT]: Placing request to send full info about prim {0} text {1} to client {2}", +// data.localID, text, Name); + if (data.priority == double.NaN) { m_log.Error("[LLClientView] SendPrimitiveToClient received a NaN priority, dropping update"); @@ -3509,7 +3518,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[count]; for (int i = 0; i < count; i++) + { outPacket.ObjectData[i] = m_primFullUpdates.Dequeue(); + +// string text = Util.FieldToString(outPacket.ObjectData[i].Text); +// if (text.IndexOf("\n") >= 0) +// text = text.Remove(text.IndexOf("\n")); +// m_log.DebugFormat( +// "[CLIENT]: Sending full info about prim {0} text {1} to client {2}", +// outPacket.ObjectData[i].ID, text, Name); + } } OutPacket(outPacket, ThrottleOutPacketType.State); diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 67395fa23d..eeb51024e9 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs @@ -77,7 +77,11 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Stop all the scripts in this entity. /// - void RemoveScriptInstances(); + /// + /// Should be true if these scripts are being removed because the scene + /// object is being deleted. This will prevent spurious updates to the client. + /// + void RemoveScriptInstances(bool sceneObjectBeingDeleted); /// /// Start a script which is in this entity's inventory. @@ -103,7 +107,11 @@ namespace OpenSim.Region.Framework.Interfaces /// Stop a script which is in this prim's inventory. /// /// - void RemoveScriptInstance(UUID itemId); + /// + /// Should be true if these scripts are being removed because the scene + /// object is being deleted. This will prevent spurious updates to the client. + /// + void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted); /// /// Add an item to this entity's inventory. If an item with the same name already exists, then an alternative diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 30440172bd..11754eaca8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -256,7 +256,7 @@ namespace OpenSim.Region.Framework.Scenes if (isScriptRunning) { - part.Inventory.RemoveScriptInstance(item.ItemID); + part.Inventory.RemoveScriptInstance(item.ItemID, false); } // Update item with new asset @@ -855,8 +855,10 @@ namespace OpenSim.Region.Framework.Scenes if (item.Type == 10) { + part.RemoveScriptEvents(itemID); EventManager.TriggerRemoveScript(localID, itemID); } + group.RemoveInventoryItem(localID, itemID); part.GetProperties(remoteClient); } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 234554ee4d..4da05cf3c1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Framework.Scenes { if (ent is SceneObjectGroup) { - ((SceneObjectGroup) ent).RemoveScriptInstances(); + ((SceneObjectGroup) ent).RemoveScriptInstances(false); } } } @@ -1884,13 +1884,15 @@ namespace OpenSim.Region.Framework.Scenes /// Suppress broadcasting changes to other clients. public void DeleteSceneObject(SceneObjectGroup group, bool silent) { +// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID); + //SceneObjectPart rootPart = group.GetChildPart(group.UUID); // Serialise calls to RemoveScriptInstances to avoid // deadlocking on m_parts inside SceneObjectGroup lock (m_deleting_scene_object) { - group.RemoveScriptInstances(); + group.RemoveScriptInstances(true); } foreach (SceneObjectPart part in group.Children.Values) @@ -1918,6 +1920,8 @@ namespace OpenSim.Region.Framework.Scenes } group.DeleteGroup(silent); + +// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); } /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 5a06bdb7b9..71354b4eac 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -74,13 +74,17 @@ namespace OpenSim.Region.Framework.Scenes /// /// Stop the scripts contained in all the prims in this group /// - public void RemoveScriptInstances() + /// + /// Should be true if these scripts are being removed because the scene + /// object is being deleted. This will prevent spurious updates to the client. + /// + public void RemoveScriptInstances(bool sceneObjectBeingDeleted) { lock (m_parts) { foreach (SceneObjectPart part in m_parts.Values) { - part.Inventory.RemoveScriptInstances(); + part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted); } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 56b2f13f3d..a5296eb1fd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2479,7 +2479,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); //ScheduleFullUpdate(); } - + public void RemoveScriptEvents(UUID scriptid) { lock (m_scriptEvents) @@ -2533,6 +2533,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void ScheduleFullUpdate() { +// m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); + if (m_parentGroup != null) { m_parentGroup.QueueForUpdateCheck(); @@ -4042,6 +4044,8 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentGroup == null) { +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents() since m_parentGroup == null", Name, LocalId); ScheduleFullUpdate(); return; } @@ -4058,9 +4062,15 @@ namespace OpenSim.Region.Framework.Scenes LocalFlags=(PrimFlags)objectflagupdate; if (m_parentGroup != null && m_parentGroup.RootPart == this) + { m_parentGroup.aggregateScriptEvents(); + } else + { +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); ScheduleFullUpdate(); + } } public int registerTargetWaypoint(Vector3 target, float tolerance) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index eb7f5ffc9f..5f132788e1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -230,7 +230,11 @@ namespace OpenSim.Region.Framework.Scenes /// /// Stop all the scripts in this prim. /// - public void RemoveScriptInstances() + /// + /// Should be true if these scripts are being removed because the scene + /// object is being deleted. This will prevent spurious updates to the client. + /// + public void RemoveScriptInstances(bool sceneObjectBeingDeleted) { lock (Items) { @@ -238,8 +242,7 @@ namespace OpenSim.Region.Framework.Scenes { if ((int)InventoryType.LSL == item.InvType) { - RemoveScriptInstance(item.ItemID); - m_part.RemoveScriptEvents(item.ItemID); + RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted); } } } @@ -388,10 +391,17 @@ namespace OpenSim.Region.Framework.Scenes /// Stop a script which is in this prim's inventory. /// /// - public void RemoveScriptInstance(UUID itemId) + /// + /// Should be true if this script is being removed because the scene + /// object is being deleted. This will prevent spurious updates to the client. + /// + public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted) { if (m_items.ContainsKey(itemId)) { + if (!sceneObjectBeingDeleted) + m_part.RemoveScriptEvents(itemId); + m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId); m_part.ParentGroup.AddActiveScriptCount(-1); } @@ -465,7 +475,7 @@ namespace OpenSim.Region.Framework.Scenes if (i.Name == item.Name) { if (i.InvType == (int)InventoryType.LSL) - RemoveScriptInstance(i.ItemID); + RemoveScriptInstance(i.ItemID, false); RemoveInventoryItem(i.ItemID); break; @@ -613,6 +623,7 @@ namespace OpenSim.Region.Framework.Scenes int type = m_items[itemID].InvType; if (type == 10) // Script { + m_part.RemoveScriptEvents(itemID); m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); } m_items.Remove(itemID); diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 6dd94bb042..c552b92a26 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -806,12 +806,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine instance.ClearQueue(); instance.Stop(0); - SceneObjectPart part = - m_Scene.GetSceneObjectPart(localID); - - if (part != null) - part.RemoveScriptEvents(itemID); - // bool objectRemoved = false; lock (m_PrimObjects) @@ -846,7 +840,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine ObjectRemoved handlerObjectRemoved = OnObjectRemoved; if (handlerObjectRemoved != null) + { + SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); handlerObjectRemoved(part.UUID); + } CleanAssemblies(); } From 72dd680dd3808f0222bb4cba0c9989c5bbb00287 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 26 Jan 2010 14:46:53 +0000 Subject: [PATCH 17/81] Replace dome tabs with spaces --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5562e51ee4..e26283dea0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2781,11 +2781,11 @@ namespace OpenSim.Region.Framework.Scenes InTransit(); try { - m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); + m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); } catch(Exception ex) { - m_scene.CrossAgentToNewRegion(this, false); + m_scene.CrossAgentToNewRegion(this, false); } } @@ -3860,4 +3860,4 @@ namespace OpenSim.Region.Framework.Scenes } } } -} \ No newline at end of file +} From 5e58bca86d7824af6f5e9ef879795044eeb1f40f Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:15:49 -0500 Subject: [PATCH 18/81] * Fix Endlines in MyNpcCharacter.cs --- .../Examples/SimpleModule/MyNpcCharacter.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 1dfa1b1b76..0bd1a26c41 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -1133,15 +1133,15 @@ namespace OpenSim.Region.Examples.SimpleModule } public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } From d19045becd03c27db51e941f47bac4991ea9fb1d Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:17:55 -0500 Subject: [PATCH 19/81] * Fix Endlines in VWHClientView.cs --- .../VWoHTTP/ClientStack/VWHClientView.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index 6a119bd372..20122112b0 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -1194,15 +1194,15 @@ namespace OpenSim.Client.VWoHTTP.ClientStack } public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } From 8284fc8e2244eeea3915bf0485f2c7b7ef4ed153 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:19:38 -0500 Subject: [PATCH 20/81] * Fix Endlines in IRCClientView.cs --- .../Server/IRCClientView.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 6785c08ce9..b421623fb7 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1657,15 +1657,15 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } From ed11a55f859b3d1b68f3f4a7ac3a60a8156cc0e6 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:20:41 -0500 Subject: [PATCH 21/81] * Fix Endlines in SirikataClientView.cs --- .../Sirikata/ClientStack/SirikataClientView.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index 30d157565f..eac20bc6ce 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs @@ -1177,15 +1177,15 @@ namespace OpenSim.Client.Sirikata.ClientStack } public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } #endregion From 027ad495677ddaa3b05b268d167faa514954085e Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:23:06 -0500 Subject: [PATCH 22/81] * Fix Endlines in Mock/TestClient.cs --- OpenSim/Tests/Common/Mock/TestClient.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 8b79502127..b5eaf43950 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1194,14 +1194,14 @@ namespace OpenSim.Tests.Common.Mock public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } From bc68f77396ec7738b64e4abe797b9ff7eeb84b3d Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:41:37 -0500 Subject: [PATCH 23/81] * A few other endlines... --- .../OptionalModules/World/NPC/NPCAvatar.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 4a4c51557b..1d15552993 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -1138,15 +1138,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC } public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } From ccf7bfe09b4ae2fa4e4d680ddd08a23059267d40 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:44:42 -0500 Subject: [PATCH 24/81] * a few more endlines.. --- OpenSim/Framework/IClientAPI.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 3489af122d..3f53258713 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1447,10 +1447,10 @@ namespace OpenSim.Framework void SendUseCachedMuteList(); - void SendMuteListUpdate(string filename); - - void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals); - + void SendMuteListUpdate(string filename); + + void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals); + void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes); void KillEndDone(); From d28542e4d45bee5b4c260f31db64ab67c3036422 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:47:27 -0500 Subject: [PATCH 25/81] more endlines.. --- .../Client/MXP/ClientStack/MXPClientView.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 3c98229265..94a81f09bb 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -1688,15 +1688,15 @@ namespace OpenSim.Client.MXP.ClientStack } public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { + { + } + + public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) + { + } + + public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) + { } } } From 910d2177ad1e90d8b5748fbc8ffe9dbfe0c0fc9b Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Tue, 26 Jan 2010 12:49:53 -0500 Subject: [PATCH 26/81] * .. More Endlines... --- OpenSim/Framework/Communications/Clients/RegionClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs index 5ceaf39dcf..ee7dec8837 100644 --- a/OpenSim/Framework/Communications/Clients/RegionClient.cs +++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs @@ -83,7 +83,7 @@ namespace OpenSim.Framework.Communications.Clients } // Add the regionhandle of the destination region ulong regionHandle = GetRegionHandle(region.RegionHandle); - args["destination_handle"] = OSD.FromString(regionHandle.ToString()); + args["destination_handle"] = OSD.FromString(regionHandle.ToString()); args["teleport_flags"] = OSD.FromString(teleportFlags.ToString()); string strBuffer = ""; From c26f1d1bfa968f718f86761f485a6ed440b3798e Mon Sep 17 00:00:00 2001 From: Revolution Date: Wed, 27 Jan 2010 17:44:57 -0600 Subject: [PATCH 27/81] Changes WorldCommModule to ISharedRegionModule. Signed-off-by: Melanie --- .../CoreModules/Scripting/WorldComm/WorldCommModule.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index acd8dbf0f0..d935c565db 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -87,7 +87,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.WorldComm { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class WorldCommModule : INonSharedRegionModule, IWorldComm + public class WorldCommModule : ISharedRegionModule, IWorldComm { // private static readonly ILog m_log = // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -127,6 +127,10 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm m_pending = Queue.Synchronized(m_pendingQ); } + public void PostInitialise() + { + } + public void AddRegion(Scene scene) { m_scene = scene; From ddf6226502adda208d61147581a939f6fa93a12e Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Thu, 28 Jan 2010 00:54:28 -0500 Subject: [PATCH 28/81] Test osmantis (quiet) --- BUILDING.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.txt b/BUILDING.txt index 03fb482226..f23363380d 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -10,7 +10,7 @@ Steps: * run OpenSim.exe === Building on Linux === - + Prereqs: * Mono >= 2.4.2 * Nant >= 0.85 From ceb5ccc6fe6393e3616ee4a7a57bbfe39a45386b Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Thu, 28 Jan 2010 01:53:02 -0500 Subject: [PATCH 29/81] * one more test of mantisbot --- BUILDING.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.txt b/BUILDING.txt index f23363380d..03fb482226 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -10,7 +10,7 @@ Steps: * run OpenSim.exe === Building on Linux === - + Prereqs: * Mono >= 2.4.2 * Nant >= 0.85 From ee12b00cfa829d798ebf6490a8297710047b8f5c Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 28 Jan 2010 14:34:31 +0000 Subject: [PATCH 30/81] Fixes inconsistencies in the permissions module. Adds a region_manager_is_god configurable. Previously, estate managers could enter god mode, but would not have any powers. Now estate managers can enter god mode only if this option is true, and then will have real god powers. --- .../World/Permissions/PermissionsModule.cs | 11 +++++++---- bin/OpenSim.ini.example | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 68e8485daf..5b15065549 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -127,6 +127,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions private bool m_debugPermissions = false; private bool m_allowGridGods = false; private bool m_RegionOwnerIsGod = false; + private bool m_RegionManagerIsGod = false; private bool m_ParcelOwnerIsGod = false; /// @@ -167,6 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", false); m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true); m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); + m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); m_allowedScriptCreators @@ -528,10 +530,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) { - if (m_scene.RegionInfo.EstateSettings.EstateOwner == user) + if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) return true; } + if (IsEstateManager(user) && m_RegionManagerIsGod) + return true; + if (m_allowGridGods) { CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(user); @@ -544,6 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; } + protected bool IsFriendWithPerms(UUID user,UUID objectOwner) { @@ -948,9 +954,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if (IsEstateManager(user) && m_RegionOwnerIsGod) - return true; - return IsAdministrator(user); } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 179c536d32..ebc9b24e74 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -207,6 +207,7 @@ ; This allows somne control over permissions ; please note that this still doesn't duplicate SL, and is not intended to ;region_owner_is_god = true + ;region_manager_is_god = false ;parcel_owner_is_god = true ; Control user types that are allowed to create new scripts From a87a247f0548d39a8c39b1d28123d7da8db44598 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 29 Jan 2010 07:20:13 +0000 Subject: [PATCH 31/81] Revert "Updates all IRegionModules to the new style region modules." This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf. --- .../LoadRegions/LoadRegionsPlugin.cs | 4 +- OpenSim/Client/MXP/MXPModule.cs | 36 +-- .../AssetTransactionModule.cs | 35 +-- .../Agent/Capabilities/CapabilitiesModule.cs | 2 +- .../CoreModules/Agent/IPBan/IPBanModule.cs | 40 +-- .../TextureDownload/TextureDownloadModule.cs | 33 +-- .../Agent/TextureSender/J2KDecoderModule.cs | 33 +-- .../CoreModules/Agent/Xfer/XferModule.cs | 30 +- .../AvatarFactory/AvatarFactoryModule.cs | 31 +-- .../CoreModules/Avatar/Combat/CombatModule.cs | 32 +-- .../CoreModules/Avatar/Dialog/DialogModule.cs | 32 +-- .../Avatar/Friends/FriendsModule.cs | 54 +--- .../Avatar/Gestures/GesturesModule.cs | 30 +- .../CoreModules/Avatar/Gods/GodsModule.cs | 28 +- .../CoreModules/Avatar/Groups/GroupsModule.cs | 35 +-- .../InstantMessage/InstantMessageModule.cs | 53 ++-- .../InstantMessage/MessageTransferModule.cs | 54 ++-- .../Avatar/InstantMessage/MuteListModule.cs | 48 ++-- .../InstantMessage/OfflineMessageModule.cs | 41 +-- .../Avatar/InstantMessage/PresenceModule.cs | 65 ++--- .../Archiver/InventoryArchiverModule.cs | 35 +-- .../Transfer/InventoryTransferModule.cs | 65 ++--- .../CoreModules/Avatar/Lure/LureModule.cs | 61 +---- .../Avatar/ObjectCaps/ObjectAdd.cs | 55 ++-- .../Avatar/Profiles/AvatarProfilesModule.cs | 32 +-- .../EventQueue/EventQueueGetModule.cs | 42 ++- .../Framework/Monitoring/MonitorModule.cs | 103 +++---- .../Hypergrid/HGStandaloneLoginModule.cs | 83 +++--- .../Region/CoreModules/InterGrid/OGSRadmin.cs | 31 ++- .../InterGrid/OpenGridProtocolModule.cs | 108 +++----- .../DynamicTexture/DynamicTextureModule.cs | 60 ++-- .../Scripting/EMailModules/EmailModule.cs | 32 +-- .../HttpRequest/ScriptsHttpRequests.cs | 36 +-- .../Scripting/LSLHttp/UrlModule.cs | 2 - .../LoadImageURL/LoadImageURLModule.cs | 37 +-- .../VectorRender/VectorRenderModule.cs | 41 +-- .../Scripting/WorldComm/WorldCommModule.cs | 33 +-- .../Scripting/XMLRPC/XMLRPCModule.cs | 51 +--- .../Asset/AssetServiceInConnectorModule.cs | 2 +- .../Grid/HypergridServiceInConnectorModule.cs | 2 +- .../InventoryServiceInConnectorModule.cs | 2 +- .../Land/LandServiceInConnectorModule.cs | 2 +- .../NeighbourServiceInConnectorModule.cs | 2 +- .../SimulationServiceInConnectorModule.cs | 2 +- .../Interregion/LocalInterregionComms.cs | 4 +- .../Interregion/RESTInterregionComms.cs | 16 +- .../World/Archiver/ArchiverModule.cs | 1 - .../CoreModules/World/Cloud/CloudModule.cs | 30 +- .../World/Estate/EstateManagementModule.cs | 58 ++-- .../World/Permissions/PermissionsModule.cs | 256 +++++++----------- .../CoreModules/World/Sound/SoundModule.cs | 33 +-- .../Region/CoreModules/World/Sun/SunModule.cs | 150 +++++----- .../World/Vegetation/VegetationModule.cs | 27 +- .../CoreModules/World/Wind/WindModule.cs | 47 ++-- .../World/WorldMap/MapImageModule.cs | 30 +- .../World/WorldMap/MapSearchModule.cs | 35 +-- .../DataSnapshot/DataSnapshotManager.cs | 59 ++-- .../Framework/Interfaces/ICloudModule.cs | 2 +- .../Framework/Interfaces/IEmailModule.cs | 2 +- .../Framework/Interfaces/IEstateModule.cs | 2 +- .../Region/Framework/Interfaces/ISunModule.cs | 2 +- .../Framework/Interfaces/IWindModule.cs | 2 +- .../InternetRelayClientView/IRCStackModule.cs | 32 +-- .../FreeSwitchVoice/FreeSwitchVoiceModule.cs | 72 ++--- .../ContentManagementModule.cs | 47 ++-- .../Scripting/Minimodule/MRMModule.cs | 64 ++--- .../RegionReadyModule/RegionReadyModule.cs | 6 +- .../ScriptModuleCommsModule.cs | 1 - .../XmlRpcGridRouterModule.cs | 28 +- .../XmlRpcRouterModule/XmlRpcRouterModule.cs | 30 +- .../FreeswitchServiceInConnectorModule.cs | 2 +- .../SvnSerialiser/SvnBackupModule.cs | 28 +- .../OptionalModules/World/NPC/NPCModule.cs | 28 +- .../TreePopulator/TreePopulatorModule.cs | 41 ++- .../Region/UserStatistics/WebStatsModule.cs | 33 +-- .../Tests/Common/Setup/SceneSetupHelpers.cs | 9 +- 76 files changed, 940 insertions(+), 1872 deletions(-) diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 64863c5176..6fd3d301a5 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -99,7 +99,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source); RegionInfo[] regionsToLoad = regionLoader.LoadRegions(); - /*m_log.Info("[LOADREGIONSPLUGIN]: Loading specific shared modules..."); + m_log.Info("[LOADREGIONSPLUGIN]: Loading specific shared modules..."); m_log.Info("[LOADREGIONSPLUGIN]: DynamicTextureModule..."); m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule()); m_log.Info("[LOADREGIONSPLUGIN]: InstantMessageModule..."); @@ -111,7 +111,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule..."); m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule()); m_log.Info("[LOADREGIONSPLUGIN]: Done."); - */ + if (!CheckRegionsForSanity(regionsToLoad)) { m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations"); diff --git a/OpenSim/Client/MXP/MXPModule.cs b/OpenSim/Client/MXP/MXPModule.cs index 47417ab477..0b442cca15 100644 --- a/OpenSim/Client/MXP/MXPModule.cs +++ b/OpenSim/Client/MXP/MXPModule.cs @@ -31,7 +31,6 @@ using System.Reflection; using System.Text; using System.Timers; using log4net; -using Mono.Addins; using MXP; using Nini.Config; using OpenMetaverse; @@ -45,8 +44,7 @@ namespace OpenSim.Client.MXP /** * MXP Client Module which adds MXP support to client / region communication. */ - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MXPModule : ISharedRegionModule + public class MXPModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -59,23 +57,15 @@ namespace OpenSim.Client.MXP private readonly Dictionary m_scenes = new Dictionary(); private bool m_shutdown; - public void Initialise(IConfigSource source) - { - m_config = source; - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID)) m_scenes.Add(scene.RegionInfo.RegionID, scene); + + m_config = source; } - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (m_config.Configs["MXP"] != null) { @@ -86,7 +76,7 @@ namespace OpenSim.Client.MXP m_port = con.GetInt("Port", m_port); - m_server = new MXPPacketServer(m_port, m_scenes, m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate", true)); + m_server = new MXPPacketServer(m_port, m_scenes,m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate",true)); m_ticker = new Timer(100); m_ticker.AutoReset = false; @@ -99,14 +89,6 @@ namespace OpenSim.Client.MXP } } - public void RemoveRegion(Scene scene) - { - } - - public void PostInitialise() - { - } - void ticker_Elapsed(object sender, ElapsedEventArgs e) { try @@ -139,5 +121,11 @@ namespace OpenSim.Client.MXP { get { return "MXP ClientStack Module"; } } + + public bool IsSharedModule + { + get { return true; } + } + } } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 7012037834..1077f4a22f 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +35,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class AssetTransactionModule : ISharedRegionModule, IAgentAssetTransactions + public class AssetTransactionModule : IRegionModule, IAgentAssetTransactions { private readonly Dictionary RegisteredScenes = new Dictionary(); private bool m_dumpAssetsToFile = false; @@ -61,14 +59,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction //m_log.Debug("creating AgentAssetTransactionModule"); } - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -86,23 +79,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction m_scene = scene; } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) - RegisteredScenes.Remove(scene.RegionInfo.RegionID); - scene.UnregisterModuleInterface(this); - scene.EventManager.OnNewClient -= NewClient; - } - public void PostInitialise() { } @@ -116,6 +92,11 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction get { return "AgentTransactionModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index 886173fb45..2a1355b9ef 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); + m_scene.UnregisterModuleInterface(this); } public void PostInitialise() {} diff --git a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs index f7f2eff487..bfe2a716af 100644 --- a/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs +++ b/OpenSim/Region/CoreModules/Agent/IPBan/IPBanModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; @@ -37,27 +36,21 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.IPBan { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class IPBanModule : ISharedRegionModule + public class IPBanModule : IRegionModule { - #region Implementation of ISharedRegionModule + #region Implementation of IRegionModule private List m_bans = new List(); - private Dictionary SceneBanners = new Dictionary(); - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { - } - - public void AddRegion(Scene scene) - { - SceneBanners.Add(scene, new SceneBanner(scene, m_bans)); + new SceneBanner(scene, m_bans); lock (m_bans) { foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans) { - if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) + if (!String.IsNullOrEmpty(ban.BannedHostIPMask)) m_bans.Add(ban.BannedHostIPMask); if (!String.IsNullOrEmpty(ban.BannedHostNameMask)) m_bans.Add(ban.BannedHostNameMask); @@ -65,12 +58,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (File.Exists("bans.txt")) { @@ -82,18 +70,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan } } - public void RemoveRegion(Scene scene) - { - if(SceneBanners.ContainsKey(scene)) - SceneBanners.Remove(scene); - } - - public void PostInitialise() - { - } - public void Close() { + } public string Name @@ -101,6 +80,11 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan get { return "IPBanModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index c4d84cb51a..71ff28c8b5 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -42,8 +41,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Agent.TextureDownload { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class TextureDownloadModule : INonSharedRegionModule + public class TextureDownloadModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -67,14 +65,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload { } - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { + if (m_scene == null) { //m_log.Debug("Creating Texture download module"); @@ -95,21 +90,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload } } - public Type ReplaceableInterface + public void PostInitialise() { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if(m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnNewClient -= NewClient; - scene.EventManager.OnRemovePresence -= EventManager_OnRemovePresence; } public void Close() @@ -121,6 +103,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload get { return "TextureDownloadModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion /// diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index ff87493831..7ac8bed012 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -32,7 +32,6 @@ using System.Reflection; using System.Text; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -46,8 +45,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender { public delegate void J2KDecodeDelegate(UUID assetID); - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder + public class J2KDecoderModule : IRegionModule, IJ2KDecoder { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -60,19 +58,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender /// Reference to a scene (doesn't matter which one as long as it can load the cache module) private Scene m_scene; - #region ISharedRegionModule + #region IRegionModule public string Name { get { return "J2KDecoderModule"; } } - + public bool IsSharedModule { get { return true; } } + public J2KDecoderModule() { } - public void Initialise(IConfigSource source) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (m_scene == null) m_scene = scene; @@ -80,30 +75,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - m_cache = m_scene.RequestModuleInterface(); - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - public void PostInitialise() { + m_cache = m_scene.RequestModuleInterface(); } public void Close() { } - #endregion + #endregion IRegionModule #region IJ2KDecoder diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index d062361b99..ef7dce812e 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +35,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Agent.Xfer { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class XferModule : INonSharedRegionModule, IXfer + public class XferModule : IRegionModule, IXfer { private Scene m_scene; private Dictionary Requests = new Dictionary(); @@ -54,13 +52,9 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer public DateTime timeStamp; } - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; @@ -68,19 +62,8 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer m_scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface + public void PostInitialise() { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= NewClient; - scene.UnregisterModuleInterface(this); } public void Close() @@ -92,6 +75,11 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer get { return "XferModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion #region IXfer Members diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 6bbbd56569..35c59aa6d7 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -28,7 +28,6 @@ using System; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,8 +38,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class AvatarFactoryModule : IAvatarFactory, ISharedRegionModule + public class AvatarFactoryModule : IAvatarFactory, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene = null; @@ -77,16 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return appearance; } - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { scene.RegisterModuleInterface(this); scene.EventManager.OnNewClient += NewClient; @@ -95,18 +84,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_scene = scene; } + } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnNewClient -= NewClient; - } - public void PostInitialise() { } @@ -120,6 +100,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory get { return "Default Avatar Factory"; } } + public bool IsSharedModule + { + get { return false; } + } + public void NewClient(IClientAPI client) { client.OnAvatarNowWearing += AvatarIsWearing; diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index b7d12aa7e7..61b6d65cc7 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -35,8 +34,7 @@ using OpenMetaverse; namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class CombatModule : ISharedRegionModule + public class CombatModule : IRegionModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -55,17 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule /// /// /// - public void Initialise(IConfigSource config) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { lock (m_scenel) { @@ -83,17 +71,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnAvatarKilled -= KillAvatar; - scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - m_scenel.Remove(scene.RegionInfo.RegionHandle); - } - public void PostInitialise() { } @@ -107,6 +84,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule get { return "CombatModule"; } } + public bool IsSharedModule + { + get { return true; } + } + private void KillAvatar(uint killerObjectLocalID, ScenePresence DeadAvatar) { if (killerObjectLocalID == 0) diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index ecffc7ab66..72ec869c48 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -25,11 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,46 +37,28 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Dialog { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class DialogModule : ISharedRegionModule, IDialogModule + public class DialogModule : IRegionModule, IDialogModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_scene.RegisterModuleInterface(this); - + m_scene.AddCommand( this, "alert", "alert ", "Send an alert to a user", HandleAlertConsoleCommand); m_scene.AddCommand( this, "alert general", "alert general ", "Send an alert to everyone", HandleAlertConsoleCommand); } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - - public void PostInitialise() { } + + public void PostInitialise() {} public void Close() {} public string Name { get { return "Dialog Module"; } } + public bool IsSharedModule { get { return false; } } public void SendAlertToUser(IClientAPI client, string message) { diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 7254180ab9..086d4fe69a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -31,7 +31,6 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -82,8 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends - Terminate Friendship messages (single) */ - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class FriendsModule : ISharedRegionModule, IFriendsModule + public class FriendsModule : IRegionModule, IFriendsModule { private class Transaction { @@ -113,23 +111,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private IGridService m_gridServices = null; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - - } - - public void PostInitialise() - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { lock (m_scenes) { @@ -144,9 +128,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (!m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) m_scenes[scene.RegionInfo.RegionHandle] = scene; } - + scene.RegisterModuleInterface(this); - + scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; @@ -154,34 +138,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends scene.EventManager.OnClientClosed += ClientClosed; } - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (m_scenes.Count > 0) { - m_TransferModule = scene.RequestModuleInterface(); - m_gridServices = scene.GridService; + m_TransferModule = m_initialScene.RequestModuleInterface(); + m_gridServices = m_initialScene.GridService; } if (m_TransferModule == null) m_log.Error("[FRIENDS]: Unable to find a message transfer module, friendship offers will not work"); } - public void RemoveRegion(Scene scene) - { - MainServer.Instance.RemoveXmlRPCHandler("presence_update_bulk"); - MainServer.Instance.RemoveXmlRPCHandler("terminate_friend"); - - if (m_scenes.ContainsKey(scene.RegionInfo.RegionHandle)) - m_scenes.Remove(scene.RegionInfo.RegionHandle); - - scene.UnregisterModuleInterface(this); - - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - scene.EventManager.OnMakeChildAgent -= MakeChildAgent; - scene.EventManager.OnClientClosed -= ClientClosed; - } - public void Close() { } @@ -191,6 +158,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends get { return "FriendsModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion #region IInterregionFriendsComms diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index c306f94e06..8ce509239d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs @@ -25,10 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,41 +37,23 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gestures { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class GesturesModule : INonSharedRegionModule + public class GesturesModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; + m_scene.EventManager.OnNewClient += OnNewClient; } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if(m_scene == scene) - m_scene = null; - scene.EventManager.OnNewClient -= OnNewClient; - } + public void PostInitialise() {} public void Close() {} public string Name { get { return "Gestures Module"; } } + public bool IsSharedModule { get { return false; } } private void OnNewClient(IClientAPI client) { diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 3914f2efd1..50171a391e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -25,9 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,8 +34,7 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Gods { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class GodsModule : INonSharedRegionModule, IGodsModule + public class GodsModule : IRegionModule, IGodsModule { /// Special UUID for actions that apply to all agents private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb"); @@ -45,34 +42,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods protected Scene m_scene; protected IDialogModule m_dialogModule; - public void Initialise(IConfigSource source) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_dialogModule = m_scene.RequestModuleInterface(); m_scene.RegisterModuleInterface(this); } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } + public void PostInitialise() {} public void Close() {} public string Name { get { return "Gods Module"; } } + public bool IsSharedModule { get { return false; } } public void RequestGodlikePowers( UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs index 7ff8d3000d..31363e5705 100644 --- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs @@ -25,11 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,8 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Groups { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class GroupsModule : ISharedRegionModule + public class GroupsModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -58,9 +55,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups private static GroupMembershipData osGroup = new GroupMembershipData(); - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { IConfig groupsConfig = config.Configs["Groups"]; @@ -79,15 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups if (groupsConfig.GetString("Module", "Default") != "Default") return; } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { lock (m_SceneList) { if (!m_SceneList.Contains(scene)) @@ -110,19 +99,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (m_SceneList.Contains(scene)) - m_SceneList.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnClientClosed -= OnClientClosed; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - } - public void PostInitialise() { } @@ -147,6 +123,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups get { return "GroupsModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index e1bde4b3b6..9a6874909b 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -24,12 +24,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,8 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class InstantMessageModule : ISharedRegionModule + public class InstantMessageModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -51,11 +47,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private readonly List m_scenes = new List(); - #region ISharedRegionModule Members + #region IRegionModule Members private IMessageTransferModule m_TransferModule = null; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -66,15 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } m_enabled = true; - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { lock (m_scenes) { if (!m_scenes.Contains(scene)) @@ -86,27 +74,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } - public void RegionLoaded(Scene scene) - { - if (!m_enabled) - return; - - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + - "IM will not work!"); - } - - public void RemoveRegion(Scene scene) - { - if (m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnClientConnect -= OnClientConnect; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - } - void OnClientConnect(IClientCore client) { IClientIM clientIM; @@ -118,6 +85,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public void PostInitialise() { + if (!m_enabled) + return; + + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ + "IM will not work!"); } public void Close() @@ -129,6 +105,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "InstantMessageModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion public void OnInstantMessage(IClientAPI client, GridInstantMessage im) diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 16bdfddea7..e5159b3817 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -41,8 +40,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MessageTransferModule : ISharedRegionModule, IMessageTransferModule + public class MessageTransferModule : IRegionModule, IMessageTransferModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -52,9 +50,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage protected Dictionary m_UserRegionMap = new Dictionary(); public event UndeliveredMessage OnUndeliveredMessage; - private bool m_enabled = true; - public virtual void Initialise(IConfigSource config) + public virtual void Initialise(Scene scene, IConfigSource config) { IConfig cnf = config.Configs["Messaging"]; if (cnf != null && cnf.GetString( @@ -62,51 +59,29 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage "MessageTransferModule") { m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration"); - m_enabled = false; + return; } cnf = config.Configs["Startup"]; if (cnf != null) m_Gridmode = cnf.GetBoolean("gridmode", false); - } - public Type ReplaceableInterface - { - get { return null; } - } + // m_Enabled = true; - public void AddRegion(Scene scene) - { - if (m_enabled) + lock (m_Scenes) { - lock (m_Scenes) + if (m_Scenes.Count == 0) { - if (m_Scenes.Count == 0) - { - MainServer.Instance.AddXmlRPCHandler( - "grid_instant_message", processXMLRPCGridInstantMessage); - } - - m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); - scene.RegisterModuleInterface(this); - m_Scenes.Add(scene); + MainServer.Instance.AddXmlRPCHandler( + "grid_instant_message", processXMLRPCGridInstantMessage); } + + m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active"); + scene.RegisterModuleInterface(this); + m_Scenes.Add(scene); } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (m_Scenes.Contains(scene)) - m_Scenes.Remove(scene); - MainServer.Instance.RemoveXmlRPCHandler( - "grid_instant_message"); - scene.UnregisterModuleInterface(this); - } - public virtual void PostInitialise() { } @@ -120,6 +95,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "MessageTransferModule"; } } + public virtual bool IsSharedModule + { + get { return true; } + } + public virtual void SendInstantMessage(GridInstantMessage im, MessageResultNotification result) { UUID toAgentID = new UUID(im.toAgentID); diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs index 3570495796..2d4a635056 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MuteListModule.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,8 +39,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.MuteList { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MuteListModule : ISharedRegionModule + public class MuteListModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -49,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList private List m_SceneList = new List(); private string m_RestURL = String.Empty; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (!enabled) return; @@ -68,24 +66,19 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList enabled = false; return; } - m_RestURL = cnf.GetString("MuteListURL", ""); - if (m_RestURL == "") - { - m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); - enabled = false; - return; - } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { lock (m_SceneList) { + if (m_SceneList.Count == 0) + { + m_RestURL = cnf.GetString("MuteListURL", ""); + if (m_RestURL == "") + { + m_log.Error("[MUTE LIST] Module was enabled, but no URL is given, disabling"); + enabled = false; + return; + } + } if (!m_SceneList.Contains(scene)) m_SceneList.Add(scene); @@ -93,18 +86,6 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (m_SceneList.Contains(scene)) - m_SceneList.Remove(scene); - - scene.EventManager.OnNewClient -= OnNewClient; - } - public void PostInitialise() { if (!enabled) @@ -121,6 +102,11 @@ namespace OpenSim.Region.CoreModules.Avatar.MuteList get { return "MuteListModule"; } } + public bool IsSharedModule + { + get { return true; } + } + public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index 6c4d0bfcf4..ff38b6f29c 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,8 +40,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class OfflineMessageModule : ISharedRegionModule + public class OfflineMessageModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -51,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage private string m_RestURL = String.Empty; private bool m_ForwardOfflineGroupMessages = true; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (!enabled) return; @@ -85,23 +83,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage return; } } + if (!m_SceneList.Contains(scene)) + m_SceneList.Add(scene); + + scene.EventManager.OnNewClient += OnNewClient; } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - if (!m_SceneList.Contains(scene)) - m_SceneList.Add(scene); - - scene.EventManager.OnNewClient += OnNewClient; - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (!enabled) return; @@ -131,22 +120,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_log.Debug("[OFFLINE MESSAGING] Offline messages enabled"); } - public void RemoveRegion(Scene scene) - { - if (m_SceneList.Contains(scene)) - m_SceneList.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - } - - public void PostInitialise() - { - } - public string Name { get { return "OfflineMessageModule"; } } + public bool IsSharedModule + { + get { return true; } + } + public void Close() { } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index f5498f42e1..f5ab45466c 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs @@ -24,14 +24,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -using System; using System.Collections; using System.Collections.Generic; using System.Net; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -42,8 +39,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class PresenceModule : ISharedRegionModule, IPresenceModule + public class PresenceModule : IRegionModule, IPresenceModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -63,7 +59,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage public event PresenceChange OnPresenceChange; public event BulkPresenceData OnBulkPresenceData; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { lock (m_Scenes) { @@ -82,38 +78,28 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage m_Gridmode = cnf.GetBoolean("gridmode", false); m_Enabled = true; + + m_initialScene = scene; } - } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - if (m_Enabled) - { - m_initialScene = scene; if (m_Gridmode) NotifyMessageServerOfStartup(scene); m_Scenes.Add(scene); - - scene.RegisterModuleInterface(this); - - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; - scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; } + + scene.RegisterModuleInterface(this); + + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; + scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; } - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) + public void Close() { if (!m_Gridmode || !m_Enabled) return; @@ -130,23 +116,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } - NotifyMessageServerOfShutdown(scene); - if(m_Scenes.Contains(scene)) - m_Scenes.Remove(scene); - - scene.UnregisterModuleInterface(this); - - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; - scene.EventManager.OnMakeChildAgent -= OnMakeChildAgent; - } - - public void PostInitialise() - { - } - - public void Close() - { + lock (m_Scenes) + { + foreach (Scene scene in m_Scenes) + NotifyMessageServerOfShutdown(scene); + } } public string Name @@ -154,6 +128,11 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage get { return "PresenceModule"; } } + public bool IsSharedModule + { + get { return true; } + } + public void RequestBulkPresenceData(UUID[] users) { if (OnBulkPresenceData != null) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index a04ab22588..ecd60bdaad 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -42,11 +41,10 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] /// /// This module loads and saves OpenSimulator inventory archives /// - public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule + public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -84,28 +82,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver DisablePresenceChecks = disablePresenceChecks; } - public void Initialise(IConfigSource source) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (m_scenes.Count == 0) { scene.RegisterModuleInterface(this); OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted; - + scene.AddCommand( this, "load iar", "load iar []", - "Load user inventory archive.", HandleLoadInvConsoleCommand); - + "Load user inventory archive.", HandleLoadInvConsoleCommand); + scene.AddCommand( this, "save iar", "save iar []", @@ -113,21 +101,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_aScene = scene; } - + m_scenes[scene.RegionInfo.RegionID] = scene; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - if(m_scenes.ContainsKey(scene.RegionInfo.RegionID)) - m_scenes.Remove(scene.RegionInfo.RegionID); - } - public void PostInitialise() {} public void Close() {} diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 44906b4afa..d9a021fc02 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -40,8 +39,7 @@ using OpenSim.Services.Interfaces; namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule + public class InventoryTransferModule : IInventoryTransferModule, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -52,11 +50,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer new Dictionary(); private IMessageTransferModule m_TransferModule = null; - private bool m_enabled = true; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (config.Configs["Messaging"] != null) { @@ -65,59 +62,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer if (config.Configs["Messaging"].GetString( "InventoryTransferModule", "InventoryTransferModule") != "InventoryTransferModule") - m_enabled = false; + return; } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - if (m_enabled) + if (!m_Scenelist.Contains(scene)) { - if (!m_Scenelist.Contains(scene)) - { - m_Scenelist.Add(scene); + m_Scenelist.Add(scene); - scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnClientClosed += ClientLoggedOut; - scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; - } + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnClientClosed += ClientLoggedOut; + scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; } } - public void RegionLoaded(Scene scene) - { - if (m_enabled) - { - if (m_Scenelist.Count > 0) - { - m_TransferModule = m_Scenelist[0].RequestModuleInterface(); - if (m_TransferModule == null) - m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); - } - } - } - - public void RemoveRegion(Scene scene) - { - if (m_Scenelist.Contains(scene)) - m_Scenelist.Remove(scene); - - scene.UnregisterModuleInterface(this); - - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnClientClosed -= ClientLoggedOut; - scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; - } - public void PostInitialise() { + if (m_Scenelist.Count > 0) + { + m_TransferModule = m_Scenelist[0].RequestModuleInterface(); + if (m_TransferModule == null) + m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); + } } public void Close() diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index 973d27fd24..261bd6c609 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,72 +37,36 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Lure { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class LureModule : ISharedRegionModule + public class LureModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); - private bool m_enabled = true; - private IMessageTransferModule m_TransferModule = null; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (config.Configs["Messaging"] != null) { if (config.Configs["Messaging"].GetString( "LureModule", "LureModule") != "LureModule") - m_enabled = false; + return; } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - if (m_enabled) + lock (m_scenes) { - lock (m_scenes) + if (!m_scenes.Contains(scene)) { - if (!m_scenes.Contains(scene)) - { - m_scenes.Add(scene); - scene.EventManager.OnNewClient += OnNewClient; - scene.EventManager.OnIncomingInstantMessage += - OnGridInstantMessage; - } + m_scenes.Add(scene); + scene.EventManager.OnNewClient += OnNewClient; + scene.EventManager.OnIncomingInstantMessage += + OnGridInstantMessage; } } } - public void RegionLoaded(Scene scene) - { - if (m_enabled) - { - m_TransferModule = - m_scenes[0].RequestModuleInterface(); - - if (m_TransferModule == null) - m_log.Error("[INSTANT MESSAGE]: No message transfer module, " + - "lures will not work!"); - } - } - - public void RemoveRegion(Scene scene) - { - if (m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - scene.EventManager.OnIncomingInstantMessage -= - OnGridInstantMessage; - } - void OnNewClient(IClientAPI client) { client.OnInstantMessage += OnInstantMessage; @@ -113,6 +76,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure public void PostInitialise() { + m_TransferModule = + m_scenes[0].RequestModuleInterface(); + + if (m_TransferModule == null) + m_log.Error("[INSTANT MESSAGE]: No message transfer module, "+ + "lures will not work!"); } public void Close() diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs index 748b42c5f3..63a93aa026 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/ObjectAdd.cs @@ -29,7 +29,6 @@ using System; using System.Collections; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -42,54 +41,24 @@ using Caps=OpenSim.Framework.Capabilities.Caps; namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class ObjectAdd : ISharedRegionModule + public class ObjectAdd : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource pSource) + public void Initialise(Scene pScene, IConfigSource pSource) { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - m_scene = scene; + m_scene = pScene; m_scene.EventManager.OnRegisterCaps += RegisterCaps; } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnRegisterCaps -= RegisterCaps; - } - public void PostInitialise() { } - public void Close() - { - - } - - public string Name - { - get { return "ObjectAddModule"; } - } - public void RegisterCaps(UUID agentID, Caps caps) { UUID capuuid = UUID.Random(); @@ -379,6 +348,22 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps Array.Reverse(resultbytes); return String.Format("{0}",Convert.ToBase64String(resultbytes)); } + + public void Close() + { + + } + + public string Name + { + get { return "ObjectAddModule"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion } } diff --git a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs index 7fcb0e13cf..8cf58c6df0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Profiles/AvatarProfilesModule.cs @@ -30,7 +30,6 @@ using System.Collections; using System.Globalization; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,17 +38,20 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Profiles { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class AvatarProfilesModule : INonSharedRegionModule + public class AvatarProfilesModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; private IProfileModule m_profileModule = null; private bool m_enabled = true; - #region INonSharedRegionModule Members + public AvatarProfilesModule() + { + } - public void Initialise(IConfigSource config) + #region IRegionModule Members + + public void Initialise(Scene scene, IConfigSource config) { IConfig profileConfig = config.Configs["Profile"]; if (profileConfig != null) @@ -60,31 +62,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles return; } } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { m_scene = scene; m_scene.EventManager.OnNewClient += NewClient; } - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (!m_enabled) return; m_profileModule = m_scene.RequestModuleInterface(); } - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= NewClient; - } - public void Close() { } @@ -94,6 +83,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Profiles get { return "AvatarProfilesModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion public void NewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 1ee6f0d322..0c6cb1bdfa 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Packets; @@ -53,13 +52,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue public OSDMap body; } - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class EventQueueGetModule : IEventQueue, INonSharedRegionModule + public class EventQueueGetModule : IEventQueue, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene = null; private IConfigSource m_gConfig; - private IConfig m_startupConfig; bool enabledYN = false; private Dictionary m_ids = new Dictionary(); @@ -68,31 +65,23 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue private Dictionary m_QueueUUIDAvatarMapping = new Dictionary(); private Dictionary m_AvatarQueueUUIDMapping = new Dictionary(); - #region INonSharedRegionModule methods - public virtual void Initialise(IConfigSource config) + #region IRegionModule methods + public virtual void Initialise(Scene scene, IConfigSource config) { m_gConfig = config; - m_startupConfig = m_gConfig.Configs["Startup"]; - } + IConfig startupConfig = m_gConfig.Configs["Startup"]; - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - ReadConfigAndPopulate(scene, m_startupConfig, "Startup"); + ReadConfigAndPopulate(scene, startupConfig, "Startup"); if (enabledYN) { m_scene = scene; scene.RegisterModuleInterface(this); - + // Register fallback handler // Why does EQG Fail on region crossings! - + //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); scene.EventManager.OnNewClient += OnNewClient; @@ -110,14 +99,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue { m_gConfig = null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { + } private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) @@ -125,6 +107,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue enabledYN = startupConfig.GetBoolean("EventQueue", true); } + public void PostInitialise() + { + } + public virtual void Close() { } @@ -134,6 +120,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue get { return "EventQueueGetModule"; } } + public bool IsSharedModule + { + get { return false; } + } #endregion /// diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs index 0135d3359b..f15f8f6de1 100644 --- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs @@ -25,12 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,8 +39,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Framework.Monitoring { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MonitorModule : INonSharedRegionModule + public class MonitorModule : IRegionModule { private Scene m_scene; private readonly List m_monitors = new List(); @@ -65,19 +62,9 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring } } - #region Implementation of INonSharedRegionModule + #region Implementation of IRegionModule - public void Initialise(IConfigSource source) - { - - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; @@ -90,51 +77,6 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage); } - public void RegionLoaded(Scene scene) - { - m_monitors.Add(new AgentCountMonitor(m_scene)); - m_monitors.Add(new ChildAgentCountMonitor(m_scene)); - m_monitors.Add(new GCMemoryMonitor()); - m_monitors.Add(new ObjectCountMonitor(m_scene)); - m_monitors.Add(new PhysicsFrameMonitor(m_scene)); - m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); - m_monitors.Add(new PWSMemoryMonitor()); - m_monitors.Add(new ThreadCountMonitor()); - m_monitors.Add(new TotalFrameMonitor(m_scene)); - m_monitors.Add(new EventFrameMonitor(m_scene)); - m_monitors.Add(new LandFrameMonitor(m_scene)); - m_monitors.Add(new LastFrameTimeMonitor(m_scene)); - - m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); - - foreach (IAlert alert in m_alerts) - { - alert.OnTriggerAlert += OnTriggerAlert; - } - } - - public void RemoveRegion(Scene scene) - { - MainServer.Instance.RemoveHTTPHandler("", "/monitorstats/" + m_scene.RegionInfo.RegionID + "/"); - m_monitors.Clear(); - - foreach (IAlert alert in m_alerts) - { - alert.OnTriggerAlert -= OnTriggerAlert; - } - m_alerts.Clear(); - } - - public void Close() - { - - } - - public string Name - { - get { return "Region Health Monitoring Module"; } - } - public Hashtable StatsPage(Hashtable request) { // If request was for a specific monitor @@ -190,10 +132,49 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring return ereply; } + public void PostInitialise() + { + m_monitors.Add(new AgentCountMonitor(m_scene)); + m_monitors.Add(new ChildAgentCountMonitor(m_scene)); + m_monitors.Add(new GCMemoryMonitor()); + m_monitors.Add(new ObjectCountMonitor(m_scene)); + m_monitors.Add(new PhysicsFrameMonitor(m_scene)); + m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene)); + m_monitors.Add(new PWSMemoryMonitor()); + m_monitors.Add(new ThreadCountMonitor()); + m_monitors.Add(new TotalFrameMonitor(m_scene)); + m_monitors.Add(new EventFrameMonitor(m_scene)); + m_monitors.Add(new LandFrameMonitor(m_scene)); + m_monitors.Add(new LastFrameTimeMonitor(m_scene)); + + m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor)); + + foreach (IAlert alert in m_alerts) + { + alert.OnTriggerAlert += OnTriggerAlert; + } + } + void OnTriggerAlert(System.Type reporter, string reason, bool fatal) { m_log.Error("[Monitor] " + reporter.Name + " for " + m_scene.RegionInfo.RegionName + " reports " + reason + " (Fatal: " + fatal + ")"); } + + public void Close() + { + + } + + public string Name + { + get { return "Region Health Monitoring Module"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion } } diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs index f9c594b800..0b54746f19 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGStandaloneLoginModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Text.RegularExpressions; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using Nwc.XmlRpc; @@ -47,8 +46,7 @@ using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.CoreModules.Hypergrid { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class HGStandaloneLoginModule : ISharedRegionModule, ILoginServiceToRegionsConnector + public class HGStandaloneLoginModule : IRegionModule, ILoginServiceToRegionsConnector { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -58,58 +56,47 @@ namespace OpenSim.Region.CoreModules.Hypergrid protected bool m_enabled = false; // Module is only enabled if running in standalone mode protected HGLoginAuthService m_loginService; - private bool authenticate = true; - private string welcomeMessage = "Welcome to OpenSim"; - private IConfig startupConfig; - private IConfig standaloneConfig; - - #region ISharedRegionModule Members - public void Initialise(IConfigSource source) - { - startupConfig = source.Configs["Startup"]; - standaloneConfig = source.Configs["StandAlone"]; - if (standaloneConfig != null) - { - authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); - welcomeMessage = standaloneConfig.GetString("welcome_message"); - } - m_enabled = !startupConfig.GetBoolean("gridmode", false); - } + #region IRegionModule Members - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - } - - public void RegionLoaded(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { if (m_firstScene == null) { m_firstScene = scene; + IConfig startupConfig = source.Configs["Startup"]; + if (startupConfig != null) + { + m_enabled = !startupConfig.GetBoolean("gridmode", false); + } + if (m_enabled) { m_log.Debug("[HGLogin]: HGlogin module enabled"); + bool authenticate = true; + string welcomeMessage = "Welcome to OpenSim"; + IConfig standaloneConfig = source.Configs["StandAlone"]; + if (standaloneConfig != null) + { + authenticate = standaloneConfig.GetBoolean("accounts_authenticate", true); + welcomeMessage = standaloneConfig.GetString("welcome_message"); + } //TODO: fix casting. LibraryRootFolder rootFolder = m_firstScene.CommsManager.UserProfileCacheService.LibraryRoot as LibraryRootFolder; - + IHttpServer httpServer = MainServer.Instance; //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference - m_loginService + m_loginService = new HGLoginAuthService( - (UserManagerBase)m_firstScene.CommsManager.UserAdminService, - welcomeMessage, - m_firstScene.CommsManager.InterServiceInventoryService, - m_firstScene.CommsManager.NetworkServersInfo, - authenticate, - rootFolder, + (UserManagerBase)m_firstScene.CommsManager.UserAdminService, + welcomeMessage, + m_firstScene.CommsManager.InterServiceInventoryService, + m_firstScene.CommsManager.NetworkServersInfo, + authenticate, + rootFolder, this); httpServer.AddXmlRPCHandler("hg_login", m_loginService.XmlRpcLoginMethod); @@ -126,19 +113,6 @@ namespace OpenSim.Region.CoreModules.Hypergrid } } - public void RemoveRegion(Scene scene) - { - if (scene == m_firstScene) - { - IHttpServer httpServer = MainServer.Instance; - httpServer.RemoveXmlRPCHandler("hg_login"); - httpServer.RemoveXmlRPCHandler("check_auth_session"); - httpServer.RemoveXmlRPCHandler("get_avatar_appearance"); - httpServer.RemoveXmlRPCHandler("update_avatar_appearance"); - } - m_scenes.Remove(scene); - } - public void PostInitialise() { @@ -154,6 +128,11 @@ namespace OpenSim.Region.CoreModules.Hypergrid get { return "HGStandaloneLoginModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion protected void AddScene(Scene scene) diff --git a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs index 45340241cb..0f2ba324e0 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OGSRadmin.cs @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Text; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -43,8 +42,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.InterGrid { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class OGSRadmin : ISharedRegionModule + public class OGSRadmin : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_scenes = new List(); @@ -58,6 +56,7 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OGS Supporting RAdmin"; } } + public void Initialise(IConfigSource source) { m_settings = source; @@ -68,11 +67,6 @@ namespace OpenSim.Region.CoreModules.InterGrid } - public Type ReplaceableInterface - { - get { return null; } - } - public void AddRegion(Scene scene) { lock (m_scenes) @@ -83,10 +77,14 @@ namespace OpenSim.Region.CoreModules.InterGrid { lock (m_scenes) m_scenes.Remove(scene); - MainServer.Instance.RemoveXmlRPCHandler("grid_message"); } public void RegionLoaded(Scene scene) + { + + } + + public void PostInitialise() { if (m_settings.Configs["Startup"].GetBoolean("gridmode", false)) { @@ -95,8 +93,21 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - public void PostInitialise() + #endregion + + #region IRegionModule + + public void Initialise(Scene scene, IConfigSource source) { + m_settings = source; + + lock (m_scenes) + m_scenes.Add(scene); + } + + public bool IsSharedModule + { + get { return true; } } #endregion diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index 8bb0fa9bd2..10a3232019 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -35,7 +35,6 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Web; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -76,9 +75,8 @@ namespace OpenSim.Region.CoreModules.InterGrid public bool visible_to_parent; public string teleported_into_region; } - - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class OpenGridProtocolModule : ISharedRegionModule + + public class OpenGridProtocolModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_scene = new List(); @@ -94,22 +92,21 @@ namespace OpenSim.Region.CoreModules.InterGrid private bool httpSSL = false; private uint httpsslport = 0; private bool GridMode = false; - private bool m_enabled = false; - private IConfig cfg = null; - private IConfig httpcfg = null; - private IConfig startupcfg = null; - - #region ISharedRegionModule Members - public void Initialise(IConfigSource config) + #region IRegionModule Members + + public void Initialise(Scene scene, IConfigSource config) { + bool enabled = false; + IConfig cfg = null; + IConfig httpcfg = null; + IConfig startupcfg = null; try { cfg = config.Configs["OpenGridProtocol"]; - } - catch (NullReferenceException) + } catch (NullReferenceException) { - m_enabled = false; + enabled = false; } try @@ -131,15 +128,15 @@ namespace OpenSim.Region.CoreModules.InterGrid if (startupcfg != null) { - GridMode = m_enabled = startupcfg.GetBoolean("gridmode", false); + GridMode = enabled = startupcfg.GetBoolean("gridmode", false); } if (cfg != null) { - m_enabled = cfg.GetBoolean("ogp_enabled", false); + enabled = cfg.GetBoolean("ogp_enabled", false); LastNameSuffix = cfg.GetString("ogp_lastname_suffix", "_EXTERNAL"); FirstNamePrefix = cfg.GetString("ogp_firstname_prefix", ""); - if (m_enabled) + if (enabled) { m_log.Warn("[OGP]: Open Grid Protocol is on, Listening for Clients on /agent/"); lock (m_scene) @@ -168,60 +165,34 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - } - } - } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - if (m_enabled) - { - lock (m_scene) - { - if (m_scene.Count == 1) - { - if (httpcfg != null) + // can't pick the region 'agent' because it would conflict with our agent domain handler + // a zero length region name would conflict with are base region seed cap + if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) { - httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); - httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); - if (httpsCN.Length == 0) - httpsCN = scene.RegionInfo.ExternalHostName; - httpsslport = (uint)httpcfg.GetInt("http_listener_sslport", ((int)scene.RegionInfo.HttpPort + 1)); + MainServer.Instance.AddLLSDHandler( + "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), + ProcessRegionDomainSeed); } + + if (!m_scene.Contains(scene)) + m_scene.Add(scene); + } + } + } + lock (m_scene) + { + if (m_scene.Count == 1) + { + if (httpcfg != null) + { + httpSSL = httpcfg.GetBoolean("http_listener_ssl", false); + httpsCN = httpcfg.GetString("http_listener_cn", scene.RegionInfo.ExternalHostName); + if (httpsCN.Length == 0) + httpsCN = scene.RegionInfo.ExternalHostName; + httpsslport = (uint)httpcfg.GetInt("http_listener_sslport",((int)scene.RegionInfo.HttpPort + 1)); } } - // can't pick the region 'agent' because it would conflict with our agent domain handler - // a zero length region name would conflict with are base region seed cap - if (!SceneListDuplicateCheck(scene.RegionInfo.RegionName) && scene.RegionInfo.RegionName.ToLower() != "agent" && scene.RegionInfo.RegionName.Length > 0) - { - MainServer.Instance.AddLLSDHandler( - "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), - ProcessRegionDomainSeed); - } - - if (!m_scene.Contains(scene)) - m_scene.Add(scene); } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - MainServer.Instance.RemoveLLSDHandler( - "/" + HttpUtility.UrlPathEncode(scene.RegionInfo.RegionName.ToLower()), - ProcessRegionDomainSeed); - - if (m_scene.Contains(scene)) - m_scene.Remove(scene); } public void PostInitialise() @@ -238,6 +209,11 @@ namespace OpenSim.Region.CoreModules.InterGrid get { return "OpenGridProtocolModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion public OSD ProcessRegionDomainSeed(string path, OSD request, string endpoint) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 40b715955a..679c871441 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -41,8 +40,7 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager + public class DynamicTextureModule : IRegionModule, IDynamicTextureManager { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -212,14 +210,9 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { @@ -228,24 +221,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) - { - RegisteredScenes.Remove(scene.RegionInfo.RegionID); - scene.UnregisterModuleInterface(this); - } - } - public void PostInitialise() { } @@ -259,6 +234,11 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture get { return "DynamicTextureModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion #region Nested type: DynamicTextureUpdater @@ -378,18 +358,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); - if (oldAsset != null) - { - if (oldAsset.Temporary == true) - { - scene.AssetService.Delete(oldID.ToString()); - } - } + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index d6ed468814..83f004dc60 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs @@ -32,7 +32,6 @@ using System.Text.RegularExpressions; using DotNetOpenMail; using DotNetOpenMail.SmtpAuth; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,7 +40,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.EmailModules { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EmailModule : IEmailModule { // @@ -96,7 +94,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules } } - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { m_Config = config; IConfig SMTPConfig; @@ -138,16 +136,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Enabled = false; return; } - m_log.Info("[EMAIL] Activated DefaultEmailModule"); - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { // It's a go! if (m_Enabled) { @@ -166,20 +155,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); } } - } - } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - - if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle)) - { - m_Scenes.Remove(scene.RegionInfo.RegionHandle); + m_log.Info("[EMAIL] Activated DefaultEmailModule"); } } @@ -196,6 +173,11 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules get { return "DefaultEmailModule"; } } + public bool IsSharedModule + { + get { return true; } + } + /// /// Delay function using thread in seconds /// diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index e331b8d3e8..d78931a524 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -31,7 +31,6 @@ using System.IO; using System.Net; using System.Text; using System.Threading; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -85,8 +84,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.HttpRequest { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class HttpRequestModule : ISharedRegionModule, IHttpRequestModule + public class HttpRequestModule : IRegionModule, IHttpRequestModule { private object HttpListLock = new object(); private int httpTimeout = 30000; @@ -231,35 +229,18 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); - - m_pendingRequests = new Dictionary(); - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { m_scene = scene; m_scene.RegisterModuleInterface(this); - } - public Type ReplaceableInterface - { - get { return null; } - } + m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); + m_pendingRequests = new Dictionary(); } public void PostInitialise() @@ -275,6 +256,11 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion } diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 6ce55a90c6..9b565ed85b 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -126,8 +126,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnScriptReset -= OnScriptReset; } public void Close() diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index 35ce2cbf2c..c23cea539a 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -29,7 +29,6 @@ using System; using System.Drawing; using System.IO; using System.Net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -40,8 +39,7 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class LoadImageURLModule : ISharedRegionModule, IDynamicTextureRender + public class LoadImageURLModule : IRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -99,28 +97,20 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) - { - m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); - m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource config) { if (m_scene == null) { m_scene = scene; } + + m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); + m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -129,14 +119,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL } } - public void RemoveRegion(Scene scene) - { - } - - public void PostInitialise() - { - } - public void Close() { } @@ -146,6 +128,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void MakeHttpRequest(string url, UUID requestID) diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 71b01a16bc..d57a8e5979 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -31,7 +31,6 @@ using System.Drawing.Imaging; using System.Globalization; using System.IO; using System.Net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -44,8 +43,7 @@ using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.VectorRender { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class VectorRenderModule : ISharedRegionModule, IDynamicTextureRender + public class VectorRenderModule : IRegionModule, IDynamicTextureRender { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -112,10 +110,15 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + if (m_scene == null) + { + m_scene = scene; + } + if (m_graph == null) { Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); @@ -130,20 +133,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName); } - public void AddRegion(Scene scene) - { - if (m_scene == null) - { - m_scene = scene; - } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { m_textureManager = m_scene.RequestModuleInterface(); if (m_textureManager != null) @@ -152,14 +142,6 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender } } - public void RemoveRegion(Scene scene) - { - } - - public void PostInitialise() - { - } - public void Close() { } @@ -169,6 +151,11 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void Draw(string data, UUID id, string extraParams) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index d935c565db..93aa88c4de 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -28,7 +28,6 @@ using System; using System.Collections; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -86,8 +85,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.WorldComm { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class WorldCommModule : ISharedRegionModule, IWorldComm + public class WorldCommModule : IRegionModule, IWorldComm { // private static readonly ILog m_log = // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -100,9 +98,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm private int m_saydistance = 30; private int m_shoutdistance = 100; - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { // wrap this in a try block so that defaults will work if // the config file doesn't specify otherwise. @@ -122,6 +120,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (maxlisteners < 1) maxlisteners = int.MaxValue; if (maxhandles < 1) maxhandles = int.MaxValue; +<<<<<<< HEAD:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs m_listenerManager = new ListenerManager(maxlisteners, maxhandles); m_pendingQ = new Queue(); m_pending = Queue.Synchronized(m_pendingQ); @@ -133,26 +132,19 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm public void AddRegion(Scene scene) { +======= +>>>>>>> ec3c31e... Updates all IRegionModules to the new style region modules.:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs m_scene = scene; m_scene.RegisterModuleInterface(this); + m_listenerManager = new ListenerManager(maxlisteners, maxhandles); m_scene.EventManager.OnChatFromClient += DeliverClientMessage; m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; + m_pendingQ = new Queue(); + m_pending = Queue.Synchronized(m_pendingQ); } - public Type ReplaceableInterface + public void PostInitialise() { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnChatFromClient -= DeliverClientMessage; - scene.EventManager.OnChatBroadcast -= DeliverClientMessage; } public void Close() @@ -164,6 +156,11 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm get { return "WorldCommModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion #region IWorldComm Members diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index a9147fb601..27b64bffc0 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -32,7 +32,6 @@ using System.Net; using System.Reflection; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenMetaverse; @@ -77,8 +76,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class XMLRPCModule : ISharedRegionModule, IXMLRPC + public class XMLRPCModule : IRegionModule, IXMLRPC { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -96,9 +94,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC private int RemoteReplyScriptWait = 300; private object XMLRPCListLock = new object(); - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { // We need to create these early because the scripts might be calling // But since this gets called for every region, we need to make sure they @@ -118,14 +116,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { } } - } - public void PostInitialise() - { - } - - public void AddRegion(Scene scene) - { if (!m_scenes.Contains(scene)) { m_scenes.Add(scene); @@ -134,12 +125,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } } - public Type ReplaceableInterface - { - get { return null; } - } - private Dictionary m_HttpServers = new Dictionary(); - public void RegionLoaded(Scene scene) + public void PostInitialise() { if (IsEnabled()) { @@ -147,31 +133,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC // Attach xmlrpc handlers m_log.Info("[REMOTE_DATA]: " + "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); - BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort); + BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); httpServer.Start(); - m_HttpServers.Add(scene, httpServer); - } - } - - public void RemoveRegion(Scene scene) - { - if (m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.UnregisterModuleInterface(this); - if (IsEnabled()) - { - // Start http server - // Attach xmlrpc handlers - if (m_HttpServers.ContainsKey(scene)) - { - BaseHttpServer httpServer; - m_HttpServers.TryGetValue(scene, out httpServer); - m_log.Info("[REMOTE_DATA]: " + - "Stopping XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); - httpServer.RemoveXmlRPCHandler("llRemoteData"); - httpServer.Stop(); - } } } @@ -184,6 +148,11 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC get { return m_name; } } + public bool IsSharedModule + { + get { return true; } + } + public int Port { get { return m_remoteDataPort; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs index d3e2db7cde..879cc70903 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Asset/AssetServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset private IConfigSource m_Config; bool m_Registered = false; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs index a895a3fa0b..b12d778f87 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/HypergridServiceInConnectorModule.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid bool m_Registered = false; HypergridServiceInConnector m_HypergridHandler; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs index 4c74725ed9..54c6d89073 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Inventory/InventoryServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory private IConfigSource m_Config; bool m_Registered = false; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index dcc6decc3c..bce160a92a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land private IConfigSource m_Config; private List m_Scenes = new List(); - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs index a5c5ef637f..8a903701fa 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Neighbour/NeighbourServiceInConnectorModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Neighbour private IConfigSource m_Config; private List m_Scenes = new List(); - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs index c2cea1640e..f28a31849a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Simulation/SimulationServiceInConnectorModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation private IConfigSource m_Config; bool m_Registered = false; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs index 71d7993ab4..d68c683143 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/LocalInterregionComms.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion #endregion /* Events */ - #region ISharedRegionModule + #region IRegionModule public void Initialise(IConfigSource config) { @@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } } - #endregion + #endregion /* IRegionModule */ #region IInterregionComms diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 24d35e10cc..44458d175f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion protected bool m_safemode; protected IPAddress m_thisIP; - #region ISharedRegionModule + #region IRegionModule public virtual void Initialise(IConfigSource config) { @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion MainServer.Instance.AddHTTPHandler("/object/", ObjectHandler); } - #endregion + #endregion /* IRegionModule */ #region IInterregionComms @@ -436,12 +436,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } OSDMap resp = new OSDMap(2); - string reason = String.Empty; - uint teleportFlags = 0; - if (args.ContainsKey("teleport_flags")) - { - teleportFlags = args["teleport_flags"].AsUInteger(); - } + string reason = String.Empty; + uint teleportFlags = 0; + if (args.ContainsKey("teleport_flags")) + { + teleportFlags = args["teleport_flags"].AsUInteger(); + } // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index c738b65773..fc8d4e1d04 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -81,7 +81,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); } public void Close() diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index a2cfce6d38..5fa3dc2191 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs @@ -27,7 +27,6 @@ using System; using System.Collections.Generic; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -36,7 +35,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class CloudModule : ICloudModule { // private static readonly log4net.ILog m_log @@ -50,7 +48,7 @@ namespace OpenSim.Region.CoreModules private float m_cloudDensity = 1.0F; private float[] cloudCover = new float[16 * 16]; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { IConfig cloudConfig = config.Configs["Cloud"]; @@ -60,17 +58,10 @@ namespace OpenSim.Region.CoreModules m_cloudDensity = cloudConfig.GetFloat("density", 0.5F); m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { if (m_enabled) { + m_scene = scene; scene.EventManager.OnNewClient += CloudsToClient; @@ -80,18 +71,9 @@ namespace OpenSim.Region.CoreModules GenerateCloudCover(); m_ready = true; + } - } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= CloudsToClient; - scene.UnregisterModuleInterface(this); - scene.EventManager.OnFrame -= CloudUpdate; } public void PostInitialise() @@ -114,6 +96,12 @@ namespace OpenSim.Region.CoreModules get { return "CloudModule"; } } + public bool IsSharedModule + { + get { return false; } + } + + public float CloudCover(int x, int y, int z) { float cover = 0f; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 39836aeeee..695cced293 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -30,7 +30,6 @@ using System.IO; using System.Reflection; using System.Security; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -39,7 +38,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Estate { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class EstateManagementModule : IEstateModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -900,16 +898,7 @@ namespace OpenSim.Region.CoreModules.World.Estate #region IRegionModule Members - public void Initialise(IConfigSource source) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_scene.RegisterModuleInterface(this); @@ -931,29 +920,6 @@ namespace OpenSim.Region.CoreModules.World.Estate consoleSetTerrainHeights); } - public void RegionLoaded(Scene scene) - { - // Sets up the sun module based on the saved Estate and Region Settings - // DO NOT REMOVE or the sun will stop working - TriggerEstateToolsSunUpdate(); - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnNewClient -= EventManager_OnNewClient; - scene.EventManager.OnRequestChangeWaterHeight -= changeWaterHeight; - } - - public void Close() - { - } - - public string Name - { - get { return "EstateManagementModule"; } - } - #region Console Commands public void consoleSetTerrainTexture(string module, string[] args) @@ -1040,6 +1006,28 @@ namespace OpenSim.Region.CoreModules.World.Estate } #endregion + + public void PostInitialise() + { + // Sets up the sun module based no the saved Estate and Region Settings + // DO NOT REMOVE or the sun will stop working + TriggerEstateToolsSunUpdate(); + } + + public void Close() + { + } + + public string Name + { + get { return "EstateManagementModule"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion #region Other Functions diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 5b15065549..1533462b8d 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -90,8 +89,7 @@ enum GroupPowers : long namespace OpenSim.Region.CoreModules.World.Permissions { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class PermissionsModule : INonSharedRegionModule + public class PermissionsModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -151,10 +149,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions #endregion - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + m_scene = scene; + IConfig myConfig = config.Configs["Startup"]; string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); @@ -179,7 +179,74 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_bypassPermissions) m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); else - m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); + m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); + + //Register functions with Scene External Checks! + m_scene.Permissions.OnBypassPermissions += BypassPermissions; + m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions; + m_scene.Permissions.OnPropagatePermissions += PropagatePermissions; + m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags; + m_scene.Permissions.OnAbandonParcel += CanAbandonParcel; + m_scene.Permissions.OnReclaimParcel += CanReclaimParcel; + m_scene.Permissions.OnDeedParcel += CanDeedParcel; + m_scene.Permissions.OnDeedObject += CanDeedObject; + m_scene.Permissions.OnIsGod += IsGod; + m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; + m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnInstantMessage += CanInstantMessage; + m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED + m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED + m_scene.Permissions.OnMoveObject += CanMoveObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnObjectEntry += CanObjectEntry; + m_scene.Permissions.OnReturnObject += CanReturnObject; //NOT YET IMPLEMENTED + m_scene.Permissions.OnRezObject += CanRezObject; //MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; + m_scene.Permissions.OnRunScript += CanRunScript; //NOT YET IMPLEMENTED + m_scene.Permissions.OnCompileScript += CanCompileScript; + m_scene.Permissions.OnSellParcel += CanSellParcel; + m_scene.Permissions.OnTakeObject += CanTakeObject; + m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; + m_scene.Permissions.OnTerraformLand += CanTerraformLand; + m_scene.Permissions.OnLinkObject += CanLinkObject; //NOT YET IMPLEMENTED + m_scene.Permissions.OnDelinkObject += CanDelinkObject; //NOT YET IMPLEMENTED + m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED + + m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED + m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED + m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED + m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED + + m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE + m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED + m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnResetScript += CanResetScript; + + m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; //NOT YET IMPLEMENTED + m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED + + m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED + m_scene.Permissions.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED + + m_scene.AddCommand(this, "bypass permissions", + "bypass permissions ", + "Bypass permission checks", + HandleBypassPermissions); + + m_scene.AddCommand(this, "force permissions", + "force permissions ", + "Force permissions on or off", + HandleForcePermissions); + + m_scene.AddCommand(this, "debug permissions", + "debug permissions ", + "Enable permissions debugging", + HandleDebugPermissions); + string grant = myConfig.GetString("GrantLSL",""); if (grant.Length > 0) { @@ -227,158 +294,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions } - public void AddRegion(Scene scene) - { - m_scene = scene; - - //Register functions with Scene External Checks! - m_scene.Permissions.OnBypassPermissions += BypassPermissions; - m_scene.Permissions.OnSetBypassPermissions += SetBypassPermissions; - m_scene.Permissions.OnPropagatePermissions += PropagatePermissions; - m_scene.Permissions.OnGenerateClientFlags += GenerateClientFlags; - m_scene.Permissions.OnAbandonParcel += CanAbandonParcel; - m_scene.Permissions.OnReclaimParcel += CanReclaimParcel; - m_scene.Permissions.OnDeedParcel += CanDeedParcel; - m_scene.Permissions.OnDeedObject += CanDeedObject; - m_scene.Permissions.OnIsGod += IsGod; - m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; - m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnEditParcel += CanEditParcel; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnInstantMessage += CanInstantMessage; - m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; //NOT YET IMPLEMENTED - m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; //FULLY IMPLEMENTED - m_scene.Permissions.OnMoveObject += CanMoveObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnObjectEntry += CanObjectEntry; - m_scene.Permissions.OnReturnObject += CanReturnObject; //NOT YET IMPLEMENTED - m_scene.Permissions.OnRezObject += CanRezObject; //MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; - m_scene.Permissions.OnRunScript += CanRunScript; //NOT YET IMPLEMENTED - m_scene.Permissions.OnCompileScript += CanCompileScript; - m_scene.Permissions.OnSellParcel += CanSellParcel; - m_scene.Permissions.OnTakeObject += CanTakeObject; - m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; - m_scene.Permissions.OnTerraformLand += CanTerraformLand; - m_scene.Permissions.OnLinkObject += CanLinkObject; //NOT YET IMPLEMENTED - m_scene.Permissions.OnDelinkObject += CanDelinkObject; //NOT YET IMPLEMENTED - m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED - - m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED - m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED - m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED - m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED - - m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE - m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED - m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnResetScript += CanResetScript; - - m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; //NOT YET IMPLEMENTED - m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED - - m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED - m_scene.Permissions.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED - - m_scene.AddCommand(this, "bypass permissions", - "bypass permissions ", - "Bypass permission checks", - HandleBypassPermissions); - - m_scene.AddCommand(this, "force permissions", - "force permissions ", - "Force permissions on or off", - HandleForcePermissions); - - m_scene.AddCommand(this, "debug permissions", - "debug permissions ", - "Enable permissions debugging", - HandleDebugPermissions); - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - m_friendsModule = m_scene.RequestModuleInterface(); - - if (m_friendsModule == null) - m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); - else - m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); - } - - public void RemoveRegion(Scene scene) - { - scene.Permissions.OnBypassPermissions -= BypassPermissions; - scene.Permissions.OnSetBypassPermissions -= SetBypassPermissions; - scene.Permissions.OnPropagatePermissions -= PropagatePermissions; - scene.Permissions.OnGenerateClientFlags -= GenerateClientFlags; - scene.Permissions.OnAbandonParcel -= CanAbandonParcel; - scene.Permissions.OnReclaimParcel -= CanReclaimParcel; - scene.Permissions.OnDeedParcel -= CanDeedParcel; - scene.Permissions.OnDeedObject -= CanDeedObject; - scene.Permissions.OnIsGod -= IsGod; - scene.Permissions.OnDuplicateObject -= CanDuplicateObject; - scene.Permissions.OnDeleteObject -= CanDeleteObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnEditObject -= CanEditObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnEditParcel -= CanEditParcel; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnInstantMessage -= CanInstantMessage; - scene.Permissions.OnInventoryTransfer -= CanInventoryTransfer; //NOT YET IMPLEMENTED - scene.Permissions.OnIssueEstateCommand -= CanIssueEstateCommand; //FULLY IMPLEMENTED - scene.Permissions.OnMoveObject -= CanMoveObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnObjectEntry -= CanObjectEntry; - scene.Permissions.OnReturnObject -= CanReturnObject; //NOT YET IMPLEMENTED - scene.Permissions.OnRezObject -= CanRezObject; //MAYBE FULLY IMPLEMENTED - scene.Permissions.OnRunConsoleCommand -= CanRunConsoleCommand; - scene.Permissions.OnRunScript -= CanRunScript; //NOT YET IMPLEMENTED - scene.Permissions.OnCompileScript -= CanCompileScript; - scene.Permissions.OnSellParcel -= CanSellParcel; - scene.Permissions.OnTakeObject -= CanTakeObject; - scene.Permissions.OnTakeCopyObject -= CanTakeCopyObject; - scene.Permissions.OnTerraformLand -= CanTerraformLand; - scene.Permissions.OnLinkObject -= CanLinkObject; //NOT YET IMPLEMENTED - scene.Permissions.OnDelinkObject -= CanDelinkObject; //NOT YET IMPLEMENTED - scene.Permissions.OnBuyLand -= CanBuyLand; //NOT YET IMPLEMENTED - - scene.Permissions.OnViewNotecard -= CanViewNotecard; //NOT YET IMPLEMENTED - scene.Permissions.OnViewScript -= CanViewScript; //NOT YET IMPLEMENTED - scene.Permissions.OnEditNotecard -= CanEditNotecard; //NOT YET IMPLEMENTED - scene.Permissions.OnEditScript -= CanEditScript; //NOT YET IMPLEMENTED - - scene.Permissions.OnCreateObjectInventory -= CanCreateObjectInventory; //NOT IMPLEMENTED HERE - scene.Permissions.OnEditObjectInventory -= CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED - scene.Permissions.OnCopyObjectInventory -= CanCopyObjectInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnDeleteObjectInventory -= CanDeleteObjectInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnResetScript -= CanResetScript; - - scene.Permissions.OnCreateUserInventory -= CanCreateUserInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnCopyUserInventory -= CanCopyUserInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnEditUserInventory -= CanEditUserInventory; //NOT YET IMPLEMENTED - scene.Permissions.OnDeleteUserInventory -= CanDeleteUserInventory; //NOT YET IMPLEMENTED - - scene.Permissions.OnTeleport -= CanTeleport; //NOT YET IMPLEMENTED - scene.Permissions.OnUseObjectReturn -= CanUseObjectReturn; //NOT YET IMPLEMENTED - } - - public void PostInitialise() - { - } - - public void Close() - { - } - - public string Name - { - get { return "PermissionsModule"; } - } - public void HandleBypassPermissions(string module, string[] args) { if (m_scene.ConsoleScene() != null && @@ -449,6 +364,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_log.InfoFormat("[PERMISSIONS] Set permissions debugging to {0} in {1}", m_debugPermissions, m_scene.RegionInfo.RegionName); } } + + public void PostInitialise() + { + m_friendsModule = m_scene.RequestModuleInterface(); + + if (m_friendsModule == null) + m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); + else + m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); + } + + public void Close() + { + } + + public string Name + { + get { return "PermissionsModule"; } + } + + public bool IsSharedModule + { + get { return false; } + } + #endregion #region Helper Functions diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index ed7bfe1a01..37f1f2eb9f 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -26,7 +26,6 @@ */ using System; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -35,44 +34,26 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Sound { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class SoundModule : INonSharedRegionModule, ISoundModule + public class SoundModule : IRegionModule, ISoundModule { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; - public void Initialise(IConfigSource source) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; - + m_scene.EventManager.OnNewClient += OnNewClient; - + m_scene.RegisterModuleInterface(this); } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnNewClient -= OnNewClient; - scene.UnregisterModuleInterface(this); - } + public void PostInitialise() {} public void Close() {} public string Name { get { return "Sound Module"; } } - + public bool IsSharedModule { get { return false; } } + private void OnNewClient(IClientAPI client) { client.OnSoundTrigger += TriggerSound; diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index 948c47ce10..0712a7fabc 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -29,7 +29,6 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -38,7 +37,6 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class SunModule : ISunModule { /// @@ -280,12 +278,27 @@ namespace OpenSim.Region.CoreModules return GetCurrentSunHour() + 6.0f; } - #region INonSharedRegionModule Methods + #region IRegion Methods // Called immediately after the module is loaded for a given region // i.e. Immediately after instance creation. - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + m_scene = scene; + m_frame = 0; + + // This one puts an entry in the main help screen + m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); + + // This one enables the ability to type just "sun" without any parameters + m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); + foreach (KeyValuePair kvp in GetParamList()) + { + m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); + } + + + TimeZone local = TimeZone.CurrentTimeZone; TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset); @@ -333,6 +346,57 @@ namespace OpenSim.Region.CoreModules // m_latitude = d_latitude; // m_longitude = d_longitude; } + + switch (m_RegionMode) + { + case "T1": + default: + case "SL": + // Time taken to complete a cycle (day and season) + + SecondsPerSunCycle = (uint) (m_DayLengthHours * 60 * 60); + SecondsPerYear = (uint) (SecondsPerSunCycle*m_YearLengthDays); + + // Ration of real-to-virtual time + + // VWTimeRatio = 24/m_day_length; + + // Speed of rotation needed to complete a cycle in the + // designated period (day and season) + + SunSpeed = m_SunCycle/SecondsPerSunCycle; + SeasonSpeed = m_SeasonalCycle/SecondsPerYear; + + // Horizon translation + + HorizonShift = m_HorizonShift; // Z axis translation + // HoursToRadians = (SunCycle/24)*VWTimeRatio; + + // Insert our event handling hooks + + scene.EventManager.OnFrame += SunUpdate; + scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; + scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; + scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; + + ready = true; + + m_log.Debug("[SUN]: Mode is " + m_RegionMode); + m_log.Debug("[SUN]: Initialization completed. Day is " + SecondsPerSunCycle + " seconds, and year is " + m_YearLengthDays + " days"); + m_log.Debug("[SUN]: Axis offset is " + m_HorizonShift); + m_log.Debug("[SUN]: Percentage of time for daylight " + m_DayTimeSunHourScale); + m_log.Debug("[SUN]: Positional data updated every " + m_UpdateInterval + " frames"); + + break; + } + + scene.RegisterModuleInterface(this); + + } + + + public void PostInitialise() + { } public void Close() @@ -351,84 +415,10 @@ namespace OpenSim.Region.CoreModules get { return "SunModule"; } } - public Type ReplaceableInterface + public bool IsSharedModule { - get { return null; } + get { return false; } } - - public void AddRegion(Scene scene) - { - m_scene = scene; - m_frame = 0; - - // This one puts an entry in the main help screen - m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null); - - // This one enables the ability to type just "sun" without any parameters - m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand); - foreach (KeyValuePair kvp in GetParamList()) - { - m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); - } - switch (m_RegionMode) - { - case "T1": - default: - case "SL": - // Time taken to complete a cycle (day and season) - - SecondsPerSunCycle = (uint)(m_DayLengthHours * 60 * 60); - SecondsPerYear = (uint)(SecondsPerSunCycle * m_YearLengthDays); - - // Ration of real-to-virtual time - - // VWTimeRatio = 24/m_day_length; - - // Speed of rotation needed to complete a cycle in the - // designated period (day and season) - - SunSpeed = m_SunCycle / SecondsPerSunCycle; - SeasonSpeed = m_SeasonalCycle / SecondsPerYear; - - // Horizon translation - - HorizonShift = m_HorizonShift; // Z axis translation - // HoursToRadians = (SunCycle/24)*VWTimeRatio; - - // Insert our event handling hooks - - scene.EventManager.OnFrame += SunUpdate; - scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; - scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; - scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; - - ready = true; - - m_log.Debug("[SUN]: Mode is " + m_RegionMode); - m_log.Debug("[SUN]: Initialization completed. Day is " + SecondsPerSunCycle + " seconds, and year is " + m_YearLengthDays + " days"); - m_log.Debug("[SUN]: Axis offset is " + m_HorizonShift); - m_log.Debug("[SUN]: Percentage of time for daylight " + m_DayTimeSunHourScale); - m_log.Debug("[SUN]: Positional data updated every " + m_UpdateInterval + " frames"); - - break; - } - - scene.RegisterModuleInterface(this); - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.RegisterModuleInterface(this); - scene.EventManager.OnFrame -= SunUpdate; - scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; - scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; - } - #endregion #region EventManager Events diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index 0b487ed442..c2ad7b8c38 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs @@ -28,7 +28,6 @@ using System; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -37,8 +36,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.Avatar.Vegetation { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class VegetationModule : INonSharedRegionModule, IVegetationModule + public class VegetationModule : IRegionModule, IVegetationModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -47,34 +45,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; public PCode[] CreationCapabilities { get { return creationCapabilities; } } - public void Initialise(IConfigSource source) - { - } - - public void AddRegion(Scene scene) + public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; m_scene.RegisterModuleInterface(this); } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } public void PostInitialise() {} public void Close() {} public string Name { get { return "Vegetation Module"; } } - + public bool IsSharedModule { get { return false; } } + public SceneObjectGroup AddTree( UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree) { diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index cd3706d7b3..3283c1ffa7 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -55,19 +55,17 @@ namespace OpenSim.Region.CoreModules private IWindModelPlugin m_activeWindPlugin = null; private const string m_dWindPluginName = "SimpleRandomWind"; - private string m_desiredWindPlugin = "SimpleRandomWind"; private Dictionary m_availableWindPlugins = new Dictionary(); // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m private Vector2[] windSpeeds = new Vector2[16 * 16]; - private IConfig windConfig; #region IRegion Methods - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { - windConfig = config.Configs["Wind"]; - m_desiredWindPlugin = m_dWindPluginName; + IConfig windConfig = config.Configs["Wind"]; + string desiredWindPlugin = m_dWindPluginName; if (windConfig != null) { @@ -78,18 +76,10 @@ namespace OpenSim.Region.CoreModules // Determine which wind model plugin is desired if (windConfig.Contains("wind_plugin")) { - m_desiredWindPlugin = windConfig.GetString("wind_plugin"); + desiredWindPlugin = windConfig.GetString("wind_plugin"); } } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { if (m_enabled) { m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate); @@ -105,30 +95,30 @@ namespace OpenSim.Region.CoreModules } // Check for desired plugin - if (m_availableWindPlugins.ContainsKey(m_desiredWindPlugin)) + if (m_availableWindPlugins.ContainsKey(desiredWindPlugin)) { - m_activeWindPlugin = m_availableWindPlugins[m_desiredWindPlugin]; + m_activeWindPlugin = m_availableWindPlugins[desiredWindPlugin]; - m_log.InfoFormat("[WIND] {0} plugin found, initializing.", m_desiredWindPlugin); + m_log.InfoFormat("[WIND] {0} plugin found, initializing.", desiredWindPlugin); if (windConfig != null) { m_activeWindPlugin.Initialise(); m_activeWindPlugin.WindConfig(m_scene, windConfig); } - } + } // if the plug-in wasn't found, default to no wind. if (m_activeWindPlugin == null) { - m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", m_desiredWindPlugin); + m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", desiredWindPlugin); m_log.ErrorFormat("[WIND] Defaulting to no wind."); } // This one puts an entry in the main help screen m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind [value] - Get or Update Wind paramaters", null); - + // This one enables the ability to type just the base command without any parameters m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand); @@ -137,7 +127,7 @@ namespace OpenSim.Region.CoreModules { m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand); m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand); - + foreach (KeyValuePair kvp in windPlugin.WindParams()) { m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand); @@ -159,19 +149,13 @@ namespace OpenSim.Region.CoreModules m_ready = true; } + } - public void RegionLoaded(Scene scene) + public void PostInitialise() { } - public void RemoveRegion(Scene scene) - { - scene.EventManager.OnFrame -= WindUpdate; - scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion; - scene.UnregisterModuleInterface(this); - } - public void Close() { if (m_enabled) @@ -198,6 +182,11 @@ namespace OpenSim.Region.CoreModules get { return "WindModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 6bda1e9e6d..285d36a3d6 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Drawing; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Imaging; @@ -60,8 +59,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public face[] trns; } - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MapImageModule : IMapImageGenerator, INonSharedRegionModule + public class MapImageModule : IMapImageGenerator, IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -130,36 +128,23 @@ namespace OpenSim.Region.CoreModules.World.WorldMap #endregion - #region INonSharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { + m_scene = scene; m_config = source; IConfig startupConfig = m_config.Configs["Startup"]; if (startupConfig.GetString("MapImageModule", "MapImageModule") != "MapImageModule") return; - } - public void AddRegion(Scene scene) - { - m_scene = scene; m_scene.RegisterModuleInterface(this); } - public Type ReplaceableInterface + public void PostInitialise() { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); } public void Close() @@ -171,6 +156,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapImageModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion // TODO: unused: diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index dd336735a3..be46fa55b2 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -24,12 +24,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -using System; using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -41,8 +38,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.WorldMap { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MapSearchModule : ISharedRegionModule + public class MapSearchModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -50,12 +46,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap Scene m_scene = null; // only need one for communication with GridService List m_scenes = new List(); - #region ISharedRegionModule Members - public void Initialise(IConfigSource source) - { - } - - public void AddRegion(Scene scene) + #region IRegionModule Members + public void Initialise(Scene scene, IConfigSource source) { if (m_scene == null) { @@ -66,22 +58,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap scene.EventManager.OnNewClient += OnNewClient; } - public Type ReplaceableInterface - { - get { return null; } - } - - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if(m_scenes.Contains(scene)) - m_scenes.Remove(scene); - scene.EventManager.OnNewClient -= OnNewClient; - } - public void PostInitialise() { } @@ -97,6 +73,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapSearchModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index b0cefc3047..4df9094644 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -33,7 +33,6 @@ using System.Net; using System.Reflection; using System.Xml; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -44,8 +43,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.DataSnapshot { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class DataSnapshotManager : ISharedRegionModule, IDataSnapshot + public class DataSnapshotManager : IRegionModule, IDataSnapshot { #region Class members //Information from config @@ -91,7 +89,7 @@ namespace OpenSim.Region.DataSnapshot #region IRegionModule - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { if (!m_configLoaded) { @@ -142,29 +140,24 @@ namespace OpenSim.Region.DataSnapshot return; } } + + if (m_enabled) + { + //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer + new DataRequestHandler(scene, this); + + m_hostname = scene.RegionInfo.ExternalHostName; + m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); + + MakeEverythingStale(); + + if (m_dataServices != "" && m_dataServices != "noservices") + NotifyDataServices(m_dataServices, "online"); + } } - } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { if (m_enabled) { - //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer - new DataRequestHandler(scene, this); - - m_hostname = scene.RegionInfo.ExternalHostName; - m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); - - MakeEverythingStale(); - - if (m_dataServices != "" && m_dataServices != "noservices") - NotifyDataServices(m_dataServices, "online"); - m_log.Info("[DATASNAPSHOT]: Scene added to module."); m_snapStore.AddScene(scene); @@ -198,27 +191,22 @@ namespace OpenSim.Region.DataSnapshot } else { - m_log.Info("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else)."); + m_log.Warn("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else)."); } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (m_scenes.Contains(scene)) - m_scenes.Remove(scene); - m_snapStore.RemoveScene(scene); - } - public void Close() { if (m_enabled && m_dataServices != "" && m_dataServices != "noservices") NotifyDataServices(m_dataServices, "offline"); } + + public bool IsSharedModule + { + get { return true; } + } + public string Name { get { return "External Data Generator"; } @@ -226,6 +214,7 @@ namespace OpenSim.Region.DataSnapshot public void PostInitialise() { + } #endregion diff --git a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs index 879114b18c..f8a5bad347 100644 --- a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs @@ -28,7 +28,7 @@ namespace OpenSim.Region.Framework.Interfaces { - public interface ICloudModule : INonSharedRegionModule + public interface ICloudModule : IRegionModule { /// /// Retrieves the cloud density at the given region coordinates diff --git a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs index bdad0b4061..3a2c4231cf 100644 --- a/OpenSim/Region/Framework/Interfaces/IEmailModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEmailModule.cs @@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Interfaces public int numLeft; } - public interface IEmailModule : ISharedRegionModule + public interface IEmailModule : IRegionModule { void SendEmail(UUID objectID, string address, string subject, string body); Email GetNextEmail(UUID objectID, string sender, string subject); diff --git a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs index 347818cf42..890fa31df0 100644 --- a/OpenSim/Region/Framework/Interfaces/IEstateModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEstateModule.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface IEstateModule : INonSharedRegionModule + public interface IEstateModule : IRegionModule { uint GetRegionFlags(); bool IsManager(UUID avatarID); diff --git a/OpenSim/Region/Framework/Interfaces/ISunModule.cs b/OpenSim/Region/Framework/Interfaces/ISunModule.cs index 8231716f2e..819ae11d3c 100644 --- a/OpenSim/Region/Framework/Interfaces/ISunModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ISunModule.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface ISunModule : INonSharedRegionModule + public interface ISunModule : IRegionModule { double GetSunParameter(string param); diff --git a/OpenSim/Region/Framework/Interfaces/IWindModule.cs b/OpenSim/Region/Framework/Interfaces/IWindModule.cs index 4a26a717db..10ecc325c8 100644 --- a/OpenSim/Region/Framework/Interfaces/IWindModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IWindModule.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface IWindModule : INonSharedRegionModule + public interface IWindModule : IRegionModule { /// diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs index ec040dbbf2..cfe1278786 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/IRCStackModule.cs @@ -25,11 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Net; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -37,23 +35,24 @@ using OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server; namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class IRCStackModule : INonSharedRegionModule + public class IRCStackModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IRCServer m_server; // private Scene m_scene; - private int portNo; - #region Implementation of ISharedRegionModule + #region Implementation of IRegionModule - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { if (null != source.Configs["IRCd"] && source.Configs["IRCd"].GetBoolean("Enabled",false)) { - portNo = source.Configs["IRCd"].GetInt("Port",6666); + int portNo = source.Configs["IRCd"].GetInt("Port",6666); +// m_scene = scene; + m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); + m_server.OnNewIRCClient += m_server_OnNewIRCClient; } } @@ -69,20 +68,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView m_log.Info("[IRCd] Added user to Scene"); } - public void AddRegion(Scene scene) + public void PostInitialise() { - if (portNo != null) - { - m_server = new IRCServer(IPAddress.Parse("0.0.0.0"), portNo, scene); - m_server.OnNewIRCClient += m_server_OnNewIRCClient; - } - } - public void RegionLoaded(Scene scene) - { - } - public void RemoveRegion(Scene scene) - { } public void Close() @@ -95,9 +83,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView get { return "IRCClientStackModule"; } } - public Type ReplaceableInterface + public bool IsSharedModule { - get { return null; } + get { return false; } } #endregion diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 23ae307910..b04b076629 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -38,7 +38,6 @@ using System.Collections.Generic; using System.Reflection; using OpenMetaverse; using log4net; -using Mono.Addins; using Nini.Config; using Nwc.XmlRpc; using OpenSim.Framework; @@ -54,8 +53,7 @@ using System.Text.RegularExpressions; namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule + public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -110,8 +108,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice private IConfig m_config; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + m_scene = scene; m_config = config.Configs["FreeSwitchVoice"]; if (null == m_config) @@ -225,21 +224,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice return; } } - } - public void AddRegion(Scene scene) - { - m_scene = scene; - if (m_pluginEnabled) + if (m_pluginEnabled) { // we need to capture scene in an anonymous method // here as we need it later in the callbacks scene.EventManager.OnRegisterCaps += delegate(UUID agentID, Caps caps) - { - OnRegisterCaps(scene, agentID, caps); - }; - - + { + OnRegisterCaps(scene, agentID, caps); + }; + + try { @@ -259,53 +254,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); } } - + } + } + + public void PostInitialise() + { if (m_pluginEnabled) { m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); - + // register the voice interface for this module, so the script engine can call us m_scene.RegisterModuleInterface(this); } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (UseProxy) - { - MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/", m_freeSwitchAPIPrefix)); - } - else - { - MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix)); - - MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix)); - - MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix)); - - MainServer.Instance.RemoveHTTPHandler("", String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix)); - } - scene.EventManager.OnRegisterCaps -= delegate(UUID agentID, Caps caps) - { - OnRegisterCaps(scene, agentID, caps); - }; - scene.UnregisterModuleInterface(this); - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void PostInitialise() - { - } - public void Close() { } @@ -314,6 +277,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { get { return "FreeSwitchVoiceModule"; } } + + public bool IsSharedModule + { + get { return true; } + } // // implementation of IVoiceModule, called by osSetParcelSIPAddress script function diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs index 6769d59bc6..3d1c346dc8 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -38,7 +38,6 @@ using System.Threading; using OpenMetaverse; -using Mono.Addins; using Nini.Config; using OpenSim; @@ -51,8 +50,7 @@ using log4net; namespace OpenSim.Region.OptionalModules.ContentManagement { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class ContentManagementModule : ISharedRegionModule + public class ContentManagementModule : IRegionModule { #region Static Fields @@ -62,20 +60,22 @@ namespace OpenSim.Region.OptionalModules.ContentManagement #region Fields - private bool initialised = false; - private CMController m_control = null; - private bool m_enabled = false; - private CMModel m_model = null; - private bool m_posted = false; - private CMView m_view = null; - private string databaseDir = "./"; - private string database = "FileSystemDatabase"; - private int channel = 345; + bool initialised = false; + CMController m_control = null; + bool m_enabled = false; + CMModel m_model = null; + bool m_posted = false; + CMView m_view = null; #endregion Fields #region Public Properties + public bool IsSharedModule + { + get { return true; } + } + public string Name { get { return "ContentManagementModule"; } @@ -89,8 +89,11 @@ namespace OpenSim.Region.OptionalModules.ContentManagement { } - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { + string databaseDir = "./"; + string database = "FileSystemDatabase"; + int channel = 345; try { if (source.Configs["CMS"] == null) @@ -112,15 +115,13 @@ namespace OpenSim.Region.OptionalModules.ContentManagement m_log.ErrorFormat("[Content Management]: Exception thrown while reading parameters from configuration file. Message: " + e); m_enabled = false; } - } - public void AddRegion(Scene scene) - { if (!m_enabled) { m_log.Info("[Content Management]: Content Management System is not Enabled."); return; } + lock (this) { if (!initialised) //only init once @@ -141,18 +142,6 @@ namespace OpenSim.Region.OptionalModules.ContentManagement } } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } public void PostInitialise() { diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index f24bcdc1e7..4521f8ef6a 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -38,7 +38,6 @@ using System.Security.Policy; using System.Text; using log4net; using Microsoft.CSharp; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -47,8 +46,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class MRMModule : INonSharedRegionModule, IMRMModule + public class MRMModule : IRegionModule, IMRMModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; @@ -64,14 +62,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule private IConfig m_config; - private bool m_hidden = true; - public void RegisterExtension(T instance) { m_extensions[typeof (T)] = instance; } - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { if (source.Configs["MRM"] != null) { @@ -80,10 +76,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule if (source.Configs["MRM"].GetBoolean("Enabled", false)) { m_log.Info("[MRM] Enabling MRM Module"); - + m_scene = scene; + // when hidden, we don't listen for client initiated script events // only making the MRM engine available for region modules - m_hidden = source.Configs["MRM"].GetBoolean("Hidden", false); + if (!source.Configs["MRM"].GetBoolean("Hidden", false)) + { + scene.EventManager.OnRezScript += EventManager_OnRezScript; + scene.EventManager.OnStopScript += EventManager_OnStopScript; + } + + scene.EventManager.OnFrame += EventManager_OnFrame; + + scene.RegisterModuleInterface(this); } else { @@ -96,39 +101,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule } } - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { - m_scene = scene; - if (!m_hidden) - { - scene.EventManager.OnRezScript += EventManager_OnRezScript; - scene.EventManager.OnStopScript += EventManager_OnStopScript; - } - scene.EventManager.OnFrame += EventManager_OnFrame; - - scene.RegisterModuleInterface(this); - } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - if (!m_hidden) - { - scene.EventManager.OnRezScript -= EventManager_OnRezScript; - scene.EventManager.OnStopScript -= EventManager_OnStopScript; - } - scene.EventManager.OnFrame -= EventManager_OnFrame; - - scene.UnregisterModuleInterface(this); - } - void EventManager_OnStopScript(uint localID, UUID itemID) { if (m_scripts.ContainsKey(itemID)) @@ -330,6 +302,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule mmb.InitMiniModule(world, host, itemID); } + public void PostInitialise() + { + + } + public void Close() { foreach (KeyValuePair pair in m_scripts) @@ -343,6 +320,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule get { return "MiniRegionModule"; } } + public bool IsSharedModule + { + get { return false; } + } + /// /// Stolen from ScriptEngine Common /// diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index 999756a93f..c653e98401 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs @@ -100,10 +100,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady if (!m_enabled) return; - scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; - scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; + m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; + m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; - scene = null; + m_scene = null; } public void Close() diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index df01938d5f..44c9ada221 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs @@ -58,7 +58,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms public void RemoveRegion(Scene scene) { - scene.UnregisterModuleInterface(this); } public void RegionLoaded(Scene scene) diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs index f2a0e53558..d18ac0a90c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs @@ -30,7 +30,6 @@ using System.Collections.Generic; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; @@ -50,8 +49,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule public string uri; } - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class XmlRpcGridRouter : INonSharedRegionModule, IXmlRpcRouter + public class XmlRpcGridRouter : IRegionModule, IXmlRpcRouter { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -61,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule private bool m_Enabled = false; private string m_ServerURI = String.Empty; - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { IConfig startupConfig = config.Configs["Startup"]; if (startupConfig == null) @@ -77,26 +75,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule return; } + scene.RegisterModuleInterface(this); m_Enabled = true; } } - public void AddRegion(Scene scene) + public void PostInitialise() { - scene.RegisterModuleInterface(this); - } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - - public Type ReplaceableInterface - { - get { return null; } } public void Close() @@ -108,6 +93,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule get { return "XmlRpcGridRouterModule"; } } + public bool IsSharedModule + { + get { return false; } + } + public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) { if (!m_Channels.ContainsKey(itemID)) diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs index 4d39345302..32659c8e5d 100644 --- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs @@ -29,7 +29,6 @@ using System; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; @@ -40,12 +39,11 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class XmlRpcRouter : INonSharedRegionModule, IXmlRpcRouter + public class XmlRpcRouter : IRegionModule, IXmlRpcRouter { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private bool m_enabled = false; - public void Initialise(IConfigSource config) + + public void Initialise(Scene scene, IConfigSource config) { IConfig startupConfig = config.Configs["Startup"]; if (startupConfig == null) @@ -54,25 +52,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule if (startupConfig.GetString("XmlRpcRouterModule", "XmlRpcRouterModule") == "XmlRpcRouterModule") { - m_enabled = true; + scene.RegisterModuleInterface(this); } } - public void AddRegion(Scene scene) - { - scene.RegisterModuleInterface(this); - } - public void RegionLoaded(Scene scene) - { - } - public void RemoveRegion(Scene scene) + public void PostInitialise() { - scene.UnregisterModuleInterface(this); - } - - public Type ReplaceableInterface - { - get { return null; } } public void Close() @@ -84,6 +69,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule get { return "XmlRpcRouterModule"; } } + public bool IsSharedModule + { + get { return false; } + } + public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) { scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri}); diff --git a/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs b/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs index 801f1f8f50..97fa63cb45 100644 --- a/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/ServiceConnectorsIn/Freeswitch/FreeswitchServiceInConnectorModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Freeswitch private IConfigSource m_Config; bool m_Registered = false; - #region ISharedRegionModule interface + #region IRegionModule interface public void Initialise(IConfigSource config) { diff --git a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs index fa5878d5c5..3490a8baef 100644 --- a/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs +++ b/OpenSim/Region/OptionalModules/SvnSerialiser/SvnBackupModule.cs @@ -31,7 +31,6 @@ using System.IO; using System.Reflection; using System.Timers; using log4net; -using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.CoreModules.World.Serialiser; @@ -43,8 +42,7 @@ using Slash = System.IO.Path; namespace OpenSim.Region.Modules.SvnSerialiser { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class SvnBackupModule : ISharedRegionModule + public class SvnBackupModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -202,9 +200,9 @@ namespace OpenSim.Region.Modules.SvnSerialiser #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { m_scenes = new List(); m_timer = new Timer(); @@ -227,10 +225,7 @@ namespace OpenSim.Region.Modules.SvnSerialiser catch (Exception) { } - } - public void AddRegion(Scene scene) - { lock (m_scenes) { m_scenes.Add(scene); @@ -241,18 +236,6 @@ namespace OpenSim.Region.Modules.SvnSerialiser scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - } - - public Type ReplaceableInterface - { - get { return null; } - } public void PostInitialise() { @@ -294,6 +277,11 @@ namespace OpenSim.Region.Modules.SvnSerialiser get { return "SvnBackupModule"; } } + public bool IsSharedModule + { + get { return true; } + } + #endregion private void EventManager_OnPluginConsole(string[] args) diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 521d01a7d4..ac39a532ae 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -25,11 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; using System.Collections.Generic; using System.Threading; using OpenMetaverse; -using Mono.Addins; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -39,8 +37,7 @@ using Timer=System.Timers.Timer; namespace OpenSim.Region.OptionalModules.World.NPC { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class NPCModule : ISharedRegionModule, INPCModule + public class NPCModule : IRegionModule, INPCModule { // private const bool m_enabled = false; @@ -137,13 +134,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC } - public void Initialise(IConfigSource source) + public void Initialise(Scene scene, IConfigSource source) { m_createMutex = new Mutex(false); m_timer = new Timer(500); m_timer.Elapsed += m_timer_Elapsed; m_timer.Start(); + + scene.RegisterModuleInterface(this); } void m_timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) @@ -174,19 +173,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC } } - public void AddRegion(Scene scene) - { - scene.RegisterModuleInterface(this); - } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - } - public void PostInitialise() { } @@ -200,9 +186,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC get { return "NPCModule"; } } - public Type ReplaceableInterface + public bool IsSharedModule { - get { return null; } - } + get { return true; } + } } } diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index b59d07adde..e3fbb6ee09 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs @@ -31,7 +31,6 @@ using System.Reflection; using System.Timers; using OpenMetaverse; using log4net; -using Mono.Addins; using Nini.Config; using OpenSim.Framework; using OpenSim.Region.CoreModules.Framework.InterfaceCommander; @@ -47,8 +46,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator /// /// Version 2.02 - Still hacky /// - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class TreePopulatorModule : INonSharedRegionModule, ICommandableModule, IVegetationModule + public class TreePopulatorModule : IRegionModule, ICommandableModule, IVegetationModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly Commander m_commander = new Commander("tree"); @@ -170,10 +168,15 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator #endregion - #region ISharedRegionModule Members + #region IRegionModule Members - public void Initialise(IConfigSource config) + public void Initialise(Scene scene, IConfigSource config) { + + m_scene = scene; + m_scene.RegisterModuleInterface(this); + m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; + // ini file settings try { @@ -193,18 +196,12 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator m_log.Debug("[TREES]: ini failure for update_rate - using default"); } + InstallCommands(); + m_log.Debug("[TREES]: Initialised tree module"); } - public void AddRegion(Scene scene) - { - m_scene = scene; - m_scene.RegisterModuleInterface(this); - m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole; - InstallCommands(); - } - - public void RegionLoaded(Scene scene) + public void PostInitialise() { ReloadCopse(); if (m_copse.Count > 0) @@ -214,17 +211,6 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator activeizeTreeze(true); } - public void RemoveRegion(Scene scene) - { - scene.UnregisterModuleInterface(this); - scene.EventManager.OnPluginConsole -= EventManager_OnPluginConsole; - } - - public Type ReplaceableInterface - { - get { return null; } - } - public void Close() { } @@ -234,6 +220,11 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator get { return "TreePopulatorModule"; } } + public bool IsSharedModule + { + get { return false; } + } + #endregion //-------------------------------------------------------------- diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs index 9b53d06bb9..a03cc4cf50 100644 --- a/OpenSim/Region/UserStatistics/WebStatsModule.cs +++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs @@ -34,7 +34,6 @@ using System.Reflection; using System.Text; using System.Threading; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -53,8 +52,7 @@ using OSDMap = OpenMetaverse.StructuredData.OSDMap; namespace OpenSim.Region.UserStatistics { - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class WebStatsModule : ISharedRegionModule + public class WebStatsModule : IRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -72,7 +70,7 @@ namespace OpenSim.Region.UserStatistics private string m_loglines = String.Empty; private volatile int lastHit = 12000; - public virtual void Initialise(IConfigSource config) + public virtual void Initialise(Scene scene, IConfigSource config) { IConfig cnfg; try @@ -84,17 +82,11 @@ namespace OpenSim.Region.UserStatistics { enabled = false; } - } - - public Type ReplaceableInterface - { - get { return null; } - } - - public void AddRegion(Scene scene) - { + if (!enabled) + { return; + } lock (m_scene) { @@ -138,7 +130,7 @@ namespace OpenSim.Region.UserStatistics MainServer.Instance.AddHTTPHandler("/SStats/", HandleStatsRequest); MainServer.Instance.AddHTTPHandler("/CAPS/VS/", HandleUnknownCAPSRequest); } - + m_scene.Add(scene); if (m_simstatsCounters.ContainsKey(scene.RegionInfo.RegionID)) m_simstatsCounters.Remove(scene.RegionInfo.RegionID); @@ -148,14 +140,6 @@ namespace OpenSim.Region.UserStatistics } } - public void RegionLoaded(Scene scene) - { - } - - public void RemoveRegion(Scene scene) - { - } - public void ReceiveClassicSimStatsPacket(SimStats stats) { if (!enabled) @@ -324,6 +308,11 @@ namespace OpenSim.Region.UserStatistics get { return "ViewerStatsModule"; } } + public bool IsSharedModule + { + get { return true; } + } + public void OnRegisterCaps(UUID agentID, Caps caps) { m_log.DebugFormat("[VC]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 20f2bca301..b13e8dd208 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -161,11 +161,10 @@ namespace OpenSim.Tests.Common.Setup capsModule.Initialise(new IniConfigSource()); testScene.AddRegionModule(capsModule.Name, capsModule); capsModule.AddRegion(testScene); - - INonSharedRegionModule godsModule = new GodsModule(); - godsModule.Initialise(new IniConfigSource()); - testScene.AddRegionModule(godsModule.Name, godsModule); - godsModule.AddRegion(testScene); + + IRegionModule godsModule = new GodsModule(); + godsModule.Initialise(testScene, new IniConfigSource()); + testScene.AddModule(godsModule.Name, godsModule); realServices = realServices.ToLower(); // IConfigSource config = new IniConfigSource(); From 536a6bac72b33220dc785e70dd703b02330f3812 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 29 Jan 2010 07:42:45 +0000 Subject: [PATCH 32/81] Resolve one more conflict I overlooked --- .../Scripting/WorldComm/WorldCommModule.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 93aa88c4de..60df2e7273 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -120,20 +120,6 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (maxlisteners < 1) maxlisteners = int.MaxValue; if (maxhandles < 1) maxhandles = int.MaxValue; -<<<<<<< HEAD:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs - m_listenerManager = new ListenerManager(maxlisteners, maxhandles); - m_pendingQ = new Queue(); - m_pending = Queue.Synchronized(m_pendingQ); - } - - public void PostInitialise() - { - } - - public void AddRegion(Scene scene) - { -======= ->>>>>>> ec3c31e... Updates all IRegionModules to the new style region modules.:OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs m_scene = scene; m_scene.RegisterModuleInterface(this); m_listenerManager = new ListenerManager(maxlisteners, maxhandles); From ae2174d8f526b225c3cccf551f1a9f01d6569203 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 18:11:53 +0000 Subject: [PATCH 33/81] Add method to get all items with the same name from a particular prim Extend load oar test to check loading of a sound item --- .../World/Archiver/Tests/ArchiverTests.cs | 9 +++---- .../Framework/Interfaces/IEntityInventory.cs | 13 +++++++++- .../Scenes/SceneObjectPartInventory.cs | 26 ++++++++++++++++++- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 1200105817..bf80a1cbb9 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -237,6 +237,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectGroup object1 = new SceneObjectGroup(part1); // Let's put some inventory items into our object + string soundItemName = "sound-item1"; UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); Type type = GetType(); Assembly assembly = type.Assembly; @@ -269,7 +270,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests asset1FileName = ArchiveConstants.ASSETS_PATH + soundUuid + ".wav"; */ - TaskInventoryItem item1 = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid }; + TaskInventoryItem item1 + = new TaskInventoryItem { AssetID = soundUuid, ItemID = soundItemUuid, Name = soundItemName }; part1.Inventory.AddInventoryItem(item1, true); } } @@ -305,14 +307,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That( object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); - // Need to implement a method to get the task inventory item by name (since the uuid will have changed on load) - /* - TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItem(soundItemUuid); + TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItems(soundItemName)[0]; Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); AssetBase loadedSoundAsset = scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); - */ // Temporary Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index eeb51024e9..fa9bf19dee 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs @@ -71,7 +71,8 @@ namespace OpenSim.Region.Framework.Interfaces /// /// Start all the scripts contained in this entity's inventory /// - void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); + void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); + ArrayList GetScriptErrors(UUID itemID); /// @@ -142,6 +143,16 @@ namespace OpenSim.Region.Framework.Interfaces /// null if the item does not exist TaskInventoryItem GetInventoryItem(UUID itemId); + /// + /// Get inventory items by name. + /// + /// + /// + /// A list of inventory items with that name. + /// If no inventory item has that name then an empty list is returned. + /// + IList GetInventoryItems(string name); + /// /// Update an existing inventory item. /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 5f132788e1..b37e1a29cf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -554,8 +554,32 @@ namespace OpenSim.Region.Framework.Scenes m_items.TryGetValue(itemId, out item); return item; - } + } + /// + /// Get inventory items by name. + /// + /// + /// + /// A list of inventory items with that name. + /// If no inventory item has that name then an empty list is returned. + /// + public IList GetInventoryItems(string name) + { + IList items = new List(); + + lock (m_items) + { + foreach (TaskInventoryItem item in m_items.Values) + { + if (item.Name == name) + items.Add(item); + } + } + + return items; + } + /// /// Update an existing inventory item. /// From 968b9e160d70568fbdea5b190d1386e9431316e3 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 20:36:13 +0000 Subject: [PATCH 34/81] improve locking of m_items in SceneObjectPartInventory --- .../Scenes/SceneObjectPartInventory.cs | 218 +++++++++++------- 1 file changed, 133 insertions(+), 85 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index b37e1a29cf..87c1a95197 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -44,6 +44,8 @@ namespace OpenSim.Region.Framework.Scenes { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + static System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + private string m_inventoryFileName = String.Empty; private int m_inventoryFileNameSerial = 0; @@ -270,8 +272,12 @@ namespace OpenSim.Region.Framework.Scenes if (stateSource == 1 && // Prim crossing m_part.ParentGroup.Scene.m_trustBinaries) { - m_items[item.ItemID].PermsMask = 0; - m_items[item.ItemID].PermsGranter = UUID.Zero; + lock (m_items) + { + m_items[item.ItemID].PermsMask = 0; + m_items[item.ItemID].PermsGranter = UUID.Zero; + } + m_part.ParentGroup.Scene.EventManager.TriggerRezScript( m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource); m_part.ParentGroup.AddActiveScriptCount(1); @@ -279,33 +285,38 @@ namespace OpenSim.Region.Framework.Scenes return; } - m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString(), this, delegate(string id, object sender, AssetBase asset) - { - if (null == asset) - { - m_log.ErrorFormat( - "[PRIM INVENTORY]: " + - "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", - item.Name, item.ItemID, m_part.AbsolutePosition, - m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); - } - else - { - if (m_part.ParentGroup.m_savedScriptState != null) - RestoreSavedScriptState(item.OldItemID, item.ItemID); - m_items[item.ItemID].PermsMask = 0; - m_items[item.ItemID].PermsGranter = UUID.Zero; - string script = Utils.BytesToString(asset.Data); - m_part.ParentGroup.Scene.EventManager.TriggerRezScript( - m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); - m_part.ParentGroup.AddActiveScriptCount(1); - m_part.ScheduleFullUpdate(); - } - }); - } - } + m_part.ParentGroup.Scene.AssetService.Get( + item.AssetID.ToString(), this, delegate(string id, object sender, AssetBase asset) + { + if (null == asset) + { + m_log.ErrorFormat( + "[PRIM INVENTORY]: " + + "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found", + item.Name, item.ItemID, m_part.AbsolutePosition, + m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); + } + else + { + if (m_part.ParentGroup.m_savedScriptState != null) + RestoreSavedScriptState(item.OldItemID, item.ItemID); - static System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + lock (m_items) + { + m_items[item.ItemID].PermsMask = 0; + m_items[item.ItemID].PermsGranter = UUID.Zero; + } + + string script = Utils.BytesToString(asset.Data); + m_part.ParentGroup.Scene.EventManager.TriggerRezScript( + m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); + m_part.ParentGroup.AddActiveScriptCount(1); + m_part.ScheduleFullUpdate(); + } + } + ); + } + } private void RestoreSavedScriptState(UUID oldID, UUID newID) { @@ -397,7 +408,15 @@ namespace OpenSim.Region.Framework.Scenes /// public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted) { - if (m_items.ContainsKey(itemId)) + bool scriptPresent = false; + + lock (m_items) + { + if (m_items.ContainsKey(itemId)) + scriptPresent = true; + } + + if (scriptPresent) { if (!sceneObjectBeingDeleted) m_part.RemoveScriptEvents(itemId); @@ -469,7 +488,13 @@ namespace OpenSim.Region.Framework.Scenes /// public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop) { - List il = new List(m_items.Values); + List il; + + lock (m_items) + { + il = new List(m_items.Values); + } + foreach (TaskInventoryItem i in il) { if (i.Name == item.Name) @@ -551,7 +576,9 @@ namespace OpenSim.Region.Framework.Scenes public TaskInventoryItem GetInventoryItem(UUID itemId) { TaskInventoryItem item; - m_items.TryGetValue(itemId, out item); + + lock (m_items) + m_items.TryGetValue(itemId, out item); return item; } @@ -877,54 +904,61 @@ namespace OpenSim.Region.Framework.Scenes { uint mask=0x7fffffff; - foreach (TaskInventoryItem item in m_items.Values) + lock (m_items) { - if (item.InvType != (int)InventoryType.Object) + foreach (TaskInventoryItem item in m_items.Values) { - if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) - mask &= ~((uint)PermissionMask.Copy >> 13); - if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0) - mask &= ~((uint)PermissionMask.Transfer >> 13); - if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) - mask &= ~((uint)PermissionMask.Modify >> 13); + if (item.InvType != (int)InventoryType.Object) + { + if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) + mask &= ~((uint)PermissionMask.Copy >> 13); + if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0) + mask &= ~((uint)PermissionMask.Transfer >> 13); + if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) + mask &= ~((uint)PermissionMask.Modify >> 13); + } + else + { + if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) + mask &= ~((uint)PermissionMask.Copy >> 13); + if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) + mask &= ~((uint)PermissionMask.Transfer >> 13); + if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) + mask &= ~((uint)PermissionMask.Modify >> 13); + } + + if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) + mask &= ~(uint)PermissionMask.Copy; + if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) + mask &= ~(uint)PermissionMask.Transfer; + if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0) + mask &= ~(uint)PermissionMask.Modify; } - else - { - if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) - mask &= ~((uint)PermissionMask.Copy >> 13); - if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) - mask &= ~((uint)PermissionMask.Transfer >> 13); - if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) - mask &= ~((uint)PermissionMask.Modify >> 13); - } - - if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) - mask &= ~(uint)PermissionMask.Copy; - if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) - mask &= ~(uint)PermissionMask.Transfer; - if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0) - mask &= ~(uint)PermissionMask.Modify; } + return mask; } public void ApplyNextOwnerPermissions() { - foreach (TaskInventoryItem item in m_items.Values) + lock (m_items) { - if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) + foreach (TaskInventoryItem item in m_items.Values) { - if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Copy; - if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; - if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Modify; - item.CurrentPermissions |= 8; + if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) + { + if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Copy; + if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; + if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Modify; + item.CurrentPermissions |= 8; + } + item.CurrentPermissions &= item.NextPermissions; + item.BasePermissions &= item.NextPermissions; + item.EveryonePermissions &= item.NextPermissions; } - item.CurrentPermissions &= item.NextPermissions; - item.BasePermissions &= item.NextPermissions; - item.EveryonePermissions &= item.NextPermissions; } m_part.TriggerScriptChangedEvent(Changed.OWNER); @@ -932,22 +966,29 @@ namespace OpenSim.Region.Framework.Scenes public void ApplyGodPermissions(uint perms) { - foreach (TaskInventoryItem item in m_items.Values) + lock (m_items) { - item.CurrentPermissions = perms; - item.BasePermissions = perms; + foreach (TaskInventoryItem item in m_items.Values) + { + item.CurrentPermissions = perms; + item.BasePermissions = perms; + } } } public bool ContainsScripts() { - foreach (TaskInventoryItem item in m_items.Values) + lock (m_items) { - if (item.InvType == (int)InventoryType.LSL) + foreach (TaskInventoryItem item in m_items.Values) { - return true; + if (item.InvType == (int)InventoryType.LSL) + { + return true; + } } } + return false; } @@ -955,8 +996,11 @@ namespace OpenSim.Region.Framework.Scenes { List ret = new List(); - foreach (TaskInventoryItem item in m_items.Values) - ret.Add(item.ItemID); + lock (m_items) + { + foreach (TaskInventoryItem item in m_items.Values) + ret.Add(item.ItemID); + } return ret; } @@ -969,26 +1013,30 @@ namespace OpenSim.Region.Framework.Scenes if (engines == null) // No engine at all return ret; - foreach (TaskInventoryItem item in m_items.Values) + lock (m_items) { - if (item.InvType == (int)InventoryType.LSL) + foreach (TaskInventoryItem item in m_items.Values) { - foreach (IScriptModule e in engines) + if (item.InvType == (int)InventoryType.LSL) { - if (e != null) + foreach (IScriptModule e in engines) { - string n = e.GetXMLState(item.ItemID); - if (n != String.Empty) + if (e != null) { - if (!ret.ContainsKey(item.ItemID)) - ret[item.ItemID] = n; - break; + string n = e.GetXMLState(item.ItemID); + if (n != String.Empty) + { + if (!ret.ContainsKey(item.ItemID)) + ret[item.ItemID] = n; + break; + } } } } } } + return ret; } } -} +} \ No newline at end of file From c1da07e4eb3510588e97f4652d72f875be51faa8 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 20:59:56 +0000 Subject: [PATCH 35/81] factor out scene setup in ArchiverTests --- .../World/Archiver/Tests/ArchiverTests.cs | 93 +++++++++++-------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index bf80a1cbb9..5a177b2266 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -42,6 +42,7 @@ using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; using OpenSim.Tests.Common.Setup; namespace OpenSim.Region.CoreModules.World.Archiver.Tests @@ -51,6 +52,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests { private Guid m_lastRequestId; private string m_lastErrorMessage; + + protected TestScene m_scene; + protected ArchiverModule m_archiverModule; + + [SetUp] + public void SetUp() + { + m_archiverModule = new ArchiverModule(); + SerialiserModule serialiserModule = new SerialiserModule(); + TerrainModule terrainModule = new TerrainModule(); + + m_scene = SceneSetupHelpers.SetupScene("scene1"); + SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); + } private void LoadCompleted(Guid requestId, string errorMessage) { @@ -75,6 +90,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } +// protected void AddSceneObject1() +// { +// string partName = "My Little Pony"; +// UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); +// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); +// Vector3 groupPosition = new Vector3(10, 20, 30); +// Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); +// Vector3 offsetPosition = new Vector3(5, 10, 15); +// +// part1 +// = new SceneObjectPart( +// ownerId, shape, groupPosition, rotationOffset, offsetPosition); +// part1.Name = partName; +// +// scene.AddNewSceneObject(new SceneObjectGroup(part1), false); +// } + /// /// Test saving a V0.2 OpenSim Region Archive. /// @@ -84,13 +116,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - ArchiverModule archiverModule = new ArchiverModule(); - SerialiserModule serialiserModule = new SerialiserModule(); - TerrainModule terrainModule = new TerrainModule(); - - Scene scene = SceneSetupHelpers.SetupScene("asset"); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - SceneObjectPart part1; // Create and add prim 1 @@ -107,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests ownerId, shape, groupPosition, rotationOffset, offsetPosition); part1.Name = partName; - scene.AddNewSceneObject(new SceneObjectGroup(part1), false); + m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); } SceneObjectPart part2; @@ -126,17 +151,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests ownerId, shape, groupPosition, rotationOffset, offsetPosition); part2.Name = partName; - scene.AddNewSceneObject(new SceneObjectGroup(part2), false); + m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); } MemoryStream archiveWriteStream = new MemoryStream(); - scene.EventManager.OnOarFileSaved += SaveCompleted; + m_scene.EventManager.OnOarFileSaved += SaveCompleted; Guid requestId = new Guid("00000000-0000-0000-0000-808080808080"); lock (this) { - archiverModule.ArchiveRegion(archiveWriteStream, requestId); + m_archiverModule.ArchiveRegion(archiveWriteStream, requestId); //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; //while (assetServer.HasWaitingRequests()) // assetServer.ProcessNextRequest(); @@ -224,11 +249,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); Vector3 offsetPosition = new Vector3(20, 25, 30); - SerialiserModule serialiserModule = new SerialiserModule(); - ArchiverModule archiverModule = new ArchiverModule(); - - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); +// SerialiserModule serialiserModule = new SerialiserModule(); +// ArchiverModule archiverModule = new ArchiverModule(); +// +// Scene scene = SceneSetupHelpers.SetupScene(); +// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneObjectPart part1 = new SceneObjectPart( @@ -276,7 +301,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } - scene.AddNewSceneObject(object1, false); + m_scene.AddNewSceneObject(object1, false); string object1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", @@ -291,13 +316,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests lock (this) { - scene.EventManager.OnOarFileLoaded += LoadCompleted; - archiverModule.DearchiveRegion(archiveReadStream); + m_scene.EventManager.OnOarFileLoaded += LoadCompleted; + m_archiverModule.DearchiveRegion(archiveReadStream); } Assert.That(m_lastErrorMessage, Is.Null); - SceneObjectPart object1PartLoaded = scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1PartLoaded = m_scene.GetSceneObjectPart(part1Name); Assert.That(object1PartLoaded, Is.Not.Null, "object1 was not loaded"); Assert.That(object1PartLoaded.Name, Is.EqualTo(part1Name), "object1 names not identical"); @@ -309,7 +334,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItems(soundItemName)[0]; Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); - AssetBase loadedSoundAsset = scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); + AssetBase loadedSoundAsset = m_scene.AssetService.Get(loadedSoundItem.AssetID.ToString()); Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null"); Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match"); @@ -324,12 +349,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests public void TestLoadOarV0_2RegionSettings() { TestHelper.InMethod(); - //log4net.Config.XmlConfigurator.Configure(); - - SerialiserModule serialiserModule = new SerialiserModule(); - ArchiverModule archiverModule = new ArchiverModule(); - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); + //log4net.Config.XmlConfigurator.Configure(); MemoryStream archiveWriteStream = new MemoryStream(); TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); @@ -376,12 +396,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests lock (this) { - scene.EventManager.OnOarFileLoaded += LoadCompleted; - archiverModule.DearchiveRegion(archiveReadStream); + m_scene.EventManager.OnOarFileLoaded += LoadCompleted; + m_archiverModule.DearchiveRegion(archiveReadStream); } Assert.That(m_lastErrorMessage, Is.Null); - RegionSettings loadedRs = scene.RegionInfo.RegionSettings; + RegionSettings loadedRs = m_scene.RegionInfo.RegionSettings; Assert.That(loadedRs.AgentLimit, Is.EqualTo(17)); Assert.That(loadedRs.AllowDamage, Is.True); @@ -433,27 +453,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests // Create an oar file that we can use for the merge { - ArchiverModule archiverModule = new ArchiverModule(); - SerialiserModule serialiserModule = new SerialiserModule(); - TerrainModule terrainModule = new TerrainModule(); - - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - SceneObjectPart part2 = new SceneObjectPart( UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); part2.Name = part2Name; SceneObjectGroup object2 = new SceneObjectGroup(part2); - scene.AddNewSceneObject(object2, false); + m_scene.AddNewSceneObject(object2, false); // Write out this scene - scene.EventManager.OnOarFileSaved += SaveCompleted; + m_scene.EventManager.OnOarFileSaved += SaveCompleted; lock (this) { - archiverModule.ArchiveRegion(archiveWriteStream); + m_archiverModule.ArchiveRegion(archiveWriteStream); Monitor.Wait(this, 60000); } } From 115e66218eaa6ca4fed8b754765e4c289c24a207 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 21:10:14 +0000 Subject: [PATCH 36/81] refactor out scene object 1 creation n ArchiverTetss --- .../World/Archiver/Tests/ArchiverTests.cs | 66 +++++++------------ 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 5a177b2266..b4af8a612a 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -55,6 +55,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests protected TestScene m_scene; protected ArchiverModule m_archiverModule; + + protected SceneObjectPart m_part1; [SetUp] public void SetUp() @@ -90,22 +92,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } -// protected void AddSceneObject1() -// { -// string partName = "My Little Pony"; -// UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); -// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); -// Vector3 groupPosition = new Vector3(10, 20, 30); -// Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); -// Vector3 offsetPosition = new Vector3(5, 10, 15); -// -// part1 -// = new SceneObjectPart( -// ownerId, shape, groupPosition, rotationOffset, offsetPosition); -// part1.Name = partName; -// -// scene.AddNewSceneObject(new SceneObjectGroup(part1), false); -// } + protected void AddSceneObject1() + { + string partName = "My Little Pony"; + UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); + PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); + Vector3 groupPosition = new Vector3(10, 20, 30); + Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); + Vector3 offsetPosition = new Vector3(5, 10, 15); + + m_part1 + = new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; + + m_scene.AddNewSceneObject(new SceneObjectGroup(m_part1), false); + } /// /// Test saving a V0.2 OpenSim Region Archive. @@ -116,24 +116,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - SceneObjectPart part1; - - // Create and add prim 1 - { - string partName = "My Little Pony"; - UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); - PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); - Vector3 groupPosition = new Vector3(10, 20, 30); - Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); - Vector3 offsetPosition = new Vector3(5, 10, 15); - - part1 - = new SceneObjectPart( - ownerId, shape, groupPosition, rotationOffset, offsetPosition); - part1.Name = partName; - - m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); - } + AddSceneObject1(); SceneObjectPart part2; @@ -180,9 +163,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests bool gotObject2File = false; string expectedObject1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", - part1.Name, - Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), - part1.UUID); + m_part1.Name, + Math.Round(m_part1.GroupPosition.X), Math.Round(m_part1.GroupPosition.Y), Math.Round(m_part1.GroupPosition.Z), + m_part1.UUID); string expectedObject2FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", part2.Name, @@ -202,7 +185,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests { string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length); - if (fileName.StartsWith(part1.Name)) + if (fileName.StartsWith(m_part1.Name)) { Assert.That(fileName, Is.EqualTo(expectedObject1FileName)); gotObject1File = true; @@ -243,18 +226,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); + AddSceneObject1(); string part1Name = "object1"; PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); Vector3 groupPosition = new Vector3(90, 80, 70); Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); Vector3 offsetPosition = new Vector3(20, 25, 30); -// SerialiserModule serialiserModule = new SerialiserModule(); -// ArchiverModule archiverModule = new ArchiverModule(); -// -// Scene scene = SceneSetupHelpers.SetupScene(); -// SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); - SceneObjectPart part1 = new SceneObjectPart( UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); From 75dcd721de7aec4e43d091724ac883b1d945aae2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 21:27:14 +0000 Subject: [PATCH 37/81] use common part1 creation in ArchiverTests.TestLoadOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index b4af8a612a..a0958d1e33 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -55,8 +55,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests protected TestScene m_scene; protected ArchiverModule m_archiverModule; - - protected SceneObjectPart m_part1; [SetUp] public void SetUp() @@ -92,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } } - protected void AddSceneObject1() + protected SceneObjectPart CreateSceneObjectPart1() { string partName = "My Little Pony"; UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000015"); @@ -101,10 +99,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); Vector3 offsetPosition = new Vector3(5, 10, 15); - m_part1 - = new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; - - m_scene.AddNewSceneObject(new SceneObjectGroup(m_part1), false); + return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; } /// @@ -116,7 +111,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - AddSceneObject1(); + SceneObjectPart part1 = CreateSceneObjectPart1(); + m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); SceneObjectPart part2; @@ -163,9 +159,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests bool gotObject2File = false; string expectedObject1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", - m_part1.Name, - Math.Round(m_part1.GroupPosition.X), Math.Round(m_part1.GroupPosition.Y), Math.Round(m_part1.GroupPosition.Z), - m_part1.UUID); + part1.Name, + Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), + part1.UUID); string expectedObject2FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", part2.Name, @@ -185,7 +181,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests { string fileName = filePath.Remove(0, ArchiveConstants.OBJECTS_PATH.Length); - if (fileName.StartsWith(m_part1.Name)) + if (fileName.StartsWith(part1.Name)) { Assert.That(fileName, Is.EqualTo(expectedObject1FileName)); gotObject1File = true; @@ -226,19 +222,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); - AddSceneObject1(); - string part1Name = "object1"; - PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 groupPosition = new Vector3(90, 80, 70); - Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); - Vector3 offsetPosition = new Vector3(20, 25, 30); - - SceneObjectPart part1 - = new SceneObjectPart( - UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); - part1.Name = part1Name; + SceneObjectPart part1 = CreateSceneObjectPart1(); SceneObjectGroup object1 = new SceneObjectGroup(part1); +// string part1Name = "object1"; +// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); +// Vector3 groupPosition = new Vector3(90, 80, 70); +// Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); +// Vector3 offsetPosition = new Vector3(20, 25, 30); +// +// SceneObjectPart part1 +// = new SceneObjectPart( +// UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); +// part1.Name = part1Name; +// SceneObjectGroup object1 = new SceneObjectGroup(part1); + // Let's put some inventory items into our object string soundItemName = "sound-item1"; UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); @@ -283,8 +281,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests string object1FileName = string.Format( "{0}_{1:000}-{2:000}-{3:000}__{4}.xml", - part1Name, - Math.Round(groupPosition.X), Math.Round(groupPosition.Y), Math.Round(groupPosition.Z), + part1.Name, + Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), part1.UUID); tar.WriteFile(ArchiveConstants.OBJECTS_PATH + object1FileName, SceneObjectSerializer.ToXml2Format(object1)); @@ -300,15 +298,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That(m_lastErrorMessage, Is.Null); - SceneObjectPart object1PartLoaded = m_scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1PartLoaded = m_scene.GetSceneObjectPart(part1.Name); Assert.That(object1PartLoaded, Is.Not.Null, "object1 was not loaded"); - Assert.That(object1PartLoaded.Name, Is.EqualTo(part1Name), "object1 names not identical"); - Assert.That(object1PartLoaded.GroupPosition, Is.EqualTo(groupPosition), "object1 group position not equal"); + Assert.That(object1PartLoaded.Name, Is.EqualTo(part1.Name), "object1 names not identical"); + Assert.That(object1PartLoaded.GroupPosition, Is.EqualTo(part1.GroupPosition), "object1 group position not equal"); Assert.That( - object1PartLoaded.RotationOffset, Is.EqualTo(rotationOffset), "object1 rotation offset not equal"); + object1PartLoaded.RotationOffset, Is.EqualTo(part1.RotationOffset), "object1 rotation offset not equal"); Assert.That( - object1PartLoaded.OffsetPosition, Is.EqualTo(offsetPosition), "object1 offset position not equal"); + object1PartLoaded.OffsetPosition, Is.EqualTo(part1.OffsetPosition), "object1 offset position not equal"); TaskInventoryItem loadedSoundItem = object1PartLoaded.Inventory.GetInventoryItems(soundItemName)[0]; Assert.That(loadedSoundItem, Is.Not.Null, "loaded sound item was null"); From 055d991cc12f8c3720b41ffc314d95b8dbd7ce1a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 21:33:11 +0000 Subject: [PATCH 38/81] minor: swap which part uses the automatically set up scene in TestMergeOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index a0958d1e33..930ea1ca8b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -225,18 +225,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectPart part1 = CreateSceneObjectPart1(); SceneObjectGroup object1 = new SceneObjectGroup(part1); -// string part1Name = "object1"; -// PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); -// Vector3 groupPosition = new Vector3(90, 80, 70); -// Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); -// Vector3 offsetPosition = new Vector3(20, 25, 30); -// -// SceneObjectPart part1 -// = new SceneObjectPart( -// UUID.Zero, shape, groupPosition, rotationOffset, offsetPosition); -// part1.Name = part1Name; -// SceneObjectGroup object1 = new SceneObjectGroup(part1); - // Let's put some inventory items into our object string soundItemName = "sound-item1"; UUID soundItemUuid = UUID.Parse("00000000-0000-0000-0000-000000000002"); @@ -429,16 +417,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests // Create an oar file that we can use for the merge { + ArchiverModule archiverModule = new ArchiverModule(); + SerialiserModule serialiserModule = new SerialiserModule(); + TerrainModule terrainModule = new TerrainModule(); + + Scene scene = SceneSetupHelpers.SetupScene(); + SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); + SceneObjectPart part2 = new SceneObjectPart( UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); part2.Name = part2Name; SceneObjectGroup object2 = new SceneObjectGroup(part2); - m_scene.AddNewSceneObject(object2, false); + scene.AddNewSceneObject(object2, false); // Write out this scene - m_scene.EventManager.OnOarFileSaved += SaveCompleted; + scene.EventManager.OnOarFileSaved += SaveCompleted; lock (this) { @@ -448,13 +443,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } { - ArchiverModule archiverModule = new ArchiverModule(); - SerialiserModule serialiserModule = new SerialiserModule(); - TerrainModule terrainModule = new TerrainModule(); - - Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - string part1Name = "objectExisting"; PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder(); Vector3 part1GroupPosition = new Vector3(80, 70, 60); @@ -467,20 +455,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests part1.Name = part1Name; SceneObjectGroup object1 = new SceneObjectGroup(part1); - scene.AddNewSceneObject(object1, false); + m_scene.AddNewSceneObject(object1, false); // Merge in the archive we created earlier byte[] archive = archiveWriteStream.ToArray(); MemoryStream archiveReadStream = new MemoryStream(archive); - archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty); + m_archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty); - SceneObjectPart object1Existing = scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1Name); Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge"); Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge"); Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge"); - SceneObjectPart object2PartMerged = scene.GetSceneObjectPart(part2Name); + SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2Name); Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge"); Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge"); From 0c3043a298070b95dd782a9193b9c245aa7894ee Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 21:37:25 +0000 Subject: [PATCH 39/81] use common part1 createio nin TestMergeOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 930ea1ca8b..dea8a45eb4 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -443,19 +443,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } { - string part1Name = "objectExisting"; - PrimitiveBaseShape part1Shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 part1GroupPosition = new Vector3(80, 70, 60); - Quaternion part1RotationOffset = new Quaternion(50, 60, 70, 80); - Vector3 part1OffsetPosition = new Vector3(15, 20, 25); - - SceneObjectPart part1 - = new SceneObjectPart( - UUID.Zero, part1Shape, part1GroupPosition, part1RotationOffset, part1OffsetPosition); - part1.Name = part1Name; - SceneObjectGroup object1 = new SceneObjectGroup(part1); - - m_scene.AddNewSceneObject(object1, false); + SceneObjectPart part1 = CreateSceneObjectPart1(); + m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); // Merge in the archive we created earlier byte[] archive = archiveWriteStream.ToArray(); @@ -463,10 +452,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_archiverModule.DearchiveRegion(archiveReadStream, true, Guid.Empty); - SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1Name); + SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name); Assert.That(object1Existing, Is.Not.Null, "object1 was not present after merge"); - Assert.That(object1Existing.Name, Is.EqualTo(part1Name), "object1 names not identical after merge"); - Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1GroupPosition), "object1 group position not equal after merge"); + Assert.That(object1Existing.Name, Is.EqualTo(part1.Name), "object1 names not identical after merge"); + Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1.GroupPosition), "object1 group position not equal after merge"); SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2Name); Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); From 68c7218fa1557a8e00c3f74829b91a5b43d94069 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 21:42:27 +0000 Subject: [PATCH 40/81] make TestSaveOarV0_2() use a common part2 construction --- .../World/Archiver/Tests/ArchiverTests.cs | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index dea8a45eb4..ae4aece7b9 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -102,6 +102,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; } + protected SceneObjectPart CreateSceneObjectPart2() + { + string partName = "Action Man"; + UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000016"); + PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); + Vector3 groupPosition = new Vector3(90, 80, 70); + Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); + Vector3 offsetPosition = new Vector3(20, 25, 30); + + return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; + } + /// /// Test saving a V0.2 OpenSim Region Archive. /// @@ -114,24 +126,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectPart part1 = CreateSceneObjectPart1(); m_scene.AddNewSceneObject(new SceneObjectGroup(part1), false); - SceneObjectPart part2; - - // Create and add prim 2 - { - string partName = "Action Man"; - UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000016"); - PrimitiveBaseShape shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 groupPosition = new Vector3(90, 80, 70); - Quaternion rotationOffset = new Quaternion(60, 70, 80, 90); - Vector3 offsetPosition = new Vector3(20, 25, 30); - - part2 - = new SceneObjectPart( - ownerId, shape, groupPosition, rotationOffset, offsetPosition); - part2.Name = partName; - - m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); - } + SceneObjectPart part2 = CreateSceneObjectPart2(); + m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); MemoryStream archiveWriteStream = new MemoryStream(); m_scene.EventManager.OnOarFileSaved += SaveCompleted; From 0cf88b34c9690a5c3d1d9983b59abed3b1e67911 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 21:45:07 +0000 Subject: [PATCH 41/81] use common sop2 setup for TestMergeOarV0_2() --- .../World/Archiver/Tests/ArchiverTests.cs | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index ae4aece7b9..c3e57f0574 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -405,11 +405,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests MemoryStream archiveWriteStream = new MemoryStream(); - string part2Name = "objectMerge"; - PrimitiveBaseShape part2Shape = PrimitiveBaseShape.CreateCylinder(); - Vector3 part2GroupPosition = new Vector3(90, 80, 70); - Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); - Vector3 part2OffsetPosition = new Vector3(20, 25, 30); +// string part2Name = "objectMerge"; +// PrimitiveBaseShape part2Shape = PrimitiveBaseShape.CreateCylinder(); +// Vector3 part2GroupPosition = new Vector3(90, 80, 70); +// Quaternion part2RotationOffset = new Quaternion(60, 70, 80, 90); +// Vector3 part2OffsetPosition = new Vector3(20, 25, 30); + + SceneObjectPart part2 = CreateSceneObjectPart2(); // Create an oar file that we can use for the merge { @@ -418,15 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TerrainModule terrainModule = new TerrainModule(); Scene scene = SceneSetupHelpers.SetupScene(); - SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - - SceneObjectPart part2 - = new SceneObjectPart( - UUID.Zero, part2Shape, part2GroupPosition, part2RotationOffset, part2OffsetPosition); - part2.Name = part2Name; - SceneObjectGroup object2 = new SceneObjectGroup(part2); + SceneSetupHelpers.SetupSceneModules(scene, archiverModule, serialiserModule, terrainModule); - scene.AddNewSceneObject(object2, false); + m_scene.AddNewSceneObject(new SceneObjectGroup(part2), false); // Write out this scene scene.EventManager.OnOarFileSaved += SaveCompleted; @@ -453,10 +449,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.That(object1Existing.Name, Is.EqualTo(part1.Name), "object1 names not identical after merge"); Assert.That(object1Existing.GroupPosition, Is.EqualTo(part1.GroupPosition), "object1 group position not equal after merge"); - SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2Name); + SceneObjectPart object2PartMerged = m_scene.GetSceneObjectPart(part2.Name); Assert.That(object2PartMerged, Is.Not.Null, "object2 was not present after merge"); - Assert.That(object2PartMerged.Name, Is.EqualTo(part2Name), "object2 names not identical after merge"); - Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2GroupPosition), "object2 group position not equal after merge"); + Assert.That(object2PartMerged.Name, Is.EqualTo(part2.Name), "object2 names not identical after merge"); + Assert.That(object2PartMerged.GroupPosition, Is.EqualTo(part2.GroupPosition), "object2 group position not equal after merge"); } } } From 7b53067d6d503fd3d94a4a0ab3955071ef96669c Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 21:52:13 +0000 Subject: [PATCH 42/81] Apply http://opensimulator.org/mantis/view.php?id=4548 Fix command params check on fcache expire Thanks coyled --- OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index adcf6bd4f0..9216e0b410 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -762,7 +762,7 @@ namespace Flotsam.RegionModules.AssetCache case "expire": - if (cmdparams.Length >= 3) + if (cmdparams.Length < 3) { m_log.InfoFormat("[FLOTSAM ASSET CACHE] Invalid parameters for Expire, please specify a valid date & time", cmd); break; From 05a3e37b853fc870b83eb67b47bc70eb724f652e Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 23:12:08 +0000 Subject: [PATCH 43/81] Apply http://opensimulator.org/mantis/view.php?id=3334 Send continuous touch() events if the left mouse button is held down while moving over an object This conforms with Linden Lab practice Thanks Revolution --- .../Region/Framework/Scenes/EventManager.cs | 11 +++++ .../Framework/Scenes/Scene.PacketHandlers.cs | 40 +++++++++++++++++++ OpenSim/Region/Framework/Scenes/Scene.cs | 1 + .../ScriptEngine/XEngine/EventManager.cs | 7 +++- 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 399379ea2c..004ea1f87f 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -104,6 +104,7 @@ namespace OpenSim.Region.Framework.Scenes public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; public event ObjectGrabDelegate OnObjectGrab; + public event ObjectGrabDelegate OnObjectGrabbing; public event ObjectDeGrabDelegate OnObjectDeGrab; public event ScriptResetDelegate OnScriptReset; @@ -408,6 +409,7 @@ namespace OpenSim.Region.Framework.Scenes private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd; private OnShutdownDelegate handlerShutdown = null; //OnShutdown; private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab; + private ObjectGrabDelegate handlerObjectGrabbing = null; //OnObjectGrabbing; private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab; private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset private NewRezScript handlerRezScript = null; //OnRezScript; @@ -620,6 +622,15 @@ namespace OpenSim.Region.Framework.Scenes } } + public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) + { + handlerObjectGrabbing = OnObjectGrabbing; + if (handlerObjectGrabbing != null) + { + handlerObjectGrabbing(localID, originalID, offsetPos, remoteClient, surfaceArgs); + } + } + public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) { handlerObjectDeGrab = OnObjectDeGrab; diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 47fbeb45db..ac04dc795b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -292,6 +292,46 @@ namespace OpenSim.Region.Framework.Scenes } } + public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List surfaceArgs) + { + List EntityList = GetEntities(); + + SurfaceTouchEventArgs surfaceArg = null; + if (surfaceArgs != null && surfaceArgs.Count > 0) + surfaceArg = surfaceArgs[0]; + + foreach (EntityBase ent in EntityList) + { + if (ent is SceneObjectGroup) + { + SceneObjectGroup obj = ent as SceneObjectGroup; + if (obj != null) + { + // Is this prim part of the group + if (obj.HasChildPrim(objectID)) + { + SceneObjectPart part = obj.GetChildPart(objectID); + + // If the touched prim handles touches, deliver it + // If not, deliver to root prim + if ((part.ScriptEvents & scriptEvents.touch) != 0) + EventManager.TriggerObjectGrabbing(part.LocalId, 0, part.OffsetPosition, remoteClient, surfaceArg); + // Deliver to the root prim if the touched prim doesn't handle touches + // or if we're meant to pass on touches anyway. Don't send to root prim + // if prim touched is the root prim as we just did it + if (((part.ScriptEvents & scriptEvents.touch) == 0) || + (part.PassTouches && (part.LocalId != obj.RootPart.LocalId))) + { + EventManager.TriggerObjectGrabbing(obj.RootPart.LocalId, part.LocalId, part.OffsetPosition, remoteClient, surfaceArg); + } + + return; + } + } + } + } + } + public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List surfaceArgs) { List EntityList = GetEntities(); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 4da05cf3c1..73b0b3e2e9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2675,6 +2675,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; client.OnObjectPermissions += HandleObjectPermissionsUpdate; client.OnGrabObject += ProcessObjectGrab; + client.OnGrabUpdate += ProcessObjectGrabUpdate; client.OnDeGrabObject += ProcessObjectDeGrab; client.OnUndo += m_sceneGraph.HandleUndo; client.OnObjectDescription += m_sceneGraph.PrimDescription; diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 16309efca4..09b79d07f2 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -55,6 +55,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_log.Info("[XEngine] Hooking up to server events"); myScriptEngine.World.EventManager.OnAttach += attach; myScriptEngine.World.EventManager.OnObjectGrab += touch_start; + myScriptEngine.World.EventManager.OnObjectGrabbing += touch; myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end; myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; @@ -148,7 +149,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine } public void touch(uint localID, uint originalID, Vector3 offsetPos, - IClientAPI remoteClient) + IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) { // Add to queue for all scripts in ObjectID object DetectParams[] det = new DetectParams[1]; @@ -172,6 +173,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID); det[0].LinkNum = originalPart.LinkNum; } + if (surfaceArgs != null) + { + det[0].SurfaceTouchArgs = surfaceArgs; + } myScriptEngine.PostObjectEvent(localID, new EventParams( "touch", new Object[] { new LSL_Types.LSLInteger(1) }, From 627df50646b9271ca7bcde6b05671db61b92913f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 29 Jan 2010 23:38:44 +0000 Subject: [PATCH 44/81] Apply http://opensimulator.org/mantis/view.php?id=4504 Stop the REST console crashing when entering return on an empty line Thanks BlueWall --- OpenSim/ConsoleClient/ConsoleClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/ConsoleClient/ConsoleClient.cs b/OpenSim/ConsoleClient/ConsoleClient.cs index d195d25296..8c616e0271 100644 --- a/OpenSim/ConsoleClient/ConsoleClient.cs +++ b/OpenSim/ConsoleClient/ConsoleClient.cs @@ -82,9 +82,11 @@ namespace OpenSim.ConsoleClient private static void SendCommand(string module, string[] cmd) { - string sendCmd = cmd[0]; + string sendCmd = ""; if (cmd.Length > 1) { + sendCmd = cmd[0]; + Array.Copy(cmd, 1, cmd, 0, cmd.Length-1); Array.Resize(ref cmd, cmd.Length-1); sendCmd += "\"" + String.Join("\" \"", cmd) + "\""; From 4c1365f1496b2c60c313b6d221362d3e09a8c1d4 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 30 Jan 2010 00:15:37 +0000 Subject: [PATCH 45/81] apply http://opensimulator.org/mantis/view.php?id=4486 fix compilation of mrm scripts using microthreaded parmeter Thanks ziah --- .../Region/OptionalModules/Scripting/Minimodule/MRMModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index 4521f8ef6a..f2adcb74c2 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -116,7 +116,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule static string ConvertMRMKeywords(string script) { - script = script.Replace("microthreaded void ", "IEnumerable"); + script = script.Replace("microthreaded void", "IEnumerable"); script = script.Replace("relax;", "yield return null;"); return script; From 53a01dc42273b9252eb290187e87a47a898af86a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 1 Feb 2010 20:06:43 +0000 Subject: [PATCH 46/81] Don't try to start attachment scripts or send updates if the attachment itself has been unsuccessful --- .../Framework/Scenes/Scene.Inventory.cs | 14 +++- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 77 +++++++++++++------ 2 files changed, 64 insertions(+), 27 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 11754eaca8..7df3e50792 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2376,9 +2376,19 @@ namespace OpenSim.Region.Framework.Scenes } } - public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent) + /// + /// Attach an object. + /// + /// + /// + /// + /// + /// + /// + /// true if the object was successfully attached, false otherwise + public bool AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent) { - m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); + return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); } public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index f74fd5d93f..fc2798d7ab 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -478,46 +478,59 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) return; - if (!m_parentScene.Permissions.CanTakeObject( - part.UUID, remoteClient.AgentId)) + if (!m_parentScene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) return; // Calls attach with a Zero position - AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false); - m_parentScene.SendAttachEvent(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); - - // Save avatar attachment information - ScenePresence presence; - if (m_parentScene.AvatarFactory != null && m_parentScene.TryGetAvatar(remoteClient.AgentId, out presence)) + if (AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false)) { - m_log.Info("[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", AttachmentPoint: " + AttachmentPt); - m_parentScene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); + m_parentScene.SendAttachEvent(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); + + // Save avatar attachment information + ScenePresence presence; + if (m_parentScene.AvatarFactory != null && m_parentScene.TryGetAvatar(remoteClient.AgentId, out presence)) + { + m_log.Info( + "[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + + ", AttachmentPoint: " + AttachmentPt); + + m_parentScene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); + } } } - public SceneObjectGroup RezSingleAttachment( - IClientAPI remoteClient, UUID itemID, uint AttachmentPt) + /// + /// Rez an attachment + /// + /// + /// + /// + /// The scene object that was attached. Null if the scene object could not be found + public SceneObjectGroup RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) { SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, false, false, remoteClient.AgentId, true); - if (objatt != null) { bool tainted = false; if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) tainted = true; - AttachObject(remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false); - objatt.ScheduleGroupForFullUpdate(); - if (tainted) - objatt.HasGroupChanged = true; - - // Fire after attach, so we don't get messy perms dialogs - // 3 == AttachedRez - objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3); + if (AttachObject( + remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false)) + { + objatt.ScheduleGroupForFullUpdate(); + if (tainted) + objatt.HasGroupChanged = true; + + // Fire after attach, so we don't get messy perms dialogs + // 3 == AttachedRez + objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3); + } } + return objatt; } @@ -554,7 +567,17 @@ namespace OpenSim.Region.Framework.Scenes } } - protected internal void AttachObject( + /// + /// Attach a scene object to an avatar. + /// + /// + /// + /// + /// + /// + /// + /// true if the attachment was successful, false otherwise + protected internal bool AttachObject( IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, Vector3 attachPos, bool silent) { SceneObjectGroup group = GetGroupByPrim(objectLocalID); @@ -583,10 +606,8 @@ namespace OpenSim.Region.Framework.Scenes // Stick it on left hand with Zero Offset from the attachment point. AttachmentPt = (uint)AttachmentPoint.LeftHand; attachPos = Vector3.Zero; - } - group.SetAttachmentPoint((byte)AttachmentPt); group.AbsolutePosition = attachPos; @@ -609,15 +630,21 @@ namespace OpenSim.Region.Framework.Scenes // it get cleaned up // group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); - group.HasGroupChanged = false; + group.HasGroupChanged = false; } else { remoteClient.SendAgentAlertMessage("You don't have sufficient permissions to attach this object", false); + return false; } } else + { m_log.DebugFormat("[SCENE GRAPH]: AttachObject found no such scene object {0}", objectLocalID); + return false; + } + + return true; } protected internal ScenePresence CreateAndAddChildScenePresence(IClientAPI client, AvatarAppearance appearance) From 4c1740f7d8e4e577167a84438cce83a7cc32f56d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 1 Feb 2010 20:15:36 +0000 Subject: [PATCH 47/81] Actually make EventManager.OnAttach() fire when an object is attached. Previously, only detach was firing! --- OpenSim/Region/Framework/Scenes/EventManager.cs | 5 +++-- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 004ea1f87f..464ead8279 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -313,9 +313,10 @@ namespace OpenSim.Region.Framework.Scenes public event EmptyScriptCompileQueue OnEmptyScriptCompileQueue; /// - /// Called whenever an object is attached, or detached - /// from an in-world presence. + /// Called whenever an object is attached, or detached from an in-world presence. /// + /// If the object is being attached, then the avatarID will be present. If the object is being detached then + /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical). public delegate void Attach(uint localID, UUID itemID, UUID avatarID); public event Attach OnAttach; diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index fc2798d7ab..1ac061a1b2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -528,6 +528,9 @@ namespace OpenSim.Region.Framework.Scenes // Fire after attach, so we don't get messy perms dialogs // 3 == AttachedRez objatt.CreateScriptInstances(0, true, m_parentScene.DefaultScriptEngine, 3); + + // Do this last so that event listeners have access to all the effects of the attachment + m_parentScene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); } } From 3863cd1d2395fb87489ed4e544fc33048c81761c Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 1 Feb 2010 21:35:05 +0000 Subject: [PATCH 48/81] Copy prim face color setting code from LSL_Api down into SOP so that non-LSL callers can use it --- .../Framework/Scenes/SceneObjectPart.cs | 192 ++++++++++++++++++ .../Shared/Api/Implementation/LSL_Api.cs | 1 - 2 files changed, 192 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a5296eb1fd..8b5c348d18 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -90,10 +90,27 @@ namespace OpenSim.Region.Framework.Scenes SCALE = 0x40 } + public enum PrimType : int + { + BOX = 0, + CYLINDER = 1, + PRISM = 2, + SPHERE = 3, + TORUS = 4, + TUBE = 5, + RING = 6, + SCULPT = 7 + } + #endregion Enumerations public class SceneObjectPart : IScriptHost { + /// + /// Denote all sides of the prim + /// + public const int ALL_SIDES = -1; + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // use only one serializer to give the runtime a chance to optimize it (it won't do that if you @@ -737,6 +754,9 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Text color. + /// public Color Color { get { return m_color; } @@ -2955,6 +2975,178 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Set the color of prim faces + /// + /// + /// + public void SetFaceColor(Vector3 color, int face) + { + Primitive.TextureEntry tex = Shape.Textures; + Color4 texcolor; + if (face >= 0 && face < GetNumberOfSides()) + { + texcolor = tex.CreateFace((uint)face).RGBA; + texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); + texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); + texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); + tex.FaceTextures[face].RGBA = texcolor; + UpdateTexture(tex); + return; + } + else if (face == ALL_SIDES) + { + for (uint i = 0; i < GetNumberOfSides(); i++) + { + if (tex.FaceTextures[i] != null) + { + texcolor = tex.FaceTextures[i].RGBA; + texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); + texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); + texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); + tex.FaceTextures[i].RGBA = texcolor; + } + texcolor = tex.DefaultTexture.RGBA; + texcolor.R = Util.Clip((float)color.X, 0.0f, 1.0f); + texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); + texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); + tex.DefaultTexture.RGBA = texcolor; + } + UpdateTexture(tex); + return; + } + } + + /// + /// Get the number of sides that this part has. + /// + /// + public int GetNumberOfSides() + { + int ret = 0; + bool hasCut; + bool hasHollow; + bool hasDimple; + bool hasProfileCut; + + PrimType primType = getScriptPrimType(); + hasCutHollowDimpleProfileCut(primType, Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut); + + switch (primType) + { + case PrimType.BOX: + ret = 6; + if (hasCut) ret += 2; + if (hasHollow) ret += 1; + break; + case PrimType.CYLINDER: + ret = 3; + if (hasCut) ret += 2; + if (hasHollow) ret += 1; + break; + case PrimType.PRISM: + ret = 5; + if (hasCut) ret += 2; + if (hasHollow) ret += 1; + break; + case PrimType.SPHERE: + ret = 1; + if (hasCut) ret += 2; + if (hasDimple) ret += 2; + if (hasHollow) ret += 3; // Emulate lsl on secondlife (according to documentation it should have added only +1) + break; + case PrimType.TORUS: + ret = 1; + if (hasCut) ret += 2; + if (hasProfileCut) ret += 2; + if (hasHollow) ret += 1; + break; + case PrimType.TUBE: + ret = 4; + if (hasCut) ret += 2; + if (hasProfileCut) ret += 2; + if (hasHollow) ret += 1; + break; + case PrimType.RING: + ret = 3; + if (hasCut) ret += 2; + if (hasProfileCut) ret += 2; + if (hasHollow) ret += 1; + break; + case PrimType.SCULPT: + ret = 1; + break; + } + return ret; + } + + /// + /// Tell us what type this prim is + /// + /// + /// + public PrimType getScriptPrimType() + { + if (Shape.SculptEntry) + return PrimType.SCULPT; + if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) + { + if (Shape.PathCurve == (byte)Extrusion.Straight) + return PrimType.BOX; + else if (Shape.PathCurve == (byte)Extrusion.Curve1) + return PrimType.TUBE; + } + else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Circle) + { + if (Shape.PathCurve == (byte)Extrusion.Straight) + return PrimType.CYLINDER; + // ProfileCurve seems to combine hole shape and profile curve so we need to only compare against the lower 3 bits + else if (Shape.PathCurve == (byte)Extrusion.Curve1) + return PrimType.TORUS; + } + else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle) + { + if (Shape.PathCurve == (byte)Extrusion.Curve1 || Shape.PathCurve == (byte)Extrusion.Curve2) + return PrimType.SPHERE; + } + else if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle) + { + if (Shape.PathCurve == (byte)Extrusion.Straight) + return PrimType.PRISM; + else if (Shape.PathCurve == (byte)Extrusion.Curve1) + return PrimType.RING; + } + + return PrimType.BOX; + } + + /// + /// Tell us if this object has cut, hollow, dimple, and other factors affecting the number of faces + /// + /// + /// + /// + /// + /// + /// + protected static void hasCutHollowDimpleProfileCut(PrimType primType, PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow, + out bool hasDimple, out bool hasProfileCut) + { + if (primType == PrimType.BOX + || + primType == PrimType.CYLINDER + || + primType == PrimType.PRISM) + + hasCut = (shape.ProfileBegin > 0) || (shape.ProfileEnd > 0); + else + hasCut = (shape.PathBegin > 0) || (shape.PathEnd > 0); + + hasHollow = shape.ProfileHollow > 0; + hasDimple = (shape.ProfileBegin > 0) || (shape.ProfileEnd > 0); // taken from llSetPrimitiveParms + hasProfileCut = hasDimple; // is it the same thing? + } + public void SetGroup(UUID groupID, IClientAPI client) { _groupID = groupID; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c9998c0d86..2f00a1adf1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4394,7 +4394,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ret; } - /* The new / changed functions were tested with the following LSL script: default From ecc068fbe0b8a95563281c3aaf8e7392e5ef49e9 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 1 Feb 2010 22:08:00 +0000 Subject: [PATCH 49/81] remove now duplicated shape code from LSL_Api.cs --- .../Framework/Scenes/SceneObjectPart.cs | 8 +- .../Shared/Api/Implementation/LSL_Api.cs | 235 ++++-------------- 2 files changed, 49 insertions(+), 194 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8b5c348d18..33c3fcfa81 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3029,8 +3029,8 @@ namespace OpenSim.Region.Framework.Scenes bool hasDimple; bool hasProfileCut; - PrimType primType = getScriptPrimType(); - hasCutHollowDimpleProfileCut(primType, Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut); + PrimType primType = GetScriptPrimType(); + HasCutHollowDimpleProfileCut(primType, Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut); switch (primType) { @@ -3085,7 +3085,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public PrimType getScriptPrimType() + public PrimType GetScriptPrimType() { if (Shape.SculptEntry) return PrimType.SCULPT; @@ -3129,7 +3129,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - protected static void hasCutHollowDimpleProfileCut(PrimType primType, PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow, + protected static void HasCutHollowDimpleProfileCut(PrimType primType, PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow, out bool hasDimple, out bool hasProfileCut) { if (primType == PrimType.BOX diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2f00a1adf1..1437bb75cf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1330,44 +1330,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - SetColor(m_host, color, face); - } - - protected void SetColor(SceneObjectPart part, LSL_Vector color, int face) - { - Primitive.TextureEntry tex = part.Shape.Textures; - Color4 texcolor; - if (face >= 0 && face < GetNumberOfSides(part)) - { - texcolor = tex.CreateFace((uint)face).RGBA; - texcolor.R = Util.Clip((float)color.x, 0.0f, 1.0f); - texcolor.G = Util.Clip((float)color.y, 0.0f, 1.0f); - texcolor.B = Util.Clip((float)color.z, 0.0f, 1.0f); - tex.FaceTextures[face].RGBA = texcolor; - part.UpdateTexture(tex); - return; - } - else if (face == ScriptBaseClass.ALL_SIDES) - { - for (uint i = 0; i < GetNumberOfSides(part); i++) - { - if (tex.FaceTextures[i] != null) - { - texcolor = tex.FaceTextures[i].RGBA; - texcolor.R = Util.Clip((float)color.x, 0.0f, 1.0f); - texcolor.G = Util.Clip((float)color.y, 0.0f, 1.0f); - texcolor.B = Util.Clip((float)color.z, 0.0f, 1.0f); - tex.FaceTextures[i].RGBA = texcolor; - } - texcolor = tex.DefaultTexture.RGBA; - texcolor.R = Util.Clip((float)color.x, 0.0f, 1.0f); - texcolor.G = Util.Clip((float)color.y, 0.0f, 1.0f); - texcolor.B = Util.Clip((float)color.z, 0.0f, 1.0f); - tex.DefaultTexture.RGBA = texcolor; - } - part.UpdateTexture(tex); - return; - } + m_host.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); } public void SetTexGen(SceneObjectPart part, int face,int style) @@ -1378,7 +1341,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (style == (int)ScriptBaseClass.PRIM_TEXGEN_PLANAR) textype = MappingType.Planar; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { tex.CreateFace((uint) face); tex.FaceTextures[face].TexMapType = textype; @@ -1387,7 +1350,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < GetNumberOfSides(part); i++) + for (uint i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1403,7 +1366,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void SetGlow(SceneObjectPart part, int face, float glow) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { tex.CreateFace((uint) face); tex.FaceTextures[face].Glow = glow; @@ -1412,7 +1375,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < GetNumberOfSides(part); i++) + for (uint i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1450,7 +1413,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { tex.CreateFace((uint) face); tex.FaceTextures[face].Shiny = sval; @@ -1460,7 +1423,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < GetNumberOfSides(part); i++) + for (uint i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1478,7 +1441,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void SetFullBright(SceneObjectPart part, int face, bool bright) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { tex.CreateFace((uint) face); tex.FaceTextures[face].Fullbright = bright; @@ -1487,7 +1450,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < GetNumberOfSides(part); i++) + for (uint i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1514,11 +1477,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { int i; double sum = 0.0; - for (i = 0 ; i < GetNumberOfSides(part) ; i++) + for (i = 0 ; i < part.GetNumberOfSides(); i++) sum += (double)tex.GetFace((uint)i).RGBA.A; return sum; } - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { return (double)tex.GetFace((uint)face).RGBA.A; } @@ -1546,7 +1509,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { Primitive.TextureEntry tex = part.Shape.Textures; Color4 texcolor; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { texcolor = tex.CreateFace((uint)face).RGBA; texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); @@ -1556,7 +1519,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < GetNumberOfSides(part); i++) + for (int i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1661,7 +1624,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { int i; - for (i = 0 ; i < GetNumberOfSides(part) ; i++) + for (i = 0 ; i < part.GetNumberOfSides(); i++) { texcolor = tex.GetFace((uint)i).RGBA; rgb.x += texcolor.R; @@ -1669,13 +1632,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api rgb.z += texcolor.B; } - rgb.x /= (float)GetNumberOfSides(part); - rgb.y /= (float)GetNumberOfSides(part); - rgb.z /= (float)GetNumberOfSides(part); + rgb.x /= (float)part.GetNumberOfSides(); + rgb.y /= (float)part.GetNumberOfSides(); + rgb.z /= (float)part.GetNumberOfSides(); return rgb; } - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { texcolor = tex.GetFace((uint)face).RGBA; rgb.x = texcolor.R; @@ -1722,7 +1685,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.TextureID = textureID; @@ -1732,7 +1695,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < GetNumberOfSides(part); i++) + for (uint i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1756,7 +1719,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void ScaleTexture(SceneObjectPart part, double u, double v, int face) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.RepeatU = (float)u; @@ -1767,7 +1730,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < GetNumberOfSides(part); i++) + for (int i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1792,7 +1755,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void OffsetTexture(SceneObjectPart part, double u, double v, int face) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.OffsetU = (float)u; @@ -1803,7 +1766,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < GetNumberOfSides(part); i++) + for (int i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1828,7 +1791,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void RotateTexture(SceneObjectPart part, double rotation, int face) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.Rotation = (float)rotation; @@ -1838,7 +1801,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < GetNumberOfSides(part); i++) + for (int i = 0; i < part.GetNumberOfSides(); i++) { if (tex.FaceTextures[i] != null) { @@ -1864,7 +1827,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); @@ -3414,7 +3377,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api List parts = GetLinkParts(linknumber); foreach (SceneObjectPart part in parts) - SetColor(part, color, face); + part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); } public void llCreateLink(string target, int parent) @@ -4271,127 +4234,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return result; } - // this function to understand which shape it is (taken from meshmerizer) - // quite useful can be used by meshmerizer to have a centralized point of understanding the shape - // except that it refers to scripting constants - public int getScriptPrimType(PrimitiveBaseShape primShape) - { - if (primShape.SculptEntry) - return ScriptBaseClass.PRIM_TYPE_SCULPT; - if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) - { - if (primShape.PathCurve == (byte)Extrusion.Straight) - return ScriptBaseClass.PRIM_TYPE_BOX; - else if (primShape.PathCurve == (byte)Extrusion.Curve1) - return ScriptBaseClass.PRIM_TYPE_TUBE; - } - else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Circle) - { - if (primShape.PathCurve == (byte)Extrusion.Straight) - return ScriptBaseClass.PRIM_TYPE_CYLINDER; - // ProfileCurve seems to combine hole shape and profile curve so we need to only compare against the lower 3 bits - else if (primShape.PathCurve == (byte)Extrusion.Curve1) - return ScriptBaseClass.PRIM_TYPE_TORUS; - } - else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.HalfCircle) - { - if (primShape.PathCurve == (byte)Extrusion.Curve1 || primShape.PathCurve == (byte)Extrusion.Curve2) - return ScriptBaseClass.PRIM_TYPE_SPHERE; - } - else if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.EquilateralTriangle) - { - if (primShape.PathCurve == (byte)Extrusion.Straight) - return ScriptBaseClass.PRIM_TYPE_PRISM; - else if (primShape.PathCurve == (byte)Extrusion.Curve1) - return ScriptBaseClass.PRIM_TYPE_RING; - } - return ScriptBaseClass.PRIM_TYPE_BOX; - } - - // Helper functions to understand if object has cut, hollow, dimple, and other affecting number of faces - protected void hasCutHollowDimpleProfileCut(int primType, PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow, - out bool hasDimple, out bool hasProfileCut) - { - if (primType == ScriptBaseClass.PRIM_TYPE_BOX - || - primType == ScriptBaseClass.PRIM_TYPE_CYLINDER - || - primType == ScriptBaseClass.PRIM_TYPE_PRISM) - - hasCut = (shape.ProfileBegin > 0) || (shape.ProfileEnd > 0); - else - hasCut = (shape.PathBegin > 0) || (shape.PathEnd > 0); - - hasHollow = shape.ProfileHollow > 0; - hasDimple = (shape.ProfileBegin > 0) || (shape.ProfileEnd > 0); // taken from llSetPrimitiveParms - hasProfileCut = hasDimple; // is it the same thing? - - } - public LSL_Integer llGetNumberOfSides() { m_host.AddScriptLPS(1); - return GetNumberOfSides(m_host); - } - - protected int GetNumberOfSides(SceneObjectPart part) - { - int ret = 0; - bool hasCut; - bool hasHollow; - bool hasDimple; - bool hasProfileCut; - - int primType = getScriptPrimType(part.Shape); - hasCutHollowDimpleProfileCut(primType, part.Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut); - - switch (primType) - { - case ScriptBaseClass.PRIM_TYPE_BOX: - ret = 6; - if (hasCut) ret += 2; - if (hasHollow) ret += 1; - break; - case ScriptBaseClass.PRIM_TYPE_CYLINDER: - ret = 3; - if (hasCut) ret += 2; - if (hasHollow) ret += 1; - break; - case ScriptBaseClass.PRIM_TYPE_PRISM: - ret = 5; - if (hasCut) ret += 2; - if (hasHollow) ret += 1; - break; - case ScriptBaseClass.PRIM_TYPE_SPHERE: - ret = 1; - if (hasCut) ret += 2; - if (hasDimple) ret += 2; - if (hasHollow) ret += 3; // Emulate lsl on secondlife (according to documentation it should have added only +1) - break; - case ScriptBaseClass.PRIM_TYPE_TORUS: - ret = 1; - if (hasCut) ret += 2; - if (hasProfileCut) ret += 2; - if (hasHollow) ret += 1; - break; - case ScriptBaseClass.PRIM_TYPE_TUBE: - ret = 4; - if (hasCut) ret += 2; - if (hasProfileCut) ret += 2; - if (hasHollow) ret += 1; - break; - case ScriptBaseClass.PRIM_TYPE_RING: - ret = 3; - if (hasCut) ret += 2; - if (hasProfileCut) ret += 2; - if (hasHollow) ret += 1; - break; - case ScriptBaseClass.PRIM_TYPE_SCULPT: - ret = 1; - break; - } - return ret; + return m_host.GetNumberOfSides(); } /* The new / changed functions were tested with the following LSL script: @@ -4588,7 +4435,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { offset.x = tex.GetFace((uint)face).OffsetU; offset.y = tex.GetFace((uint)face).OffsetV; @@ -4629,7 +4476,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { return tex.GetFace((uint)face).Rotation; } @@ -7019,10 +6866,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_Vector color=rules.GetVector3Item(idx++); double alpha=(double)rules.GetLSLFloatItem(idx++); - SetColor(part, color, face); + part.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); SetAlpha(part, alpha, face); break; + case (int)ScriptBaseClass.PRIM_FLEXIBLE: if (remain < 7) return; @@ -7038,6 +6886,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force); break; + case (int)ScriptBaseClass.PRIM_POINT_LIGHT: if (remain < 5) return; @@ -7050,6 +6899,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetPointLight(part, light, lightcolor, intensity, radius, falloff); break; + case (int)ScriptBaseClass.PRIM_GLOW: if (remain < 2) return; @@ -7059,6 +6909,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetGlow(part, face, glow); break; + case (int)ScriptBaseClass.PRIM_BUMP_SHINY: if (remain < 3) return; @@ -7069,6 +6920,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetShiny(part, face, shiny, bump); break; + case (int)ScriptBaseClass.PRIM_FULLBRIGHT: if (remain < 2) return; @@ -7076,6 +6928,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool st = rules.GetLSLIntegerItem(idx++); SetFullBright(part, face , st); break; + case (int)ScriptBaseClass.PRIM_MATERIAL: if (remain < 1) return; @@ -7085,6 +6938,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.Material = Convert.ToByte(mat); break; + case (int)ScriptBaseClass.PRIM_PHANTOM: if (remain < 1) return; @@ -7099,6 +6953,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.ScriptSetPhantomStatus(phantom); break; + case (int)ScriptBaseClass.PRIM_PHYSICS: if (remain < 1) return; @@ -7112,6 +6967,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.ScriptSetPhysicsStatus(physics); break; + case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: if (remain < 1) return; @@ -7379,7 +7235,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules) { - LSL_List res = new LSL_List(); int idx=0; while (idx < rules.Length) @@ -7441,7 +7296,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_TYPE: // implementing box PrimitiveBaseShape Shape = part.Shape; - int primType = getScriptPrimType(part.Shape); + int primType = (int)part.GetScriptPrimType(); res.Add(new LSL_Integer(primType)); double topshearx = (double)(sbyte)Shape.PathShearX / 100.0; // Fix negative values for PathShearX double topsheary = (double)(sbyte)Shape.PathShearY / 100.0; // and PathShearY. @@ -7521,7 +7376,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Primitive.TextureEntry tex = part.Shape.Textures; if (face == ScriptBaseClass.ALL_SIDES) { - for (face = 0 ; face < GetNumberOfSides(part) ; face++) + for (face = 0 ; face < part.GetNumberOfSides() ; face++) { Primitive.TextureEntryFace texface = tex.GetFace((uint)face); @@ -7537,7 +7392,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - if (face >= 0 && face < GetNumberOfSides(part)) + if (face >= 0 && face < part.GetNumberOfSides()) { Primitive.TextureEntryFace texface = tex.GetFace((uint)face); @@ -7563,7 +7418,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Color4 texcolor; if (face == ScriptBaseClass.ALL_SIDES) { - for (face = 0 ; face < GetNumberOfSides(part) ; face++) + for (face = 0 ; face < part.GetNumberOfSides() ; face++) { texcolor = tex.GetFace((uint)face).RGBA; res.Add(new LSL_Vector(texcolor.R, From 5432925a3b153737adf7f59483e05202068ce2af Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 1 Feb 2010 22:29:21 +0000 Subject: [PATCH 50/81] move hollow sphere faces bug back up to LSL_Api.cs --- .../Framework/Scenes/SceneObjectPart.cs | 2 +- .../Shared/Api/Implementation/LSL_Api.cs | 87 +++++++++++-------- 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 33c3fcfa81..4f9beb7221 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3053,7 +3053,7 @@ namespace OpenSim.Region.Framework.Scenes ret = 1; if (hasCut) ret += 2; if (hasDimple) ret += 2; - if (hasHollow) ret += 3; // Emulate lsl on secondlife (according to documentation it should have added only +1) + if (hasHollow) ret += 1; break; case PrimType.TORUS: ret = 1; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1437bb75cf..3dc7613b62 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -53,8 +53,8 @@ using OpenSim.Region.ScriptEngine.Interfaces; using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; using OpenSim.Services.Interfaces; +using PrimType = OpenSim.Region.Framework.Scenes.PrimType; using GridRegion = OpenSim.Services.Interfaces.GridRegion; - using AssetLandmark = OpenSim.Framework.AssetLandmark; using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; @@ -1330,6 +1330,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); + if (face == ScriptBaseClass.ALL_SIDES) + face = SceneObjectPart.ALL_SIDES; + m_host.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); } @@ -1341,7 +1344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (style == (int)ScriptBaseClass.PRIM_TEXGEN_PLANAR) textype = MappingType.Planar; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { tex.CreateFace((uint) face); tex.FaceTextures[face].TexMapType = textype; @@ -1350,7 +1353,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < part.GetNumberOfSides(); i++) + for (uint i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1366,7 +1369,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void SetGlow(SceneObjectPart part, int face, float glow) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { tex.CreateFace((uint) face); tex.FaceTextures[face].Glow = glow; @@ -1375,7 +1378,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < part.GetNumberOfSides(); i++) + for (uint i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1413,7 +1416,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { tex.CreateFace((uint) face); tex.FaceTextures[face].Shiny = sval; @@ -1423,7 +1426,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < part.GetNumberOfSides(); i++) + for (uint i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1441,7 +1444,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void SetFullBright(SceneObjectPart part, int face, bool bright) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { tex.CreateFace((uint) face); tex.FaceTextures[face].Fullbright = bright; @@ -1450,7 +1453,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < part.GetNumberOfSides(); i++) + for (uint i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1477,11 +1480,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { int i; double sum = 0.0; - for (i = 0 ; i < part.GetNumberOfSides(); i++) + for (i = 0 ; i < GetNumberOfSides(part); i++) sum += (double)tex.GetFace((uint)i).RGBA.A; return sum; } - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { return (double)tex.GetFace((uint)face).RGBA.A; } @@ -1509,7 +1512,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { Primitive.TextureEntry tex = part.Shape.Textures; Color4 texcolor; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { texcolor = tex.CreateFace((uint)face).RGBA; texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); @@ -1519,7 +1522,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < part.GetNumberOfSides(); i++) + for (int i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1624,7 +1627,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { int i; - for (i = 0 ; i < part.GetNumberOfSides(); i++) + for (i = 0 ; i < GetNumberOfSides(part); i++) { texcolor = tex.GetFace((uint)i).RGBA; rgb.x += texcolor.R; @@ -1632,13 +1635,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api rgb.z += texcolor.B; } - rgb.x /= (float)part.GetNumberOfSides(); - rgb.y /= (float)part.GetNumberOfSides(); - rgb.z /= (float)part.GetNumberOfSides(); + rgb.x /= (float)GetNumberOfSides(part); + rgb.y /= (float)GetNumberOfSides(part); + rgb.z /= (float)GetNumberOfSides(part); return rgb; } - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { texcolor = tex.GetFace((uint)face).RGBA; rgb.x = texcolor.R; @@ -1685,7 +1688,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.TextureID = textureID; @@ -1695,7 +1698,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else if (face == ScriptBaseClass.ALL_SIDES) { - for (uint i = 0; i < part.GetNumberOfSides(); i++) + for (uint i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1719,7 +1722,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void ScaleTexture(SceneObjectPart part, double u, double v, int face) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.RepeatU = (float)u; @@ -1730,7 +1733,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < part.GetNumberOfSides(); i++) + for (int i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1755,7 +1758,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void OffsetTexture(SceneObjectPart part, double u, double v, int face) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.OffsetU = (float)u; @@ -1766,7 +1769,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < part.GetNumberOfSides(); i++) + for (int i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1791,7 +1794,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void RotateTexture(SceneObjectPart part, double rotation, int face) { Primitive.TextureEntry tex = part.Shape.Textures; - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); texface.Rotation = (float)rotation; @@ -1801,7 +1804,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } if (face == ScriptBaseClass.ALL_SIDES) { - for (int i = 0; i < part.GetNumberOfSides(); i++) + for (int i = 0; i < GetNumberOfSides(part); i++) { if (tex.FaceTextures[i] != null) { @@ -1827,7 +1830,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface; texface = tex.GetFace((uint)face); @@ -4225,7 +4228,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 10 && item.ItemID == m_itemID) { - result = item.Name!=null?item.Name:String.Empty; + result = item.Name != null ? item.Name : String.Empty; break; } } @@ -4238,9 +4241,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - return m_host.GetNumberOfSides(); + return GetNumberOfSides(m_host); } + protected int GetNumberOfSides(SceneObjectPart part) + { + int sides = part.GetNumberOfSides(); + + if (part.GetScriptPrimType() == PrimType.SPHERE && part.Shape.ProfileHollow > 0) + { + // Make up for a bug where LSL shows 4 sides rather than 2 + sides += 2; + } + + return sides; + } + + /* The new / changed functions were tested with the following LSL script: default @@ -4264,8 +4281,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } */ - - // Xantor 29/apr/2008 // Returns rotation described by rotating angle radians about axis. // q = cos(a/2) + i (x * sin(a/2)) + j (y * sin(a/2)) + k (z * sin(a/2)) @@ -4435,7 +4450,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { offset.x = tex.GetFace((uint)face).OffsetU; offset.y = tex.GetFace((uint)face).OffsetV; @@ -4476,7 +4491,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { face = 0; } - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { return tex.GetFace((uint)face).Rotation; } @@ -7376,7 +7391,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Primitive.TextureEntry tex = part.Shape.Textures; if (face == ScriptBaseClass.ALL_SIDES) { - for (face = 0 ; face < part.GetNumberOfSides() ; face++) + for (face = 0 ; face < GetNumberOfSides(part); face++) { Primitive.TextureEntryFace texface = tex.GetFace((uint)face); @@ -7392,7 +7407,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - if (face >= 0 && face < part.GetNumberOfSides()) + if (face >= 0 && face < GetNumberOfSides(part)) { Primitive.TextureEntryFace texface = tex.GetFace((uint)face); @@ -7418,7 +7433,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Color4 texcolor; if (face == ScriptBaseClass.ALL_SIDES) { - for (face = 0 ; face < part.GetNumberOfSides() ; face++) + for (face = 0 ; face < GetNumberOfSides(part); face++) { texcolor = tex.GetFace((uint)face).RGBA; res.Add(new LSL_Vector(texcolor.R, From 08721be3740624fb10a205bcf1ddcfd58bff7f87 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Mon, 1 Feb 2010 22:33:15 +0000 Subject: [PATCH 51/81] minor: rename GetScriptPrimType() to GetPrimType() --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ++-- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4f9beb7221..ef9005fc01 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3029,7 +3029,7 @@ namespace OpenSim.Region.Framework.Scenes bool hasDimple; bool hasProfileCut; - PrimType primType = GetScriptPrimType(); + PrimType primType = GetPrimType(); HasCutHollowDimpleProfileCut(primType, Shape, out hasCut, out hasHollow, out hasDimple, out hasProfileCut); switch (primType) @@ -3085,7 +3085,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public PrimType GetScriptPrimType() + public PrimType GetPrimType() { if (Shape.SculptEntry) return PrimType.SCULPT; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3dc7613b62..a1db77ee73 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4248,7 +4248,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { int sides = part.GetNumberOfSides(); - if (part.GetScriptPrimType() == PrimType.SPHERE && part.Shape.ProfileHollow > 0) + if (part.GetPrimType() == PrimType.SPHERE && part.Shape.ProfileHollow > 0) { // Make up for a bug where LSL shows 4 sides rather than 2 sides += 2; @@ -7311,7 +7311,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case (int)ScriptBaseClass.PRIM_TYPE: // implementing box PrimitiveBaseShape Shape = part.Shape; - int primType = (int)part.GetScriptPrimType(); + int primType = (int)part.GetPrimType(); res.Add(new LSL_Integer(primType)); double topshearx = (double)(sbyte)Shape.PathShearX / 100.0; // Fix negative values for PathShearX double topsheary = (double)(sbyte)Shape.PathShearY / 100.0; // and PathShearY. From 96d5c8196a3c756639e9f57a7fb3d630d174d0c4 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 2 Feb 2010 15:45:41 +0000 Subject: [PATCH 52/81] minor: add reminder to lock SOG.Children before using it directly in order to avoid threading issues --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ec41ac76c0..8c568707aa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -235,6 +235,9 @@ namespace OpenSim.Region.Framework.Scenes set { m_rootPart.GroupID = value; } } + /// + /// The parts of this scene object group. You must lock this property before using it. + /// public Dictionary Children { get { return m_parts; } @@ -2097,7 +2100,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Get a child part with a given UUID + /// Get a part with a given UUID /// /// /// null if a child part with the primID was not found @@ -2112,7 +2115,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Get a child part with a given local ID + /// Get a part with a given local ID /// /// /// null if a child part with the local ID was not found From 0e23c5fffb8eced017c696ee85bee32131e18d51 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 2 Feb 2010 18:19:15 +0000 Subject: [PATCH 53/81] minor: add some documentation to EventManager.OnObjectGrab --- .../Region/Framework/Scenes/EventManager.cs | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 464ead8279..a4a1abc551 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -92,8 +92,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnShutdownDelegate(); public event OnShutdownDelegate OnShutdown; - - public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); + public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); public delegate void ScriptResetDelegate(uint localID, UUID itemID); @@ -103,7 +102,14 @@ namespace OpenSim.Region.Framework.Scenes public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; + /// + /// Called when an object is touched/grabbed. + /// + /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of + /// the root part. + public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); public event ObjectGrabDelegate OnObjectGrab; + public event ObjectGrabDelegate OnObjectGrabbing; public event ObjectDeGrabDelegate OnObjectDeGrab; public event ScriptResetDelegate OnScriptReset; @@ -111,55 +117,42 @@ namespace OpenSim.Region.Framework.Scenes public event OnPermissionErrorDelegate OnPermissionError; public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); - public event NewRezScript OnRezScript; public delegate void RemoveScript(uint localID, UUID itemID); - public event RemoveScript OnRemoveScript; public delegate void StartScript(uint localID, UUID itemID); - public event StartScript OnStartScript; public delegate void StopScript(uint localID, UUID itemID); - public event StopScript OnStopScript; public delegate bool SceneGroupMoved(UUID groupID, Vector3 delta); - public event SceneGroupMoved OnSceneGroupMove; public delegate void SceneGroupGrabed(UUID groupID, Vector3 offset, UUID userID); - public event SceneGroupGrabed OnSceneGroupGrab; public delegate bool SceneGroupSpinStarted(UUID groupID); - public event SceneGroupSpinStarted OnSceneGroupSpinStart; public delegate bool SceneGroupSpun(UUID groupID, Quaternion rotation); - public event SceneGroupSpun OnSceneGroupSpin; public delegate void LandObjectAdded(ILandObject newParcel); - public event LandObjectAdded OnLandObjectAdded; public delegate void LandObjectRemoved(UUID globalID); - public event LandObjectRemoved OnLandObjectRemoved; public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID); - public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel; public delegate void SignificantClientMovement(IClientAPI remote_client); - public event SignificantClientMovement OnSignificantClientMovement; public delegate void IncomingInstantMessage(GridInstantMessage message); - public event IncomingInstantMessage OnIncomingInstantMessage; public event IncomingInstantMessage OnUnhandledInstantMessage; From dc8240910620b1ca2faa0709c0db00d405124193 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 2 Feb 2010 19:04:06 +0000 Subject: [PATCH 54/81] minor: add method doc to sop.SetScriptEvents() --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ef9005fc01..d7f9bbb3a4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3178,6 +3178,11 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Set the events that this part will pass on to listeners. + /// + /// + /// public void SetScriptEvents(UUID scriptid, int events) { // scriptEvents oldparts; From 0faeaf98a66bbe32a171ee32024ea38fc17b6db2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 2 Feb 2010 19:42:45 +0000 Subject: [PATCH 55/81] minor: copy some method doc from the WorldComm implementation to the interface --- .../Region/Framework/Interfaces/IWorldComm.cs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs index 74526c452f..948b9dc522 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs @@ -49,10 +49,49 @@ namespace OpenSim.Region.Framework.Interfaces public interface IWorldComm { + /// + /// Create a listen event callback with the specified filters. + /// The parameters localID,itemID are needed to uniquely identify + /// the script during 'peek' time. Parameter hostID is needed to + /// determine the position of the script. + /// + /// localID of the script engine + /// UUID of the script engine + /// UUID of the SceneObjectPart + /// channel to listen on + /// name to filter on + /// key to filter on (user given, could be totally faked) + /// msg to filter on + /// number of the scripts handle int Listen(uint LocalID, UUID itemID, UUID hostID, int channel, string name, UUID id, string msg); + + /// + /// This method scans over the objects which registered an interest in listen callbacks. + /// For everyone it finds, it checks if it fits the given filter. If it does, then + /// enqueue the message for delivery to the objects listen event handler. + /// The enqueued ListenerInfo no longer has filter values, but the actually trigged values. + /// Objects that do an llSay have their messages delivered here and for nearby avatars, + /// the OnChatFromClient event is used. + /// + /// type of delvery (whisper,say,shout or regionwide) + /// channel to sent on + /// name of sender (object or avatar) + /// key of sender (object or avatar) + /// msg to sent void DeliverMessage(ChatTypeEnum type, int channel, string name, UUID id, string msg); + + /// + /// Are there any listen events ready to be dispatched? + /// + /// boolean indication bool HasMessages(); + + /// + /// Pop the first availlable listen event from the queue + /// + /// ListenerInfo with filter filled in IWorldCommListenerInfo GetNextMessage(); + void ListenControl(UUID itemID, int handle, int active); void ListenRemove(UUID itemID, int handle); void DeleteListener(UUID itemID); From bbd41de6d5a4aa0301b408be28957b0a15bcc53d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 2 Feb 2010 20:38:58 +0000 Subject: [PATCH 56/81] refactor: move world comm message queueing into its own method --- .../Scripting/WorldComm/WorldCommModule.cs | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 60df2e7273..d647e71693 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -262,44 +262,34 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm { case ChatTypeEnum.Whisper: if (dis < m_whisperdistance) - { - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; case ChatTypeEnum.Say: if (dis < m_saydistance) - { - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; case ChatTypeEnum.Shout: if (dis < m_shoutdistance) - { - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; case ChatTypeEnum.Region: - lock (m_pending.SyncRoot) - { - m_pending.Enqueue(new ListenerInfo(li,name,id,msg)); - } + QueueMessage(new ListenerInfo(li, name, id, msg)); break; } } } + protected void QueueMessage(ListenerInfo li) + { + lock (m_pending.SyncRoot) + { + m_pending.Enqueue(li); + } + } + /// /// Are there any listen events ready to be dispatched? /// @@ -319,7 +309,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm lock (m_pending.SyncRoot) { - li = (ListenerInfo) m_pending.Dequeue(); + li = (ListenerInfo)m_pending.Dequeue(); } return li; From 88d0fc3b093e1ae79ef17e2496348251e196a5fa Mon Sep 17 00:00:00 2001 From: radams1 Date: Tue, 2 Feb 2010 16:20:02 -0800 Subject: [PATCH 57/81] allow terrain collision events after regular collision check Signed-off-by: Melanie --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ef9005fc01..b1c6fb90d3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1921,7 +1921,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (uint localId in startedColliders) { if (localId == 0) - return; + continue; // always running this check because if the user deletes the object it would return a null reference. if (m_parentGroup == null) return; @@ -2057,7 +2057,7 @@ namespace OpenSim.Region.Framework.Scenes { // always running this check because if the user deletes the object it would return a null reference. if (localId == 0) - return; + continue; if (m_parentGroup == null) return; @@ -2189,7 +2189,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (uint localId in endedColliders) { if (localId == 0) - return; + continue; // always running this check because if the user deletes the object it would return a null reference. if (m_parentGroup == null) From b6bee4999c9d238a052022f105069ea4eb85f8f4 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 15:35:41 +0000 Subject: [PATCH 58/81] change position of OnAttach event firing so that this also happens when a user teleports into a region --- OpenSim/Region/Framework/Scenes/Scene.cs | 29 ++++++++++--------- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 73b0b3e2e9..ff2be05455 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2496,20 +2496,24 @@ namespace OpenSim.Region.Framework.Scenes //RootPrim.SetParentLocalId(parentLocalID); - m_log.DebugFormat("[ATTACHMENT]: Received " + - "attachment {0}, inworld asset id {1}", - //grp.RootPart.LastOwnerID.ToString(), - grp.GetFromItemID(), - grp.UUID.ToString()); + m_log.DebugFormat( + "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", + //grp.RootPart.LastOwnerID.ToString(), + grp.GetFromItemID(), + grp.UUID.ToString()); //grp.SetFromAssetID(grp.RootPart.LastOwnerID); - m_log.DebugFormat("[ATTACHMENT]: Attach " + - "to avatar {0} at position {1}", - sp.UUID.ToString(), grp.AbsolutePosition); - AttachObject(sp.ControllingClient, - grp.LocalId, (uint)0, - grp.GroupRotation, - grp.AbsolutePosition, false); + m_log.DebugFormat( + "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID.ToString(), grp.AbsolutePosition); + + if ( + AttachObject( + sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false)) + { + // Do this last so that event listeners have access to all the effects of the attachment + EventManager.TriggerOnAttach(grp.LocalId, UUID.Zero, sp.UUID); + } + RootPrim.RemFlag(PrimFlags.TemporaryOnRez); grp.SendGroupFullUpdate(); } @@ -2518,7 +2522,6 @@ namespace OpenSim.Region.Framework.Scenes RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.AddFlag(PrimFlags.TemporaryOnRez); } - } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1ac061a1b2..b508af5f7f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -627,11 +627,10 @@ namespace OpenSim.Region.Framework.Scenes } m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); - group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); + // In case it is later dropped again, don't let // it get cleaned up - // group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); group.HasGroupChanged = false; } From da62344822524b74b431bf35e682aaf882c44da9 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 15:40:59 +0000 Subject: [PATCH 59/81] minor: remove a couple of mono warnings --- OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 2 -- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 87c1a95197..298ede9da5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -44,8 +44,6 @@ namespace OpenSim.Region.Framework.Scenes { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - static System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); - private string m_inventoryFileName = String.Empty; private int m_inventoryFileNameSerial = 0; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e26283dea0..bd59f2ec1c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2783,11 +2783,10 @@ namespace OpenSim.Region.Framework.Scenes { m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); } - catch(Exception ex) + catch { m_scene.CrossAgentToNewRegion(this, false); } - } public void InTransit() From c020fed1b86588966d397bcfe8530b8a3bc5df99 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 15:46:24 +0000 Subject: [PATCH 60/81] minor: comment out a log line in ScenePresence --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bd59f2ec1c..5419a9a5de 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2864,7 +2864,6 @@ namespace OpenSim.Region.Framework.Scenes { RemoveNeighbourRegion(handle); } - } #endregion @@ -3025,7 +3024,7 @@ namespace OpenSim.Region.Framework.Scenes List attPoints = m_appearance.GetAttachedPoints(); if (attPoints != null) { - m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); + //m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); int i = 0; AttachmentData[] attachs = new AttachmentData[attPoints.Count]; foreach (int point in attPoints) From daa66c4811be49a0eee843f2bc77a3465da674de Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 16:40:21 +0000 Subject: [PATCH 61/81] add an IsRoot property to sop --- OpenSim/Region/Framework/Scenes/EventManager.cs | 16 +++++++++++++++- .../Region/Framework/Scenes/SceneObjectPart.cs | 9 +++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index a4a1abc551..c50082d2f1 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -469,7 +469,21 @@ namespace OpenSim.Region.Framework.Scenes { handlerOnAttach = OnAttach; if (handlerOnAttach != null) - handlerOnAttach(localID, itemID, avatarID); + { + foreach (Delegate d in handlerOnAttach.GetInvocationList()) + { + try + { + d(localID, itemID, avatarID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. Error was {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d7f9bbb3a4..d012d3e9a3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -113,6 +113,15 @@ namespace OpenSim.Region.Framework.Scenes private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Is this sop a root part? + /// + [XmlIgnore] + public bool IsRoot + { + get { return ParentGroup.RootPart == this; } + } + // use only one serializer to give the runtime a chance to optimize it (it won't do that if you // use a new instance every time) private static XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); From cd4651041efb277ff101e009806aa9ea75536bb1 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 19:04:31 +0000 Subject: [PATCH 62/81] For each delegate added to events in the EventManager, catch and log but do not propogate any exceptions that come back This stops exceptions thrown by modules from disrupting the kernel and still allows other delegates to be executed normally --- .../Region/Framework/Scenes/EventManager.cs | 1442 +++++++++++++---- 1 file changed, 1128 insertions(+), 314 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index c50082d2f1..2ab393f837 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -27,11 +27,13 @@ using System; using System.Collections.Generic; +using System.Reflection; +using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Client; using OpenSim.Region.Framework.Interfaces; -using Caps=OpenSim.Framework.Capabilities.Caps; +using Caps = OpenSim.Framework.Capabilities.Caps; using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.Framework.Scenes @@ -41,6 +43,8 @@ namespace OpenSim.Region.Framework.Scenes /// public class EventManager { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + public delegate void OnFrameDelegate(); public event OnFrameDelegate OnFrame; @@ -213,9 +217,9 @@ namespace OpenSim.Region.Framework.Scenes public event AvatarKillData OnAvatarKilled; - public delegate void ScriptTimerEvent(uint localID, double timerinterval); +// public delegate void ScriptTimerEvent(uint localID, double timerinterval); - public event ScriptTimerEvent OnScriptTimerEvent; +// public event ScriptTimerEvent OnScriptTimerEvent; public delegate void EstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); @@ -382,95 +386,12 @@ namespace OpenSim.Region.Framework.Scenes public event LandBuy OnLandBuy; public event LandBuy OnValidateLandBuy; - /* Designated Event Deletage Instances */ - - private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent; - private ScriptAtTargetEvent handlerScriptAtTargetEvent = null; - private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null; - private ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = null; - private ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = null; - private ClientMovement handlerClientMovement = null; //OnClientMovement; - private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError; - private OnPluginConsoleDelegate handlerPluginConsole = null; //OnPluginConsole; - private OnFrameDelegate handlerFrame = null; //OnFrame; - private OnNewClientDelegate handlerNewClient = null; //OnNewClient; - private OnClientConnectCoreDelegate handlerClientConnect = null; //OnClientConnect - private OnNewPresenceDelegate handlerNewPresence = null; //OnNewPresence; - private OnRemovePresenceDelegate handlerRemovePresence = null; //OnRemovePresence; - private OnBackupDelegate handlerBackup = null; //OnBackup; - private OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = null; //OnParcelPrimCountUpdate; - private MoneyTransferEvent handlerMoneyTransfer = null; //OnMoneyTransfer; - private OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = null; //OnParcelPrimCountAdd; - private OnShutdownDelegate handlerShutdown = null; //OnShutdown; - private ObjectGrabDelegate handlerObjectGrab = null; //OnObjectGrab; - private ObjectGrabDelegate handlerObjectGrabbing = null; //OnObjectGrabbing; - private ObjectDeGrabDelegate handlerObjectDeGrab = null; //OnObjectDeGrab; - private ScriptResetDelegate handlerScriptReset = null; // OnScriptReset - private NewRezScript handlerRezScript = null; //OnRezScript; - private RemoveScript handlerRemoveScript = null; //OnRemoveScript; - private StartScript handlerStartScript = null; //OnStartScript; - private StopScript handlerStopScript = null; //OnStopScript; - private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; - private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab; - private SceneGroupSpinStarted handlerSceneGroupSpinStarted = null; //OnSceneGroupSpinStart; - private SceneGroupSpun handlerSceneGroupSpin = null; //OnSceneGroupSpin; - private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded; - private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved; - private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel; - private IncomingInstantMessage handlerIncomingInstantMessage = null; //OnIncomingInstantMessage; - private IncomingInstantMessage handlerUnhandledInstantMessage = null; //OnUnhandledInstantMessage; - private ClientClosed handlerClientClosed = null; //OnClientClosed; - private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; - private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent; - private OnTerrainTickDelegate handlerTerrainTick = null; // OnTerainTick; - private RegisterCapsEvent handlerRegisterCaps = null; // OnRegisterCaps; - private DeregisterCapsEvent handlerDeregisterCaps = null; // OnDeregisterCaps; - private ChatFromWorldEvent handlerChatFromWorld = null; // OnChatFromWorld; - private ChatFromClientEvent handlerChatFromClient = null; // OnChatFromClient; - private ChatBroadcastEvent handlerChatBroadcast = null; // OnChatBroadcast; - private NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = null; - private RequestChangeWaterHeight handlerRequestChangeWaterHeight = null; //OnRequestChangeWaterHeight - private ScriptControlEvent handlerScriptControlEvent = null; - private SignificantClientMovement handlerSignificantClientMovement = null; - - private LandBuy handlerLandBuy = null; - private LandBuy handlerValidateLandBuy = null; - private AvatarKillData handlerAvatarKill = null; - - private NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = null; - private IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = null; - private SetAllowForcefulBan handlerSetAllowForcefulBan = null; - private RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = null; - private ParcelPrimCountTainted handlerParcelPrimCountTainted = null; - private ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = null; - // TODO: unused: private ScriptTimerEvent handlerScriptTimerEvent = null; - private EstateToolsSunUpdate handlerEstateToolsSunUpdate = null; - - private ScriptColliding handlerCollidingStart = null; - private ScriptColliding handlerColliding = null; - private ScriptColliding handlerCollidingEnd = null; - private ScriptColliding handlerLandCollidingStart = null; - private ScriptColliding handlerLandColliding = null; - private ScriptColliding handlerLandCollidingEnd = null; - private GetScriptRunning handlerGetScriptRunning = null; - - private SunLindenHour handlerCurrentTimeAsLindenSunHour = null; - private OnSetRootAgentSceneDelegate handlerSetRootAgentScene = null; - - private OarFileLoaded handlerOarFileLoaded = null; - private OarFileSaved handlerOarFileSaved = null; - - private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null; - - private Attach handlerOnAttach = null; - private RegionUp handlerOnRegionUp = null; - public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) { - handlerOnAttach = OnAttach; + Attach handlerOnAttach = OnAttach; if (handlerOnAttach != null) { - foreach (Delegate d in handlerOnAttach.GetInvocationList()) + foreach (Attach d in handlerOnAttach.GetInvocationList()) { try { @@ -479,7 +400,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. Error was {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", e.Message, e.StackTrace); } } @@ -488,525 +409,1240 @@ namespace OpenSim.Region.Framework.Scenes public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) { - handlerGetScriptRunning = OnGetScriptRunning; + GetScriptRunning handlerGetScriptRunning = OnGetScriptRunning; if (handlerGetScriptRunning != null) - handlerGetScriptRunning(controllingClient, objectID, itemID); + { + foreach (GetScriptRunning d in handlerGetScriptRunning.GetInvocationList()) + { + try + { + d(controllingClient, objectID, itemID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnScriptChangedEvent(uint localID, uint change) { - handlerScriptChangedEvent = OnScriptChangedEvent; + ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent; if (handlerScriptChangedEvent != null) - handlerScriptChangedEvent(localID, change); + { + foreach (ScriptChangedEvent d in handlerScriptChangedEvent.GetInvocationList()) + { + try + { + d(localID, change); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnClientMovement(ScenePresence avatar) { - handlerClientMovement = OnClientMovement; + ClientMovement handlerClientMovement = OnClientMovement; if (handlerClientMovement != null) - handlerClientMovement(avatar); + { + foreach (ClientMovement d in handlerClientMovement.GetInvocationList()) + { + try + { + d(avatar); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerPermissionError(UUID user, string reason) { - handlerPermissionError = OnPermissionError; + OnPermissionErrorDelegate handlerPermissionError = OnPermissionError; if (handlerPermissionError != null) - handlerPermissionError(user, reason); + { + foreach (OnPermissionErrorDelegate d in handlerPermissionError.GetInvocationList()) + { + try + { + d(user, reason); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnPluginConsole(string[] args) { - handlerPluginConsole = OnPluginConsole; + OnPluginConsoleDelegate handlerPluginConsole = OnPluginConsole; if (handlerPluginConsole != null) - handlerPluginConsole(args); + { + foreach (OnPluginConsoleDelegate d in handlerPluginConsole.GetInvocationList()) + { + try + { + d(args); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnFrame() { - handlerFrame = OnFrame; + OnFrameDelegate handlerFrame = OnFrame; if (handlerFrame != null) { - handlerFrame(); - } + foreach (OnFrameDelegate d in handlerFrame.GetInvocationList()) + { + try + { + d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnNewClient(IClientAPI client) - { - handlerNewClient = OnNewClient; + { + OnNewClientDelegate handlerNewClient = OnNewClient; if (handlerNewClient != null) - handlerNewClient(client); + { + foreach (OnNewClientDelegate d in handlerNewClient.GetInvocationList()) + { + try + { + d(client); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } if (client is IClientCore) - { - handlerClientConnect = OnClientConnect; + { + OnClientConnectCoreDelegate handlerClientConnect = OnClientConnect; if (handlerClientConnect != null) - handlerClientConnect((IClientCore)client); + { + foreach (OnClientConnectCoreDelegate d in handlerClientConnect.GetInvocationList()) + { + try + { + d((IClientCore)client); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } } public void TriggerOnNewPresence(ScenePresence presence) { - handlerNewPresence = OnNewPresence; + OnNewPresenceDelegate handlerNewPresence = OnNewPresence; if (handlerNewPresence != null) - handlerNewPresence(presence); + { + foreach (OnNewPresenceDelegate d in handlerNewPresence.GetInvocationList()) + { + try + { + d(presence); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnRemovePresence(UUID agentId) - { - handlerRemovePresence = OnRemovePresence; + { + OnRemovePresenceDelegate handlerRemovePresence = OnRemovePresence; if (handlerRemovePresence != null) { - handlerRemovePresence(agentId); - } + foreach (OnRemovePresenceDelegate d in handlerRemovePresence.GetInvocationList()) + { + try + { + d(agentId); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnBackup(IRegionDataStore dstore) - { - handlerBackup = OnBackup; - if (handlerBackup != null) + { + OnBackupDelegate handlerOnAttach = OnBackup; + if (handlerOnAttach != null) { - handlerBackup(dstore, false); - } + foreach (OnBackupDelegate d in handlerOnAttach.GetInvocationList()) + { + try + { + d(dstore, false); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerParcelPrimCountUpdate() { - handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate; + OnParcelPrimCountUpdateDelegate handlerParcelPrimCountUpdate = OnParcelPrimCountUpdate; if (handlerParcelPrimCountUpdate != null) { - handlerParcelPrimCountUpdate(); - } + foreach (OnParcelPrimCountUpdateDelegate d in handlerParcelPrimCountUpdate.GetInvocationList()) + { + try + { + d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } - public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs e) + public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args) { - handlerMoneyTransfer = OnMoneyTransfer; + MoneyTransferEvent handlerMoneyTransfer = OnMoneyTransfer; if (handlerMoneyTransfer != null) { - handlerMoneyTransfer(sender, e); - } + foreach (MoneyTransferEvent d in handlerMoneyTransfer.GetInvocationList()) + { + try + { + d(sender, args); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerTerrainTick() { - handlerTerrainTick = OnTerrainTick; + OnTerrainTickDelegate handlerTerrainTick = OnTerrainTick; if (handlerTerrainTick != null) { - handlerTerrainTick(); - } + foreach (OnTerrainTickDelegate d in handlerTerrainTick.GetInvocationList()) + { + try + { + d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerParcelPrimCountAdd(SceneObjectGroup obj) { - handlerParcelPrimCountAdd = OnParcelPrimCountAdd; + OnParcelPrimCountAddDelegate handlerParcelPrimCountAdd = OnParcelPrimCountAdd; if (handlerParcelPrimCountAdd != null) { - handlerParcelPrimCountAdd(obj); - } + foreach (OnParcelPrimCountAddDelegate d in handlerParcelPrimCountAdd.GetInvocationList()) + { + try + { + d(obj); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) { - handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; + ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; if (handlerObjectBeingRemovedFromScene != null) { - handlerObjectBeingRemovedFromScene(obj); - } + foreach (ObjectBeingRemovedFromScene d in handlerObjectBeingRemovedFromScene.GetInvocationList()) + { + try + { + d(obj); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerShutdown() - { - handlerShutdown = OnShutdown; + { + OnShutdownDelegate handlerShutdown = OnShutdown; if (handlerShutdown != null) - handlerShutdown(); + { + foreach (OnShutdownDelegate d in handlerShutdown.GetInvocationList()) + { + try + { + d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) - { - handlerObjectGrab = OnObjectGrab; + { + ObjectGrabDelegate handlerObjectGrab = OnObjectGrab; if (handlerObjectGrab != null) { - handlerObjectGrab(localID, originalID, offsetPos, remoteClient, surfaceArgs); - } + foreach (ObjectGrabDelegate d in handlerObjectGrab.GetInvocationList()) + { + try + { + d(localID, originalID, offsetPos, remoteClient, surfaceArgs); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) - { - handlerObjectGrabbing = OnObjectGrabbing; + { + ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing; if (handlerObjectGrabbing != null) { - handlerObjectGrabbing(localID, originalID, offsetPos, remoteClient, surfaceArgs); - } + foreach (ObjectGrabDelegate d in handlerObjectGrabbing.GetInvocationList()) + { + try + { + d(localID, originalID, offsetPos, remoteClient, surfaceArgs); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs) - { - handlerObjectDeGrab = OnObjectDeGrab; + { + ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab; if (handlerObjectDeGrab != null) { - handlerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs); - } + foreach (ObjectDeGrabDelegate d in handlerObjectDeGrab.GetInvocationList()) + { + try + { + d(localID, originalID, remoteClient, surfaceArgs); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerScriptReset(uint localID, UUID itemID) - { - handlerScriptReset = OnScriptReset; + { + ScriptResetDelegate handlerScriptReset = OnScriptReset; if (handlerScriptReset != null) { - handlerScriptReset(localID, itemID); - } + foreach (ScriptResetDelegate d in handlerScriptReset.GetInvocationList()) + { + try + { + d(localID, itemID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) - { - handlerRezScript = OnRezScript; + { + NewRezScript handlerRezScript = OnRezScript; if (handlerRezScript != null) { - handlerRezScript(localID, itemID, script, startParam, - postOnRez, engine, stateSource); - } + foreach (NewRezScript d in handlerRezScript.GetInvocationList()) + { + try + { + d(localID, itemID, script, startParam, postOnRez, engine, stateSource); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerStartScript(uint localID, UUID itemID) { - handlerStartScript = OnStartScript; + StartScript handlerStartScript = OnStartScript; if (handlerStartScript != null) { - handlerStartScript(localID, itemID); - } + foreach (StartScript d in handlerStartScript.GetInvocationList()) + { + try + { + d(localID, itemID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerStopScript(uint localID, UUID itemID) { - handlerStopScript = OnStopScript; + StopScript handlerStopScript = OnStopScript; if (handlerStopScript != null) { - handlerStopScript(localID, itemID); - } + foreach (StopScript d in handlerStopScript.GetInvocationList()) + { + try + { + d(localID, itemID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerRemoveScript(uint localID, UUID itemID) - { - handlerRemoveScript = OnRemoveScript; + { + RemoveScript handlerRemoveScript = OnRemoveScript; if (handlerRemoveScript != null) { - handlerRemoveScript(localID, itemID); - } + foreach (RemoveScript d in handlerRemoveScript.GetInvocationList()) + { + try + { + d(localID, itemID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public bool TriggerGroupMove(UUID groupID, Vector3 delta) { - handlerSceneGroupMove = OnSceneGroupMove; - + bool result = true; + + SceneGroupMoved handlerSceneGroupMove = OnSceneGroupMove; if (handlerSceneGroupMove != null) { - return handlerSceneGroupMove(groupID, delta); + foreach (SceneGroupMoved d in handlerSceneGroupMove.GetInvocationList()) + { + try + { + if (d(groupID, delta) == false) + result = false; + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } } - return true; + + return result; } public bool TriggerGroupSpinStart(UUID groupID) { - handlerSceneGroupSpinStarted = OnSceneGroupSpinStart; - + bool result = true; + + SceneGroupSpinStarted handlerSceneGroupSpinStarted = OnSceneGroupSpinStart; if (handlerSceneGroupSpinStarted != null) { - return handlerSceneGroupSpinStarted(groupID); + foreach (SceneGroupSpinStarted d in handlerSceneGroupSpinStarted.GetInvocationList()) + { + try + { + if (d(groupID) == false) + result = false; + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } } - return true; + + return result; } public bool TriggerGroupSpin(UUID groupID, Quaternion rotation) { - handlerSceneGroupSpin = OnSceneGroupSpin; - + bool result = true; + + SceneGroupSpun handlerSceneGroupSpin = OnSceneGroupSpin; if (handlerSceneGroupSpin != null) { - return handlerSceneGroupSpin(groupID, rotation); + foreach (SceneGroupSpun d in handlerSceneGroupSpin.GetInvocationList()) + { + try + { + if (d(groupID, rotation) == false) + result = false; + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } } - return true; + + return result; } public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID) { - handlerSceneGroupGrab = OnSceneGroupGrab; + SceneGroupGrabed handlerSceneGroupGrab = OnSceneGroupGrab; if (handlerSceneGroupGrab != null) { - handlerSceneGroupGrab(groupID, offset, userID); - } + foreach (SceneGroupGrabed d in handlerSceneGroupGrab.GetInvocationList()) + { + try + { + d(groupID, offset, userID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerLandObjectAdded(ILandObject newParcel) { - handlerLandObjectAdded = OnLandObjectAdded; - + LandObjectAdded handlerLandObjectAdded = OnLandObjectAdded; if (handlerLandObjectAdded != null) { - handlerLandObjectAdded(newParcel); - } + foreach (LandObjectAdded d in handlerLandObjectAdded.GetInvocationList()) + { + try + { + d(newParcel); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerLandObjectRemoved(UUID globalID) { - handlerLandObjectRemoved = OnLandObjectRemoved; + LandObjectRemoved handlerLandObjectRemoved = OnLandObjectRemoved; if (handlerLandObjectRemoved != null) { - handlerLandObjectRemoved(globalID); - } + foreach (LandObjectRemoved d in handlerLandObjectRemoved.GetInvocationList()) + { + try + { + d(globalID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerLandObjectUpdated(uint localParcelID, ILandObject newParcel) { - //triggerLandObjectRemoved(localParcelID); - TriggerLandObjectAdded(newParcel); } public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) { - handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel; - + AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = OnAvatarEnteringNewParcel; if (handlerAvatarEnteringNewParcel != null) { - handlerAvatarEnteringNewParcel(avatar, localLandID, regionID); - } + foreach (AvatarEnteringNewParcel d in handlerAvatarEnteringNewParcel.GetInvocationList()) + { + try + { + d(avatar, localLandID, regionID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerIncomingInstantMessage(GridInstantMessage message) { - handlerIncomingInstantMessage = OnIncomingInstantMessage; + IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage; if (handlerIncomingInstantMessage != null) { - handlerIncomingInstantMessage(message); - } + foreach (IncomingInstantMessage d in handlerIncomingInstantMessage.GetInvocationList()) + { + try + { + d(message); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerUnhandledInstantMessage(GridInstantMessage message) { - handlerUnhandledInstantMessage = OnUnhandledInstantMessage; + IncomingInstantMessage handlerUnhandledInstantMessage = OnUnhandledInstantMessage; if (handlerUnhandledInstantMessage != null) { - handlerUnhandledInstantMessage(message); - } + foreach (IncomingInstantMessage d in handlerUnhandledInstantMessage.GetInvocationList()) + { + try + { + d(message); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerClientClosed(UUID ClientID, Scene scene) { - handlerClientClosed = OnClientClosed; + ClientClosed handlerClientClosed = OnClientClosed; if (handlerClientClosed != null) { - handlerClientClosed(ClientID, scene); - } + foreach (ClientClosed d in handlerClientClosed.GetInvocationList()) + { + try + { + d(ClientID, scene); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnMakeChildAgent(ScenePresence presence) { - handlerMakeChildAgent = OnMakeChildAgent; + OnMakeChildAgentDelegate handlerMakeChildAgent = OnMakeChildAgent; if (handlerMakeChildAgent != null) { - handlerMakeChildAgent(presence); - } + foreach (OnMakeChildAgentDelegate d in handlerMakeChildAgent.GetInvocationList()) + { + try + { + d(presence); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnMakeRootAgent(ScenePresence presence) { - handlerMakeRootAgent = OnMakeRootAgent; + OnMakeRootAgentDelegate handlerMakeRootAgent = OnMakeRootAgent; if (handlerMakeRootAgent != null) { - handlerMakeRootAgent(presence); - } + foreach (OnMakeRootAgentDelegate d in handlerMakeRootAgent.GetInvocationList()) + { + try + { + d(presence); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnRegisterCaps(UUID agentID, Caps caps) - { - handlerRegisterCaps = OnRegisterCaps; + { + RegisterCapsEvent handlerRegisterCaps = OnRegisterCaps; if (handlerRegisterCaps != null) { - handlerRegisterCaps(agentID, caps); - } + foreach (RegisterCapsEvent d in handlerRegisterCaps.GetInvocationList()) + { + try + { + d(agentID, caps); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnDeregisterCaps(UUID agentID, Caps caps) { - handlerDeregisterCaps = OnDeregisterCaps; + DeregisterCapsEvent handlerDeregisterCaps = OnDeregisterCaps; if (handlerDeregisterCaps != null) { - handlerDeregisterCaps(agentID, caps); - } + foreach (DeregisterCapsEvent d in handlerDeregisterCaps.GetInvocationList()) + { + try + { + d(agentID, caps); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, UUID AssetID, String AssetName, int userlevel) { - handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; + NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; if (handlerNewInventoryItemUpdateComplete != null) { - handlerNewInventoryItemUpdateComplete(agentID, AssetID, AssetName, userlevel); - } + foreach (NewInventoryItemUploadComplete d in handlerNewInventoryItemUpdateComplete.GetInvocationList()) + { + try + { + d(agentID, AssetID, AssetName, userlevel); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } - public void TriggerLandBuy(Object sender, LandBuyArgs e) + public void TriggerLandBuy(Object sender, LandBuyArgs args) { - handlerLandBuy = OnLandBuy; + LandBuy handlerLandBuy = OnLandBuy; if (handlerLandBuy != null) { - handlerLandBuy(sender, e); - } + foreach (LandBuy d in handlerLandBuy.GetInvocationList()) + { + try + { + d(sender, args); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } - public void TriggerValidateLandBuy(Object sender, LandBuyArgs e) + public void TriggerValidateLandBuy(Object sender, LandBuyArgs args) { - handlerValidateLandBuy = OnValidateLandBuy; + LandBuy handlerValidateLandBuy = OnValidateLandBuy; if (handlerValidateLandBuy != null) { - handlerValidateLandBuy(sender, e); - } + foreach (LandBuy d in handlerValidateLandBuy.GetInvocationList()) + { + try + { + d(sender, args); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerAtTargetEvent(uint localID, uint handle, Vector3 targetpos, Vector3 currentpos) - { - handlerScriptAtTargetEvent = OnScriptAtTargetEvent; + { + ScriptAtTargetEvent handlerScriptAtTargetEvent = OnScriptAtTargetEvent; if (handlerScriptAtTargetEvent != null) { - handlerScriptAtTargetEvent(localID, handle, targetpos, currentpos); - } + foreach (ScriptAtTargetEvent d in handlerScriptAtTargetEvent.GetInvocationList()) + { + try + { + d(localID, handle, targetpos, currentpos); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerNotAtTargetEvent(uint localID) { - handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent; + ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = OnScriptNotAtTargetEvent; if (handlerScriptNotAtTargetEvent != null) { - handlerScriptNotAtTargetEvent(localID); - } + foreach (ScriptNotAtTargetEvent d in handlerScriptNotAtTargetEvent.GetInvocationList()) + { + try + { + d(localID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) - { - handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; + { + ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; if (handlerScriptAtRotTargetEvent != null) { - handlerScriptAtRotTargetEvent(localID, handle, targetrot, currentrot); - } + foreach (ScriptAtRotTargetEvent d in handlerScriptAtRotTargetEvent.GetInvocationList()) + { + try + { + d(localID, handle, targetrot, currentrot); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerNotAtRotTargetEvent(uint localID) { - handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent; + ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent; if (handlerScriptNotAtRotTargetEvent != null) { - handlerScriptNotAtRotTargetEvent(localID); - } + foreach (ScriptNotAtRotTargetEvent d in handlerScriptNotAtRotTargetEvent.GetInvocationList()) + { + try + { + d(localID); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerRequestChangeWaterHeight(float height) { - handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; + RequestChangeWaterHeight handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; if (handlerRequestChangeWaterHeight != null) { - handlerRequestChangeWaterHeight(height); - } + foreach (RequestChangeWaterHeight d in handlerRequestChangeWaterHeight.GetInvocationList()) + { + try + { + d(height); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar) { - handlerAvatarKill = OnAvatarKilled; + AvatarKillData handlerAvatarKill = OnAvatarKilled; if (handlerAvatarKill != null) { - handlerAvatarKill(KillerObjectLocalID, DeadAvatar); - } + foreach (AvatarKillData d in handlerAvatarKill.GetInvocationList()) + { + try + { + d(KillerObjectLocalID, DeadAvatar); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerSignificantClientMovement(IClientAPI client) { - handlerSignificantClientMovement = OnSignificantClientMovement; + SignificantClientMovement handlerSignificantClientMovement = OnSignificantClientMovement; if (handlerSignificantClientMovement != null) { - handlerSignificantClientMovement(client); - } + foreach (SignificantClientMovement d in handlerSignificantClientMovement.GetInvocationList()) + { + try + { + d(client); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat) { - handlerChatFromWorld = OnChatFromWorld; + ChatFromWorldEvent handlerChatFromWorld = OnChatFromWorld; if (handlerChatFromWorld != null) { - handlerChatFromWorld(sender, chat); - } + foreach (ChatFromWorldEvent d in handlerChatFromWorld.GetInvocationList()) + { + try + { + d(sender, chat); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnChatFromClient(Object sender, OSChatMessage chat) { - handlerChatFromClient = OnChatFromClient; + ChatFromClientEvent handlerChatFromClient = OnChatFromClient; if (handlerChatFromClient != null) { - handlerChatFromClient(sender, chat); - } + foreach (ChatFromClientEvent d in handlerChatFromClient.GetInvocationList()) + { + try + { + d(sender, chat); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) { - handlerChatBroadcast = OnChatBroadcast; + ChatBroadcastEvent handlerChatBroadcast = OnChatBroadcast; if (handlerChatBroadcast != null) { - handlerChatBroadcast(sender, chat); - } + foreach (ChatBroadcastEvent d in handlerChatBroadcast.GetInvocationList()) + { + try + { + d(sender, chat); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } internal void TriggerControlEvent(uint p, UUID scriptUUID, UUID avatarID, uint held, uint _changed) { - handlerScriptControlEvent = OnScriptControlEvent; + ScriptControlEvent handlerScriptControlEvent = OnScriptControlEvent; if (handlerScriptControlEvent != null) { - handlerScriptControlEvent(p, scriptUUID, avatarID, held, _changed); - } + foreach (ScriptControlEvent d in handlerScriptControlEvent.GetInvocationList()) + { + try + { + d(p, scriptUUID, avatarID, held, _changed); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerNoticeNoLandDataFromStorage() { - handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; + NoticeNoLandDataFromStorage handlerNoticeNoLandDataFromStorage = OnNoticeNoLandDataFromStorage; if (handlerNoticeNoLandDataFromStorage != null) { - handlerNoticeNoLandDataFromStorage(); - - } + foreach (NoticeNoLandDataFromStorage d in handlerNoticeNoLandDataFromStorage.GetInvocationList()) + { + try + { + d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerIncomingLandDataFromStorage(List landData) { - handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage; + IncomingLandDataFromStorage handlerIncomingLandDataFromStorage = OnIncomingLandDataFromStorage; if (handlerIncomingLandDataFromStorage != null) { - handlerIncomingLandDataFromStorage(landData); - - } + foreach (IncomingLandDataFromStorage d in handlerIncomingLandDataFromStorage.GetInvocationList()) + { + try + { + d(landData); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerSetAllowForcefulBan(bool allow) { - handlerSetAllowForcefulBan = OnSetAllowForcefulBan; + SetAllowForcefulBan handlerSetAllowForcefulBan = OnSetAllowForcefulBan; if (handlerSetAllowForcefulBan != null) { - handlerSetAllowForcefulBan(allow); - - } + foreach (SetAllowForcefulBan d in handlerSetAllowForcefulBan.GetInvocationList()) + { + try + { + d(allow); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerRequestParcelPrimCountUpdate() { - handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; + RequestParcelPrimCountUpdate handlerRequestParcelPrimCountUpdate = OnRequestParcelPrimCountUpdate; if (handlerRequestParcelPrimCountUpdate != null) { - handlerRequestParcelPrimCountUpdate(); - } + foreach (RequestParcelPrimCountUpdate d in handlerRequestParcelPrimCountUpdate.GetInvocationList()) + { + try + { + d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerParcelPrimCountTainted() { - handlerParcelPrimCountTainted = OnParcelPrimCountTainted; + ParcelPrimCountTainted handlerParcelPrimCountTainted = OnParcelPrimCountTainted; if (handlerParcelPrimCountTainted != null) { - handlerParcelPrimCountTainted(); - } + foreach (ParcelPrimCountTainted d in handlerParcelPrimCountTainted.GetInvocationList()) + { + try + { + d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } // this lets us keep track of nasty script events like timer, etc. @@ -1029,99 +1665,277 @@ namespace OpenSim.Region.Framework.Scenes /// The hour 0.0 <= FixedSunHour <= 24.0 at which the sun is fixed at. Sun Hour 0 is sun-rise, when Day/Night ratio is 1:1 public void TriggerEstateToolsSunUpdate(ulong regionHandle, bool FixedTime, bool useEstateTime, float FixedSunHour) { - handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; + EstateToolsSunUpdate handlerEstateToolsSunUpdate = OnEstateToolsSunUpdate; if (handlerEstateToolsSunUpdate != null) { - handlerEstateToolsSunUpdate(regionHandle, FixedTime, useEstateTime, FixedSunHour); - } + foreach (EstateToolsSunUpdate d in handlerEstateToolsSunUpdate.GetInvocationList()) + { + try + { + d(regionHandle, FixedTime, useEstateTime, FixedSunHour); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public float GetCurrentTimeAsSunLindenHour() { - handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour; + SunLindenHour handlerCurrentTimeAsLindenSunHour = OnGetCurrentTimeAsLindenSunHour; if (handlerCurrentTimeAsLindenSunHour != null) { - return handlerCurrentTimeAsLindenSunHour(); + foreach (SunLindenHour d in handlerCurrentTimeAsLindenSunHour.GetInvocationList()) + { + try + { + return d(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } } + return 6; } public void TriggerOarFileLoaded(Guid requestId, string message) - { - handlerOarFileLoaded = OnOarFileLoaded; + { + OarFileLoaded handlerOarFileLoaded = OnOarFileLoaded; if (handlerOarFileLoaded != null) - handlerOarFileLoaded(requestId, message); + { + foreach (OarFileLoaded d in handlerOarFileLoaded.GetInvocationList()) + { + try + { + d(requestId, message); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOarFileSaved(Guid requestId, string message) { - handlerOarFileSaved = OnOarFileSaved; + OarFileSaved handlerOarFileSaved = OnOarFileSaved; if (handlerOarFileSaved != null) - handlerOarFileSaved(requestId, message); + { + foreach (OarFileSaved d in handlerOarFileSaved.GetInvocationList()) + { + try + { + d(requestId, message); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) { - handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue; + EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = OnEmptyScriptCompileQueue; if (handlerEmptyScriptCompileQueue != null) - handlerEmptyScriptCompileQueue(numScriptsFailed, message); + { + foreach (EmptyScriptCompileQueue d in handlerEmptyScriptCompileQueue.GetInvocationList()) + { + try + { + d(numScriptsFailed, message); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) { - handlerCollidingStart = OnScriptColliderStart; + ScriptColliding handlerCollidingStart = OnScriptColliderStart; if (handlerCollidingStart != null) - handlerCollidingStart(localId, colliders); + { + foreach (ScriptColliding d in handlerCollidingStart.GetInvocationList()) + { + try + { + d(localId, colliders); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerScriptColliding(uint localId, ColliderArgs colliders) { - handlerColliding = OnScriptColliding; + ScriptColliding handlerColliding = OnScriptColliding; if (handlerColliding != null) - handlerColliding(localId, colliders); + { + foreach (ScriptColliding d in handlerColliding.GetInvocationList()) + { + try + { + d(localId, colliders); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) { - handlerCollidingEnd = OnScriptCollidingEnd; + ScriptColliding handlerCollidingEnd = OnScriptCollidingEnd; if (handlerCollidingEnd != null) - handlerCollidingEnd(localId, colliders); + { + foreach (ScriptColliding d in handlerCollidingEnd.GetInvocationList()) + { + try + { + d(localId, colliders); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) { - handlerLandCollidingStart = OnScriptLandColliderStart; + ScriptColliding handlerLandCollidingStart = OnScriptLandColliderStart; if (handlerLandCollidingStart != null) - handlerLandCollidingStart(localId, colliders); + { + foreach (ScriptColliding d in handlerLandCollidingStart.GetInvocationList()) + { + try + { + d(localId, colliders); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) { - handlerLandColliding = OnScriptLandColliding; + ScriptColliding handlerLandColliding = OnScriptLandColliding; if (handlerLandColliding != null) - handlerLandColliding(localId, colliders); + { + foreach (ScriptColliding d in handlerLandColliding.GetInvocationList()) + { + try + { + d(localId, colliders); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) { - handlerLandCollidingEnd = OnScriptLandColliderEnd; + ScriptColliding handlerLandCollidingEnd = OnScriptLandColliderEnd; if (handlerLandCollidingEnd != null) - handlerLandCollidingEnd(localId, colliders); + { + foreach (ScriptColliding d in handlerLandCollidingEnd.GetInvocationList()) + { + try + { + d(localId, colliders); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerSetRootAgentScene(UUID agentID, Scene scene) - { - handlerSetRootAgentScene = OnSetRootAgentScene; + { + OnSetRootAgentSceneDelegate handlerSetRootAgentScene = OnSetRootAgentScene; if (handlerSetRootAgentScene != null) - handlerSetRootAgentScene(agentID, scene); + { + foreach (OnSetRootAgentSceneDelegate d in handlerSetRootAgentScene.GetInvocationList()) + { + try + { + d(agentID, scene); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } public void TriggerOnRegionUp(GridRegion otherRegion) { - handlerOnRegionUp = OnRegionUp; + RegionUp handlerOnRegionUp = OnRegionUp; if (handlerOnRegionUp != null) - handlerOnRegionUp(otherRegion); + { + foreach (RegionUp d in handlerOnRegionUp.GetInvocationList()) + { + try + { + d(otherRegion); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } } - } -} +} \ No newline at end of file From 1442ab08aa06f244ef43e7df96aeb664f112cb06 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 19:08:02 +0000 Subject: [PATCH 63/81] minor: remove one mono compiler warning --- OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs index 7d71f18d58..daf1fb01ef 100644 --- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs +++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs @@ -55,7 +55,7 @@ namespace OpenSim.Client.MXP.PacketHandler private readonly Dictionary m_scenes; private readonly Transmitter m_transmitter; - private readonly Thread m_clientThread; +// private readonly Thread m_clientThread; private readonly IList m_sessions = new List(); private readonly IList m_sessionsToClient = new List(); From 2c7672a2b9d2cf38087ff29fa4a142710c3043bb Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 19:27:44 +0000 Subject: [PATCH 64/81] minor: add a smidgen of EventManager doc --- OpenSim/Region/Framework/Scenes/EventManager.cs | 8 +++++--- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 2ab393f837..473920ee88 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -212,10 +212,12 @@ namespace OpenSim.Region.Framework.Scenes public delegate void RequestChangeWaterHeight(float height); public event RequestChangeWaterHeight OnRequestChangeWaterHeight; - - public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar); - + + /// + /// Fired if any avatar is 'killed' due to its health falling to zero + /// public event AvatarKillData OnAvatarKilled; + public delegate void AvatarKillData(uint KillerLocalID, ScenePresence avatar); // public delegate void ScriptTimerEvent(uint localID, double timerinterval); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5419a9a5de..cd39cab81d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3274,9 +3274,7 @@ namespace OpenSim.Region.Framework.Scenes } if (m_health <= 0) m_scene.EventManager.TriggerAvatarKill(killerObj, this); - } - - + } } public void setHealthWithUpdate(float health) From 7c69badd3daa81464f00aa1009941c7c4825cc2b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 19:34:08 +0000 Subject: [PATCH 65/81] minor: remove one mono compiler warning --- .../Framework/Library/LibraryModule.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 6941e009cd..13f58bdcd2 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs @@ -174,18 +174,16 @@ namespace OpenSim.Region.CoreModules.Framework.Library { m_log.DebugFormat("[LIBRARY MODULE]: Exception when processing archive {0}: {1}", iarFileName, e.Message); } - } - - } - - private void DumpLibrary() - { - InventoryFolderImpl lib = m_Scene.CommsManager.UserProfileCacheService.LibraryRoot; - - m_log.DebugFormat(" - folder {0}", lib.Name); - DumpFolder(lib); } +// +// private void DumpLibrary() +// { +// InventoryFolderImpl lib = m_Scene.CommsManager.UserProfileCacheService.LibraryRoot; +// +// m_log.DebugFormat(" - folder {0}", lib.Name); +// DumpFolder(lib); +// } private void DumpFolder(InventoryFolderImpl folder) { From bde7f361fa6e8151d2780f8b9ca0cfae97f8736b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 19:46:33 +0000 Subject: [PATCH 66/81] minor: remove one mono compiler warning --- OpenSim/Region/CoreModules/World/Access/AccessModule.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index dfa8df6922..73f7ae333b 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs @@ -42,9 +42,7 @@ namespace OpenSim.Region.CoreModules.World { public class AccessModule : ISharedRegionModule { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_SceneList = new List(); From b9c3846e8126f3bafe457821c5244764744764e1 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Feb 2010 22:19:28 +0000 Subject: [PATCH 67/81] minor: remove some mono compiler warnings --- OpenSim/Data/SQLite/SQLiteAssetData.cs | 2 +- OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | 4 +--- OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 23642b3974..c52f60b2c0 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -41,7 +41,7 @@ namespace OpenSim.Data.SQLite /// public class SQLiteAssetData : AssetDataBase { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, UUID from assets limit :start, :count"; diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 6b67ec6fd7..8e916936aa 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs @@ -39,9 +39,7 @@ namespace OpenSim.Data.SQLite { public class SQLiteGenericTableHandler : SQLiteFramework where T: class, new() { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Dictionary m_Fields = new Dictionary(); diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index 97625a74c5..5c93f88f70 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -41,8 +41,7 @@ namespace OpenSim.Data.SQLite /// public class SQLiteXInventoryData : IXInventoryData { - private static readonly ILog m_log = LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private SQLiteGenericTableHandler m_Folders; private SqliteItemHandler m_Items; From 2953bee1f4443e041dbce38d042f6ed421d30533 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 4 Feb 2010 17:11:06 +0000 Subject: [PATCH 68/81] Revert "change position of OnAttach event firing so that this also happens when a user teleports into a region" The behavior introduced here is not compatible with SL This reverts commit b6bee4999c9d238a052022f105069ea4eb85f8f4. --- OpenSim/Region/Framework/Scenes/Scene.cs | 29 +++++++++---------- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 3 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ff2be05455..73b0b3e2e9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2496,24 +2496,20 @@ namespace OpenSim.Region.Framework.Scenes //RootPrim.SetParentLocalId(parentLocalID); - m_log.DebugFormat( - "[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", - //grp.RootPart.LastOwnerID.ToString(), - grp.GetFromItemID(), - grp.UUID.ToString()); + m_log.DebugFormat("[ATTACHMENT]: Received " + + "attachment {0}, inworld asset id {1}", + //grp.RootPart.LastOwnerID.ToString(), + grp.GetFromItemID(), + grp.UUID.ToString()); //grp.SetFromAssetID(grp.RootPart.LastOwnerID); - m_log.DebugFormat( - "[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID.ToString(), grp.AbsolutePosition); - - if ( - AttachObject( - sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false)) - { - // Do this last so that event listeners have access to all the effects of the attachment - EventManager.TriggerOnAttach(grp.LocalId, UUID.Zero, sp.UUID); - } - + m_log.DebugFormat("[ATTACHMENT]: Attach " + + "to avatar {0} at position {1}", + sp.UUID.ToString(), grp.AbsolutePosition); + AttachObject(sp.ControllingClient, + grp.LocalId, (uint)0, + grp.GroupRotation, + grp.AbsolutePosition, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez); grp.SendGroupFullUpdate(); } @@ -2522,6 +2518,7 @@ namespace OpenSim.Region.Framework.Scenes RootPrim.RemFlag(PrimFlags.TemporaryOnRez); RootPrim.AddFlag(PrimFlags.TemporaryOnRez); } + } else { diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index b508af5f7f..1ac061a1b2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -627,10 +627,11 @@ namespace OpenSim.Region.Framework.Scenes } m_parentScene.AttachObject(remoteClient, AttachmentPt, itemId, group); + group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); - // In case it is later dropped again, don't let // it get cleaned up + // group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); group.HasGroupChanged = false; } From 8556a9f1a8c85bc77c87beeaae1aec7d170ebbd3 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 4 Feb 2010 13:31:06 -0800 Subject: [PATCH 69/81] Applying patch #4534 by Misterblue to fix ODE physics stickiness --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 973aa844d3..44b2727afe 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -1575,6 +1575,7 @@ Console.WriteLine(" JointCreateFixed"); { //Console.WriteLine("Move " + m_primName); if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 + /* // NON-'VEHICLES' are dealt with here if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) { @@ -1587,6 +1588,7 @@ Console.WriteLine(" JointCreateFixed"); avel2.Z = 0; d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z); } + */ //float PID_P = 900.0f; float m_mass = CalculateMass(); From f1b99c4a7f9543c3a2aa36de2e659bdefca9e68b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 4 Feb 2010 21:35:56 +0000 Subject: [PATCH 70/81] minor: one method doc --- .../Scripting/VectorRender/VectorRenderModule.cs | 1 + OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index d57a8e5979..3291be4163 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -342,6 +342,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender m_log.Error( "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); } + m_textureManager.ReturnData(id, imageJ2000); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8d845578c6..dd797fcdae 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4144,9 +4144,13 @@ namespace OpenSim.Region.Framework.Scenes ScheduleFullUpdate(); } - // Added to handle bug in libsecondlife's TextureEntry.ToBytes() - // not handling RGBA properly. Cycles through, and "fixes" the color - // info + /// + /// Update the textures on the part. + /// + /// Added to handle bug in libsecondlife's TextureEntry.ToBytes() + /// not handling RGBA properly. Cycles through, and "fixes" the color + /// info + /// public void UpdateTexture(Primitive.TextureEntry tex) { //Color4 tmpcolor; From 0a084a31e9f96cc007f953b47e3319bde6d834f2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 4 Feb 2010 23:23:07 +0000 Subject: [PATCH 71/81] refactor: chain two ScenePresence constructors together to eliminate common code. No functional changes --- .../ClientStack/LindenUDP/LLClientView.cs | 4 ++- .../Region/Framework/Scenes/ScenePresence.cs | 26 ++++++++----------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 1d364d4178..6dc6f011fd 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -5190,6 +5190,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP { ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; + //m_log.DebugFormat("[CLIENT]: Received ScriptDialogReply from {0}", rdialog.Data.ObjectID); + #region Packet Session and User Check if (m_checkPackets) { @@ -5210,7 +5212,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP args.Type = ChatTypeEnum.Shout; args.Position = new Vector3(); args.Scene = Scene; - args.Sender = this; + args.Sender = this; ChatMessage handlerChatFromClient2 = OnChatFromClient; if (handlerChatFromClient2 != null) handlerChatFromClient2(this, args); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cd39cab81d..bcf22c3452 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -104,6 +104,8 @@ namespace OpenSim.Region.Framework.Scenes } protected ScenePresenceAnimator m_animator; + protected List m_attachments = new List(); + private Dictionary scriptedcontrols = new Dictionary(); private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; @@ -215,9 +217,7 @@ namespace OpenSim.Region.Framework.Scenes // Agent's Draw distance. protected float m_DrawDistance; - protected AvatarAppearance m_appearance; - - protected List m_attachments = new List(); + protected AvatarAppearance m_appearance; // neighbouring regions we have enabled a child agent in // holds the seed cap for the child agent in that region @@ -630,12 +630,16 @@ namespace OpenSim.Region.Framework.Scenes #endregion #region Constructor(s) - - private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) - { - m_animator = new ScenePresenceAnimator(this); + + public ScenePresence() + { m_sendCourseLocationsMethod = SendCoarseLocationsDefault; CreateSceneViewer(); + m_animator = new ScenePresenceAnimator(this); + } + + private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() + { m_rootRegionHandle = reginfo.RegionHandle; m_controllingClient = client; m_firstname = m_controllingClient.FirstName; @@ -659,7 +663,6 @@ namespace OpenSim.Region.Framework.Scenes m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize); m_reprioritization_timer.AutoReset = false; - AdjustKnownSeeds(); // TODO: I think, this won't send anything, as we are still a child here... @@ -3321,13 +3324,6 @@ namespace OpenSim.Region.Framework.Scenes m_animator = null; } - public ScenePresence() - { - m_sendCourseLocationsMethod = SendCoarseLocationsDefault; - CreateSceneViewer(); - m_animator = new ScenePresenceAnimator(this); - } - public void AddAttachment(SceneObjectGroup gobj) { lock (m_attachments) From 7058a4c2597a2b76704e906b73ae7077ff805b16 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 5 Feb 2010 18:09:27 +0000 Subject: [PATCH 72/81] Old OpenSim installations may have no AssetCaching setting in config-include/StandaloneCommon.ini [Modules] (or no [Modules] at all) If this is the case, this patch makes CenomeAssetCache the default cache (which matches that selected in StandaloneCommon.ini.example) Not having an asset cache may lead to a continual loop of appearance baking failures and cause dynamic textures not to work, among other effects --- OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index 1add0ab1be..e0e4cc635f 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs @@ -324,7 +324,9 @@ namespace OpenSim.Region.CoreModules.Asset if (moduleConfig == null) return; - string name = moduleConfig.GetString("AssetCaching"); + // We're going to make CenomeAssetCache the default if there is no AssetCaching setting at all. This + // matches the default StandaloneCommon.ini.example + string name = moduleConfig.GetString("AssetCaching", Name); //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); if (name != Name) From 68bb2dac45d7ce0d280cdfa66de3d142bb05c8cc Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 5 Feb 2010 19:21:27 +0000 Subject: [PATCH 73/81] Revert "Old OpenSim installations may have no AssetCaching setting in config-include/StandaloneCommon.ini [Modules] (or no [Modules] at all)" This will be replaced by a better solution where an enabled baking module will fail if no cache is in place (same for dynamic texture modules) This reverts commit 7058a4c2597a2b76704e906b73ae7077ff805b16. --- OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs index e0e4cc635f..1add0ab1be 100644 --- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs @@ -324,9 +324,7 @@ namespace OpenSim.Region.CoreModules.Asset if (moduleConfig == null) return; - // We're going to make CenomeAssetCache the default if there is no AssetCaching setting at all. This - // matches the default StandaloneCommon.ini.example - string name = moduleConfig.GetString("AssetCaching", Name); + string name = moduleConfig.GetString("AssetCaching"); //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name); if (name != Name) From 97eaae9d8454ade646dbd210bcf0cb521ec6b288 Mon Sep 17 00:00:00 2001 From: OpenSim Master Date: Mon, 18 Jan 2010 15:50:33 -0800 Subject: [PATCH 74/81] * Fixed the Cable Beach inventory server to save the CreatorID as well as properly handling null item names and descriptions * Fixed the MySQL reader to safely handle null values in string columns that can be null --- OpenSim/Data/MySQL/MySQLInventoryData.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index f566fdec2e..4b71e3951f 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -345,8 +345,8 @@ namespace OpenSim.Data.MySQL item.AssetID = new UUID((string) reader["assetID"]); item.AssetType = (int) reader["assetType"]; item.Folder = new UUID((string) reader["parentFolderID"]); - item.Name = (string) reader["inventoryName"]; - item.Description = (string) reader["inventoryDescription"]; + item.Name = (string)(reader["inventoryName"] ?? String.Empty); + item.Description = (string)(reader["inventoryDescription"] ?? String.Empty); item.NextPermissions = (uint) reader["inventoryNextPermissions"]; item.CurrentPermissions = (uint) reader["inventoryCurrentPermissions"]; item.InvType = (int) reader["invType"]; From 6392cfcd61a156bda403ee233c322650940df6f7 Mon Sep 17 00:00:00 2001 From: OpenSim Master Date: Mon, 18 Jan 2010 13:47:41 -0800 Subject: [PATCH 75/81] Fixing an incorrect logging message in insertUserRow --- OpenSim/Data/MySQL/MySQLManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index a6cce57819..243394e9db 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -778,7 +778,7 @@ namespace OpenSim.Data.MySQL string aboutText, string firstText, UUID profileImage, UUID firstImage, UUID webLoginKey, int userFlags, int godLevel, string customType, UUID partner) { - m_log.Debug("[MySQLManager]: Fetching profile for " + uuid.ToString()); + m_log.Debug("[MySQLManager]: Creating profile for \"" + username + " " + lastname + "\" (" + uuid + ")"); string sql = "INSERT INTO users (`UUID`, `username`, `lastname`, `email`, `passwordHash`, `passwordSalt`, `homeRegion`, `homeRegionID`, "; sql += From 3e697ad57e8f26e50e13b88fff059855ed17e660 Mon Sep 17 00:00:00 2001 From: OpenSim Master Date: Mon, 18 Jan 2010 15:50:33 -0800 Subject: [PATCH 76/81] * Fixed the Cable Beach inventory server to save the CreatorID as well as properly handling null item names and descriptions * Fixed the MySQL reader to safely handle null values in string columns that can be null --- OpenSim/Data/MySQL/MySQLInventoryData.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index f566fdec2e..4b71e3951f 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -345,8 +345,8 @@ namespace OpenSim.Data.MySQL item.AssetID = new UUID((string) reader["assetID"]); item.AssetType = (int) reader["assetType"]; item.Folder = new UUID((string) reader["parentFolderID"]); - item.Name = (string) reader["inventoryName"]; - item.Description = (string) reader["inventoryDescription"]; + item.Name = (string)(reader["inventoryName"] ?? String.Empty); + item.Description = (string)(reader["inventoryDescription"] ?? String.Empty); item.NextPermissions = (uint) reader["inventoryNextPermissions"]; item.CurrentPermissions = (uint) reader["inventoryCurrentPermissions"]; item.InvType = (int) reader["invType"]; From 5f1f5c29e93d5ef92ccf93386c0738a205df4150 Mon Sep 17 00:00:00 2001 From: OpenSim Master Date: Mon, 18 Jan 2010 13:47:41 -0800 Subject: [PATCH 77/81] Fixing an incorrect logging message in insertUserRow --- OpenSim/Data/MySQL/MySQLManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index a6cce57819..243394e9db 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -778,7 +778,7 @@ namespace OpenSim.Data.MySQL string aboutText, string firstText, UUID profileImage, UUID firstImage, UUID webLoginKey, int userFlags, int godLevel, string customType, UUID partner) { - m_log.Debug("[MySQLManager]: Fetching profile for " + uuid.ToString()); + m_log.Debug("[MySQLManager]: Creating profile for \"" + username + " " + lastname + "\" (" + uuid + ")"); string sql = "INSERT INTO users (`UUID`, `username`, `lastname`, `email`, `passwordHash`, `passwordSalt`, `homeRegion`, `homeRegionID`, "; sql += From e1b5c612472b9d1acf47383c0bf75b555daff2e6 Mon Sep 17 00:00:00 2001 From: Master ScienceSim Date: Thu, 4 Feb 2010 13:19:30 -0800 Subject: [PATCH 78/81] Updated MySQL connection management to use the MySQL connection pooling. This should accommodate various timeout problems that exist with the current connection pool code in a more general and standard way. --- OpenSim/Data/MySQL/MySQLAssetData.cs | 349 +++---- OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 73 +- OpenSim/Data/MySQL/MySQLEstateData.cs | 466 ++++----- OpenSim/Data/MySQL/MySQLFramework.cs | 62 +- .../Data/MySQL/MySQLGenericTableHandler.cs | 225 +++-- OpenSim/Data/MySQL/MySQLGridData.cs | 354 +++---- OpenSim/Data/MySQL/MySQLInventoryData.cs | 867 +++++++---------- OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | 918 +++++++++--------- OpenSim/Data/MySQL/MySQLLogData.cs | 16 +- OpenSim/Data/MySQL/MySQLManager.cs | 432 ++++----- OpenSim/Data/MySQL/MySQLRegionData.cs | 255 ++--- OpenSim/Data/MySQL/MySQLUserAccountData.cs | 156 +-- OpenSim/Data/MySQL/MySQLUserData.cs | 674 +++++-------- OpenSim/Data/MySQL/MySQLXInventoryData.cs | 65 +- OpenSim/Data/MySQL/Tests/MySQLGridTest.cs | 9 +- 15 files changed, 2261 insertions(+), 2660 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 6a4ccd7057..666c22f135 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -43,10 +43,13 @@ namespace OpenSim.Data.MySQL { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private MySQLManager _dbConnection; + private string m_connectionString; + private object m_dbLock = new object(); #region IPlugin Members + public override string Version { get { return "1.0.0.0"; } } + /// /// Initialises Asset interface /// @@ -58,62 +61,28 @@ namespace OpenSim.Data.MySQL /// /// /// connect string - override public void Initialise(string connect) + public override void Initialise(string connect) { - // TODO: This will let you pass in the connect string in - // the config, though someone will need to write that. - if (connect == String.Empty) - { - // This is old seperate config file - m_log.Warn("no connect string, using old mysql_connection.ini instead"); - Initialise(); - } - else - { - _dbConnection = new MySQLManager(connect); - } + m_connectionString = connect; // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; - Migration m = new Migration(_dbConnection.Connection, assem, "AssetStore"); - m.Update(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, assem, "AssetStore"); + m.Update(); + } } - /// - /// Initialises Asset interface - /// - /// - /// Loads and initialises the MySQL storage plugin - /// uses the obsolete mysql_connection.ini - /// - /// - /// - /// DEPRECATED and shouldn't be used public override void Initialise() { - IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); - string hostname = GridDataMySqlFile.ParseFileReadValue("hostname"); - string database = GridDataMySqlFile.ParseFileReadValue("database"); - string username = GridDataMySqlFile.ParseFileReadValue("username"); - string password = GridDataMySqlFile.ParseFileReadValue("password"); - string pooling = GridDataMySqlFile.ParseFileReadValue("pooling"); - string port = GridDataMySqlFile.ParseFileReadValue("port"); - - _dbConnection = new MySQLManager(hostname, database, username, password, pooling, port); - + throw new NotImplementedException(); } public override void Dispose() { } - /// - /// Database provider version - /// - override public string Version - { - get { return _dbConnection.getVersion(); } - } - /// /// The name of this DB provider /// @@ -135,46 +104,43 @@ namespace OpenSim.Data.MySQL override public AssetBase GetAsset(UUID assetID) { AssetBase asset = null; - lock (_dbConnection) + lock (m_dbLock) { - _dbConnection.CheckConnection(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - MySqlCommand cmd = - new MySqlCommand( + using (MySqlCommand cmd = new MySqlCommand( "SELECT name, description, assetType, local, temporary, data FROM assets WHERE id=?id", - _dbConnection.Connection); - cmd.Parameters.AddWithValue("?id", assetID.ToString()); - - try - { - using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) + dbcon)) { - if (dbReader.Read()) + cmd.Parameters.AddWithValue("?id", assetID.ToString()); + + try { - asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"]); - asset.Data = (byte[]) dbReader["data"]; - asset.Description = (string) dbReader["description"]; + using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) + { + if (dbReader.Read()) + { + asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"]); + asset.Data = (byte[])dbReader["data"]; + asset.Description = (string)dbReader["description"]; - string local = dbReader["local"].ToString(); - if (local.Equals("1") || local.Equals("true", StringComparison.InvariantCultureIgnoreCase)) - asset.Local = true; - else - asset.Local = false; + string local = dbReader["local"].ToString(); + if (local.Equals("1") || local.Equals("true", StringComparison.InvariantCultureIgnoreCase)) + asset.Local = true; + else + asset.Local = false; - asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); + asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); + } + } + } + catch (Exception e) + { + m_log.Error("[ASSETS DB]: MySql failure fetching asset " + assetID + ": " + e.Message); } - dbReader.Close(); - cmd.Dispose(); } - if (asset != null) - UpdateAccessTime(asset); - } - catch (Exception e) - { - m_log.ErrorFormat( - "[ASSETS DB]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString() - + Environment.NewLine + "Reconnecting", assetID); - _dbConnection.Reconnect(); } } return asset; @@ -187,55 +153,57 @@ namespace OpenSim.Data.MySQL /// On failure : Throw an exception and attempt to reconnect to database override public void StoreAsset(AssetBase asset) { - lock (_dbConnection) + lock (m_dbLock) { - _dbConnection.CheckConnection(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - MySqlCommand cmd = - new MySqlCommand( - "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, data)" + - "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", - _dbConnection.Connection); + MySqlCommand cmd = + new MySqlCommand( + "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, data)" + + "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", + dbcon); - string assetName = asset.Name; - if (asset.Name.Length > 64) - { - assetName = asset.Name.Substring(0, 64); - m_log.Warn("[ASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add"); - } - - string assetDescription = asset.Description; - if (asset.Description.Length > 64) - { - assetDescription = asset.Description.Substring(0, 64); - m_log.Warn("[ASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); - } - - // need to ensure we dispose - try - { - using (cmd) + string assetName = asset.Name; + if (asset.Name.Length > 64) { - // create unix epoch time - int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow); - cmd.Parameters.AddWithValue("?id", asset.ID); - cmd.Parameters.AddWithValue("?name", assetName); - cmd.Parameters.AddWithValue("?description", assetDescription); - cmd.Parameters.AddWithValue("?assetType", asset.Type); - cmd.Parameters.AddWithValue("?local", asset.Local); - cmd.Parameters.AddWithValue("?temporary", asset.Temporary); - cmd.Parameters.AddWithValue("?create_time", now); - cmd.Parameters.AddWithValue("?access_time", now); - cmd.Parameters.AddWithValue("?data", asset.Data); - cmd.ExecuteNonQuery(); - cmd.Dispose(); + assetName = asset.Name.Substring(0, 64); + m_log.Warn("[ASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add"); + } + + string assetDescription = asset.Description; + if (asset.Description.Length > 64) + { + assetDescription = asset.Description.Substring(0, 64); + m_log.Warn("[ASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add"); + } + + // need to ensure we dispose + try + { + using (cmd) + { + // create unix epoch time + int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow); + cmd.Parameters.AddWithValue("?id", asset.ID); + cmd.Parameters.AddWithValue("?name", assetName); + cmd.Parameters.AddWithValue("?description", assetDescription); + cmd.Parameters.AddWithValue("?assetType", asset.Type); + cmd.Parameters.AddWithValue("?local", asset.Local); + cmd.Parameters.AddWithValue("?temporary", asset.Temporary); + cmd.Parameters.AddWithValue("?create_time", now); + cmd.Parameters.AddWithValue("?access_time", now); + cmd.Parameters.AddWithValue("?data", asset.Data); + cmd.ExecuteNonQuery(); + cmd.Dispose(); + } + } + catch (Exception e) + { + m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}", + asset.FullID, asset.Name, e.Message); } - } - catch (Exception e) - { - m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Attempting reconnect. Error: {2}", - asset.FullID, asset.Name, e.Message); - _dbConnection.Reconnect(); } } } @@ -245,34 +213,35 @@ namespace OpenSim.Data.MySQL // Writing to the database every time Get() is called on an asset is killing us. Seriously. -jph return; - lock (_dbConnection) + lock (m_dbLock) { - _dbConnection.CheckConnection(); - - MySqlCommand cmd = - new MySqlCommand("update assets set access_time=?access_time where id=?id", - _dbConnection.Connection); - - // need to ensure we dispose - try + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - using (cmd) + dbcon.Open(); + MySqlCommand cmd = + new MySqlCommand("update assets set access_time=?access_time where id=?id", + dbcon); + + // need to ensure we dispose + try { - // create unix epoch time - int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow); - cmd.Parameters.AddWithValue("?id", asset.ID); - cmd.Parameters.AddWithValue("?access_time", now); - cmd.ExecuteNonQuery(); - cmd.Dispose(); + using (cmd) + { + // create unix epoch time + int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow); + cmd.Parameters.AddWithValue("?id", asset.ID); + cmd.Parameters.AddWithValue("?access_time", now); + cmd.ExecuteNonQuery(); + cmd.Dispose(); + } + } + catch (Exception e) + { + m_log.ErrorFormat( + "[ASSETS DB]: " + + "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() + + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); } - } - catch (Exception e) - { - m_log.ErrorFormat( - "[ASSETS DB]: " + - "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString() - + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); - _dbConnection.Reconnect(); } } @@ -287,37 +256,30 @@ namespace OpenSim.Data.MySQL { bool assetExists = false; - lock (_dbConnection) + lock (m_dbLock) { - _dbConnection.CheckConnection(); - - MySqlCommand cmd = - new MySqlCommand( - "SELECT id FROM assets WHERE id=?id", - _dbConnection.Connection); - - cmd.Parameters.AddWithValue("?id", uuid.ToString()); - - try + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) + dbcon.Open(); + using (MySqlCommand cmd = new MySqlCommand("SELECT id FROM assets WHERE id=?id", dbcon)) { - if (dbReader.Read()) - { - assetExists = true; - } + cmd.Parameters.AddWithValue("?id", uuid.ToString()); - dbReader.Close(); - cmd.Dispose(); + try + { + using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) + { + if (dbReader.Read()) + assetExists = true; + } + } + catch (Exception e) + { + m_log.ErrorFormat( + "[ASSETS DB]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString(), uuid); + } } } - catch (Exception e) - { - m_log.ErrorFormat( - "[ASSETS DB]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString() - + Environment.NewLine + "Attempting reconnection", uuid); - _dbConnection.Reconnect(); - } } return assetExists; @@ -335,38 +297,39 @@ namespace OpenSim.Data.MySQL { List retList = new List(count); - lock (_dbConnection) + lock (m_dbLock) { - _dbConnection.CheckConnection(); - - MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id FROM assets LIMIT ?start, ?count", _dbConnection.Connection); - cmd.Parameters.AddWithValue("?start", start); - cmd.Parameters.AddWithValue("?count", count); - - try + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - using (MySqlDataReader dbReader = cmd.ExecuteReader()) + dbcon.Open(); + MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id FROM assets LIMIT ?start, ?count", dbcon); + cmd.Parameters.AddWithValue("?start", start); + cmd.Parameters.AddWithValue("?count", count); + + try { - while (dbReader.Read()) + using (MySqlDataReader dbReader = cmd.ExecuteReader()) { - AssetMetadata metadata = new AssetMetadata(); - metadata.Name = (string) dbReader["name"]; - metadata.Description = (string) dbReader["description"]; - metadata.Type = (sbyte) dbReader["assetType"]; - metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. - metadata.FullID = new UUID((string) dbReader["id"]); + while (dbReader.Read()) + { + AssetMetadata metadata = new AssetMetadata(); + metadata.Name = (string)dbReader["name"]; + metadata.Description = (string)dbReader["description"]; + metadata.Type = (sbyte)dbReader["assetType"]; + metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. + metadata.FullID = new UUID((string)dbReader["id"]); - // Current SHA1s are not stored/computed. - metadata.SHA1 = new byte[] {}; + // Current SHA1s are not stored/computed. + metadata.SHA1 = new byte[] { }; - retList.Add(metadata); + retList.Add(metadata); + } } } - } - catch (Exception e) - { - m_log.Error("[ASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString() + Environment.NewLine + "Attempting reconnection"); - _dbConnection.Reconnect(); + catch (Exception e) + { + m_log.Error("[ASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString()); + } } } @@ -374,7 +337,5 @@ namespace OpenSim.Data.MySQL } #endregion - - } } diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index e508b5285b..5056aee6c1 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs @@ -38,16 +38,22 @@ namespace OpenSim.Data.MySQL public class MySqlAuthenticationData : MySqlFramework, IAuthenticationData { private string m_Realm; - private List m_ColumnNames = null; - private int m_LastExpire = 0; + private List m_ColumnNames; + private int m_LastExpire; + // private string m_connectionString; public MySqlAuthenticationData(string connectionString, string realm) : base(connectionString) { m_Realm = realm; + m_connectionString = connectionString; - Migration m = new Migration(m_Connection, GetType().Assembly, "AuthStore"); - m.Update(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, GetType().Assembly, "AuthStore"); + m.Update(); + } } public AuthenticationData Get(UUID principalID) @@ -55,45 +61,42 @@ namespace OpenSim.Data.MySQL AuthenticationData ret = new AuthenticationData(); ret.Data = new Dictionary(); - MySqlCommand cmd = new MySqlCommand( - "select * from `"+m_Realm+"` where UUID = ?principalID" - ); - - cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); - - IDataReader result = ExecuteReader(cmd); - - if (result.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - ret.PrincipalID = principalID; + dbcon.Open(); + MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID", dbcon); + cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); - if (m_ColumnNames == null) + IDataReader result = cmd.ExecuteReader(); + + if (result.Read()) { - m_ColumnNames = new List(); + ret.PrincipalID = principalID; - DataTable schemaTable = result.GetSchemaTable(); - foreach (DataRow row in schemaTable.Rows) - m_ColumnNames.Add(row["ColumnName"].ToString()); + if (m_ColumnNames == null) + { + m_ColumnNames = new List(); + + DataTable schemaTable = result.GetSchemaTable(); + foreach (DataRow row in schemaTable.Rows) + m_ColumnNames.Add(row["ColumnName"].ToString()); + } + + foreach (string s in m_ColumnNames) + { + if (s == "UUID") + continue; + + ret.Data[s] = result[s].ToString(); + } + + return ret; } - - foreach (string s in m_ColumnNames) + else { - if (s == "UUID") - continue; - - ret.Data[s] = result[s].ToString(); + return null; } - - result.Close(); - CloseReaderCommand(cmd); - - return ret; } - - result.Close(); - CloseReaderCommand(cmd); - - return null; } public bool Store(AuthenticationData data) diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index e8694fcd50..2eae2d82b2 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -44,7 +44,6 @@ namespace OpenSim.Data.MySQL private const string m_waitTimeoutSelect = "select @@wait_timeout"; - private MySqlConnection m_connection; private string m_connectionString; private long m_waitTimeout; private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond; @@ -67,24 +66,26 @@ namespace OpenSim.Data.MySQL m_log.Debug("Exception: password not found in connection string\n" + e.ToString()); } - m_connection = new MySqlConnection(m_connectionString); - m_connection.Open(); - GetWaitTimeout(); - Assembly assem = GetType().Assembly; - Migration m = new Migration(m_connection, assem, "EstateStore"); - m.Update(); - - Type t = typeof(EstateSettings); - m_Fields = t.GetFields(BindingFlags.NonPublic | - BindingFlags.Instance | - BindingFlags.DeclaredOnly); - - foreach (FieldInfo f in m_Fields) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - if (f.Name.Substring(0, 2) == "m_") - m_FieldMap[f.Name.Substring(2)] = f; + dbcon.Open(); + + Assembly assem = GetType().Assembly; + Migration m = new Migration(dbcon, assem, "EstateStore"); + m.Update(); + + Type t = typeof(EstateSettings); + m_Fields = t.GetFields(BindingFlags.NonPublic | + BindingFlags.Instance | + BindingFlags.DeclaredOnly); + + foreach (FieldInfo f in m_Fields) + { + if (f.Name.Substring(0, 2) == "m_") + m_FieldMap[f.Name.Substring(2)] = f; + } } } @@ -95,47 +96,29 @@ namespace OpenSim.Data.MySQL protected void GetWaitTimeout() { - MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, - m_connection); - - using (MySqlDataReader dbReader = - cmd.ExecuteReader(CommandBehavior.SingleRow)) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - if (dbReader.Read()) + dbcon.Open(); + + using (MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, dbcon)) { - m_waitTimeout - = Convert.ToInt32(dbReader["@@wait_timeout"]) * - TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; + using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) + { + if (dbReader.Read()) + { + m_waitTimeout + = Convert.ToInt32(dbReader["@@wait_timeout"]) * + TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; + } + } } - dbReader.Close(); - cmd.Dispose(); + m_lastConnectionUse = DateTime.Now.Ticks; + + m_log.DebugFormat( + "[REGION DB]: Connection wait timeout {0} seconds", + m_waitTimeout / TimeSpan.TicksPerSecond); } - - m_lastConnectionUse = DateTime.Now.Ticks; - - m_log.DebugFormat( - "[REGION DB]: Connection wait timeout {0} seconds", - m_waitTimeout / TimeSpan.TicksPerSecond); - } - - protected void CheckConnection() - { - long timeNow = DateTime.Now.Ticks; - if (timeNow - m_lastConnectionUse > m_waitTimeout || - m_connection.State != ConnectionState.Open) - { - m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); - - lock (m_connection) - { - m_connection.Close(); - m_connection = new MySqlConnection(m_connectionString); - m_connection.Open(); - } - } - - m_lastConnectionUse = timeNow; } public EstateSettings LoadEstateSettings(UUID regionID) @@ -143,114 +126,111 @@ namespace OpenSim.Data.MySQL EstateSettings es = new EstateSettings(); es.OnSave += StoreEstateSettings; - string sql = "select estate_settings." + String.Join(",estate_settings.", FieldList) + " from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = ?RegionID"; + string sql = "select estate_settings." + String.Join(",estate_settings.", FieldList) + + " from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = ?RegionID"; - CheckConnection(); + bool migration = true; - MySqlCommand cmd = m_connection.CreateCommand(); - - cmd.CommandText = sql; - cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); - - IDataReader r = cmd.ExecuteReader(); - - if (r.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - foreach (string name in FieldList) + dbcon.Open(); + + using (MySqlCommand cmd = dbcon.CreateCommand()) { - if (m_FieldMap[name].GetValue(es) is bool) + cmd.CommandText = sql; + cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); + + using (IDataReader r = cmd.ExecuteReader()) { - int v = Convert.ToInt32(r[name]); - if (v != 0) - m_FieldMap[name].SetValue(es, true); - else - m_FieldMap[name].SetValue(es, false); - } - else if (m_FieldMap[name].GetValue(es) is UUID) - { - UUID uuid = UUID.Zero; + if (r.Read()) + { + migration = false; - UUID.TryParse(r[name].ToString(), out uuid); - m_FieldMap[name].SetValue(es, uuid); - } - else - { - m_FieldMap[name].SetValue(es, r[name]); - } - } - r.Close(); - } - else - { - // Migration case - // - r.Close(); + foreach (string name in FieldList) + { + if (m_FieldMap[name].GetValue(es) is bool) + { + int v = Convert.ToInt32(r[name]); + if (v != 0) + m_FieldMap[name].SetValue(es, true); + else + m_FieldMap[name].SetValue(es, false); + } + else if (m_FieldMap[name].GetValue(es) is UUID) + { + UUID uuid = UUID.Zero; - List names = new List(FieldList); - - names.Remove("EstateID"); - - sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")"; - - cmd.CommandText = sql; - cmd.Parameters.Clear(); - - foreach (string name in FieldList) - { - if (m_FieldMap[name].GetValue(es) is bool) - { - if ((bool)m_FieldMap[name].GetValue(es)) - cmd.Parameters.AddWithValue("?" + name, "1"); - else - cmd.Parameters.AddWithValue("?" + name, "0"); - } - else - { - cmd.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString()); + UUID.TryParse(r[name].ToString(), out uuid); + m_FieldMap[name].SetValue(es, uuid); + } + else + { + m_FieldMap[name].SetValue(es, r[name]); + } + } + } } } - cmd.ExecuteNonQuery(); - - cmd.CommandText = "select LAST_INSERT_ID() as id"; - cmd.Parameters.Clear(); - - r = cmd.ExecuteReader(); - - r.Read(); - - es.EstateID = Convert.ToUInt32(r["id"]); - - r.Close(); - - cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)"; - cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); - cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); - - // This will throw on dupe key - try + if (migration) { - cmd.ExecuteNonQuery(); - } - catch (Exception) - { - } + // Migration case + List names = new List(FieldList); - // Munge and transfer the ban list - // - cmd.Parameters.Clear(); - cmd.CommandText = "insert into estateban select " + es.EstateID.ToString() + ", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = ?UUID"; - cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); + names.Remove("EstateID"); - try - { - cmd.ExecuteNonQuery(); - } - catch (Exception) - { - } + sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")"; - es.Save(); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = sql; + cmd.Parameters.Clear(); + + foreach (string name in FieldList) + { + if (m_FieldMap[name].GetValue(es) is bool) + { + if ((bool)m_FieldMap[name].GetValue(es)) + cmd.Parameters.AddWithValue("?" + name, "1"); + else + cmd.Parameters.AddWithValue("?" + name, "0"); + } + else + { + cmd.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString()); + } + } + + cmd.ExecuteNonQuery(); + + cmd.CommandText = "select LAST_INSERT_ID() as id"; + cmd.Parameters.Clear(); + + using (IDataReader r = cmd.ExecuteReader()) + { + r.Read(); + es.EstateID = Convert.ToUInt32(r["id"]); + } + + cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)"; + cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); + cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); + + // This will throw on dupe key + try { cmd.ExecuteNonQuery(); } + catch (Exception) { } + + // Munge and transfer the ban list + cmd.Parameters.Clear(); + cmd.CommandText = "insert into estateban select " + es.EstateID.ToString() + ", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = ?UUID"; + cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); + + try { cmd.ExecuteNonQuery(); } + catch (Exception) { } + + es.Save(); + } + } } LoadBanList(es); @@ -265,29 +245,33 @@ namespace OpenSim.Data.MySQL { string sql = "replace into estate_settings (" + String.Join(",", FieldList) + ") values ( ?" + String.Join(", ?", FieldList) + ")"; - CheckConnection(); - - MySqlCommand cmd = m_connection.CreateCommand(); - - cmd.CommandText = sql; - - foreach (string name in FieldList) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - if (m_FieldMap[name].GetValue(es) is bool) + dbcon.Open(); + + using (MySqlCommand cmd = dbcon.CreateCommand()) { - if ((bool)m_FieldMap[name].GetValue(es)) - cmd.Parameters.AddWithValue("?" + name, "1"); - else - cmd.Parameters.AddWithValue("?" + name, "0"); - } - else - { - cmd.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString()); + cmd.CommandText = sql; + + foreach (string name in FieldList) + { + if (m_FieldMap[name].GetValue(es) is bool) + { + if ((bool)m_FieldMap[name].GetValue(es)) + cmd.Parameters.AddWithValue("?" + name, "1"); + else + cmd.Parameters.AddWithValue("?" + name, "0"); + } + else + { + cmd.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString()); + } + } + + cmd.ExecuteNonQuery(); } } - cmd.ExecuteNonQuery(); - SaveBanList(es); SaveUUIDList(es.EstateID, "estate_managers", es.EstateManagers); SaveUUIDList(es.EstateID, "estate_users", es.EstateAccess); @@ -298,77 +282,89 @@ namespace OpenSim.Data.MySQL { es.ClearBans(); - CheckConnection(); - - MySqlCommand cmd = m_connection.CreateCommand(); - - cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; - cmd.Parameters.AddWithValue("?EstateID", es.EstateID); - - IDataReader r = cmd.ExecuteReader(); - - while (r.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - EstateBan eb = new EstateBan(); + dbcon.Open(); - UUID uuid = new UUID(); - UUID.TryParse(r["bannedUUID"].ToString(), out uuid); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "select bannedUUID from estateban where EstateID = ?EstateID"; + cmd.Parameters.AddWithValue("?EstateID", es.EstateID); - eb.BannedUserID = uuid; - eb.BannedHostAddress = "0.0.0.0"; - eb.BannedHostIPMask = "0.0.0.0"; - es.AddBan(eb); + using (IDataReader r = cmd.ExecuteReader()) + { + while (r.Read()) + { + EstateBan eb = new EstateBan(); + + UUID uuid = new UUID(); + UUID.TryParse(r["bannedUUID"].ToString(), out uuid); + + eb.BannedUserID = uuid; + eb.BannedHostAddress = "0.0.0.0"; + eb.BannedHostIPMask = "0.0.0.0"; + es.AddBan(eb); + } + } + } } - r.Close(); } private void SaveBanList(EstateSettings es) { - CheckConnection(); - - MySqlCommand cmd = m_connection.CreateCommand(); - - cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; - cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); - - cmd.ExecuteNonQuery(); - - cmd.Parameters.Clear(); - - cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( ?EstateID, ?bannedUUID, '', '', '' )"; - - foreach (EstateBan b in es.EstateBans) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); - cmd.Parameters.AddWithValue("?bannedUUID", b.BannedUserID.ToString()); + dbcon.Open(); - cmd.ExecuteNonQuery(); - cmd.Parameters.Clear(); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from estateban where EstateID = ?EstateID"; + cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); + + cmd.ExecuteNonQuery(); + + cmd.Parameters.Clear(); + + cmd.CommandText = "insert into estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask) values ( ?EstateID, ?bannedUUID, '', '', '' )"; + + foreach (EstateBan b in es.EstateBans) + { + cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); + cmd.Parameters.AddWithValue("?bannedUUID", b.BannedUserID.ToString()); + + cmd.ExecuteNonQuery(); + cmd.Parameters.Clear(); + } + } } } void SaveUUIDList(uint EstateID, string table, UUID[] data) { - CheckConnection(); - - MySqlCommand cmd = m_connection.CreateCommand(); - - cmd.CommandText = "delete from " + table + " where EstateID = ?EstateID"; - cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); - - cmd.ExecuteNonQuery(); - - cmd.Parameters.Clear(); - - cmd.CommandText = "insert into " + table + " (EstateID, uuid) values ( ?EstateID, ?uuid )"; - - foreach (UUID uuid in data) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); - cmd.Parameters.AddWithValue("?uuid", uuid.ToString()); + dbcon.Open(); - cmd.ExecuteNonQuery(); - cmd.Parameters.Clear(); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from " + table + " where EstateID = ?EstateID"; + cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); + + cmd.ExecuteNonQuery(); + + cmd.Parameters.Clear(); + + cmd.CommandText = "insert into " + table + " (EstateID, uuid) values ( ?EstateID, ?uuid )"; + + foreach (UUID uuid in data) + { + cmd.Parameters.AddWithValue("?EstateID", EstateID.ToString()); + cmd.Parameters.AddWithValue("?uuid", uuid.ToString()); + + cmd.ExecuteNonQuery(); + cmd.Parameters.Clear(); + } + } } } @@ -376,25 +372,29 @@ namespace OpenSim.Data.MySQL { List uuids = new List(); - CheckConnection(); - - MySqlCommand cmd = m_connection.CreateCommand(); - - cmd.CommandText = "select uuid from " + table + " where EstateID = ?EstateID"; - cmd.Parameters.AddWithValue("?EstateID", EstateID); - - IDataReader r = cmd.ExecuteReader(); - - while (r.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - // EstateBan eb = new EstateBan(); + dbcon.Open(); - UUID uuid = new UUID(); - UUID.TryParse(r["uuid"].ToString(), out uuid); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "select uuid from " + table + " where EstateID = ?EstateID"; + cmd.Parameters.AddWithValue("?EstateID", EstateID); - uuids.Add(uuid); + using (IDataReader r = cmd.ExecuteReader()) + { + while (r.Read()) + { + // EstateBan eb = new EstateBan(); + + UUID uuid = new UUID(); + UUID.TryParse(r["uuid"].ToString(), out uuid); + + uuids.Add(uuid); + } + } + } } - r.Close(); return uuids.ToArray(); } diff --git a/OpenSim/Data/MySQL/MySQLFramework.cs b/OpenSim/Data/MySQL/MySQLFramework.cs index fca0ca5e8a..3fdcf1e54c 100644 --- a/OpenSim/Data/MySQL/MySQLFramework.cs +++ b/OpenSim/Data/MySQL/MySQLFramework.cs @@ -40,12 +40,16 @@ namespace OpenSim.Data.MySQL /// public class MySqlFramework { - protected MySqlConnection m_Connection; + private static readonly log4net.ILog m_log = + log4net.LogManager.GetLogger( + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + + protected string m_connectionString; + protected object m_dbLock = new object(); protected MySqlFramework(string connectionString) { - m_Connection = new MySqlConnection(connectionString); - m_Connection.Open(); + m_connectionString = connectionString; } ////////////////////////////////////////////////////////////// @@ -55,64 +59,24 @@ namespace OpenSim.Data.MySQL // protected int ExecuteNonQuery(MySqlCommand cmd) { - lock (m_Connection) + lock (m_dbLock) { - cmd.Connection = m_Connection; - - bool errorSeen = false; - - while (true) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { + dbcon.Open(); + cmd.Connection = dbcon; + try { return cmd.ExecuteNonQuery(); } - catch (MySqlException e) - { - if (errorSeen) - throw; - - // This is "Server has gone away" and "Server lost" - // - if (e.Number == 2006 || e.Number == 2013) - { - errorSeen = true; - - m_Connection.Close(); - MySqlConnection newConnection = - (MySqlConnection)((ICloneable)m_Connection).Clone(); - m_Connection.Dispose(); - m_Connection = newConnection; - m_Connection.Open(); - - cmd.Connection = m_Connection; - } - else - throw; - } catch (Exception e) { + m_log.Error(e.Message, e); return 0; } } } } - - protected IDataReader ExecuteReader(MySqlCommand cmd) - { - MySqlConnection newConnection = - (MySqlConnection)((ICloneable)m_Connection).Clone(); - newConnection.Open(); - - cmd.Connection = newConnection; - return cmd.ExecuteReader(); - } - - protected void CloseReaderCommand(MySqlCommand cmd) - { - cmd.Connection.Close(); - cmd.Connection.Dispose(); - cmd.Dispose(); - } } } diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index fdb98eba92..698bf521d6 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs @@ -54,12 +54,16 @@ namespace OpenSim.Data.MySQL string realm, string storeName) : base(connectionString) { m_Realm = realm; + m_connectionString = connectionString; + if (storeName != String.Empty) { - Assembly assem = GetType().Assembly; - - Migration m = new Migration(m_Connection, assem, storeName); - m.Update(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, GetType().Assembly, storeName); + m.Update(); + } } Type t = typeof(T); @@ -107,147 +111,160 @@ namespace OpenSim.Data.MySQL List terms = new List(); - MySqlCommand cmd = new MySqlCommand(); - - for (int i = 0 ; i < fields.Length ; i++) + using (MySqlCommand cmd = new MySqlCommand()) { - cmd.Parameters.AddWithValue(fields[i], keys[i]); - terms.Add("`" + fields[i] + "` = ?" + fields[i]); + for (int i = 0 ; i < fields.Length ; i++) + { + cmd.Parameters.AddWithValue(fields[i], keys[i]); + terms.Add("`" + fields[i] + "` = ?" + fields[i]); + } + + string where = String.Join(" and ", terms.ToArray()); + + string query = String.Format("select * from {0} where {1}", + m_Realm, where); + + cmd.CommandText = query; + + return DoQuery(cmd); } - - string where = String.Join(" and ", terms.ToArray()); - - string query = String.Format("select * from {0} where {1}", - m_Realm, where); - - cmd.CommandText = query; - - return DoQuery(cmd); } protected T[] DoQuery(MySqlCommand cmd) { - IDataReader reader = ExecuteReader(cmd); - if (reader == null) - return new T[0]; - - CheckColumnNames(reader); - List result = new List(); - while (reader.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - T row = new T(); + dbcon.Open(); + cmd.Connection = dbcon; - foreach (string name in m_Fields.Keys) + using (IDataReader reader = cmd.ExecuteReader()) { - if (m_Fields[name].GetValue(row) is bool) - { - int v = Convert.ToInt32(reader[name]); - m_Fields[name].SetValue(row, v != 0 ? true : false); - } - else if (m_Fields[name].GetValue(row) is UUID) - { - UUID uuid = UUID.Zero; + if (reader == null) + return new T[0]; - UUID.TryParse(reader[name].ToString(), out uuid); - m_Fields[name].SetValue(row, uuid); - } - else if (m_Fields[name].GetValue(row) is int) + CheckColumnNames(reader); + + while (reader.Read()) { - int v = Convert.ToInt32(reader[name]); - m_Fields[name].SetValue(row, v); - } - else - { - m_Fields[name].SetValue(row, reader[name]); - } - } + T row = new T(); + + foreach (string name in m_Fields.Keys) + { + if (m_Fields[name].GetValue(row) is bool) + { + int v = Convert.ToInt32(reader[name]); + m_Fields[name].SetValue(row, v != 0 ? true : false); + } + else if (m_Fields[name].GetValue(row) is UUID) + { + UUID uuid = UUID.Zero; + + UUID.TryParse(reader[name].ToString(), out uuid); + m_Fields[name].SetValue(row, uuid); + } + else if (m_Fields[name].GetValue(row) is int) + { + int v = Convert.ToInt32(reader[name]); + m_Fields[name].SetValue(row, v); + } + else + { + m_Fields[name].SetValue(row, reader[name]); + } + } - if (m_DataField != null) - { - Dictionary data = - new Dictionary(); + if (m_DataField != null) + { + Dictionary data = + new Dictionary(); - foreach (string col in m_ColumnNames) - { - data[col] = reader[col].ToString(); - if (data[col] == null) - data[col] = String.Empty; + foreach (string col in m_ColumnNames) + { + data[col] = reader[col].ToString(); + if (data[col] == null) + data[col] = String.Empty; + } + + m_DataField.SetValue(row, data); + } + + result.Add(row); } - - m_DataField.SetValue(row, data); } - - result.Add(row); } - CloseReaderCommand(cmd); - return result.ToArray(); } public T[] Get(string where) { - MySqlCommand cmd = new MySqlCommand(); - - string query = String.Format("select * from {0} where {1}", - m_Realm, where); - - cmd.CommandText = query; - - return DoQuery(cmd); + using (MySqlCommand cmd = new MySqlCommand()) + { + + string query = String.Format("select * from {0} where {1}", + m_Realm, where); + + cmd.CommandText = query; + + return DoQuery(cmd); + } } public bool Store(T row) { - MySqlCommand cmd = new MySqlCommand(); - - string query = ""; - List names = new List(); - List values = new List(); - - foreach (FieldInfo fi in m_Fields.Values) + using (MySqlCommand cmd = new MySqlCommand()) { - names.Add(fi.Name); - values.Add("?" + fi.Name); - cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString()); - } - if (m_DataField != null) - { - Dictionary data = + string query = ""; + List names = new List(); + List values = new List(); + + foreach (FieldInfo fi in m_Fields.Values) + { + names.Add(fi.Name); + values.Add("?" + fi.Name); + cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString()); + } + + if (m_DataField != null) + { + Dictionary data = (Dictionary)m_DataField.GetValue(row); - foreach (KeyValuePair kvp in data) - { - names.Add(kvp.Key); - values.Add("?" + kvp.Key); - cmd.Parameters.AddWithValue("?" + kvp.Key, kvp.Value); + foreach (KeyValuePair kvp in data) + { + names.Add(kvp.Key); + values.Add("?" + kvp.Key); + cmd.Parameters.AddWithValue("?" + kvp.Key, kvp.Value); + } } + + query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")"; + + cmd.CommandText = query; + + if (ExecuteNonQuery(cmd) > 0) + return true; + + return false; } - - query = String.Format("replace into {0} (`", m_Realm) + String.Join("`,`", names.ToArray()) + "`) values (" + String.Join(",", values.ToArray()) + ")"; - - cmd.CommandText = query; - - if (ExecuteNonQuery(cmd) > 0) - return true; - - return false; } public bool Delete(string field, string val) { - MySqlCommand cmd = new MySqlCommand(); + using (MySqlCommand cmd = new MySqlCommand()) + { - cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field); - cmd.Parameters.AddWithValue(field, val); + cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field); + cmd.Parameters.AddWithValue(field, val); - if (ExecuteNonQuery(cmd) > 0) - return true; + if (ExecuteNonQuery(cmd) > 0) + return true; - return false; + return false; + } } } } diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index 1ec26090b1..f4e7b859d6 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs @@ -31,6 +31,7 @@ using System.Data; using System.Reflection; using System.Threading; using log4net; +using MySql.Data.MySqlClient; using OpenMetaverse; using OpenSim.Framework; @@ -43,49 +44,9 @@ namespace OpenSim.Data.MySQL { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - /// - /// MySQL Database Manager - /// - private MySQLManager database; - - - /// - /// Better DB manager. Swap-in replacement too. - /// - public Dictionary m_dbconnections = new Dictionary(); - - public int m_maxConnections = 10; - public int m_lastConnect; - - public MySQLSuperManager GetLockedConnection() - { - int lockedCons = 0; - while (true) - { - m_lastConnect++; - - // Overflow protection - if (m_lastConnect == int.MaxValue) - m_lastConnect = 0; - - MySQLSuperManager x = m_dbconnections[m_lastConnect % m_maxConnections]; - if (!x.Locked) - { - x.GetLock(); - return x; - } - - lockedCons++; - if (lockedCons > m_maxConnections) - { - lockedCons = 0; - Thread.Sleep(1000); // Wait some time before searching them again. - m_log.Debug( - "WARNING: All threads are in use. Probable cause: Something didnt release a mutex properly, or high volume of requests inbound."); - } - } - } - + private MySQLManager m_database; + private object m_dbLock = new object(); + private string m_connectionString; override public void Initialise() { @@ -106,49 +67,17 @@ namespace OpenSim.Data.MySQL /// connect string. override public void Initialise(string connect) { - if (connect != String.Empty) - { - database = new MySQLManager(connect); - - m_log.Info("Creating " + m_maxConnections + " DB connections..."); - for (int i = 0; i < m_maxConnections; i++) - { - m_log.Info("Connecting to DB... [" + i + "]"); - MySQLSuperManager msm = new MySQLSuperManager(); - msm.Manager = new MySQLManager(connect); - m_dbconnections.Add(i, msm); - } - - } - else - { - m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead"); - IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); - string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); - string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); - string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); - string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); - string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); - string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); - - database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, - settingPooling, settingPort); - - m_log.Info("Creating " + m_maxConnections + " DB connections..."); - for (int i = 0; i < m_maxConnections; i++) - { - m_log.Info("Connecting to DB... [" + i + "]"); - MySQLSuperManager msm = new MySQLSuperManager(); - msm.Manager = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, - settingPooling, settingPort); - m_dbconnections.Add(i, msm); - } - } + m_connectionString = connect; + m_database = new MySQLManager(connect); // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; - Migration m = new Migration(database.Connection, assem, "GridStore"); - m.Update(); + + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + Migration m = new Migration(dbcon, assem, "GridStore"); + m.Update(); + } } /// @@ -156,7 +85,6 @@ namespace OpenSim.Data.MySQL /// override public void Dispose() { - database.Close(); } /// @@ -187,8 +115,6 @@ namespace OpenSim.Data.MySQL /// Array of sim profiles override public RegionProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax) { - MySQLSuperManager dbm = GetLockedConnection(); - try { Dictionary param = new Dictionary(); @@ -197,35 +123,33 @@ namespace OpenSim.Data.MySQL param["?xmax"] = xmax.ToString(); param["?ymax"] = ymax.ToString(); - IDbCommand result = - dbm.Manager.Query( - "SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", - param); - IDataReader reader = result.ExecuteReader(); - - RegionProfileData row; - - List rows = new List(); - - while ((row = dbm.Manager.readSimRow(reader)) != null) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - rows.Add(row); - } - reader.Close(); - result.Dispose(); + dbcon.Open(); - return rows.ToArray(); + using (IDbCommand result = m_database.Query(dbcon, + "SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", + param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + RegionProfileData row; + + List rows = new List(); + + while ((row = m_database.readSimRow(reader)) != null) + rows.Add(row); + + return rows.ToArray(); + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } /// @@ -236,42 +160,38 @@ namespace OpenSim.Data.MySQL /// A list of sim profiles override public List GetRegionsByName(string namePrefix, uint maxNum) { - MySQLSuperManager dbm = GetLockedConnection(); - try { Dictionary param = new Dictionary(); param["?name"] = namePrefix + "%"; - IDbCommand result = - dbm.Manager.Query( - "SELECT * FROM regions WHERE regionName LIKE ?name", - param); - IDataReader reader = result.ExecuteReader(); - - RegionProfileData row; - - List rows = new List(); - - while (rows.Count < maxNum && (row = dbm.Manager.readSimRow(reader)) != null) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - rows.Add(row); - } - reader.Close(); - result.Dispose(); + dbcon.Open(); - return rows; + using (IDbCommand result = m_database.Query(dbcon, + "SELECT * FROM regions WHERE regionName LIKE ?name", + param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + RegionProfileData row; + + List rows = new List(); + + while (rows.Count < maxNum && (row = m_database.readSimRow(reader)) != null) + rows.Add(row); + + return rows; + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } /// @@ -281,32 +201,30 @@ namespace OpenSim.Data.MySQL /// Sim profile override public RegionProfileData GetProfileByHandle(ulong handle) { - MySQLSuperManager dbm = GetLockedConnection(); - try { Dictionary param = new Dictionary(); - param["?handle"] = handle.ToString(); + param["?handle"] = handle.ToString(); - IDbCommand result = dbm.Manager.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param); - IDataReader reader = result.ExecuteReader(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - RegionProfileData row = dbm.Manager.readSimRow(reader); - reader.Close(); - result.Dispose(); - - return row; + using (IDbCommand result = m_database.Query(dbcon, "SELECT * FROM regions WHERE regionHandle = ?handle", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + RegionProfileData row = m_database.readSimRow(reader); + return row; + } + } } + } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } /// @@ -316,30 +234,29 @@ namespace OpenSim.Data.MySQL /// The sim profile override public RegionProfileData GetProfileByUUID(UUID uuid) { - MySQLSuperManager dbm = GetLockedConnection(); - try { Dictionary param = new Dictionary(); - param["?uuid"] = uuid.ToString(); + param["?uuid"] = uuid.ToString(); - IDbCommand result = dbm.Manager.Query("SELECT * FROM regions WHERE uuid = ?uuid", param); - IDataReader reader = result.ExecuteReader(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - RegionProfileData row = dbm.Manager.readSimRow(reader); - reader.Close(); - result.Dispose(); - - return row; + using (IDbCommand result = m_database.Query(dbcon, "SELECT * FROM regions WHERE uuid = ?uuid", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + RegionProfileData row = m_database.readSimRow(reader); + return row; + } + } } + } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; - } finally - { - dbm.Release(); } } @@ -351,37 +268,36 @@ namespace OpenSim.Data.MySQL { if (regionName.Length > 2) { - MySQLSuperManager dbm = GetLockedConnection(); - try { Dictionary param = new Dictionary(); // Add % because this is a like query. param["?regionName"] = regionName + "%"; - // Order by statement will return shorter matches first. Only returns one record or no record. - IDbCommand result = - dbm.Manager.Query( + + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + // Order by statement will return shorter matches first. Only returns one record or no record. + using (IDbCommand result = m_database.Query(dbcon, "SELECT * FROM regions WHERE regionName like ?regionName order by LENGTH(regionName) asc LIMIT 1", - param); - IDataReader reader = result.ExecuteReader(); - - RegionProfileData row = dbm.Manager.readSimRow(reader); - reader.Close(); - result.Dispose(); - - return row; + param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + RegionProfileData row = m_database.readSimRow(reader); + return row; + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } + m_log.Error("[GRID DB]: Searched for a Region Name shorter then 3 characters"); return null; } @@ -393,17 +309,16 @@ namespace OpenSim.Data.MySQL /// Successful? override public DataResponse StoreProfile(RegionProfileData profile) { - MySQLSuperManager dbm = GetLockedConnection(); - try { - if (dbm.Manager.insertRegion(profile)) - { - return DataResponse.RESPONSE_OK; - } - return DataResponse.RESPONSE_ERROR; - } - finally + try { - dbm.Release(); + if (m_database.insertRegion(profile)) + return DataResponse.RESPONSE_OK; + else + return DataResponse.RESPONSE_ERROR; + } + catch + { + return DataResponse.RESPONSE_ERROR; } } @@ -415,18 +330,16 @@ namespace OpenSim.Data.MySQL //public DataResponse DeleteProfile(RegionProfileData profile) override public DataResponse DeleteProfile(string uuid) { - MySQLSuperManager dbm = GetLockedConnection(); - - - try { - if (dbm.Manager.deleteRegion(uuid)) - { - return DataResponse.RESPONSE_OK; - } - return DataResponse.RESPONSE_ERROR; - } finally + try { - dbm.Release(); + if (m_database.deleteRegion(uuid)) + return DataResponse.RESPONSE_OK; + else + return DataResponse.RESPONSE_ERROR; + } + catch + { + return DataResponse.RESPONSE_ERROR; } } @@ -477,33 +390,32 @@ namespace OpenSim.Data.MySQL /// override public ReservationData GetReservationAtPoint(uint x, uint y) { - MySQLSuperManager dbm = GetLockedConnection(); - try { Dictionary param = new Dictionary(); - param["?x"] = x.ToString(); - param["?y"] = y.ToString(); - IDbCommand result = - dbm.Manager.Query( - "SELECT * FROM reservations WHERE resXMin <= ?x AND resXMax >= ?x AND resYMin <= ?y AND resYMax >= ?y", - param); - IDataReader reader = result.ExecuteReader(); + param["?x"] = x.ToString(); + param["?y"] = y.ToString(); - ReservationData row = dbm.Manager.readReservationRow(reader); - reader.Close(); - result.Dispose(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - return row; + using (IDbCommand result = m_database.Query(dbcon, + "SELECT * FROM reservations WHERE resXMin <= ?x AND resXMax >= ?x AND resYMin <= ?y AND resYMax >= ?y", + param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + ReservationData row = m_database.readReservationRow(reader); + return row; + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; - } finally - { - dbm.Release(); } } } diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 4b71e3951f..192deb298a 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -26,7 +26,6 @@ */ using System; -using System.IO; using System.Collections.Generic; using System.Reflection; using log4net; @@ -44,14 +43,10 @@ namespace OpenSim.Data.MySQL private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - /// - /// The database manager - /// - private MySQLManager database; + private string m_connectionString; + private object m_dbLock = new object(); - private bool rollbackStore = false; - private bool opengridmode = false; - private string rollbackDir = ""; + public string Version { get { return "1.0.0.0"; } } public void Initialise() { @@ -72,37 +67,17 @@ namespace OpenSim.Data.MySQL /// connect string public void Initialise(string connect) { - if (connect != String.Empty) - { - database = new MySQLManager(connect); - } - else - { - m_log.Warn("Reverting to deprecated mysql_connection.ini file for connection info"); - IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); - string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); - string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); - string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); - string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); - string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); - string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); - - rollbackDir = GridDataMySqlFile.ParseFileReadValue("rollbackdir"); - rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true"; - opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true"; - - if (rollbackStore) - m_log.Warn("[MysqlInventory] Enabling rollback mode in: " + rollbackDir); - - database = - new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, - settingPort); - } + m_connectionString = connect; // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; - Migration m = new Migration(database.Connection, assem, "InventoryStore"); - m.Update(); + + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, assem, "InventoryStore"); + m.Update(); + } } /// @@ -123,15 +98,6 @@ namespace OpenSim.Data.MySQL // Do nothing. } - /// - /// Returns the version of this DB provider - /// - /// A string containing the DB provider version - public string Version - { - get { return database.getVersion(); } - } - /// /// Returns a list of items in a specified folder /// @@ -141,36 +107,37 @@ namespace OpenSim.Data.MySQL { try { - lock (database) + lock (m_dbLock) { List items = new List(); - database.CheckConnection(); - - MySqlCommand result = - new MySqlCommand("SELECT * FROM inventoryitems WHERE parentFolderID = ?uuid", - database.Connection); - result.Parameters.AddWithValue("?uuid", folderID.ToString()); - MySqlDataReader reader = result.ExecuteReader(); - - while (reader.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - // A null item (because something went wrong) breaks everything in the folder - InventoryItemBase item = readInventoryItem(reader); - if (item != null) - items.Add(item); + dbcon.Open(); + + using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryitems WHERE parentFolderID = ?uuid", dbcon)) + { + result.Parameters.AddWithValue("?uuid", folderID.ToString()); + + using (MySqlDataReader reader = result.ExecuteReader()) + { + while (reader.Read()) + { + // A null item (because something went wrong) breaks everything in the folder + InventoryItemBase item = readInventoryItem(reader); + if (item != null) + items.Add(item); + } + + return items; + } + } } - - reader.Close(); - result.Dispose(); - - return items; } } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } } @@ -184,33 +151,33 @@ namespace OpenSim.Data.MySQL { try { - lock (database) + lock (m_dbLock) { - database.CheckConnection(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - MySqlCommand result = - new MySqlCommand( - "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", - database.Connection); - result.Parameters.AddWithValue("?uuid", user.ToString()); - result.Parameters.AddWithValue("?zero", UUID.Zero.ToString()); - MySqlDataReader reader = result.ExecuteReader(); + using (MySqlCommand result = new MySqlCommand( + "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", dbcon)) + { + result.Parameters.AddWithValue("?uuid", user.ToString()); + result.Parameters.AddWithValue("?zero", UUID.Zero.ToString()); - List items = new List(); - while (reader.Read()) - items.Add(readInventoryFolder(reader)); + using (MySqlDataReader reader = result.ExecuteReader()) + { + List items = new List(); + while (reader.Read()) + items.Add(readInventoryFolder(reader)); - - reader.Close(); - result.Dispose(); - - return items; + return items; + } + } + } } } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } } @@ -225,46 +192,44 @@ namespace OpenSim.Data.MySQL { try { - lock (database) + lock (m_dbLock) { - database.CheckConnection(); - - MySqlCommand result = - new MySqlCommand( - "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", - database.Connection); - result.Parameters.AddWithValue("?uuid", user.ToString()); - result.Parameters.AddWithValue("?zero", UUID.Zero.ToString()); - - MySqlDataReader reader = result.ExecuteReader(); - - List items = new List(); - while (reader.Read()) - items.Add(readInventoryFolder(reader)); - - InventoryFolderBase rootFolder = null; - - // There should only ever be one root folder for a user. However, if there's more - // than one we'll simply use the first one rather than failing. It would be even - // nicer to print some message to this effect, but this feels like it's too low a - // to put such a message out, and it's too minor right now to spare the time to - // suitably refactor. - if (items.Count > 0) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - rootFolder = items[0]; + dbcon.Open(); + + using (MySqlCommand result = new MySqlCommand( + "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", dbcon)) + { + result.Parameters.AddWithValue("?uuid", user.ToString()); + result.Parameters.AddWithValue("?zero", UUID.Zero.ToString()); + + using (MySqlDataReader reader = result.ExecuteReader()) + { + List items = new List(); + while (reader.Read()) + items.Add(readInventoryFolder(reader)); + + InventoryFolderBase rootFolder = null; + + // There should only ever be one root folder for a user. However, if there's more + // than one we'll simply use the first one rather than failing. It would be even + // nicer to print some message to this effect, but this feels like it's too low a + // to put such a message out, and it's too minor right now to spare the time to + // suitably refactor. + if (items.Count > 0) + rootFolder = items[0]; + + return rootFolder; + } + } } - - reader.Close(); - result.Dispose(); - - return rootFolder; } } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); - throw; + m_log.Error(e.Message, e); + return null; } } @@ -279,31 +244,31 @@ namespace OpenSim.Data.MySQL { try { - lock (database) + lock (m_dbLock) { - database.CheckConnection(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - MySqlCommand result = - new MySqlCommand("SELECT * FROM inventoryfolders WHERE parentFolderID = ?uuid", - database.Connection); - result.Parameters.AddWithValue("?uuid", parentID.ToString()); - MySqlDataReader reader = result.ExecuteReader(); + using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE parentFolderID = ?uuid", dbcon)) + { + result.Parameters.AddWithValue("?uuid", parentID.ToString()); + using (MySqlDataReader reader = result.ExecuteReader()) + { + List items = new List(); - List items = new List(); + while (reader.Read()) + items.Add(readInventoryFolder(reader)); - while (reader.Read()) - items.Add(readInventoryFolder(reader)); - - reader.Close(); - result.Dispose(); - - return items; + return items; + } + } + } } } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } } @@ -378,29 +343,31 @@ namespace OpenSim.Data.MySQL { try { - lock (database) + lock (m_dbLock) { - database.CheckConnection(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - MySqlCommand result = - new MySqlCommand("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", database.Connection); - result.Parameters.AddWithValue("?uuid", itemID.ToString()); - MySqlDataReader reader = result.ExecuteReader(); + using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", dbcon)) + { + result.Parameters.AddWithValue("?uuid", itemID.ToString()); - InventoryItemBase item = null; - if (reader.Read()) - item = readInventoryItem(reader); + using (MySqlDataReader reader = result.ExecuteReader()) + { + InventoryItemBase item = null; + if (reader.Read()) + item = readInventoryItem(reader); - reader.Close(); - result.Dispose(); - - return item; + return item; + } + } + } } } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); } return null; } @@ -425,7 +392,7 @@ namespace OpenSim.Data.MySQL } catch (Exception e) { - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); } return null; @@ -441,151 +408,35 @@ namespace OpenSim.Data.MySQL { try { - lock (database) + lock (m_dbLock) { - database.CheckConnection(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - MySqlCommand result = - new MySqlCommand("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", database.Connection); - result.Parameters.AddWithValue("?uuid", folderID.ToString()); - MySqlDataReader reader = result.ExecuteReader(); + using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", dbcon)) + { + result.Parameters.AddWithValue("?uuid", folderID.ToString()); - InventoryFolderBase folder = null; - if (reader.Read()) - folder = readInventoryFolder(reader); - reader.Close(); - result.Dispose(); + using (MySqlDataReader reader = result.ExecuteReader()) + { + InventoryFolderBase folder = null; + if (reader.Read()) + folder = readInventoryFolder(reader); - return folder; + return folder; + } + } + } } } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } } - #region Inventory Rollback-via-.sql Support - /// - /// Not a good SQL escape function, but it'll do the job (if mutilate the data.) - /// Someone may want to write something better here. - /// - /// - /// - private static string cheapSQLescape(string str) - { - str = str.Replace("\\", ""); - str = str.Replace("'", ""); - str = str.Replace("\"", ""); - return "'" + str + "'"; - } - - private static string InventoryItemToSql(InventoryItemBase item) - { - string sql = - "REPLACE /*! INVITEM AT ***$SUBS$*** */ INTO inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName" - + ", inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType" - + ", creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, inventoryGroupPermissions, salePrice, saleType" - + ", creationDate, groupID, groupOwned, flags) VALUES "; - sql += - "(?inventoryID, ?assetID, ?assetType, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription" - + ", ?inventoryNextPermissions, ?inventoryCurrentPermissions, ?invType, ?creatorID" - + ", ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?inventoryGroupPermissions, ?salePrice, ?saleType, ?creationDate" - + ", ?groupID, ?groupOwned, ?flags);\r\n"; - - string itemName = item.Name; - string itemDesc = item.Description; - - sql = sql.Replace("$SUBS$", Util.UnixTimeSinceEpoch().ToString()); - - sql = sql.Replace("?inventoryID", cheapSQLescape(item.ID.ToString())); - sql = sql.Replace("?assetID", cheapSQLescape(item.AssetID.ToString())); - sql = sql.Replace("?assetType", cheapSQLescape(item.AssetType.ToString())); - sql = sql.Replace("?parentFolderID", cheapSQLescape(item.Folder.ToString())); - sql = sql.Replace("?avatarID", cheapSQLescape(item.Owner.ToString())); - sql = sql.Replace("?inventoryName", cheapSQLescape(itemName)); - sql = sql.Replace("?inventoryDescription", cheapSQLescape(itemDesc)); - sql = sql.Replace("?inventoryNextPermissions", cheapSQLescape(item.NextPermissions.ToString())); - sql = sql.Replace("?inventoryCurrentPermissions", cheapSQLescape(item.CurrentPermissions.ToString())); - sql = sql.Replace("?invType", cheapSQLescape(item.InvType.ToString())); - sql = sql.Replace("?creatorID", cheapSQLescape(item.CreatorId)); - sql = sql.Replace("?inventoryBasePermissions", cheapSQLescape(item.BasePermissions.ToString())); - sql = sql.Replace("?inventoryEveryOnePermissions", cheapSQLescape(item.EveryOnePermissions.ToString())); - sql = sql.Replace("?inventoryGroupPermissions", cheapSQLescape(item.GroupPermissions.ToString())); - sql = sql.Replace("?salePrice", cheapSQLescape(item.SalePrice.ToString())); - sql = sql.Replace("?saleType", cheapSQLescape(unchecked((sbyte)item.SaleType).ToString())); - sql = sql.Replace("?creationDate", cheapSQLescape(item.CreationDate.ToString())); - sql = sql.Replace("?groupID", cheapSQLescape(item.GroupID.ToString())); - sql = sql.Replace("?groupOwned", cheapSQLescape(item.GroupOwned.ToString())); - sql = sql.Replace("?flags", cheapSQLescape(item.Flags.ToString())); - - return sql; - } - - private static string InventoryFolderToSql(InventoryFolderBase folder) - { - string sql = - "REPLACE /*! INVFOLDER AT ***$SUBS$*** */ INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, type, version) VALUES "; - sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version);\r\n"; - - string folderName = folder.Name; - - sql = sql.Replace("$SUBS$", Util.UnixTimeSinceEpoch().ToString()); - - sql = sql.Replace("?folderID", cheapSQLescape(folder.ID.ToString())); - sql = sql.Replace("?agentID", cheapSQLescape(folder.Owner.ToString())); - sql = sql.Replace("?parentFolderID", cheapSQLescape(folder.ParentID.ToString())); - sql = sql.Replace("?folderName", cheapSQLescape(folderName)); - sql = sql.Replace("?type", cheapSQLescape(folder.Type.ToString())); - sql = sql.Replace("?version", cheapSQLescape(folder.Version.ToString())); - - return sql; - } - - private static string getRollbackFolderDate() - { - return DateTime.UtcNow.Year.ToString() + "-" + DateTime.UtcNow.Month.ToString() + "-" + - DateTime.UtcNow.Day.ToString(); - } - - private void StoreRollbackItem(UUID ItemID) - { - if (rollbackStore == true) - { - string todaysPath = RollbackGetTodaysPath(); - - InventoryItemBase imb = getInventoryItem(ItemID); - string sql = InventoryItemToSql(imb); - File.AppendAllText(Path.Combine(todaysPath, imb.Owner.ToString()), sql); - } - } - - private void StoreRollbackFolder(UUID FolderID) - { - if (rollbackStore == true) - { - string todaysPath = RollbackGetTodaysPath(); - - InventoryFolderBase ifb = getInventoryFolder(FolderID); - string sql = InventoryFolderToSql(ifb); - File.AppendAllText(Path.Combine(todaysPath, ifb.Owner.ToString()), sql); - } - } - - private string RollbackGetTodaysPath() - { - if (!Directory.Exists(rollbackDir)) - Directory.CreateDirectory(rollbackDir); - - string todaysPath = Path.Combine(rollbackDir, getRollbackFolderDate()); - if (!Directory.Exists(todaysPath)) - Directory.CreateDirectory(todaysPath); - return todaysPath; - } - #endregion - /// /// Adds a specified item to the database /// @@ -619,46 +470,48 @@ namespace OpenSim.Data.MySQL try { - database.CheckConnection(); - - MySqlCommand result = new MySqlCommand(sql, database.Connection); - result.Parameters.AddWithValue("?inventoryID", item.ID.ToString()); - result.Parameters.AddWithValue("?assetID", item.AssetID.ToString()); - result.Parameters.AddWithValue("?assetType", item.AssetType.ToString()); - result.Parameters.AddWithValue("?parentFolderID", item.Folder.ToString()); - result.Parameters.AddWithValue("?avatarID", item.Owner.ToString()); - result.Parameters.AddWithValue("?inventoryName", itemName); - result.Parameters.AddWithValue("?inventoryDescription", itemDesc); - result.Parameters.AddWithValue("?inventoryNextPermissions", item.NextPermissions.ToString()); - result.Parameters.AddWithValue("?inventoryCurrentPermissions", - item.CurrentPermissions.ToString()); - result.Parameters.AddWithValue("?invType", item.InvType); - result.Parameters.AddWithValue("?creatorID", item.CreatorId); - result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); - result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); - result.Parameters.AddWithValue("?inventoryGroupPermissions", item.GroupPermissions); - result.Parameters.AddWithValue("?salePrice", item.SalePrice); - result.Parameters.AddWithValue("?saleType", unchecked((sbyte)item.SaleType)); - result.Parameters.AddWithValue("?creationDate", item.CreationDate); - result.Parameters.AddWithValue("?groupID", item.GroupID); - result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); - result.Parameters.AddWithValue("?flags", item.Flags); - - lock (database) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - result.ExecuteNonQuery(); - } + dbcon.Open(); - result.Dispose(); + MySqlCommand result = new MySqlCommand(sql, dbcon); + result.Parameters.AddWithValue("?inventoryID", item.ID.ToString()); + result.Parameters.AddWithValue("?assetID", item.AssetID.ToString()); + result.Parameters.AddWithValue("?assetType", item.AssetType.ToString()); + result.Parameters.AddWithValue("?parentFolderID", item.Folder.ToString()); + result.Parameters.AddWithValue("?avatarID", item.Owner.ToString()); + result.Parameters.AddWithValue("?inventoryName", itemName); + result.Parameters.AddWithValue("?inventoryDescription", itemDesc); + result.Parameters.AddWithValue("?inventoryNextPermissions", item.NextPermissions.ToString()); + result.Parameters.AddWithValue("?inventoryCurrentPermissions", + item.CurrentPermissions.ToString()); + result.Parameters.AddWithValue("?invType", item.InvType); + result.Parameters.AddWithValue("?creatorID", item.CreatorId); + result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); + result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); + result.Parameters.AddWithValue("?inventoryGroupPermissions", item.GroupPermissions); + result.Parameters.AddWithValue("?salePrice", item.SalePrice); + result.Parameters.AddWithValue("?saleType", unchecked((sbyte)item.SaleType)); + result.Parameters.AddWithValue("?creationDate", item.CreationDate); + result.Parameters.AddWithValue("?groupID", item.GroupID); + result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); + result.Parameters.AddWithValue("?flags", item.Flags); - result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", database.Connection); - result.Parameters.AddWithValue("?folderID", item.Folder.ToString -()); - lock (database) - { - result.ExecuteNonQuery(); + lock (m_dbLock) + { + result.ExecuteNonQuery(); + } + + result.Dispose(); + + result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon); + result.Parameters.AddWithValue("?folderID", item.Folder.ToString()); + lock (m_dbLock) + { + result.ExecuteNonQuery(); + } + result.Dispose(); } - result.Dispose(); } catch (MySqlException e) { @@ -672,8 +525,6 @@ namespace OpenSim.Data.MySQL /// Inventory item to update public void updateInventoryItem(InventoryItemBase item) { - StoreRollbackItem(item.ID); - addInventoryItem(item); } @@ -683,25 +534,24 @@ namespace OpenSim.Data.MySQL /// The inventory item UUID to delete public void deleteInventoryItem(UUID itemID) { - StoreRollbackItem(itemID); - try { - database.CheckConnection(); - - MySqlCommand cmd = - new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection); - cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); - - lock (database) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.ExecuteNonQuery(); + dbcon.Open(); + + MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", dbcon); + cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); + + lock (m_dbLock) + { + cmd.ExecuteNonQuery(); + } } } catch (MySqlException e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); } } @@ -732,26 +582,29 @@ namespace OpenSim.Data.MySQL m_log.Warn("[INVENTORY DB]: Name field truncated from " + folder.Name.Length + " to " + folderName.Length + " characters on add folder"); } - database.CheckConnection(); - - MySqlCommand cmd = new MySqlCommand(sql, database.Connection); - cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); - cmd.Parameters.AddWithValue("?agentID", folder.Owner.ToString()); - cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); - cmd.Parameters.AddWithValue("?folderName", folderName); - cmd.Parameters.AddWithValue("?type", folder.Type); - cmd.Parameters.AddWithValue("?version", folder.Version); - - try + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - lock (database) + dbcon.Open(); + + MySqlCommand cmd = new MySqlCommand(sql, dbcon); + cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); + cmd.Parameters.AddWithValue("?agentID", folder.Owner.ToString()); + cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); + cmd.Parameters.AddWithValue("?folderName", folderName); + cmd.Parameters.AddWithValue("?type", folder.Type); + cmd.Parameters.AddWithValue("?version", folder.Version); + + try { - cmd.ExecuteNonQuery(); + lock (m_dbLock) + { + cmd.ExecuteNonQuery(); + } + } + catch (Exception e) + { + m_log.Error(e.ToString()); } - } - catch (Exception e) - { - m_log.Error(e.ToString()); } } @@ -761,7 +614,6 @@ namespace OpenSim.Data.MySQL /// Folder to update public void updateInventoryFolder(InventoryFolderBase folder) { - StoreRollbackFolder(folder.ID); addInventoryFolder(folder); } @@ -772,27 +624,28 @@ namespace OpenSim.Data.MySQL /// UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID public void moveInventoryFolder(InventoryFolderBase folder) { - StoreRollbackFolder(folder.ID); - string sql = "UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID"; - database.CheckConnection(); - - MySqlCommand cmd = new MySqlCommand(sql, database.Connection); - cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); - cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); - - try + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - lock (database) + dbcon.Open(); + + MySqlCommand cmd = new MySqlCommand(sql, dbcon); + cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); + cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); + + try { - cmd.ExecuteNonQuery(); + lock (m_dbLock) + { + cmd.ExecuteNonQuery(); + } + } + catch (Exception e) + { + m_log.Error(e.ToString()); } - } - catch (Exception e) - { - m_log.Error(e.ToString()); } } @@ -836,95 +689,102 @@ namespace OpenSim.Data.MySQL try { List folders = new List(); - Dictionary> hashtable - = new Dictionary>(); ; + Dictionary> hashtable = new Dictionary>(); ; List parentFolder = new List(); - lock (database) + bool buildResultsFromHashTable = false; + + lock (m_dbLock) { - MySqlCommand result; - MySqlDataReader reader; - bool buildResultsFromHashTable = false; - - database.CheckConnection(); - - /* Fetch the parent folder from the database to determine the agent ID, and if - * we're querying the root of the inventory folder tree */ - result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", - database.Connection); - result.Parameters.AddWithValue("?uuid", parentID.ToString()); - reader = result.ExecuteReader(); - while (reader.Read()) // Should be at most 1 result - parentFolder.Add(readInventoryFolder(reader)); - reader.Close(); - result.Dispose(); - - if (parentFolder.Count >= 1) // No result means parent folder does not exist + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - if (parentFolder[0].ParentID == UUID.Zero) // We are querying the root folder + dbcon.Open(); + + /* Fetch the parent folder from the database to determine the agent ID, and if + * we're querying the root of the inventory folder tree */ + using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE folderID = ?uuid", dbcon)) { - /* Get all of the agent's folders from the database, put them in a list and return it */ - result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid", - database.Connection); - result.Parameters.AddWithValue("?uuid", parentFolder[0].Owner.ToString()); - reader = result.ExecuteReader(); - while (reader.Read()) + result.Parameters.AddWithValue("?uuid", parentID.ToString()); + + using (MySqlDataReader reader = result.ExecuteReader()) { - InventoryFolderBase curFolder = readInventoryFolder(reader); - if (curFolder.ID != parentID) // Do not need to add the root node of the tree to the list - folders.Add(curFolder); + // Should be at most 1 result + while (reader.Read()) + parentFolder.Add(readInventoryFolder(reader)); } - reader.Close(); - result.Dispose(); - } // if we are querying the root folder - else // else we are querying a subtree of the inventory folder tree + } + + if (parentFolder.Count >= 1) // No result means parent folder does not exist { - /* Get all of the agent's folders from the database, put them all in a hash table - * indexed by their parent ID */ - result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid", - database.Connection); - result.Parameters.AddWithValue("?uuid", parentFolder[0].Owner.ToString()); - reader = result.ExecuteReader(); - while (reader.Read()) + if (parentFolder[0].ParentID == UUID.Zero) // We are querying the root folder { - InventoryFolderBase curFolder = readInventoryFolder(reader); - if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling - hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list - else // else current folder has no known (yet) siblings + /* Get all of the agent's folders from the database, put them in a list and return it */ + using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid", dbcon)) { - List siblingList = new List(); - siblingList.Add(curFolder); - // Current folder has no known (yet) siblings - hashtable.Add(curFolder.ParentID, siblingList); + result.Parameters.AddWithValue("?uuid", parentFolder[0].Owner.ToString()); + + using (MySqlDataReader reader = result.ExecuteReader()) + { + while (reader.Read()) + { + InventoryFolderBase curFolder = readInventoryFolder(reader); + if (curFolder.ID != parentID) // Do not need to add the root node of the tree to the list + folders.Add(curFolder); + } + } } - } // while more items to read from the database - reader.Close(); - result.Dispose(); + } // if we are querying the root folder + else // else we are querying a subtree of the inventory folder tree + { + /* Get all of the agent's folders from the database, put them all in a hash table + * indexed by their parent ID */ + using (MySqlCommand result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid", dbcon)) + { + result.Parameters.AddWithValue("?uuid", parentFolder[0].Owner.ToString()); - // Set flag so we know we need to build the results from the hash table after - // we unlock the database - buildResultsFromHashTable = true; + using (MySqlDataReader reader = result.ExecuteReader()) + { + while (reader.Read()) + { + InventoryFolderBase curFolder = readInventoryFolder(reader); + if (hashtable.ContainsKey(curFolder.ParentID)) // Current folder already has a sibling + hashtable[curFolder.ParentID].Add(curFolder); // append to sibling list + else // else current folder has no known (yet) siblings + { + List siblingList = new List(); + siblingList.Add(curFolder); + // Current folder has no known (yet) siblings + hashtable.Add(curFolder.ParentID, siblingList); + } + } // while more items to read from the database + } + } - } // else we are querying a subtree of the inventory folder tree - } // if folder parentID exists + // Set flag so we know we need to build the results from the hash table after + // we unlock the database + buildResultsFromHashTable = true; - if (buildResultsFromHashTable) - { - /* We have all of the user's folders stored in a hash table indexed by their parent ID - * and we need to return the requested subtree. We will build the requested subtree - * by performing a breadth-first-search on the hash table */ - if (hashtable.ContainsKey(parentID)) - folders.AddRange(hashtable[parentID]); - for (int i = 0; i < folders.Count; i++) // **Note: folders.Count is *not* static - if (hashtable.ContainsKey(folders[i].ID)) - folders.AddRange(hashtable[folders[i].ID]); + } // else we are querying a subtree of the inventory folder tree + } // if folder parentID exists + + if (buildResultsFromHashTable) + { + /* We have all of the user's folders stored in a hash table indexed by their parent ID + * and we need to return the requested subtree. We will build the requested subtree + * by performing a breadth-first-search on the hash table */ + if (hashtable.ContainsKey(parentID)) + folders.AddRange(hashtable[parentID]); + for (int i = 0; i < folders.Count; i++) // **Note: folders.Count is *not* static + if (hashtable.ContainsKey(folders[i].ID)) + folders.AddRange(hashtable[folders[i].ID]); + } } } // lock (database) + return folders; } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } } @@ -935,25 +795,24 @@ namespace OpenSim.Data.MySQL /// the folder UUID protected void deleteOneFolder(UUID folderID) { - StoreRollbackFolder(folderID); - try { - database.CheckConnection(); - - MySqlCommand cmd = - new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid", database.Connection); - cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); - - lock (database) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.ExecuteNonQuery(); + dbcon.Open(); + + using (MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid", dbcon)) + { + cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); + + lock (m_dbLock) + cmd.ExecuteNonQuery(); + } } } catch (MySqlException e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); } } @@ -963,30 +822,23 @@ namespace OpenSim.Data.MySQL /// the folder UUID protected void deleteItemsInFolder(UUID folderID) { - if (rollbackStore) - { - foreach (InventoryItemBase itemBase in getInventoryInFolder(folderID)) - { - StoreRollbackItem(itemBase.ID); - } - } - try { - database.CheckConnection(); - - MySqlCommand cmd = - new MySqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=?uuid", database.Connection); - cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); - - lock (database) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.ExecuteNonQuery(); + dbcon.Open(); + + using (MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=?uuid", dbcon)) + { + cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); + + lock (m_dbLock) + cmd.ExecuteNonQuery(); + } } } catch (MySqlException e) { - database.Reconnect(); m_log.Error(e.ToString()); } } @@ -999,80 +851,53 @@ namespace OpenSim.Data.MySQL { List subFolders = getFolderHierarchy(folderID); - // Dont delete in OGM - makes for easier restores if someone sends a malcious command. (just restore the folder entry) - if (opengridmode == false) + //Delete all sub-folders + foreach (InventoryFolderBase f in subFolders) { - //Delete all sub-folders - foreach (InventoryFolderBase f in subFolders) - { - StoreRollbackFolder(f.ID); - deleteOneFolder(f.ID); - - if (rollbackStore) - { - foreach (InventoryItemBase itemBase in getInventoryInFolder(f.ID)) - { - StoreRollbackItem(itemBase.ID); - } - } - deleteItemsInFolder(f.ID); - } + deleteOneFolder(f.ID); + deleteItemsInFolder(f.ID); } - StoreRollbackFolder(folderID); //Delete the actual row deleteOneFolder(folderID); - - // Just delete the folder context in OGM - if (opengridmode == false) - { - if (rollbackStore) - { - foreach (InventoryItemBase itemBase in getInventoryInFolder(folderID)) - { - StoreRollbackItem(itemBase.ID); - } - } - deleteItemsInFolder(folderID); - } + deleteItemsInFolder(folderID); } public List fetchActiveGestures(UUID avatarID) { - MySqlDataReader result = null; - MySqlCommand sqlCmd = null; - lock (database) + lock (m_dbLock) { try { - database.CheckConnection(); - sqlCmd = new MySqlCommand( - "SELECT * FROM inventoryitems WHERE avatarId = ?uuid AND assetType = ?type and flags = 1", - database.Connection); - sqlCmd.Parameters.AddWithValue("?uuid", avatarID.ToString()); - sqlCmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); - result = sqlCmd.ExecuteReader(); - - List list = new List(); - while (result.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - InventoryItemBase item = readInventoryItem(result); - if (item != null) - list.Add(item); + dbcon.Open(); + + using (MySqlCommand sqlCmd = new MySqlCommand( + "SELECT * FROM inventoryitems WHERE avatarId = ?uuid AND assetType = ?type and flags = 1", dbcon)) + { + sqlCmd.Parameters.AddWithValue("?uuid", avatarID.ToString()); + sqlCmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); + + using (MySqlDataReader result = sqlCmd.ExecuteReader()) + { + List list = new List(); + while (result.Read()) + { + InventoryItemBase item = readInventoryItem(result); + if (item != null) + list.Add(item); + } + return list; + } + } } - return list; } catch (Exception e) { - database.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - if (result != null) result.Close(); - if (sqlCmd != null) sqlCmd.Dispose(); - } } } } diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index 9a4a4bb8dc..a06eec3db9 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs @@ -48,75 +48,54 @@ namespace OpenSim.Data.MySQL { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private string m_ConnectionString; - - private MySqlConnection m_Connection = null; + private string m_connectionString; + private object m_dbLock = new object(); public void Initialise(string connectionString) { - m_ConnectionString = connectionString; + m_connectionString = connectionString; - m_Connection = new MySqlConnection(m_ConnectionString); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - m_Connection.Open(); + // Apply new Migrations + // + Assembly assem = GetType().Assembly; + Migration m = new Migration(dbcon, assem, "RegionStore"); + m.Update(); - // Apply new Migrations - // - Assembly assem = GetType().Assembly; - Migration m = new Migration(m_Connection, assem, "RegionStore"); - m.Update(); - - // NOTE: This is a very slow query that times out on regions with a lot of prims. - // I'm told that it is no longer relevant so it's commented out now, but if it - // is relevant it should be added as a console command instead of part of the - // startup phase - // Clean dropped attachments - // - //try - //{ - // using (MySqlCommand cmd = m_Connection.CreateCommand()) - // { - // cmd.CommandText = "delete from prims, primshapes using prims " + - // "left join primshapes on prims.uuid = primshapes.uuid " + - // "where PCode = 9 and State <> 0"; - // ExecuteNonQuery(cmd); - // } - //} - //catch (MySqlException ex) - //{ - // m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message); - //} + // Clean dropped attachments + // + try + { + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from prims, primshapes using prims " + + "left join primshapes on prims.uuid = primshapes.uuid " + + "where PCode = 9 and State <> 0"; + ExecuteNonQuery(cmd); + } + } + catch (MySqlException ex) + { + m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message); + } + } } private IDataReader ExecuteReader(MySqlCommand c) { IDataReader r = null; - bool errorSeen = false; - while (true) + try { - try - { - r = c.ExecuteReader(); - } - catch (Exception) - { - Thread.Sleep(500); - - m_Connection.Close(); - m_Connection = (MySqlConnection) ((ICloneable)m_Connection).Clone(); - m_Connection.Open(); - c.Connection = m_Connection; - - if (!errorSeen) - { - errorSeen = true; - continue; - } - throw; - } - - break; + r = c.ExecuteReader(); + } + catch (Exception e) + { + m_log.Error("[REGION DB]: MySQL error in ExecuteReader: " + e.Message); + throw; } return r; @@ -124,32 +103,14 @@ namespace OpenSim.Data.MySQL private void ExecuteNonQuery(MySqlCommand c) { - bool errorSeen = false; - - while (true) + try { - try - { - c.ExecuteNonQuery(); - } - catch (Exception) - { - Thread.Sleep(500); - - m_Connection.Close(); - m_Connection = (MySqlConnection) ((ICloneable)m_Connection).Clone(); - m_Connection.Open(); - c.Connection = m_Connection; - - if (!errorSeen) - { - errorSeen = true; - continue; - } - throw; - } - - break; + c.ExecuteNonQuery(); + } + catch (Exception e) + { + m_log.Error("[REGION DB]: MySQL error in ExecuteNonQuery: " + e.Message); + throw; } } @@ -166,115 +127,119 @@ namespace OpenSim.Data.MySQL if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) return; - lock (m_Connection) + lock (m_dbLock) { - MySqlCommand cmd = m_Connection.CreateCommand(); - - foreach (SceneObjectPart prim in obj.Children.Values) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.Parameters.Clear(); + dbcon.Open(); + MySqlCommand cmd = dbcon.CreateCommand(); - cmd.CommandText = "replace into prims ("+ - "UUID, CreationDate, "+ - "Name, Text, Description, "+ - "SitName, TouchName, ObjectFlags, "+ - "OwnerMask, NextOwnerMask, GroupMask, "+ - "EveryoneMask, BaseMask, PositionX, "+ - "PositionY, PositionZ, GroupPositionX, "+ - "GroupPositionY, GroupPositionZ, VelocityX, "+ - "VelocityY, VelocityZ, AngularVelocityX, "+ - "AngularVelocityY, AngularVelocityZ, "+ - "AccelerationX, AccelerationY, "+ - "AccelerationZ, RotationX, "+ - "RotationY, RotationZ, "+ - "RotationW, SitTargetOffsetX, "+ - "SitTargetOffsetY, SitTargetOffsetZ, "+ - "SitTargetOrientW, SitTargetOrientX, "+ - "SitTargetOrientY, SitTargetOrientZ, "+ - "RegionUUID, CreatorID, "+ - "OwnerID, GroupID, "+ - "LastOwnerID, SceneGroupID, "+ - "PayPrice, PayButton1, "+ - "PayButton2, PayButton3, "+ - "PayButton4, LoopedSound, "+ - "LoopedSoundGain, TextureAnimation, "+ - "OmegaX, OmegaY, OmegaZ, "+ - "CameraEyeOffsetX, CameraEyeOffsetY, "+ - "CameraEyeOffsetZ, CameraAtOffsetX, "+ - "CameraAtOffsetY, CameraAtOffsetZ, "+ - "ForceMouselook, ScriptAccessPin, "+ - "AllowedDrop, DieAtEdge, "+ - "SalePrice, SaleType, "+ - "ColorR, ColorG, ColorB, ColorA, "+ - "ParticleSystem, ClickAction, Material, "+ - "CollisionSound, CollisionSoundVolume, "+ - "PassTouches, "+ - "LinkNumber) values (" + "?UUID, "+ - "?CreationDate, ?Name, ?Text, "+ - "?Description, ?SitName, ?TouchName, "+ - "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, "+ - "?GroupMask, ?EveryoneMask, ?BaseMask, "+ - "?PositionX, ?PositionY, ?PositionZ, "+ - "?GroupPositionX, ?GroupPositionY, "+ - "?GroupPositionZ, ?VelocityX, "+ - "?VelocityY, ?VelocityZ, ?AngularVelocityX, "+ - "?AngularVelocityY, ?AngularVelocityZ, "+ - "?AccelerationX, ?AccelerationY, "+ - "?AccelerationZ, ?RotationX, "+ - "?RotationY, ?RotationZ, "+ - "?RotationW, ?SitTargetOffsetX, "+ - "?SitTargetOffsetY, ?SitTargetOffsetZ, "+ - "?SitTargetOrientW, ?SitTargetOrientX, "+ - "?SitTargetOrientY, ?SitTargetOrientZ, "+ - "?RegionUUID, ?CreatorID, ?OwnerID, "+ - "?GroupID, ?LastOwnerID, ?SceneGroupID, "+ - "?PayPrice, ?PayButton1, ?PayButton2, "+ - "?PayButton3, ?PayButton4, ?LoopedSound, "+ - "?LoopedSoundGain, ?TextureAnimation, "+ - "?OmegaX, ?OmegaY, ?OmegaZ, "+ - "?CameraEyeOffsetX, ?CameraEyeOffsetY, "+ - "?CameraEyeOffsetZ, ?CameraAtOffsetX, "+ - "?CameraAtOffsetY, ?CameraAtOffsetZ, "+ - "?ForceMouselook, ?ScriptAccessPin, "+ - "?AllowedDrop, ?DieAtEdge, ?SalePrice, "+ - "?SaleType, ?ColorR, ?ColorG, "+ - "?ColorB, ?ColorA, ?ParticleSystem, "+ - "?ClickAction, ?Material, ?CollisionSound, "+ - "?CollisionSoundVolume, ?PassTouches, ?LinkNumber)"; + foreach (SceneObjectPart prim in obj.Children.Values) + { + cmd.Parameters.Clear(); - FillPrimCommand(cmd, prim, obj.UUID, regionUUID); + cmd.CommandText = "replace into prims (" + + "UUID, CreationDate, " + + "Name, Text, Description, " + + "SitName, TouchName, ObjectFlags, " + + "OwnerMask, NextOwnerMask, GroupMask, " + + "EveryoneMask, BaseMask, PositionX, " + + "PositionY, PositionZ, GroupPositionX, " + + "GroupPositionY, GroupPositionZ, VelocityX, " + + "VelocityY, VelocityZ, AngularVelocityX, " + + "AngularVelocityY, AngularVelocityZ, " + + "AccelerationX, AccelerationY, " + + "AccelerationZ, RotationX, " + + "RotationY, RotationZ, " + + "RotationW, SitTargetOffsetX, " + + "SitTargetOffsetY, SitTargetOffsetZ, " + + "SitTargetOrientW, SitTargetOrientX, " + + "SitTargetOrientY, SitTargetOrientZ, " + + "RegionUUID, CreatorID, " + + "OwnerID, GroupID, " + + "LastOwnerID, SceneGroupID, " + + "PayPrice, PayButton1, " + + "PayButton2, PayButton3, " + + "PayButton4, LoopedSound, " + + "LoopedSoundGain, TextureAnimation, " + + "OmegaX, OmegaY, OmegaZ, " + + "CameraEyeOffsetX, CameraEyeOffsetY, " + + "CameraEyeOffsetZ, CameraAtOffsetX, " + + "CameraAtOffsetY, CameraAtOffsetZ, " + + "ForceMouselook, ScriptAccessPin, " + + "AllowedDrop, DieAtEdge, " + + "SalePrice, SaleType, " + + "ColorR, ColorG, ColorB, ColorA, " + + "ParticleSystem, ClickAction, Material, " + + "CollisionSound, CollisionSoundVolume, " + + "PassTouches, " + + "LinkNumber) values (" + "?UUID, " + + "?CreationDate, ?Name, ?Text, " + + "?Description, ?SitName, ?TouchName, " + + "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + + "?GroupMask, ?EveryoneMask, ?BaseMask, " + + "?PositionX, ?PositionY, ?PositionZ, " + + "?GroupPositionX, ?GroupPositionY, " + + "?GroupPositionZ, ?VelocityX, " + + "?VelocityY, ?VelocityZ, ?AngularVelocityX, " + + "?AngularVelocityY, ?AngularVelocityZ, " + + "?AccelerationX, ?AccelerationY, " + + "?AccelerationZ, ?RotationX, " + + "?RotationY, ?RotationZ, " + + "?RotationW, ?SitTargetOffsetX, " + + "?SitTargetOffsetY, ?SitTargetOffsetZ, " + + "?SitTargetOrientW, ?SitTargetOrientX, " + + "?SitTargetOrientY, ?SitTargetOrientZ, " + + "?RegionUUID, ?CreatorID, ?OwnerID, " + + "?GroupID, ?LastOwnerID, ?SceneGroupID, " + + "?PayPrice, ?PayButton1, ?PayButton2, " + + "?PayButton3, ?PayButton4, ?LoopedSound, " + + "?LoopedSoundGain, ?TextureAnimation, " + + "?OmegaX, ?OmegaY, ?OmegaZ, " + + "?CameraEyeOffsetX, ?CameraEyeOffsetY, " + + "?CameraEyeOffsetZ, ?CameraAtOffsetX, " + + "?CameraAtOffsetY, ?CameraAtOffsetZ, " + + "?ForceMouselook, ?ScriptAccessPin, " + + "?AllowedDrop, ?DieAtEdge, ?SalePrice, " + + "?SaleType, ?ColorR, ?ColorG, " + + "?ColorB, ?ColorA, ?ParticleSystem, " + + "?ClickAction, ?Material, ?CollisionSound, " + + "?CollisionSoundVolume, ?PassTouches, ?LinkNumber)"; - ExecuteNonQuery(cmd); + FillPrimCommand(cmd, prim, obj.UUID, regionUUID); - cmd.Parameters.Clear(); + ExecuteNonQuery(cmd); - cmd.CommandText = "replace into primshapes ("+ - "UUID, Shape, ScaleX, ScaleY, "+ - "ScaleZ, PCode, PathBegin, PathEnd, "+ - "PathScaleX, PathScaleY, PathShearX, "+ - "PathShearY, PathSkew, PathCurve, "+ - "PathRadiusOffset, PathRevolutions, "+ - "PathTaperX, PathTaperY, PathTwist, "+ - "PathTwistBegin, ProfileBegin, ProfileEnd, "+ - "ProfileCurve, ProfileHollow, Texture, "+ - "ExtraParams, State) values (?UUID, "+ - "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, "+ - "?PCode, ?PathBegin, ?PathEnd, "+ - "?PathScaleX, ?PathScaleY, "+ - "?PathShearX, ?PathShearY, "+ - "?PathSkew, ?PathCurve, ?PathRadiusOffset, "+ - "?PathRevolutions, ?PathTaperX, "+ - "?PathTaperY, ?PathTwist, "+ - "?PathTwistBegin, ?ProfileBegin, "+ - "?ProfileEnd, ?ProfileCurve, "+ - "?ProfileHollow, ?Texture, ?ExtraParams, "+ - "?State)"; + cmd.Parameters.Clear(); - FillShapeCommand(cmd, prim); + cmd.CommandText = "replace into primshapes (" + + "UUID, Shape, ScaleX, ScaleY, " + + "ScaleZ, PCode, PathBegin, PathEnd, " + + "PathScaleX, PathScaleY, PathShearX, " + + "PathShearY, PathSkew, PathCurve, " + + "PathRadiusOffset, PathRevolutions, " + + "PathTaperX, PathTaperY, PathTwist, " + + "PathTwistBegin, ProfileBegin, ProfileEnd, " + + "ProfileCurve, ProfileHollow, Texture, " + + "ExtraParams, State) values (?UUID, " + + "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + + "?PCode, ?PathBegin, ?PathEnd, " + + "?PathScaleX, ?PathScaleY, " + + "?PathShearX, ?PathShearY, " + + "?PathSkew, ?PathCurve, ?PathRadiusOffset, " + + "?PathRevolutions, ?PathTaperX, " + + "?PathTaperY, ?PathTwist, " + + "?PathTwistBegin, ?ProfileBegin, " + + "?ProfileEnd, ?ProfileCurve, " + + "?ProfileHollow, ?Texture, ?ExtraParams, " + + "?State)"; - ExecuteNonQuery(cmd); + FillShapeCommand(cmd, prim); + + ExecuteNonQuery(cmd); + } + cmd.Dispose(); } - cmd.Dispose(); } } @@ -290,22 +255,27 @@ namespace OpenSim.Data.MySQL // cause the loss of a prim, but is cleaner. // It's also faster because it uses the primary key. // - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "select UUID from prims where SceneGroupID= ?UUID"; - cmd.Parameters.AddWithValue("UUID", obj.ToString()); + dbcon.Open(); - using (IDataReader reader = ExecuteReader(cmd)) + using (MySqlCommand cmd = dbcon.CreateCommand()) { - while (reader.Read()) - uuids.Add(new UUID(reader["UUID"].ToString())); - } + cmd.CommandText = "select UUID from prims where SceneGroupID= ?UUID"; + cmd.Parameters.AddWithValue("UUID", obj.ToString()); - // delete the main prims - cmd.CommandText = "delete from prims where SceneGroupID= ?UUID"; - ExecuteNonQuery(cmd); + using (IDataReader reader = ExecuteReader(cmd)) + { + while (reader.Read()) + uuids.Add(new UUID(reader["UUID"].ToString())); + } + + // delete the main prims + cmd.CommandText = "delete from prims where SceneGroupID= ?UUID"; + ExecuteNonQuery(cmd); + } } } @@ -326,14 +296,19 @@ namespace OpenSim.Data.MySQL /// the Item UUID private void RemoveItems(UUID uuid) { - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "delete from primitems where PrimID = ?PrimID"; - cmd.Parameters.AddWithValue("PrimID", uuid.ToString()); + dbcon.Open(); - ExecuteNonQuery(cmd); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from primitems where PrimID = ?PrimID"; + cmd.Parameters.AddWithValue("PrimID", uuid.ToString()); + + ExecuteNonQuery(cmd); + } } } } @@ -345,29 +320,33 @@ namespace OpenSim.Data.MySQL /// the list of UUIDs private void RemoveShapes(List uuids) { - lock (m_Connection) + lock (m_dbLock) { string sql = "delete from primshapes where "; - - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - for (int i = 0; i < uuids.Count; i++) + dbcon.Open(); + + using (MySqlCommand cmd = dbcon.CreateCommand()) { - if ((i + 1) == uuids.Count) - {// end of the list - sql += "(UUID = ?UUID" + i + ")"; - } - else + for (int i = 0; i < uuids.Count; i++) { - sql += "(UUID = ?UUID" + i + ") or "; + if ((i + 1) == uuids.Count) + {// end of the list + sql += "(UUID = ?UUID" + i + ")"; + } + else + { + sql += "(UUID = ?UUID" + i + ") or "; + } } + cmd.CommandText = sql; + + for (int i = 0; i < uuids.Count; i++) + cmd.Parameters.AddWithValue("UUID" + i, uuids[i].ToString()); + + ExecuteNonQuery(cmd); } - cmd.CommandText = sql; - - for (int i = 0; i < uuids.Count; i++) - cmd.Parameters.AddWithValue("UUID" + i, uuids[i].ToString()); - - ExecuteNonQuery(cmd); } } } @@ -379,30 +358,34 @@ namespace OpenSim.Data.MySQL /// the list of UUIDs private void RemoveItems(List uuids) { - lock (m_Connection) + lock (m_dbLock) { string sql = "delete from primitems where "; - - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - for (int i = 0; i < uuids.Count; i++) + dbcon.Open(); + + using (MySqlCommand cmd = dbcon.CreateCommand()) { - if ((i + 1) == uuids.Count) + for (int i = 0; i < uuids.Count; i++) { - // end of the list - sql += "(PrimID = ?PrimID" + i + ")"; - } - else - { - sql += "(PrimID = ?PrimID" + i + ") or "; + if ((i + 1) == uuids.Count) + { + // end of the list + sql += "(PrimID = ?PrimID" + i + ")"; + } + else + { + sql += "(PrimID = ?PrimID" + i + ") or "; + } } + cmd.CommandText = sql; + + for (int i = 0; i < uuids.Count; i++) + cmd.Parameters.AddWithValue("PrimID" + i, uuids[i].ToString()); + + ExecuteNonQuery(cmd); } - cmd.CommandText = sql; - - for (int i = 0; i < uuids.Count; i++) - cmd.Parameters.AddWithValue("PrimID" + i, uuids[i].ToString()); - - ExecuteNonQuery(cmd); } } } @@ -417,33 +400,38 @@ namespace OpenSim.Data.MySQL #region Prim Loading - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = - "SELECT * FROM prims LEFT JOIN primshapes ON prims.UUID = primshapes.UUID WHERE RegionUUID = ?RegionUUID"; - cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); + dbcon.Open(); - using (IDataReader reader = ExecuteReader(cmd)) + using (MySqlCommand cmd = dbcon.CreateCommand()) { - while (reader.Read()) + cmd.CommandText = + "SELECT * FROM prims LEFT JOIN primshapes ON prims.UUID = primshapes.UUID WHERE RegionUUID = ?RegionUUID"; + cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); + + using (IDataReader reader = ExecuteReader(cmd)) { - SceneObjectPart prim = BuildPrim(reader); - if (reader["Shape"] is DBNull) - prim.Shape = PrimitiveBaseShape.Default; - else - prim.Shape = BuildShape(reader); + while (reader.Read()) + { + SceneObjectPart prim = BuildPrim(reader); + if (reader["Shape"] is DBNull) + prim.Shape = PrimitiveBaseShape.Default; + else + prim.Shape = BuildShape(reader); - UUID parentID = new UUID(reader["SceneGroupID"].ToString()); - if (parentID != prim.UUID) - prim.ParentUUID = parentID; + UUID parentID = new UUID(reader["SceneGroupID"].ToString()); + if (parentID != prim.UUID) + prim.ParentUUID = parentID; - prims[prim.UUID] = prim; + prims[prim.UUID] = prim; - ++count; - if (count % ROWS_PER_QUERY == 0) - m_log.Debug("[REGION DB]: Loaded " + count + " prims..."); + ++count; + if (count % ROWS_PER_QUERY == 0) + m_log.Debug("[REGION DB]: Loaded " + count + " prims..."); + } } } } @@ -497,20 +485,25 @@ namespace OpenSim.Data.MySQL // list from DB of all prims which have items and // LoadItems only on those List primsWithInventory = new List(); - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand itemCmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - itemCmd.CommandText = "SELECT DISTINCT primID FROM primitems"; - using (IDataReader itemReader = ExecuteReader(itemCmd)) + dbcon.Open(); + + using (MySqlCommand itemCmd = dbcon.CreateCommand()) { - while (itemReader.Read()) + itemCmd.CommandText = "SELECT DISTINCT primID FROM primitems"; + using (IDataReader itemReader = ExecuteReader(itemCmd)) { - if (!(itemReader["primID"] is DBNull)) + while (itemReader.Read()) { - UUID primID = new UUID(itemReader["primID"].ToString()); - if (prims.ContainsKey(primID)) - primsWithInventory.Add(prims[primID]); + if (!(itemReader["primID"] is DBNull)) + { + UUID primID = new UUID(itemReader["primID"].ToString()); + if (prims.ContainsKey(primID)) + primsWithInventory.Add(prims[primID]); + } } } } @@ -535,23 +528,28 @@ namespace OpenSim.Data.MySQL /// The prim private void LoadItems(SceneObjectPart prim) { - lock (m_Connection) + lock (m_dbLock) { List inventory = new List(); - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "select * from primitems where PrimID = ?PrimID"; - cmd.Parameters.AddWithValue("PrimID", prim.UUID.ToString()); + dbcon.Open(); - using (IDataReader reader = ExecuteReader(cmd)) + using (MySqlCommand cmd = dbcon.CreateCommand()) { - while (reader.Read()) - { - TaskInventoryItem item = BuildItem(reader); + cmd.CommandText = "select * from primitems where PrimID = ?PrimID"; + cmd.Parameters.AddWithValue("PrimID", prim.UUID.ToString()); - item.ParentID = prim.UUID; // Values in database are often wrong - inventory.Add(item); + using (IDataReader reader = ExecuteReader(cmd)) + { + while (reader.Read()) + { + TaskInventoryItem item = BuildItem(reader); + + item.ParentID = prim.UUID; // Values in database are often wrong + inventory.Add(item); + } } } } @@ -564,22 +562,27 @@ namespace OpenSim.Data.MySQL { m_log.Info("[REGION DB]: Storing terrain"); - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID"; - cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); + dbcon.Open(); - ExecuteNonQuery(cmd); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID"; + cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); - cmd.CommandText = "insert into terrain (RegionUUID, " + - "Revision, Heightfield) values (?RegionUUID, " + - "1, ?Heightfield)"; + ExecuteNonQuery(cmd); - cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter)); + cmd.CommandText = "insert into terrain (RegionUUID, " + + "Revision, Heightfield) values (?RegionUUID, " + + "1, ?Heightfield)"; - ExecuteNonQuery(cmd); + cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter)); + + ExecuteNonQuery(cmd); + } } } } @@ -588,38 +591,43 @@ namespace OpenSim.Data.MySQL { double[,] terrain = null; - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "select RegionUUID, Revision, Heightfield " + - "from terrain where RegionUUID = ?RegionUUID " + - "order by Revision desc limit 1"; - cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); + dbcon.Open(); - using (IDataReader reader = ExecuteReader(cmd)) + using (MySqlCommand cmd = dbcon.CreateCommand()) { - while (reader.Read()) + cmd.CommandText = "select RegionUUID, Revision, Heightfield " + + "from terrain where RegionUUID = ?RegionUUID " + + "order by Revision desc limit 1"; + cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); + + using (IDataReader reader = ExecuteReader(cmd)) { - int rev = Convert.ToInt32(reader["Revision"]); - - terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; - terrain.Initialize(); - - using (MemoryStream mstr = new MemoryStream((byte[])reader["Heightfield"])) + while (reader.Read()) { - using (BinaryReader br = new BinaryReader(mstr)) + int rev = Convert.ToInt32(reader["Revision"]); + + terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize]; + terrain.Initialize(); + + using (MemoryStream mstr = new MemoryStream((byte[])reader["Heightfield"])) { - for (int x = 0; x < (int)Constants.RegionSize; x++) + using (BinaryReader br = new BinaryReader(mstr)) { - for (int y = 0; y < (int)Constants.RegionSize; y++) + for (int x = 0; x < (int)Constants.RegionSize; x++) { - terrain[x, y] = br.ReadDouble(); + for (int y = 0; y < (int)Constants.RegionSize; y++) + { + terrain[x, y] = br.ReadDouble(); + } } } - } - m_log.InfoFormat("[REGION DB]: Loaded terrain revision r{0}", rev); + m_log.InfoFormat("[REGION DB]: Loaded terrain revision r{0}", rev); + } } } } @@ -631,63 +639,73 @@ namespace OpenSim.Data.MySQL public void RemoveLandObject(UUID globalID) { - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "delete from land where UUID = ?UUID"; - cmd.Parameters.AddWithValue("UUID", globalID.ToString()); + dbcon.Open(); - ExecuteNonQuery(cmd); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from land where UUID = ?UUID"; + cmd.Parameters.AddWithValue("UUID", globalID.ToString()); + + ExecuteNonQuery(cmd); + } } } } public void StoreLandObject(ILandObject parcel) { - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "replace into land (UUID, RegionUUID, " + - "LocalLandID, Bitmap, Name, Description, " + - "OwnerUUID, IsGroupOwned, Area, AuctionID, " + - "Category, ClaimDate, ClaimPrice, GroupUUID, " + - "SalePrice, LandStatus, LandFlags, LandingType, " + - "MediaAutoScale, MediaTextureUUID, MediaURL, " + - "MusicURL, PassHours, PassPrice, SnapshotUUID, " + - "UserLocationX, UserLocationY, UserLocationZ, " + - "UserLookAtX, UserLookAtY, UserLookAtZ, " + - "AuthbuyerID, OtherCleanTime, Dwell) values (" + - "?UUID, ?RegionUUID, " + - "?LocalLandID, ?Bitmap, ?Name, ?Description, " + - "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + - "?Category, ?ClaimDate, ?ClaimPrice, ?GroupUUID, " + - "?SalePrice, ?LandStatus, ?LandFlags, ?LandingType, " + - "?MediaAutoScale, ?MediaTextureUUID, ?MediaURL, " + - "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " + - "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + - "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + - "?AuthbuyerID, ?OtherCleanTime, ?Dwell)"; + dbcon.Open(); - FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); - - ExecuteNonQuery(cmd); - - cmd.CommandText = "delete from landaccesslist where LandUUID = ?UUID"; - - ExecuteNonQuery(cmd); - - cmd.Parameters.Clear(); - cmd.CommandText = "insert into landaccesslist (LandUUID, " + - "AccessUUID, Flags) values (?LandUUID, ?AccessUUID, " + - "?Flags)"; - - foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) + using (MySqlCommand cmd = dbcon.CreateCommand()) { - FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID); + cmd.CommandText = "replace into land (UUID, RegionUUID, " + + "LocalLandID, Bitmap, Name, Description, " + + "OwnerUUID, IsGroupOwned, Area, AuctionID, " + + "Category, ClaimDate, ClaimPrice, GroupUUID, " + + "SalePrice, LandStatus, LandFlags, LandingType, " + + "MediaAutoScale, MediaTextureUUID, MediaURL, " + + "MusicURL, PassHours, PassPrice, SnapshotUUID, " + + "UserLocationX, UserLocationY, UserLocationZ, " + + "UserLookAtX, UserLookAtY, UserLookAtZ, " + + "AuthbuyerID, OtherCleanTime, Dwell) values (" + + "?UUID, ?RegionUUID, " + + "?LocalLandID, ?Bitmap, ?Name, ?Description, " + + "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + + "?Category, ?ClaimDate, ?ClaimPrice, ?GroupUUID, " + + "?SalePrice, ?LandStatus, ?LandFlags, ?LandingType, " + + "?MediaAutoScale, ?MediaTextureUUID, ?MediaURL, " + + "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " + + "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + + "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + + "?AuthbuyerID, ?OtherCleanTime, ?Dwell)"; + + FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); + ExecuteNonQuery(cmd); + + cmd.CommandText = "delete from landaccesslist where LandUUID = ?UUID"; + + ExecuteNonQuery(cmd); + cmd.Parameters.Clear(); + cmd.CommandText = "insert into landaccesslist (LandUUID, " + + "AccessUUID, Flags) values (?LandUUID, ?AccessUUID, " + + "?Flags)"; + + foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList) + { + FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID); + ExecuteNonQuery(cmd); + cmd.Parameters.Clear(); + } } } } @@ -697,27 +715,32 @@ namespace OpenSim.Data.MySQL { RegionSettings rs = null; - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "select * from regionsettings where regionUUID = ?RegionUUID"; - cmd.Parameters.AddWithValue("regionUUID", regionUUID); + dbcon.Open(); - using (IDataReader reader = ExecuteReader(cmd)) + using (MySqlCommand cmd = dbcon.CreateCommand()) { - if (reader.Read()) - { - rs = BuildRegionSettings(reader); - rs.OnSave += StoreRegionSettings; - } - else - { - rs = new RegionSettings(); - rs.RegionUUID = regionUUID; - rs.OnSave += StoreRegionSettings; + cmd.CommandText = "select * from regionsettings where regionUUID = ?RegionUUID"; + cmd.Parameters.AddWithValue("regionUUID", regionUUID); - StoreRegionSettings(rs); + using (IDataReader reader = ExecuteReader(cmd)) + { + if (reader.Read()) + { + rs = BuildRegionSettings(reader); + rs.OnSave += StoreRegionSettings; + } + else + { + rs = new RegionSettings(); + rs.RegionUUID = regionUUID; + rs.OnSave += StoreRegionSettings; + + StoreRegionSettings(rs); + } } } } @@ -728,46 +751,51 @@ namespace OpenSim.Data.MySQL public void StoreRegionSettings(RegionSettings rs) { - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "replace into regionsettings (regionUUID, " + - "block_terraform, block_fly, allow_damage, " + - "restrict_pushing, allow_land_resell, " + - "allow_land_join_divide, block_show_in_search, " + - "agent_limit, object_bonus, maturity, " + - "disable_scripts, disable_collisions, " + - "disable_physics, terrain_texture_1, " + - "terrain_texture_2, terrain_texture_3, " + - "terrain_texture_4, elevation_1_nw, " + - "elevation_2_nw, elevation_1_ne, " + - "elevation_2_ne, elevation_1_se, " + - "elevation_2_se, elevation_1_sw, " + - "elevation_2_sw, water_height, " + - "terrain_raise_limit, terrain_lower_limit, " + - "use_estate_sun, fixed_sun, sun_position, " + - "covenant, Sandbox, sunvectorx, sunvectory, " + - "sunvectorz, loaded_creation_datetime, " + - "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " + - "?BlockFly, ?AllowDamage, ?RestrictPushing, " + - "?AllowLandResell, ?AllowLandJoinDivide, " + - "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + - "?Maturity, ?DisableScripts, ?DisableCollisions, " + - "?DisablePhysics, ?TerrainTexture1, " + - "?TerrainTexture2, ?TerrainTexture3, " + - "?TerrainTexture4, ?Elevation1NW, ?Elevation2NW, " + - "?Elevation1NE, ?Elevation2NE, ?Elevation1SE, " + - "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " + - "?WaterHeight, ?TerrainRaiseLimit, " + - "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + - "?SunPosition, ?Covenant, ?Sandbox, " + - "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + - "?LoadedCreationDateTime, ?LoadedCreationID)"; + dbcon.Open(); - FillRegionSettingsCommand(cmd, rs); + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "replace into regionsettings (regionUUID, " + + "block_terraform, block_fly, allow_damage, " + + "restrict_pushing, allow_land_resell, " + + "allow_land_join_divide, block_show_in_search, " + + "agent_limit, object_bonus, maturity, " + + "disable_scripts, disable_collisions, " + + "disable_physics, terrain_texture_1, " + + "terrain_texture_2, terrain_texture_3, " + + "terrain_texture_4, elevation_1_nw, " + + "elevation_2_nw, elevation_1_ne, " + + "elevation_2_ne, elevation_1_se, " + + "elevation_2_se, elevation_1_sw, " + + "elevation_2_sw, water_height, " + + "terrain_raise_limit, terrain_lower_limit, " + + "use_estate_sun, fixed_sun, sun_position, " + + "covenant, Sandbox, sunvectorx, sunvectory, " + + "sunvectorz, loaded_creation_datetime, " + + "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " + + "?BlockFly, ?AllowDamage, ?RestrictPushing, " + + "?AllowLandResell, ?AllowLandJoinDivide, " + + "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + + "?Maturity, ?DisableScripts, ?DisableCollisions, " + + "?DisablePhysics, ?TerrainTexture1, " + + "?TerrainTexture2, ?TerrainTexture3, " + + "?TerrainTexture4, ?Elevation1NW, ?Elevation2NW, " + + "?Elevation1NE, ?Elevation2NE, ?Elevation1SE, " + + "?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " + + "?WaterHeight, ?TerrainRaiseLimit, " + + "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + + "?SunPosition, ?Covenant, ?Sandbox, " + + "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + + "?LoadedCreationDateTime, ?LoadedCreationID)"; - ExecuteNonQuery(cmd); + FillRegionSettingsCommand(cmd, rs); + + ExecuteNonQuery(cmd); + } } } } @@ -776,36 +804,41 @@ namespace OpenSim.Data.MySQL { List landData = new List(); - lock (m_Connection) + lock (m_dbLock) { - using (MySqlCommand cmd = m_Connection.CreateCommand()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.CommandText = "select * from land where RegionUUID = ?RegionUUID"; - cmd.Parameters.AddWithValue("RegionUUID", regionUUID.ToString()); + dbcon.Open(); - using (IDataReader reader = ExecuteReader(cmd)) + using (MySqlCommand cmd = dbcon.CreateCommand()) { - while (reader.Read()) - { - LandData newLand = BuildLandData(reader); - landData.Add(newLand); - } - } - } - - using (MySqlCommand cmd = m_Connection.CreateCommand()) - { - foreach (LandData land in landData) - { - cmd.Parameters.Clear(); - cmd.CommandText = "select * from landaccesslist where LandUUID = ?LandUUID"; - cmd.Parameters.AddWithValue("LandUUID", land.GlobalID.ToString()); + cmd.CommandText = "select * from land where RegionUUID = ?RegionUUID"; + cmd.Parameters.AddWithValue("RegionUUID", regionUUID.ToString()); using (IDataReader reader = ExecuteReader(cmd)) { while (reader.Read()) { - land.ParcelAccessList.Add(BuildLandAccessData(reader)); + LandData newLand = BuildLandData(reader); + landData.Add(newLand); + } + } + } + + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + foreach (LandData land in landData) + { + cmd.Parameters.Clear(); + cmd.CommandText = "select * from landaccesslist where LandUUID = ?LandUUID"; + cmd.Parameters.AddWithValue("LandUUID", land.GlobalID.ToString()); + + using (IDataReader reader = ExecuteReader(cmd)) + { + while (reader.Read()) + { + land.ParcelAccessList.Add(BuildLandAccessData(reader)); + } } } } @@ -1513,41 +1546,46 @@ namespace OpenSim.Data.MySQL public void StorePrimInventory(UUID primID, ICollection items) { - lock (m_Connection) + lock (m_dbLock) { RemoveItems(primID); - MySqlCommand cmd = m_Connection.CreateCommand(); - - if (items.Count == 0) - return; - - cmd.CommandText = "insert into primitems ("+ - "invType, assetType, name, "+ - "description, creationDate, nextPermissions, "+ - "currentPermissions, basePermissions, "+ - "everyonePermissions, groupPermissions, "+ - "flags, itemID, primID, assetID, "+ - "parentFolderID, creatorID, ownerID, "+ - "groupID, lastOwnerID) values (?invType, "+ - "?assetType, ?name, ?description, "+ - "?creationDate, ?nextPermissions, "+ - "?currentPermissions, ?basePermissions, "+ - "?everyonePermissions, ?groupPermissions, "+ - "?flags, ?itemID, ?primID, ?assetID, "+ - "?parentFolderID, ?creatorID, ?ownerID, "+ - "?groupID, ?lastOwnerID)"; - - foreach (TaskInventoryItem item in items) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - cmd.Parameters.Clear(); + dbcon.Open(); - FillItemCommand(cmd, item); + MySqlCommand cmd = dbcon.CreateCommand(); - ExecuteNonQuery(cmd); + if (items.Count == 0) + return; + + cmd.CommandText = "insert into primitems (" + + "invType, assetType, name, " + + "description, creationDate, nextPermissions, " + + "currentPermissions, basePermissions, " + + "everyonePermissions, groupPermissions, " + + "flags, itemID, primID, assetID, " + + "parentFolderID, creatorID, ownerID, " + + "groupID, lastOwnerID) values (?invType, " + + "?assetType, ?name, ?description, " + + "?creationDate, ?nextPermissions, " + + "?currentPermissions, ?basePermissions, " + + "?everyonePermissions, ?groupPermissions, " + + "?flags, ?itemID, ?primID, ?assetID, " + + "?parentFolderID, ?creatorID, ?ownerID, " + + "?groupID, ?lastOwnerID)"; + + foreach (TaskInventoryItem item in items) + { + cmd.Parameters.Clear(); + + FillItemCommand(cmd, item); + + ExecuteNonQuery(cmd); + } + + cmd.Dispose(); } - - cmd.Dispose(); } } } diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index 8f67eebad4..304883cb36 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs @@ -79,14 +79,19 @@ namespace OpenSim.Data.MySQL // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; - Migration m = new Migration(database.Connection, assem, "LogStore"); - // TODO: After rev 6000, remove this. People should have - // been rolled onto the new migration code by then. - TestTables(m); + using (MySql.Data.MySqlClient.MySqlConnection dbcon = new MySql.Data.MySqlClient.MySqlConnection(connect)) + { + dbcon.Open(); - m.Update(); + Migration m = new Migration(dbcon, assem, "LogStore"); + // TODO: After rev 6000, remove this. People should have + // been rolled onto the new migration code by then. + TestTables(m); + + m.Update(); + } } /// @@ -128,7 +133,6 @@ namespace OpenSim.Data.MySQL } catch { - database.Reconnect(); } } diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 243394e9db..ace20279a9 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -45,16 +45,13 @@ namespace OpenSim.Data.MySQL { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - /// - /// The database connection object - /// - private MySqlConnection dbcon; - /// /// Connection string for ADO.net /// private string connectionString; + private object m_dbLock = new object(); + private const string m_waitTimeoutSelect = "select @@wait_timeout"; /// @@ -109,11 +106,11 @@ namespace OpenSim.Data.MySQL try { connectionString = connect; - dbcon = new MySqlConnection(connectionString); + //dbcon = new MySqlConnection(connectionString); try { - dbcon.Open(); + //dbcon.Open(); } catch(Exception e) { @@ -134,18 +131,21 @@ namespace OpenSim.Data.MySQL /// protected void GetWaitTimeout() { - MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, dbcon); - - using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) { - if (dbReader.Read()) - { - m_waitTimeout - = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; - } + dbcon.Open(); - dbReader.Close(); - cmd.Dispose(); + using (MySqlCommand cmd = new MySqlCommand(m_waitTimeoutSelect, dbcon)) + { + using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) + { + if (dbReader.Read()) + { + m_waitTimeout + = Convert.ToInt32(dbReader["@@wait_timeout"]) * TimeSpan.TicksPerSecond + m_waitTimeoutLeeway; + } + } + } } m_lastConnectionUse = DateTime.Now.Ticks; @@ -154,66 +154,9 @@ namespace OpenSim.Data.MySQL "[REGION DB]: Connection wait timeout {0} seconds", m_waitTimeout / TimeSpan.TicksPerSecond); } - /// - /// Should be called before any db operation. This checks to see if the connection has not timed out - /// - public void CheckConnection() + public string ConnectionString { - //m_log.Debug("[REGION DB]: Checking connection"); - - long timeNow = DateTime.Now.Ticks; - if (timeNow - m_lastConnectionUse > m_waitTimeout || dbcon.State != ConnectionState.Open) - { - m_log.DebugFormat("[REGION DB]: Database connection has gone away - reconnecting"); - Reconnect(); - } - - // Strictly, we should set this after the actual db operation. But it's more convenient to set here rather - // than require the code to call another method - the timeout leeway should be large enough to cover the - // inaccuracy. - m_lastConnectionUse = timeNow; - } - - /// - /// Get the connection being used - /// - /// MySqlConnection Object - public MySqlConnection Connection - { - get { return dbcon; } - } - - /// - /// Shuts down the database connection - /// - public void Close() - { - dbcon.Close(); - dbcon = null; - } - - /// - /// Reconnects to the database - /// - public void Reconnect() - { - m_log.Info("[REGION DB] Reconnecting database"); - - lock (dbcon) - { - try - { - // Close the DB connection - dbcon.Close(); - // Try reopen it - dbcon = new MySqlConnection(connectionString); - dbcon.Open(); - } - catch (Exception e) - { - m_log.Error("Unable to reconnect to database " + e.ToString()); - } - } + get { return connectionString; } } /// @@ -264,9 +207,13 @@ namespace OpenSim.Data.MySQL /// name of embedded resource public void ExecuteResourceSql(string name) { - CheckConnection(); - MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon); - cmd.ExecuteNonQuery(); + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) + { + dbcon.Open(); + + MySqlCommand cmd = new MySqlCommand(getResourceString(name), dbcon); + cmd.ExecuteNonQuery(); + } } /// @@ -275,22 +222,29 @@ namespace OpenSim.Data.MySQL /// sql string to execute public void ExecuteSql(string sql) { - CheckConnection(); - MySqlCommand cmd = new MySqlCommand(sql, dbcon); - cmd.ExecuteNonQuery(); + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) + { + dbcon.Open(); + + MySqlCommand cmd = new MySqlCommand(sql, dbcon); + cmd.ExecuteNonQuery(); + } } public void ExecuteParameterizedSql(string sql, Dictionary parameters) { - CheckConnection(); - - MySqlCommand cmd = (MySqlCommand)dbcon.CreateCommand(); - cmd.CommandText = sql; - foreach (KeyValuePair param in parameters) + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) { - cmd.Parameters.AddWithValue(param.Key, param.Value); + dbcon.Open(); + + MySqlCommand cmd = (MySqlCommand)dbcon.CreateCommand(); + cmd.CommandText = sql; + foreach (KeyValuePair param in parameters) + { + cmd.Parameters.AddWithValue(param.Key, param.Value); + } + cmd.ExecuteNonQuery(); } - cmd.ExecuteNonQuery(); } /// @@ -299,35 +253,37 @@ namespace OpenSim.Data.MySQL /// public void GetTableVersion(Dictionary tableList) { - lock (dbcon) + lock (m_dbLock) { - CheckConnection(); - - MySqlCommand tablesCmd = - new MySqlCommand( - "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", - dbcon); - tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); - - using (MySqlDataReader tables = tablesCmd.ExecuteReader()) + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) { - while (tables.Read()) + dbcon.Open(); + + using (MySqlCommand tablesCmd = new MySqlCommand( + "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=?dbname", dbcon)) { - try + tablesCmd.Parameters.AddWithValue("?dbname", dbcon.Database); + + using (MySqlDataReader tables = tablesCmd.ExecuteReader()) { - string tableName = (string) tables["TABLE_NAME"]; - string comment = (string) tables["TABLE_COMMENT"]; - if (tableList.ContainsKey(tableName)) + while (tables.Read()) { - tableList[tableName] = comment; + try + { + string tableName = (string)tables["TABLE_NAME"]; + string comment = (string)tables["TABLE_COMMENT"]; + if (tableList.ContainsKey(tableName)) + { + tableList[tableName] = comment; + } + } + catch (Exception e) + { + m_log.Error(e.Message, e); + } } } - catch (Exception e) - { - m_log.Error(e.ToString()); - } } - tables.Close(); } } } @@ -337,28 +293,27 @@ namespace OpenSim.Data.MySQL /// /// Runs a query with protection against SQL Injection by using parameterised input. /// + /// Database connection /// The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y /// The parameters - index so that @y is indexed as 'y' /// A MySQL DB Command - public IDbCommand Query(string sql, Dictionary parameters) + public IDbCommand Query(MySqlConnection dbcon, string sql, Dictionary parameters) { try { - CheckConnection(); // Not sure if this one is necessary - - MySqlCommand dbcommand = (MySqlCommand) dbcon.CreateCommand(); + MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand(); dbcommand.CommandText = sql; foreach (KeyValuePair param in parameters) { dbcommand.Parameters.AddWithValue(param.Key, param.Value); } - return (IDbCommand) dbcommand; + return (IDbCommand)dbcommand; } catch (Exception e) { // Return null if it fails. - m_log.Error("Failed during Query generation: " + e.ToString()); + m_log.Error("Failed during Query generation: " + e.Message, e); return null; } } @@ -694,8 +649,6 @@ namespace OpenSim.Data.MySQL ret.Add(attachpoint, item); } - r.Close(); - return ret; } @@ -727,12 +680,17 @@ namespace OpenSim.Data.MySQL try { - IDbCommand result = Query(sql, parameters); + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) + { + dbcon.Open(); - if (result.ExecuteNonQuery() == 1) - returnval = true; + IDbCommand result = Query(dbcon, sql, parameters); - result.Dispose(); + if (result.ExecuteNonQuery() == 1) + returnval = true; + + result.Dispose(); + } } catch (Exception e) { @@ -828,12 +786,17 @@ namespace OpenSim.Data.MySQL try { - IDbCommand result = Query(sql, parameters); + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) + { + dbcon.Open(); - if (result.ExecuteNonQuery() == 1) - returnval = true; + IDbCommand result = Query(dbcon, sql, parameters); - result.Dispose(); + if (result.ExecuteNonQuery() == 1) + returnval = true; + + result.Dispose(); + } } catch (Exception e) { @@ -927,12 +890,17 @@ namespace OpenSim.Data.MySQL bool returnval = false; try { - IDbCommand result = Query(sql, parameters); + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) + { + dbcon.Open(); - if (result.ExecuteNonQuery() == 1) - returnval = true; + IDbCommand result = Query(dbcon, sql, parameters); - result.Dispose(); + if (result.ExecuteNonQuery() == 1) + returnval = true; + + result.Dispose(); + } } catch (Exception e) { @@ -1030,18 +998,23 @@ namespace OpenSim.Data.MySQL try { - IDbCommand result = Query(sql, parameters); - - // int x; - // if ((x = result.ExecuteNonQuery()) > 0) - // { - // returnval = true; - // } - if (result.ExecuteNonQuery() > 0) + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) { - returnval = true; + dbcon.Open(); + + IDbCommand result = Query(dbcon, sql, parameters); + + // int x; + // if ((x = result.ExecuteNonQuery()) > 0) + // { + // returnval = true; + // } + if (result.ExecuteNonQuery() > 0) + { + returnval = true; + } + result.Dispose(); } - result.Dispose(); } catch (Exception e) { @@ -1070,18 +1043,23 @@ namespace OpenSim.Data.MySQL { parameters["?uuid"] = uuid; - IDbCommand result = Query(sql, parameters); - - // int x; - // if ((x = result.ExecuteNonQuery()) > 0) - // { - // returnval = true; - // } - if (result.ExecuteNonQuery() > 0) + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) { - returnval = true; + dbcon.Open(); + + IDbCommand result = Query(dbcon, sql, parameters); + + // int x; + // if ((x = result.ExecuteNonQuery()) > 0) + // { + // returnval = true; + // } + if (result.ExecuteNonQuery() > 0) + { + returnval = true; + } + result.Dispose(); } - result.Dispose(); } catch (Exception e) { @@ -1122,18 +1100,23 @@ namespace OpenSim.Data.MySQL try { - IDbCommand result = Query(sql, parameters); - - // int x; - // if ((x = result.ExecuteNonQuery()) > 0) - // { - // returnval = true; - // } - if (result.ExecuteNonQuery() > 0) + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) { - returnval = true; + dbcon.Open(); + + IDbCommand result = Query(dbcon, sql, parameters); + + // int x; + // if ((x = result.ExecuteNonQuery()) > 0) + // { + // returnval = true; + // } + if (result.ExecuteNonQuery() > 0) + { + returnval = true; + } + result.Dispose(); } - result.Dispose(); } catch (Exception e) { @@ -1167,45 +1150,51 @@ namespace OpenSim.Data.MySQL bool returnval = false; // we want to send in byte data, which means we can't just pass down strings - try { - MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand(); - cmd.CommandText = sql; - cmd.Parameters.AddWithValue("?owner", appearance.Owner.ToString()); - cmd.Parameters.AddWithValue("?serial", appearance.Serial); - cmd.Parameters.AddWithValue("?visual_params", appearance.VisualParams); - cmd.Parameters.AddWithValue("?texture", appearance.Texture.GetBytes()); - cmd.Parameters.AddWithValue("?avatar_height", appearance.AvatarHeight); - cmd.Parameters.AddWithValue("?body_item", appearance.BodyItem.ToString()); - cmd.Parameters.AddWithValue("?body_asset", appearance.BodyAsset.ToString()); - cmd.Parameters.AddWithValue("?skin_item", appearance.SkinItem.ToString()); - cmd.Parameters.AddWithValue("?skin_asset", appearance.SkinAsset.ToString()); - cmd.Parameters.AddWithValue("?hair_item", appearance.HairItem.ToString()); - cmd.Parameters.AddWithValue("?hair_asset", appearance.HairAsset.ToString()); - cmd.Parameters.AddWithValue("?eyes_item", appearance.EyesItem.ToString()); - cmd.Parameters.AddWithValue("?eyes_asset", appearance.EyesAsset.ToString()); - cmd.Parameters.AddWithValue("?shirt_item", appearance.ShirtItem.ToString()); - cmd.Parameters.AddWithValue("?shirt_asset", appearance.ShirtAsset.ToString()); - cmd.Parameters.AddWithValue("?pants_item", appearance.PantsItem.ToString()); - cmd.Parameters.AddWithValue("?pants_asset", appearance.PantsAsset.ToString()); - cmd.Parameters.AddWithValue("?shoes_item", appearance.ShoesItem.ToString()); - cmd.Parameters.AddWithValue("?shoes_asset", appearance.ShoesAsset.ToString()); - cmd.Parameters.AddWithValue("?socks_item", appearance.SocksItem.ToString()); - cmd.Parameters.AddWithValue("?socks_asset", appearance.SocksAsset.ToString()); - cmd.Parameters.AddWithValue("?jacket_item", appearance.JacketItem.ToString()); - cmd.Parameters.AddWithValue("?jacket_asset", appearance.JacketAsset.ToString()); - cmd.Parameters.AddWithValue("?gloves_item", appearance.GlovesItem.ToString()); - cmd.Parameters.AddWithValue("?gloves_asset", appearance.GlovesAsset.ToString()); - cmd.Parameters.AddWithValue("?undershirt_item", appearance.UnderShirtItem.ToString()); - cmd.Parameters.AddWithValue("?undershirt_asset", appearance.UnderShirtAsset.ToString()); - cmd.Parameters.AddWithValue("?underpants_item", appearance.UnderPantsItem.ToString()); - cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString()); - cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString()); - cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString()); + try + { + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) + { + dbcon.Open(); - if (cmd.ExecuteNonQuery() > 0) - returnval = true; + using (MySqlCommand cmd = (MySqlCommand)dbcon.CreateCommand()) + { + cmd.CommandText = sql; + cmd.Parameters.AddWithValue("?owner", appearance.Owner.ToString()); + cmd.Parameters.AddWithValue("?serial", appearance.Serial); + cmd.Parameters.AddWithValue("?visual_params", appearance.VisualParams); + cmd.Parameters.AddWithValue("?texture", appearance.Texture.GetBytes()); + cmd.Parameters.AddWithValue("?avatar_height", appearance.AvatarHeight); + cmd.Parameters.AddWithValue("?body_item", appearance.BodyItem.ToString()); + cmd.Parameters.AddWithValue("?body_asset", appearance.BodyAsset.ToString()); + cmd.Parameters.AddWithValue("?skin_item", appearance.SkinItem.ToString()); + cmd.Parameters.AddWithValue("?skin_asset", appearance.SkinAsset.ToString()); + cmd.Parameters.AddWithValue("?hair_item", appearance.HairItem.ToString()); + cmd.Parameters.AddWithValue("?hair_asset", appearance.HairAsset.ToString()); + cmd.Parameters.AddWithValue("?eyes_item", appearance.EyesItem.ToString()); + cmd.Parameters.AddWithValue("?eyes_asset", appearance.EyesAsset.ToString()); + cmd.Parameters.AddWithValue("?shirt_item", appearance.ShirtItem.ToString()); + cmd.Parameters.AddWithValue("?shirt_asset", appearance.ShirtAsset.ToString()); + cmd.Parameters.AddWithValue("?pants_item", appearance.PantsItem.ToString()); + cmd.Parameters.AddWithValue("?pants_asset", appearance.PantsAsset.ToString()); + cmd.Parameters.AddWithValue("?shoes_item", appearance.ShoesItem.ToString()); + cmd.Parameters.AddWithValue("?shoes_asset", appearance.ShoesAsset.ToString()); + cmd.Parameters.AddWithValue("?socks_item", appearance.SocksItem.ToString()); + cmd.Parameters.AddWithValue("?socks_asset", appearance.SocksAsset.ToString()); + cmd.Parameters.AddWithValue("?jacket_item", appearance.JacketItem.ToString()); + cmd.Parameters.AddWithValue("?jacket_asset", appearance.JacketAsset.ToString()); + cmd.Parameters.AddWithValue("?gloves_item", appearance.GlovesItem.ToString()); + cmd.Parameters.AddWithValue("?gloves_asset", appearance.GlovesAsset.ToString()); + cmd.Parameters.AddWithValue("?undershirt_item", appearance.UnderShirtItem.ToString()); + cmd.Parameters.AddWithValue("?undershirt_asset", appearance.UnderShirtAsset.ToString()); + cmd.Parameters.AddWithValue("?underpants_item", appearance.UnderPantsItem.ToString()); + cmd.Parameters.AddWithValue("?underpants_asset", appearance.UnderPantsAsset.ToString()); + cmd.Parameters.AddWithValue("?skirt_item", appearance.SkirtItem.ToString()); + cmd.Parameters.AddWithValue("?skirt_asset", appearance.SkirtAsset.ToString()); - cmd.Dispose(); + if (cmd.ExecuteNonQuery() > 0) + returnval = true; + } + } } catch (Exception e) { @@ -1221,33 +1210,38 @@ namespace OpenSim.Data.MySQL { string sql = "delete from avatarattachments where UUID = ?uuid"; - MySqlCommand cmd = (MySqlCommand) dbcon.CreateCommand(); - cmd.CommandText = sql; - cmd.Parameters.AddWithValue("?uuid", agentID.ToString()); - - cmd.ExecuteNonQuery(); - - if (data == null) - return; - - sql = "insert into avatarattachments (UUID, attachpoint, item, asset) values (?uuid, ?attachpoint, ?item, ?asset)"; - - cmd = (MySqlCommand) dbcon.CreateCommand(); - cmd.CommandText = sql; - - foreach (DictionaryEntry e in data) + using (MySqlConnection dbcon = new MySqlConnection(connectionString)) { - int attachpoint = Convert.ToInt32(e.Key); + dbcon.Open(); - Hashtable item = (Hashtable)e.Value; - - cmd.Parameters.Clear(); + MySqlCommand cmd = (MySqlCommand)dbcon.CreateCommand(); + cmd.CommandText = sql; cmd.Parameters.AddWithValue("?uuid", agentID.ToString()); - cmd.Parameters.AddWithValue("?attachpoint", attachpoint); - cmd.Parameters.AddWithValue("?item", item["item"]); - cmd.Parameters.AddWithValue("?asset", item["asset"]); cmd.ExecuteNonQuery(); + + if (data == null) + return; + + sql = "insert into avatarattachments (UUID, attachpoint, item, asset) values (?uuid, ?attachpoint, ?item, ?asset)"; + + cmd = (MySqlCommand)dbcon.CreateCommand(); + cmd.CommandText = sql; + + foreach (DictionaryEntry e in data) + { + int attachpoint = Convert.ToInt32(e.Key); + + Hashtable item = (Hashtable)e.Value; + + cmd.Parameters.Clear(); + cmd.Parameters.AddWithValue("?uuid", agentID.ToString()); + cmd.Parameters.AddWithValue("?attachpoint", attachpoint); + cmd.Parameters.AddWithValue("?item", item["item"]); + cmd.Parameters.AddWithValue("?asset", item["asset"]); + + cmd.ExecuteNonQuery(); + } } } } diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index b0075e8528..a1a08b1934 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -38,16 +38,21 @@ namespace OpenSim.Data.MySQL public class MySqlRegionData : MySqlFramework, IRegionData { private string m_Realm; - private List m_ColumnNames = null; -// private int m_LastExpire = 0; + private List m_ColumnNames; + //private string m_connectionString; public MySqlRegionData(string connectionString, string realm) : base(connectionString) { m_Realm = realm; + m_connectionString = connectionString; - Migration m = new Migration(m_Connection, GetType().Assembly, "GridStore"); - m.Update(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, GetType().Assembly, "GridStore"); + m.Update(); + } } public List Get(string regionName, UUID scopeID) @@ -56,12 +61,13 @@ namespace OpenSim.Data.MySQL if (scopeID != UUID.Zero) command += " and ScopeID = ?scopeID"; - MySqlCommand cmd = new MySqlCommand(command); + using (MySqlCommand cmd = new MySqlCommand(command)) + { + cmd.Parameters.AddWithValue("?regionName", regionName); + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - cmd.Parameters.AddWithValue("?regionName", regionName); - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - - return RunCommand(cmd); + return RunCommand(cmd); + } } public RegionData Get(int posX, int posY, UUID scopeID) @@ -70,17 +76,18 @@ namespace OpenSim.Data.MySQL if (scopeID != UUID.Zero) command += " and ScopeID = ?scopeID"; - MySqlCommand cmd = new MySqlCommand(command); + using (MySqlCommand cmd = new MySqlCommand(command)) + { + cmd.Parameters.AddWithValue("?posX", posX.ToString()); + cmd.Parameters.AddWithValue("?posY", posY.ToString()); + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - cmd.Parameters.AddWithValue("?posX", posX.ToString()); - cmd.Parameters.AddWithValue("?posY", posY.ToString()); - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); + List ret = RunCommand(cmd); + if (ret.Count == 0) + return null; - List ret = RunCommand(cmd); - if (ret.Count == 0) - return null; - - return ret[0]; + return ret[0]; + } } public RegionData Get(UUID regionID, UUID scopeID) @@ -89,16 +96,17 @@ namespace OpenSim.Data.MySQL if (scopeID != UUID.Zero) command += " and ScopeID = ?scopeID"; - MySqlCommand cmd = new MySqlCommand(command); + using (MySqlCommand cmd = new MySqlCommand(command)) + { + cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); + List ret = RunCommand(cmd); + if (ret.Count == 0) + return null; - List ret = RunCommand(cmd); - if (ret.Count == 0) - return null; - - return ret[0]; + return ret[0]; + } } public List Get(int startX, int startY, int endX, int endY, UUID scopeID) @@ -107,74 +115,79 @@ namespace OpenSim.Data.MySQL if (scopeID != UUID.Zero) command += " and ScopeID = ?scopeID"; - MySqlCommand cmd = new MySqlCommand(command); + using (MySqlCommand cmd = new MySqlCommand(command)) + { + cmd.Parameters.AddWithValue("?startX", startX.ToString()); + cmd.Parameters.AddWithValue("?startY", startY.ToString()); + cmd.Parameters.AddWithValue("?endX", endX.ToString()); + cmd.Parameters.AddWithValue("?endY", endY.ToString()); + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - cmd.Parameters.AddWithValue("?startX", startX.ToString()); - cmd.Parameters.AddWithValue("?startY", startY.ToString()); - cmd.Parameters.AddWithValue("?endX", endX.ToString()); - cmd.Parameters.AddWithValue("?endY", endY.ToString()); - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - - return RunCommand(cmd); + return RunCommand(cmd); + } } public List RunCommand(MySqlCommand cmd) { List retList = new List(); - IDataReader result = ExecuteReader(cmd); - - while (result.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - RegionData ret = new RegionData(); - ret.Data = new Dictionary(); + dbcon.Open(); + cmd.Connection = dbcon; - UUID regionID; - UUID.TryParse(result["uuid"].ToString(), out regionID); - ret.RegionID = regionID; - UUID scope; - UUID.TryParse(result["ScopeID"].ToString(), out scope); - ret.ScopeID = scope; - ret.RegionName = result["regionName"].ToString(); - ret.posX = Convert.ToInt32(result["locX"]); - ret.posY = Convert.ToInt32(result["locY"]); - ret.sizeX = Convert.ToInt32(result["sizeX"]); - ret.sizeY = Convert.ToInt32(result["sizeY"]); - - if (m_ColumnNames == null) + using (IDataReader result = cmd.ExecuteReader()) { - m_ColumnNames = new List(); + while (result.Read()) + { + RegionData ret = new RegionData(); + ret.Data = new Dictionary(); - DataTable schemaTable = result.GetSchemaTable(); - foreach (DataRow row in schemaTable.Rows) + UUID regionID; + UUID.TryParse(result["uuid"].ToString(), out regionID); + ret.RegionID = regionID; + UUID scope; + UUID.TryParse(result["ScopeID"].ToString(), out scope); + ret.ScopeID = scope; + ret.RegionName = result["regionName"].ToString(); + ret.posX = Convert.ToInt32(result["locX"]); + ret.posY = Convert.ToInt32(result["locY"]); + ret.sizeX = Convert.ToInt32(result["sizeX"]); + ret.sizeY = Convert.ToInt32(result["sizeY"]); + + if (m_ColumnNames == null) { - if (row["ColumnName"] != null) - m_ColumnNames.Add(row["ColumnName"].ToString()); + m_ColumnNames = new List(); + + DataTable schemaTable = result.GetSchemaTable(); + foreach (DataRow row in schemaTable.Rows) + { + if (row["ColumnName"] != null) + m_ColumnNames.Add(row["ColumnName"].ToString()); + } } + + foreach (string s in m_ColumnNames) + { + if (s == "uuid") + continue; + if (s == "ScopeID") + continue; + if (s == "regionName") + continue; + if (s == "locX") + continue; + if (s == "locY") + continue; + + ret.Data[s] = result[s].ToString(); + } + + retList.Add(ret); } - - foreach (string s in m_ColumnNames) - { - if (s == "uuid") - continue; - if (s == "ScopeID") - continue; - if (s == "regionName") - continue; - if (s == "locX") - continue; - if (s == "locY") - continue; - - ret.Data[s] = result[s].ToString(); } - - retList.Add(ret); } - result.Close(); - CloseReaderCommand(cmd); - return retList; } @@ -201,76 +214,72 @@ namespace OpenSim.Data.MySQL string[] fields = new List(data.Data.Keys).ToArray(); - MySqlCommand cmd = new MySqlCommand(); - - string update = "update `"+m_Realm+"` set locX=?posX, locY=?posY, sizeX=?sizeX, sizeY=?sizeY"; - foreach (string field in fields) + using (MySqlCommand cmd = new MySqlCommand()) { - update += ", "; - update += "`" + field + "` = ?"+field; + string update = "update `" + m_Realm + "` set locX=?posX, locY=?posY, sizeX=?sizeX, sizeY=?sizeY"; + foreach (string field in fields) + { + update += ", "; + update += "`" + field + "` = ?" + field; - cmd.Parameters.AddWithValue("?"+field, data.Data[field]); - } + cmd.Parameters.AddWithValue("?" + field, data.Data[field]); + } - update += " where uuid = ?regionID"; + update += " where uuid = ?regionID"; - if (data.ScopeID != UUID.Zero) - update += " and ScopeID = ?scopeID"; + if (data.ScopeID != UUID.Zero) + update += " and ScopeID = ?scopeID"; - cmd.CommandText = update; - cmd.Parameters.AddWithValue("?regionID", data.RegionID.ToString()); - cmd.Parameters.AddWithValue("?regionName", data.RegionName); - cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString()); - cmd.Parameters.AddWithValue("?posX", data.posX.ToString()); - cmd.Parameters.AddWithValue("?posY", data.posY.ToString()); - cmd.Parameters.AddWithValue("?sizeX", data.sizeX.ToString()); - cmd.Parameters.AddWithValue("?sizeY", data.sizeY.ToString()); - - if (ExecuteNonQuery(cmd) < 1) - { - string insert = "insert into `" + m_Realm + "` (`uuid`, `ScopeID`, `locX`, `locY`, `sizeX`, `sizeY`, `regionName`, `" + - String.Join("`, `", fields) + - "`) values ( ?regionID, ?scopeID, ?posX, ?posY, ?sizeX, ?sizeY, ?regionName, ?" + String.Join(", ?", fields) + ")"; - - cmd.CommandText = insert; + cmd.CommandText = update; + cmd.Parameters.AddWithValue("?regionID", data.RegionID.ToString()); + cmd.Parameters.AddWithValue("?regionName", data.RegionName); + cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString()); + cmd.Parameters.AddWithValue("?posX", data.posX.ToString()); + cmd.Parameters.AddWithValue("?posY", data.posY.ToString()); + cmd.Parameters.AddWithValue("?sizeX", data.sizeX.ToString()); + cmd.Parameters.AddWithValue("?sizeY", data.sizeY.ToString()); if (ExecuteNonQuery(cmd) < 1) { - cmd.Dispose(); - return false; + string insert = "insert into `" + m_Realm + "` (`uuid`, `ScopeID`, `locX`, `locY`, `sizeX`, `sizeY`, `regionName`, `" + + String.Join("`, `", fields) + + "`) values ( ?regionID, ?scopeID, ?posX, ?posY, ?sizeX, ?sizeY, ?regionName, ?" + String.Join(", ?", fields) + ")"; + + cmd.CommandText = insert; + + if (ExecuteNonQuery(cmd) < 1) + { + return false; + } } } - cmd.Dispose(); - return true; } public bool SetDataItem(UUID regionID, string item, string value) { - MySqlCommand cmd = new MySqlCommand("update `" + m_Realm + - "` set `" + item + "` = ?" + item + " where uuid = ?UUID"); + using (MySqlCommand cmd = new MySqlCommand("update `" + m_Realm + "` set `" + item + "` = ?" + item + " where uuid = ?UUID")) + { + cmd.Parameters.AddWithValue("?" + item, value); + cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); - - cmd.Parameters.AddWithValue("?"+item, value); - cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); - - if (ExecuteNonQuery(cmd) > 0) - return true; + if (ExecuteNonQuery(cmd) > 0) + return true; + } return false; } public bool Delete(UUID regionID) { - MySqlCommand cmd = new MySqlCommand("delete from `" + m_Realm + - "` where uuid = ?UUID"); + using (MySqlCommand cmd = new MySqlCommand("delete from `" + m_Realm + "` where uuid = ?UUID")) + { + cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); - - cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); - - if (ExecuteNonQuery(cmd) > 0) - return true; + if (ExecuteNonQuery(cmd) > 0) + return true; + } return false; } diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs index d48144d2e8..3cb00104a8 100644 --- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs +++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs @@ -38,16 +38,21 @@ namespace OpenSim.Data.MySQL public class MySqlUserAccountData : MySqlFramework, IUserAccountData { private string m_Realm; - private List m_ColumnNames = null; -// private int m_LastExpire = 0; + private List m_ColumnNames; + // private string m_connectionString; public MySqlUserAccountData(string connectionString, string realm) : base(connectionString) { m_Realm = realm; + m_connectionString = connectionString; - Migration m = new Migration(m_Connection, GetType().Assembly, "UserStore"); - m.Update(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, GetType().Assembly, "UserStore"); + m.Update(); + } } public List Query(UUID principalID, UUID scopeID, string query) @@ -64,49 +69,49 @@ namespace OpenSim.Data.MySQL if (scopeID != UUID.Zero) command += " and ScopeID = ?scopeID"; - MySqlCommand cmd = new MySqlCommand(command); - - cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - - IDataReader result = ExecuteReader(cmd); - - if (result.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - ret.PrincipalID = principalID; - UUID scope; - UUID.TryParse(result["ScopeID"].ToString(), out scope); - ret.ScopeID = scope; + dbcon.Open(); + MySqlCommand cmd = new MySqlCommand(command, dbcon); - if (m_ColumnNames == null) + cmd.Parameters.AddWithValue("?principalID", principalID.ToString()); + cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); + + IDataReader result = cmd.ExecuteReader(); + + if (result.Read()) { - m_ColumnNames = new List(); + ret.PrincipalID = principalID; + UUID scope; + UUID.TryParse(result["ScopeID"].ToString(), out scope); + ret.ScopeID = scope; - DataTable schemaTable = result.GetSchemaTable(); - foreach (DataRow row in schemaTable.Rows) - m_ColumnNames.Add(row["ColumnName"].ToString()); + if (m_ColumnNames == null) + { + m_ColumnNames = new List(); + + DataTable schemaTable = result.GetSchemaTable(); + foreach (DataRow row in schemaTable.Rows) + m_ColumnNames.Add(row["ColumnName"].ToString()); + } + + foreach (string s in m_ColumnNames) + { + if (s == "UUID") + continue; + if (s == "ScopeID") + continue; + + ret.Data[s] = result[s].ToString(); + } + + return ret; } - - foreach (string s in m_ColumnNames) + else { - if (s == "UUID") - continue; - if (s == "ScopeID") - continue; - - ret.Data[s] = result[s].ToString(); + return null; } - - result.Close(); - CloseReaderCommand(cmd); - - return ret; } - - result.Close(); - CloseReaderCommand(cmd); - - return null; } public bool Store(UserAccountData data) @@ -118,61 +123,60 @@ namespace OpenSim.Data.MySQL string[] fields = new List(data.Data.Keys).ToArray(); - MySqlCommand cmd = new MySqlCommand(); - - string update = "update `"+m_Realm+"` set "; - bool first = true; - foreach (string field in fields) + using (MySqlCommand cmd = new MySqlCommand()) { - if (!first) - update += ", "; - update += "`" + field + "` = ?"+field; + string update = "update `" + m_Realm + "` set "; + bool first = true; + foreach (string field in fields) + { + if (!first) + update += ", "; + update += "`" + field + "` = ?" + field; - first = false; + first = false; - cmd.Parameters.AddWithValue("?"+field, data.Data[field]); - } + cmd.Parameters.AddWithValue("?" + field, data.Data[field]); + } - update += " where UUID = ?principalID"; + update += " where UUID = ?principalID"; - if (data.ScopeID != UUID.Zero) - update += " and ScopeID = ?scopeID"; + if (data.ScopeID != UUID.Zero) + update += " and ScopeID = ?scopeID"; - cmd.CommandText = update; - cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString()); - cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString()); - - if (ExecuteNonQuery(cmd) < 1) - { - string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" + - String.Join("`, `", fields) + - "`) values (?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; - - cmd.CommandText = insert; + cmd.CommandText = update; + cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString()); + cmd.Parameters.AddWithValue("?scopeID", data.ScopeID.ToString()); if (ExecuteNonQuery(cmd) < 1) { - cmd.Dispose(); - return false; + string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" + + String.Join("`, `", fields) + + "`) values (?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; + + cmd.CommandText = insert; + + if (ExecuteNonQuery(cmd) < 1) + { + cmd.Dispose(); + return false; + } } } - cmd.Dispose(); - return true; } public bool SetDataItem(UUID principalID, string item, string value) { - MySqlCommand cmd = new MySqlCommand("update `" + m_Realm + - "` set `" + item + "` = ?" + item + " where UUID = ?UUID"); + using (MySqlCommand cmd = new MySqlCommand("update `" + m_Realm + "` set `" + + item + "` = ?" + item + " where UUID = ?UUID")) + { + cmd.Parameters.AddWithValue("?" + item, value); + cmd.Parameters.AddWithValue("?UUID", principalID.ToString()); - - cmd.Parameters.AddWithValue("?"+item, value); - cmd.Parameters.AddWithValue("?UUID", principalID.ToString()); - - if (ExecuteNonQuery(cmd) > 0) - return true; + if (ExecuteNonQuery(cmd) > 0) + return true; + } return false; } diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 04f872f249..2cf88b876e 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -33,6 +33,7 @@ using System.Reflection; using System.Text.RegularExpressions; using System.Threading; using log4net; +using MySql.Data.MySqlClient; using OpenMetaverse; using OpenSim.Framework; @@ -45,15 +46,9 @@ namespace OpenSim.Data.MySQL { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - /// - /// Database manager for MySQL - /// - public MySQLManager database; - - /// - /// Better DB manager. Swap-in replacement too. - /// - public Dictionary m_dbconnections = new Dictionary(); + private MySQLManager m_database; + private string m_connectionString; + private object m_dbLock = new object(); public int m_maxConnections = 10; public int m_lastConnect; @@ -63,7 +58,6 @@ namespace OpenSim.Data.MySQL private string m_userFriendsTableName = "userfriends"; private string m_appearanceTableName = "avatarappearance"; private string m_attachmentsTableName = "avatarattachments"; - private string m_connectString; public override void Initialise() { @@ -71,41 +65,6 @@ namespace OpenSim.Data.MySQL throw new PluginNotInitialisedException(Name); } - public MySQLSuperManager GetLockedConnection(string why) - { - int lockedCons = 0; - while (true) - { - m_lastConnect++; - - // Overflow protection - if (m_lastConnect == int.MaxValue) - m_lastConnect = 0; - - MySQLSuperManager x = m_dbconnections[m_lastConnect%m_maxConnections]; - if (!x.Locked) - { - x.GetLock(); - x.Running = why; - return x; - } - - lockedCons++; - if (lockedCons > m_maxConnections) - { - lockedCons = 0; - Thread.Sleep(1000); // Wait some time before searching them again. - m_log.Debug( - "WARNING: All threads are in use. Probable cause: Something didnt release a mutex properly, or high volume of requests inbound."); - m_log.Debug("Current connections-in-use dump:"); - foreach (KeyValuePair kvp in m_dbconnections) - { - m_log.Debug(kvp.Value.Running); - } - } - } - } - /// /// Initialise User Interface /// Loads and initialises the MySQL storage plugin @@ -115,55 +74,18 @@ namespace OpenSim.Data.MySQL /// connect string. public override void Initialise(string connect) { - if (connect == String.Empty) - { - // TODO: actually do something with our connect string - // instead of loading the second config - - m_log.Warn("Using obsoletely mysql_connection.ini, try using user_source connect string instead"); - IniFile iniFile = new IniFile("mysql_connection.ini"); - string settingHostname = iniFile.ParseFileReadValue("hostname"); - string settingDatabase = iniFile.ParseFileReadValue("database"); - string settingUsername = iniFile.ParseFileReadValue("username"); - string settingPassword = iniFile.ParseFileReadValue("password"); - string settingPooling = iniFile.ParseFileReadValue("pooling"); - string settingPort = iniFile.ParseFileReadValue("port"); - - m_connectString = "Server=" + settingHostname + ";Port=" + settingPort + ";Database=" + settingDatabase + - ";User ID=" + - settingUsername + ";Password=" + settingPassword + ";Pooling=" + settingPooling + ";"; - - m_log.Info("Creating " + m_maxConnections + " DB connections..."); - for (int i = 0; i < m_maxConnections; i++) - { - m_log.Info("Connecting to DB... [" + i + "]"); - MySQLSuperManager msm = new MySQLSuperManager(); - msm.Manager = new MySQLManager(m_connectString); - m_dbconnections.Add(i, msm); - } - - database = new MySQLManager(m_connectString); - } - else - { - m_connectString = connect; - database = new MySQLManager(m_connectString); - - m_log.Info("Creating " + m_maxConnections + " DB connections..."); - for (int i = 0; i < m_maxConnections; i++) - { - m_log.Info("Connecting to DB... [" + i + "]"); - MySQLSuperManager msm = new MySQLSuperManager(); - msm.Manager = new MySQLManager(m_connectString); - m_dbconnections.Add(i, msm); - } - } + m_connectionString = connect; + m_database = new MySQLManager(connect); // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; - Migration m = new Migration(database.Connection, assem, "UserStore"); - m.Update(); + using (MySql.Data.MySqlClient.MySqlConnection dbcon = new MySql.Data.MySqlClient.MySqlConnection(m_connectionString)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, assem, "UserStore"); + m.Update(); + } } public override void Dispose() @@ -173,35 +95,32 @@ namespace OpenSim.Data.MySQL // see IUserDataPlugin public override UserProfileData GetUserByName(string user, string last) { - MySQLSuperManager dbm = GetLockedConnection("GetUserByName"); - try { Dictionary param = new Dictionary(); param["?first"] = user; param["?second"] = last; - IDbCommand result = - dbm.Manager.Query( - "SELECT * FROM " + m_usersTableName + " WHERE username = ?first AND lastname = ?second", param); - IDataReader reader = result.ExecuteReader(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - UserProfileData row = dbm.Manager.readUserRow(reader); - - reader.Dispose(); - result.Dispose(); - return row; + using (IDbCommand result = m_database.Query(dbcon, + "SELECT * FROM " + m_usersTableName + " WHERE username = ?first AND lastname = ?second", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + UserProfileData row = m_database.readUserRow(reader); + return row; + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } #region User Friends List Data @@ -216,38 +135,38 @@ namespace OpenSim.Data.MySQL param["?friendPerms"] = perms.ToString(); param["?datetimestamp"] = dtvalue.ToString(); - MySQLSuperManager dbm = GetLockedConnection("AddNewUserFriend"); - try { - IDbCommand adder = - dbm.Manager.Query( + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (IDbCommand adder = m_database.Query(dbcon, "INSERT INTO `" + m_userFriendsTableName + "` " + "(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " + "VALUES " + "(?ownerID,?friendID,?friendPerms,?datetimestamp)", - param); - adder.ExecuteNonQuery(); + param)) + { + adder.ExecuteNonQuery(); + } - adder = - dbm.Manager.Query( + using (IDbCommand adder = m_database.Query(dbcon, "INSERT INTO `" + m_userFriendsTableName + "` " + "(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " + "VALUES " + "(?friendID,?ownerID,?friendPerms,?datetimestamp)", - param); - adder.ExecuteNonQuery(); + param)) + { + adder.ExecuteNonQuery(); + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return; } - finally - { - dbm.Release(); - } } public override void RemoveUserFriend(UUID friendlistowner, UUID friend) @@ -256,32 +175,32 @@ namespace OpenSim.Data.MySQL param["?ownerID"] = friendlistowner.ToString(); param["?friendID"] = friend.ToString(); - MySQLSuperManager dbm = GetLockedConnection("RemoveUserFriend"); - try { - IDbCommand updater = - dbm.Manager.Query( - "delete from " + m_userFriendsTableName + " where ownerID = ?ownerID and friendID = ?friendID", - param); - updater.ExecuteNonQuery(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - updater = - dbm.Manager.Query( - "delete from " + m_userFriendsTableName + " where ownerID = ?friendID and friendID = ?ownerID", - param); - updater.ExecuteNonQuery(); + using (IDbCommand updater = m_database.Query(dbcon, + "delete from " + m_userFriendsTableName + " where ownerID = ?ownerID and friendID = ?friendID", + param)) + { + updater.ExecuteNonQuery(); + } + + using (IDbCommand updater = m_database.Query(dbcon, + "delete from " + m_userFriendsTableName + " where ownerID = ?friendID and friendID = ?ownerID", + param)) + { + updater.ExecuteNonQuery(); + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return; } - finally - { - dbm.Release(); - } } public override void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) @@ -291,28 +210,27 @@ namespace OpenSim.Data.MySQL param["?friendID"] = friend.ToString(); param["?friendPerms"] = perms.ToString(); - MySQLSuperManager dbm = GetLockedConnection("UpdateUserFriendPerms"); - try { - IDbCommand updater = - dbm.Manager.Query( - "update " + m_userFriendsTableName + - " SET friendPerms = ?friendPerms " + - "where ownerID = ?ownerID and friendID = ?friendID", - param); - updater.ExecuteNonQuery(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (IDbCommand updater = m_database.Query(dbcon, + "update " + m_userFriendsTableName + + " SET friendPerms = ?friendPerms " + + "where ownerID = ?ownerID and friendID = ?friendID", + param)) + { + updater.ExecuteNonQuery(); + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return; } - finally - { - dbm.Release(); - } } public override List GetUserFriendList(UUID friendlistowner) @@ -322,87 +240,83 @@ namespace OpenSim.Data.MySQL Dictionary param = new Dictionary(); param["?ownerID"] = friendlistowner.ToString(); - MySQLSuperManager dbm = GetLockedConnection("GetUserFriendList"); - try { - //Left Join userfriends to itself - IDbCommand result = - dbm.Manager.Query( + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + //Left Join userfriends to itself + using (IDbCommand result = m_database.Query(dbcon, "select a.ownerID,a.friendID,a.friendPerms,b.friendPerms as ownerperms from " + m_userFriendsTableName + " as a, " + m_userFriendsTableName + " as b" + " where a.ownerID = ?ownerID and b.ownerID = a.friendID and b.friendID = a.ownerID", - param); - IDataReader reader = result.ExecuteReader(); + param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + while (reader.Read()) + { + FriendListItem fli = new FriendListItem(); + fli.FriendListOwner = new UUID((string)reader["ownerID"]); + fli.Friend = new UUID((string)reader["friendID"]); + fli.FriendPerms = (uint)Convert.ToInt32(reader["friendPerms"]); - while (reader.Read()) - { - FriendListItem fli = new FriendListItem(); - fli.FriendListOwner = new UUID((string) reader["ownerID"]); - fli.Friend = new UUID((string) reader["friendID"]); - fli.FriendPerms = (uint) Convert.ToInt32(reader["friendPerms"]); + // This is not a real column in the database table, it's a joined column from the opposite record + fli.FriendListOwnerPerms = (uint)Convert.ToInt32(reader["ownerperms"]); - // This is not a real column in the database table, it's a joined column from the opposite record - fli.FriendListOwnerPerms = (uint) Convert.ToInt32(reader["ownerperms"]); - - Lfli.Add(fli); + Lfli.Add(fli); + } + } + } } - - reader.Dispose(); - result.Dispose(); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return Lfli; } - finally - { - dbm.Release(); - } return Lfli; } override public Dictionary GetFriendRegionInfos (List uuids) { - MySQLSuperManager dbm = GetLockedConnection("GetFriendRegionInfos"); Dictionary infos = new Dictionary(); try { - foreach (UUID uuid in uuids) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - Dictionary param = new Dictionary(); - param["?uuid"] = uuid.ToString(); - IDbCommand result = - dbm.Manager.Query("select agentOnline,currentHandle from " + m_agentsTableName + - " where UUID = ?uuid", param); + dbcon.Open(); - IDataReader reader = result.ExecuteReader(); - while (reader.Read()) + foreach (UUID uuid in uuids) { - FriendRegionInfo fri = new FriendRegionInfo(); - fri.isOnline = (sbyte)reader["agentOnline"] != 0; - fri.regionHandle = (ulong)reader["currentHandle"]; + Dictionary param = new Dictionary(); + param["?uuid"] = uuid.ToString(); - infos[uuid] = fri; + using (IDbCommand result = m_database.Query(dbcon, "select agentOnline,currentHandle from " + m_agentsTableName + + " where UUID = ?uuid", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + while (reader.Read()) + { + FriendRegionInfo fri = new FriendRegionInfo(); + fri.isOnline = (sbyte)reader["agentOnline"] != 0; + fri.regionHandle = (ulong)reader["currentHandle"]; + + infos[uuid] = fri; + } + } + } } - - reader.Dispose(); - result.Dispose(); } } catch (Exception e) { m_log.Warn("[MYSQL]: Got exception on trying to find friends regions:", e); - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); - } - finally - { - dbm.Release(); + m_log.Error(e.Message, e); } return infos; @@ -423,76 +337,73 @@ namespace OpenSim.Data.MySQL Dictionary param = new Dictionary(); param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], String.Empty) + "%"; param["?second"] = objAlphaNumericPattern.Replace(querysplit[1], String.Empty) + "%"; - MySQLSuperManager dbm = GetLockedConnection("GeneratePickerResults"); try { - IDbCommand result = - dbm.Manager.Query( + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (IDbCommand result = m_database.Query(dbcon, "SELECT UUID,username,lastname FROM " + m_usersTableName + " WHERE username like ?first AND lastname like ?second LIMIT 100", - param); - IDataReader reader = result.ExecuteReader(); - - while (reader.Read()) - { - AvatarPickerAvatar user = new AvatarPickerAvatar(); - user.AvatarID = new UUID((string) reader["UUID"]); - user.firstName = (string) reader["username"]; - user.lastName = (string) reader["lastname"]; - returnlist.Add(user); + param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + while (reader.Read()) + { + AvatarPickerAvatar user = new AvatarPickerAvatar(); + user.AvatarID = new UUID((string)reader["UUID"]); + user.firstName = (string)reader["username"]; + user.lastName = (string)reader["lastname"]; + returnlist.Add(user); + } + } + } } - reader.Dispose(); - result.Dispose(); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return returnlist; } - finally - { - dbm.Release(); - } } else { - MySQLSuperManager dbm = GetLockedConnection("GeneratePickerResults"); - try { Dictionary param = new Dictionary(); param["?first"] = objAlphaNumericPattern.Replace(querysplit[0], String.Empty) + "%"; - IDbCommand result = - dbm.Manager.Query( + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (IDbCommand result = m_database.Query(dbcon, "SELECT UUID,username,lastname FROM " + m_usersTableName + " WHERE username like ?first OR lastname like ?first LIMIT 100", - param); - IDataReader reader = result.ExecuteReader(); - - while (reader.Read()) - { - AvatarPickerAvatar user = new AvatarPickerAvatar(); - user.AvatarID = new UUID((string) reader["UUID"]); - user.firstName = (string) reader["username"]; - user.lastName = (string) reader["lastname"]; - returnlist.Add(user); + param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + while (reader.Read()) + { + AvatarPickerAvatar user = new AvatarPickerAvatar(); + user.AvatarID = new UUID((string)reader["UUID"]); + user.firstName = (string)reader["username"]; + user.lastName = (string)reader["lastname"]; + returnlist.Add(user); + } + } + } } - reader.Dispose(); - result.Dispose(); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return returnlist; } - finally - { - dbm.Release(); - } } return returnlist; } @@ -504,32 +415,30 @@ namespace OpenSim.Data.MySQL /// User profile data public override UserProfileData GetUserByUUID(UUID uuid) { - MySQLSuperManager dbm = GetLockedConnection("GetUserByUUID"); try { Dictionary param = new Dictionary(); param["?uuid"] = uuid.ToString(); - IDbCommand result = dbm.Manager.Query("SELECT * FROM " + m_usersTableName + " WHERE UUID = ?uuid", param); - IDataReader reader = result.ExecuteReader(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - UserProfileData row = dbm.Manager.readUserRow(reader); - - reader.Dispose(); - result.Dispose(); - - return row; + using (IDbCommand result = m_database.Query(dbcon, "SELECT * FROM " + m_usersTableName + " WHERE UUID = ?uuid", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + UserProfileData row = m_database.readUserRow(reader); + return row; + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } /// @@ -565,25 +474,18 @@ namespace OpenSim.Data.MySQL param["?UUID"] = AgentID.ToString(); param["?webLoginKey"] = WebLoginKey.ToString(); - MySQLSuperManager dbm = GetLockedConnection("StoreWebLoginKey"); - try { - dbm.Manager.ExecuteParameterizedSql( - "update " + m_usersTableName + " SET webLoginKey = ?webLoginKey " + - "where UUID = ?UUID", - param); + m_database.ExecuteParameterizedSql( + "update " + m_usersTableName + " SET webLoginKey = ?webLoginKey " + + "where UUID = ?UUID", + param); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return; } - finally - { - dbm.Release(); - } } /// @@ -593,34 +495,30 @@ namespace OpenSim.Data.MySQL /// The users session public override UserAgentData GetAgentByUUID(UUID uuid) { - MySQLSuperManager dbm = GetLockedConnection("GetAgentByUUID"); - try { Dictionary param = new Dictionary(); param["?uuid"] = uuid.ToString(); - IDbCommand result = dbm.Manager.Query("SELECT * FROM " + m_agentsTableName + " WHERE UUID = ?uuid", - param); - IDataReader reader = result.ExecuteReader(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - UserAgentData row = dbm.Manager.readAgentRow(reader); - - reader.Dispose(); - result.Dispose(); - - return row; + using (IDbCommand result = m_database.Query(dbcon, "SELECT * FROM " + m_agentsTableName + " WHERE UUID = ?uuid", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + UserAgentData row = m_database.readAgentRow(reader); + return row; + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } /// @@ -634,27 +532,22 @@ namespace OpenSim.Data.MySQL { return; } - MySQLSuperManager dbm = GetLockedConnection("AddNewUserProfile"); try { - dbm.Manager.insertUserRow(user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt, - user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, - user.HomeLocation.Z, - user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, - user.LastLogin, user.UserInventoryURI, user.UserAssetURI, - user.CanDoMask, user.WantDoMask, - user.AboutText, user.FirstLifeAboutText, user.Image, - user.FirstLifeImage, user.WebLoginKey, user.UserFlags, user.GodLevel, user.CustomType, user.Partner); + m_database.insertUserRow( + user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt, + user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, + user.HomeLocation.Z, + user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, + user.LastLogin, user.UserInventoryURI, user.UserAssetURI, + user.CanDoMask, user.WantDoMask, + user.AboutText, user.FirstLifeAboutText, user.Image, + user.FirstLifeImage, user.WebLoginKey, user.UserFlags, user.GodLevel, user.CustomType, user.Partner); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); - } - finally - { - dbm.Release(); + m_log.Error(e.Message, e); } } @@ -668,19 +561,13 @@ namespace OpenSim.Data.MySQL if (agent.ProfileID == zero || agent.SessionID == zero) return; - MySQLSuperManager dbm = GetLockedConnection("AddNewUserAgent"); try { - dbm.Manager.insertAgentRow(agent); + m_database.insertAgentRow(agent); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); - } - finally - { - dbm.Release(); + m_log.Error(e.Message, e); } } @@ -690,24 +577,24 @@ namespace OpenSim.Data.MySQL /// The profile data to use to update the DB public override bool UpdateUserProfile(UserProfileData user) { - MySQLSuperManager dbm = GetLockedConnection("UpdateUserProfile"); try { - dbm.Manager.updateUserRow(user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt, - user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, - user.HomeLocation.Z, user.HomeLookAt.X, - user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, - user.UserInventoryURI, - user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, - user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey, - user.UserFlags, user.GodLevel, user.CustomType, user.Partner); - } - finally - { - dbm.Release(); - } + m_database.updateUserRow( + user.ID, user.FirstName, user.SurName, user.Email, user.PasswordHash, user.PasswordSalt, + user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, + user.HomeLocation.Z, user.HomeLookAt.X, + user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, + user.UserInventoryURI, + user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, + user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey, + user.UserFlags, user.GodLevel, user.CustomType, user.Partner); - return true; + return true; + } + catch + { + return false; + } } /// @@ -742,41 +629,40 @@ namespace OpenSim.Data.MySQL /// public override AvatarAppearance GetUserAppearance(UUID user) { - MySQLSuperManager dbm = GetLockedConnection("GetUserAppearance"); try { Dictionary param = new Dictionary(); param["?owner"] = user.ToString(); - IDbCommand result = dbm.Manager.Query( - "SELECT * FROM " + m_appearanceTableName + " WHERE owner = ?owner", param); - IDataReader reader = result.ExecuteReader(); - - AvatarAppearance appearance = dbm.Manager.readAppearanceRow(reader); - - reader.Dispose(); - result.Dispose(); - - if (null == appearance) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - m_log.WarnFormat("[USER DB] No appearance found for user {0}", user.ToString()); - return null; - } - - appearance.SetAttachments(GetUserAttachments(user)); + dbcon.Open(); - return appearance; + using (IDbCommand result = m_database.Query(dbcon, "SELECT * FROM " + m_appearanceTableName + " WHERE owner = ?owner", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + AvatarAppearance appearance = m_database.readAppearanceRow(reader); + + if (appearance == null) + { + m_log.WarnFormat("[USER DB] No appearance found for user {0}", user.ToString()); + return null; + } + else + { + appearance.SetAttachments(GetUserAttachments(user)); + return appearance; + } + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } /// @@ -787,22 +673,16 @@ namespace OpenSim.Data.MySQL // override public override void UpdateUserAppearance(UUID user, AvatarAppearance appearance) { - MySQLSuperManager dbm = GetLockedConnection("UpdateUserAppearance"); try { appearance.Owner = user; - dbm.Manager.insertAppearanceRow(appearance); + m_database.insertAppearanceRow(appearance); UpdateUserAttachments(user, appearance.GetAttachments()); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); - } - finally - { - dbm.Release(); + m_log.Error(e.Message, e); } } @@ -829,43 +709,33 @@ namespace OpenSim.Data.MySQL Dictionary param = new Dictionary(); param["?uuid"] = agentID.ToString(); - MySQLSuperManager dbm = GetLockedConnection("GetUserAttachments"); - try { - IDbCommand result = dbm.Manager.Query( - "SELECT attachpoint, item, asset from " + m_attachmentsTableName + " WHERE UUID = ?uuid", param); - IDataReader reader = result.ExecuteReader(); + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); - Hashtable ret = dbm.Manager.readAttachments(reader); - - reader.Dispose(); - result.Dispose(); - return ret; + using (IDbCommand result = m_database.Query(dbcon, + "SELECT attachpoint, item, asset from " + m_attachmentsTableName + " WHERE UUID = ?uuid", param)) + { + using (IDataReader reader = result.ExecuteReader()) + { + Hashtable ret = m_database.readAttachments(reader); + return ret; + } + } + } } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return null; } - finally - { - dbm.Release(); - } } public void UpdateUserAttachments(UUID agentID, Hashtable data) { - MySQLSuperManager dbm = GetLockedConnection("UpdateUserAttachments"); - try - { - dbm.Manager.writeAttachments(agentID, data); - } - finally - { - dbm.Release(); - } + m_database.writeAttachments(agentID, data); } public override void ResetAttachments(UUID userID) @@ -873,19 +743,10 @@ namespace OpenSim.Data.MySQL Dictionary param = new Dictionary(); param["?uuid"] = userID.ToString(); - MySQLSuperManager dbm = GetLockedConnection("ResetAttachments"); - - try - { - dbm.Manager.ExecuteParameterizedSql( - "UPDATE " + m_attachmentsTableName + - " SET asset = '00000000-0000-0000-0000-000000000000' WHERE UUID = ?uuid", - param); - } - finally - { - dbm.Release(); - } + m_database.ExecuteParameterizedSql( + "UPDATE " + m_attachmentsTableName + + " SET asset = '00000000-0000-0000-0000-000000000000' WHERE UUID = ?uuid", + param); } public override void LogoutUsers(UUID regionID) @@ -893,25 +754,18 @@ namespace OpenSim.Data.MySQL Dictionary param = new Dictionary(); param["?regionID"] = regionID.ToString(); - MySQLSuperManager dbm = GetLockedConnection("LogoutUsers"); - try { - dbm.Manager.ExecuteParameterizedSql( - "update " + m_agentsTableName + " SET agentOnline = 0 " + - "where currentRegion = ?regionID", - param); + m_database.ExecuteParameterizedSql( + "update " + m_agentsTableName + " SET agentOnline = 0 " + + "where currentRegion = ?regionID", + param); } catch (Exception e) { - dbm.Manager.Reconnect(); - m_log.Error(e.ToString()); + m_log.Error(e.Message, e); return; } - finally - { - dbm.Release(); - } } } } diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs index 0eebc9c7fd..b5866cbf57 100644 --- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs @@ -110,47 +110,58 @@ namespace OpenSim.Data.MySQL public bool MoveItem(string id, string newParent) { - MySqlCommand cmd = new MySqlCommand(); + using (MySqlCommand cmd = new MySqlCommand()) + { - cmd.CommandText = String.Format("update {0} set parentFolderID = ?ParentFolderID where inventoryID = ?InventoryID", m_Realm); - cmd.Parameters.AddWithValue("?ParentFolderID", newParent); - cmd.Parameters.AddWithValue("?InventoryID", id); + cmd.CommandText = String.Format("update {0} set parentFolderID = ?ParentFolderID where inventoryID = ?InventoryID", m_Realm); + cmd.Parameters.AddWithValue("?ParentFolderID", newParent); + cmd.Parameters.AddWithValue("?InventoryID", id); - return ExecuteNonQuery(cmd) == 0 ? false : true; + return ExecuteNonQuery(cmd) == 0 ? false : true; + } } public XInventoryItem[] GetActiveGestures(UUID principalID) { - MySqlCommand cmd = new MySqlCommand(); - cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags = 1", m_Realm); + using (MySqlCommand cmd = new MySqlCommand()) + { + cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags = 1", m_Realm); - cmd.Parameters.AddWithValue("?uuid", principalID.ToString()); - cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); + cmd.Parameters.AddWithValue("?uuid", principalID.ToString()); + cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture); - return DoQuery(cmd); + return DoQuery(cmd); + } } public int GetAssetPermissions(UUID principalID, UUID assetID) { - MySqlCommand cmd = new MySqlCommand(); - - cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID", m_Realm); - cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); - cmd.Parameters.AddWithValue("?AssetID", assetID.ToString()); - - IDataReader reader = ExecuteReader(cmd); - - int perms = 0; - - if (reader.Read()) + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { - perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]); + dbcon.Open(); + + using (MySqlCommand cmd = new MySqlCommand()) + { + cmd.Connection = dbcon; + + cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = ?PrincipalID and assetID = ?AssetID group by assetID", m_Realm); + cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString()); + cmd.Parameters.AddWithValue("?AssetID", assetID.ToString()); + + using (IDataReader reader = cmd.ExecuteReader()) + { + + int perms = 0; + + if (reader.Read()) + { + perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]); + } + + return perms; + } + } } - - reader.Close(); - CloseReaderCommand(cmd); - - return perms; } } } diff --git a/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs b/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs index d1d5c2a2e6..82723160e3 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs @@ -31,6 +31,7 @@ using OpenSim.Data.Tests; using log4net; using System.Reflection; using OpenSim.Tests.Common; +using MySql.Data.MySqlClient; namespace OpenSim.Data.MySQL.Tests { @@ -65,9 +66,13 @@ namespace OpenSim.Data.MySQL.Tests // This actually does the roll forward assembly stuff Assembly assem = GetType().Assembly; - Migration m = new Migration(database.Connection, assem, "GridStore"); - m.Update(); + using (MySqlConnection dbcon = new MySqlConnection(connect)) + { + dbcon.Open(); + Migration m = new Migration(dbcon, assem, "AssetStore"); + m.Update(); + } } [TestFixtureTearDown] From 59f6606ecf4ea7ac3928aec20d1528222961458b Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Sat, 6 Feb 2010 00:37:07 -0500 Subject: [PATCH 79/81] Endline fix --- .../DynamicTexture/DynamicTextureModule.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 679c871441..e3c7bbf500 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -358,18 +358,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture // tmptex.DefaultTexture.Fullbright = true; part.UpdateTexture(tmptex); - } - - if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) - { - if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); - if (oldAsset != null) - { - if (oldAsset.Temporary == true) - { - scene.AssetService.Delete(oldID.ToString()); - } - } + } + + if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) + { + if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); + if (oldAsset != null) + { + if (oldAsset.Temporary == true) + { + scene.AssetService.Delete(oldID.ToString()); + } + } } } From fabf10f1cf29a20332f5ab3b5b467a6954a83b34 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Sat, 6 Feb 2010 00:38:22 -0500 Subject: [PATCH 80/81] endline fix 2 --- .../Interregion/RESTInterregionComms.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs index 44458d175f..fa3681a689 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs @@ -436,12 +436,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion } OSDMap resp = new OSDMap(2); - string reason = String.Empty; - uint teleportFlags = 0; - if (args.ContainsKey("teleport_flags")) - { - teleportFlags = args["teleport_flags"].AsUInteger(); - } + string reason = String.Empty; + uint teleportFlags = 0; + if (args.ContainsKey("teleport_flags")) + { + teleportFlags = args["teleport_flags"].AsUInteger(); + } // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); From 70a0d7aa4677c240ad12527adde6725df946e572 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 8 Feb 2010 15:21:35 +0000 Subject: [PATCH 81/81] Adding the Careminster "Configger" tool to OpenSim. The tool will, when launched in place of OpenSim, dump the config to stdout. Use -f xml, -f ini or -f mysql to get a condensed ini file, an xml file suitable for webloading, or a set of mysql insert statements. --- .../Tools/Configger/ConfigurationLoader.cs | 251 ++++++++++++++++++ OpenSim/Tools/Configger/Main.cs | 108 ++++++++ OpenSim/Tools/Configger/Util.cs | 79 ++++++ prebuild.xml | 22 ++ 4 files changed, 460 insertions(+) create mode 100644 OpenSim/Tools/Configger/ConfigurationLoader.cs create mode 100644 OpenSim/Tools/Configger/Main.cs create mode 100644 OpenSim/Tools/Configger/Util.cs diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs new file mode 100644 index 0000000000..49af4172a8 --- /dev/null +++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs @@ -0,0 +1,251 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Threading; +using System.Xml; +using log4net; +using Nini.Config; + +namespace Careminster +{ + /// + /// Loads the Configuration files into nIni + /// + public class ConfigurationLoader + { + /// + /// A source of Configuration data + /// + protected IConfigSource m_config; + + /// + /// Console logger + /// + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + public ConfigurationLoader() + { + } + + /// + /// Loads the region configuration + /// + /// Parameters passed into the process when started + /// + /// + /// A configuration that gets passed to modules + public IConfigSource LoadConfigSettings() + { + bool iniFileExists = false; + + List sources = new List(); + + string iniFileName = "OpenSim.ini"; + string iniFilePath = Path.Combine(".", iniFileName); + + if (IsUri(iniFileName)) + { + if (!sources.Contains(iniFileName)) + sources.Add(iniFileName); + } + else + { + if (File.Exists(iniFilePath)) + { + if (!sources.Contains(iniFilePath)) + sources.Add(iniFilePath); + } + } + + m_config = new IniConfigSource(); + m_config.Merge(DefaultConfig()); + + m_log.Info("[CONFIG] Reading configuration settings"); + + if (sources.Count == 0) + { + m_log.FatalFormat("[CONFIG] Could not load any configuration"); + m_log.FatalFormat("[CONFIG] Did you copy the OpenSim.ini.example file to OpenSim.ini?"); + Environment.Exit(1); + } + + for (int i = 0 ; i < sources.Count ; i++) + { + if (ReadConfig(sources[i])) + iniFileExists = true; + AddIncludes(sources); + } + + if (!iniFileExists) + { + m_log.FatalFormat("[CONFIG] Could not load any configuration"); + m_log.FatalFormat("[CONFIG] Configuration exists, but there was an error loading it!"); + Environment.Exit(1); + } + + return m_config; + } + + /// + /// Adds the included files as ini configuration files + /// + /// List of URL strings or filename strings + private void AddIncludes(List sources) + { + //loop over config sources + foreach (IConfig config in m_config.Configs) + { + // Look for Include-* in the key name + string[] keys = config.GetKeys(); + foreach (string k in keys) + { + if (k.StartsWith("Include-")) + { + // read the config file to be included. + string file = config.GetString(k); + if (IsUri(file)) + { + if (!sources.Contains(file)) + sources.Add(file); + } + else + { + string basepath = Path.GetFullPath("."); + string path = Path.Combine(basepath, file); + string[] paths = Util.Glob(path); + foreach (string p in paths) + { + if (!sources.Contains(p)) + sources.Add(p); + } + } + } + } + } + } + /// + /// Check if we can convert the string to a URI + /// + /// String uri to the remote resource + /// true if we can convert the string to a Uri object + bool IsUri(string file) + { + Uri configUri; + + return Uri.TryCreate(file, UriKind.Absolute, + out configUri) && configUri.Scheme == Uri.UriSchemeHttp; + } + + /// + /// Provide same ini loader functionality for standard ini and master ini - file system or XML over http + /// + /// Full path to the ini + /// + private bool ReadConfig(string iniPath) + { + bool success = false; + + if (!IsUri(iniPath)) + { + m_log.InfoFormat("[CONFIG] Reading configuration file {0}", + Path.GetFullPath(iniPath)); + + m_config.Merge(new IniConfigSource(iniPath)); + success = true; + } + else + { + m_log.InfoFormat("[CONFIG] {0} is a http:// URI, fetching ...", + iniPath); + + // The ini file path is a http URI + // Try to read it + // + try + { + XmlReader r = XmlReader.Create(iniPath); + XmlConfigSource cs = new XmlConfigSource(r); + m_config.Merge(cs); + + success = true; + } + catch (Exception e) + { + m_log.FatalFormat("[CONFIG] Exception reading config from URI {0}\n" + e.ToString(), iniPath); + Environment.Exit(1); + } + } + return success; + } + + /// + /// Setup a default config values in case they aren't present in the ini file + /// + /// A Configuration source containing the default configuration + private static IConfigSource DefaultConfig() + { + IConfigSource defaultConfig = new IniConfigSource(); + + { + IConfig config = defaultConfig.Configs["Startup"]; + + if (null == config) + config = defaultConfig.AddConfig("Startup"); + + config.Set("region_info_source", "filesystem"); + + config.Set("gridmode", false); + config.Set("physics", "OpenDynamicsEngine"); + config.Set("meshing", "Meshmerizer"); + config.Set("physical_prim", true); + config.Set("see_into_this_sim_from_neighbor", true); + config.Set("serverside_object_permissions", false); + config.Set("storage_plugin", "OpenSim.Data.SQLite.dll"); + config.Set("storage_connection_string", "URI=file:OpenSim.db,version=3"); + config.Set("storage_prim_inventories", true); + config.Set("startup_console_commands_file", String.Empty); + config.Set("shutdown_console_commands_file", String.Empty); + config.Set("DefaultScriptEngine", "XEngine"); + config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); + // life doesn't really work without this + config.Set("EventQueue", true); + } + + { + IConfig config = defaultConfig.Configs["StandAlone"]; + + if (null == config) + config = defaultConfig.AddConfig("StandAlone"); + + config.Set("accounts_authenticate", true); + config.Set("welcome_message", "Welcome to OpenSimulator"); + config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll"); + config.Set("inventory_source", ""); + config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); + config.Set("user_source", ""); + config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); + } + + { + IConfig config = defaultConfig.Configs["Network"]; + + if (null == config) + config = defaultConfig.AddConfig("Network"); + + config.Set("default_location_x", 1000); + config.Set("default_location_y", 1000); + config.Set("grid_send_key", "null"); + config.Set("grid_recv_key", "null"); + config.Set("user_send_key", "null"); + config.Set("user_recv_key", "null"); + config.Set("secure_inventory_server", "true"); + } + + return defaultConfig; + } + + } +} diff --git a/OpenSim/Tools/Configger/Main.cs b/OpenSim/Tools/Configger/Main.cs new file mode 100644 index 0000000000..c85f0d28eb --- /dev/null +++ b/OpenSim/Tools/Configger/Main.cs @@ -0,0 +1,108 @@ +using Nini.Config; +using System; + +namespace Careminster +{ + public class Configger + { + public static int Main(string[] args) + { + ArgvConfigSource argvConfig = new ArgvConfigSource(args); + argvConfig.AddSwitch("Startup", "format", "f"); + + IConfig startupConfig = argvConfig.Configs["Startup"]; + + string format = startupConfig.GetString("format", "ini"); + + ConfigurationLoader loader = new ConfigurationLoader(); + + IConfigSource s = loader.LoadConfigSettings(); + + if (format == "mysql") + { + foreach (IConfig c in s.Configs) + { + foreach (string k in c.GetKeys()) + { + string v = c.GetString(k); + + if (k.StartsWith("Include-")) + continue; + Console.WriteLine("insert ignore into config (section, name, value) values ('{0}', '{1}', '{2}');", c.Name, k, v); + } + } + } + else if (format == "xml") + { + Console.WriteLine(""); + + foreach (IConfig c in s.Configs) + { + int count = 0; + + foreach (string k in c.GetKeys()) + { + if (k.StartsWith("Include-")) + continue; + + count++; + } + + if (count > 0) + { + Console.WriteLine("
", c.Name); + + foreach (string k in c.GetKeys()) + { + string v = c.GetString(k); + + if (k.StartsWith("Include-")) + continue; + Console.WriteLine(" ", k, v); + + Console.WriteLine("
"); + } + } + } + Console.WriteLine("
"); + } + else if (format == "ini") + { + foreach (IConfig c in s.Configs) + { + int count = 0; + + foreach (string k in c.GetKeys()) + { + if (k.StartsWith("Include-")) + continue; + + count++; + } + + if (count > 0) + { + Console.WriteLine("[{0}]", c.Name); + + foreach (string k in c.GetKeys()) + { + string v = c.GetString(k); + + if (k.StartsWith("Include-")) + continue; + Console.WriteLine("{0} = \"{1}\"", k, v); + } + + Console.WriteLine(); + } + } + } + else + { + Console.WriteLine("Error: unknown format: {0}", format); + } + + return 0; + } + } +} diff --git a/OpenSim/Tools/Configger/Util.cs b/OpenSim/Tools/Configger/Util.cs new file mode 100644 index 0000000000..6f8aa76411 --- /dev/null +++ b/OpenSim/Tools/Configger/Util.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.IO.Compression; +using System.Net; +using System.Net.Sockets; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using log4net; +using Nini.Config; + +namespace Careminster +{ + public static class Util + { + public static string[] Glob(string path) + { + string vol=String.Empty; + + if (Path.VolumeSeparatorChar != Path.DirectorySeparatorChar) + { + string[] vcomps = path.Split(new char[] {Path.VolumeSeparatorChar}, 2, StringSplitOptions.RemoveEmptyEntries); + + if (vcomps.Length > 1) + { + path = vcomps[1]; + vol = vcomps[0]; + } + } + + string[] comps = path.Split(new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}, StringSplitOptions.RemoveEmptyEntries); + + // Glob + + path = vol; + if (vol != String.Empty) + path += new String(new char[] {Path.VolumeSeparatorChar, Path.DirectorySeparatorChar}); + else + path = new String(new char[] {Path.DirectorySeparatorChar}); + + List paths = new List(); + List found = new List(); + paths.Add(path); + + int compIndex = -1; + foreach (string c in comps) + { + compIndex++; + + List addpaths = new List(); + foreach (string p in paths) + { + string[] dirs = Directory.GetDirectories(p, c); + + if (dirs.Length != 0) + { + foreach (string dir in dirs) + addpaths.Add(Path.Combine(path, dir)); + } + + // Only add files if that is the last path component + if (compIndex == comps.Length - 1) + { + string[] files = Directory.GetFiles(p, c); + foreach (string f in files) + found.Add(f); + } + } + paths = addpaths; + } + + return found.ToArray(); + } + } +} diff --git a/prebuild.xml b/prebuild.xml index 46a10578de..ac4400dc68 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -2886,6 +2886,28 @@ + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + + + +