diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index b8a8f4215b..666e0d2a51 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -44,7 +44,8 @@ using OpenSim.Region.Environment; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Physics.Manager; - +using Mono.Addins; +using Mono.Addins.Description; namespace OpenSim { @@ -93,6 +94,8 @@ namespace OpenSim : base() { IConfig startupConfig = configSource.Configs["Startup"]; + + AddinManager.Initialize("."); string iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini"); @@ -275,6 +278,13 @@ namespace OpenSim m_httpServer.AddStreamHandler(new SimStatusHandler()); } + MainLog.Instance.Verbose("Plugins", "Loading OpenSim application plugins"); + foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/OpenSim/Startup")) + { + IApplicationPlugin plugin = (IApplicationPlugin)node.CreateInstance(); + plugin.Initialise(this); + } + IRegionLoader regionLoader; if (m_config.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem") { diff --git a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs index 2bc3db8271..2668812c72 100644 --- a/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs +++ b/OpenSim/Region/Environment/Modules/DynamicTextureModule.cs @@ -177,7 +177,7 @@ namespace OpenSim.Region.Environment.Modules asset.Description = "dynamic image"; asset.Local = false; asset.Temporary = false; - scene.commsManager.AssetCache.AddAsset(asset); + scene.AssetCache.AddAsset(asset); LastAssetID = asset.FullID; diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index 5ba594154a..98057f9210 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs @@ -128,7 +128,7 @@ namespace OpenSim.Region.Environment.Modules AssetRequest request = new AssetRequest(client, e.RequestedAssetID, e.DiscardLevel, e.PacketNumber); ClientRequests[client.AgentId].Add(e.RequestedAssetID, request); } - m_scene.commsManager.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback); + m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback); } } diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 325153f252..5d85c1ddc0 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -91,8 +91,6 @@ namespace OpenSim.Region.Environment.Scenes } else { - //newAvatar.OnSignificantClientMovement += m_LandManager.handleSignificantClientMovement; - MainLog.Instance.Verbose("SCENE", m_regInfo.RegionName + ": Creating new root agent."); MainLog.Instance.Verbose("SCENE", m_regInfo.RegionName + ": Adding Physical agent."); diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 17f7566b7d..138cb2065c 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -52,7 +52,7 @@ namespace OpenSim.Region.Environment.Scenes public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) { - CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { userInfo.AddItem(remoteClient.AgentId, item); @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment.Scenes public LLUUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID itemID, byte[] data) { - CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { if (userInfo.RootFolder != null) @@ -89,7 +89,7 @@ namespace OpenSim.Region.Environment.Scenes asset.InvType = (sbyte) item.invType; asset.Name = item.inventoryName; asset.Data = data; - commsManager.AssetCache.AddAsset(asset); + AssetCache.AddAsset(asset); item.assetID = asset.FullID; userInfo.UpdateItem(remoteClient.AgentId, item); @@ -114,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes public void UDPUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID) { - CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { if (userInfo.RootFolder != null) @@ -123,13 +123,13 @@ namespace OpenSim.Region.Environment.Scenes if (item != null) { AgentAssetTransactions transactions = - commsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId); + CommsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId); if (transactions != null) { AssetBase asset = null; bool addToCache = false; - asset = commsManager.AssetCache.GetAsset(assetID); + asset = AssetCache.GetAsset(assetID); if (asset == null) { asset = transactions.GetTransactionAsset(transactionID); @@ -148,7 +148,7 @@ namespace OpenSim.Region.Environment.Scenes if (addToCache) { - commsManager.AssetCache.AddAsset(asset); + AssetCache.AddAsset(asset); } userInfo.UpdateItem(remoteClient.AgentId, item); @@ -179,7 +179,7 @@ namespace OpenSim.Region.Environment.Scenes { if (transActionID == LLUUID.Zero) { - CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { AssetBase asset = new AssetBase(); @@ -189,7 +189,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Type = type; asset.FullID = LLUUID.Random(); asset.Data = new byte[1]; - commsManager.AssetCache.AddAsset(asset); + AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); item.avatarID = remoteClient.AgentId; @@ -210,7 +210,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, + CommsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask); //System.Console.WriteLine("request to create inventory item from transaction " + transActionID); @@ -269,7 +269,7 @@ namespace OpenSim.Region.Environment.Scenes public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) { - CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); LLUUID copyID = LLUUID.Random(); if (userInfo != null) { @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes { isTexture = true; } - AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, isTexture); + AssetBase rezAsset = AssetCache.GetAsset(item.assetID, isTexture); if (rezAsset != null) { string script = Util.FieldToString(rezAsset.Data); @@ -295,7 +295,7 @@ namespace OpenSim.Region.Environment.Scenes else { //lets try once more incase the asset cache is being slow getting the asset from server - rezAsset = commsManager.AssetCache.GetAsset(item.assetID, isTexture); + rezAsset = AssetCache.GetAsset(item.assetID, isTexture); if (rezAsset != null) { string script = Util.FieldToString(rezAsset.Data); @@ -360,7 +360,7 @@ namespace OpenSim.Region.Environment.Scenes if (PermissionsMngr.CanDeRezObject(remoteClient.AgentId, ((SceneObjectGroup) selectedEnt).UUID)) { string sceneObjectXml = ((SceneObjectGroup) selectedEnt).ToXmlString(); - CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { AssetBase asset = new AssetBase(); @@ -371,7 +371,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Type = 6; asset.FullID = LLUUID.Random(); asset.Data = Helpers.StringToField(sceneObjectXml); - commsManager.AssetCache.AddAsset(asset); + AssetCache.AddAsset(asset); InventoryItemBase item = new InventoryItemBase(); @@ -407,7 +407,7 @@ namespace OpenSim.Region.Environment.Scenes rootPart.PhysActor = null; } - storageManager.DataStore.RemoveObject(group.UUID, m_regInfo.RegionID); + m_storageManager.DataStore.RemoveObject(group.UUID, m_regInfo.RegionID); group.DeleteGroup(); lock (Entities) @@ -419,7 +419,7 @@ namespace OpenSim.Region.Environment.Scenes public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) { - CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); + CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); if (userInfo != null) { if (userInfo.RootFolder != null) @@ -427,7 +427,7 @@ namespace OpenSim.Region.Environment.Scenes InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); if (item != null) { - AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false); + AssetBase rezAsset = AssetCache.GetAsset(item.assetID, false); if (rezAsset != null) { AddRezObject(Util.FieldToString(rezAsset.Data), pos); @@ -437,7 +437,7 @@ namespace OpenSim.Region.Environment.Scenes else { //lets try once more incase the asset cache is being slow getting the asset from server - rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false); + rezAsset = AssetCache.GetAsset(item.assetID, false); if (rezAsset != null) { AddRezObject(Util.FieldToString(rezAsset.Data), pos); diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a956eb2cdb..49d2268c60 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -70,13 +70,13 @@ namespace OpenSim.Region.Environment.Scenes private readonly Mutex updateLock; protected ModuleLoader m_moduleLoader; - protected StorageManager storageManager; - protected AgentCircuitManager authenticateHandler; - public CommunicationsManager commsManager; + protected StorageManager m_storageManager; + protected AgentCircuitManager m_authenticateHandler; + public CommunicationsManager CommsManager; // protected XferManager xferManager; protected SceneCommunicationService m_sceneGridService; - protected Dictionary capsHandlers = new Dictionary(); + protected Dictionary m_capsHandlers = new Dictionary(); protected BaseHttpServer httpListener; protected Dictionary Modules = new Dictionary(); @@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Scenes public AgentCircuitManager AuthenticateHandler { - get { return authenticateHandler; } + get { return m_authenticateHandler; } } private readonly LandManager m_LandManager; @@ -191,11 +191,11 @@ namespace OpenSim.Region.Environment.Scenes updateLock = new Mutex(false); m_moduleLoader = moduleLoader; - authenticateHandler = authen; - commsManager = commsMan; + m_authenticateHandler = authen; + CommsManager = commsMan; m_sceneGridService = sceneGridService; - storageManager = storeManager; - assetCache = assetCach; + m_storageManager = storeManager; + AssetCache = assetCach; m_regInfo = regInfo; m_regionHandle = m_regInfo.RegionHandle; m_regionName = m_regInfo.RegionName; @@ -393,7 +393,7 @@ namespace OpenSim.Region.Environment.Scenes phyScene.SetTerrain(Terrain.GetHeights1D()); } - storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); + m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); float[] terData = Terrain.GetHeights1D(); @@ -470,7 +470,7 @@ namespace OpenSim.Region.Environment.Scenes /// public bool Backup() { - EventManager.TriggerOnBackup(storageManager.DataStore); + EventManager.TriggerOnBackup(m_storageManager.DataStore); return true; } @@ -486,7 +486,7 @@ namespace OpenSim.Region.Environment.Scenes { try { - double[,] map = storageManager.DataStore.LoadTerrain(RegionInfo.RegionID); + double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID); if (map == null) { if (string.IsNullOrEmpty(m_regInfo.EstateSettings.terrainFile)) @@ -494,7 +494,7 @@ namespace OpenSim.Region.Environment.Scenes MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain."); Terrain.HillsGenerator(); - storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); + m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); } else { @@ -509,7 +509,7 @@ namespace OpenSim.Region.Environment.Scenes "No terrain found in database or default. Generating a new terrain."); Terrain.HillsGenerator(); } - storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); + m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); } } else @@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Name = "terrainImage"; asset.Type = 0; asset.Temporary = true; - commsManager.AssetCache.AddAsset(asset); + AssetCache.AddAsset(asset); } #endregion @@ -552,7 +552,7 @@ namespace OpenSim.Region.Environment.Scenes public virtual void LoadPrimsFromStorage() { MainLog.Instance.Verbose("Loading objects from datastore"); - List PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.RegionID); + List PrimsFromDB = m_storageManager.DataStore.LoadObjects(m_regInfo.RegionID); foreach (SceneObjectGroup prim in PrimsFromDB) { AddEntityFromStorage(prim); @@ -790,8 +790,8 @@ namespace OpenSim.Region.Environment.Scenes CreateAndAddScenePresence(client, child); m_LandManager.sendParcelOverlay(client); - commsManager.UserProfileCache.AddNewUser(client.AgentId); - commsManager.TransactionsManager.AddUser(client.AgentId); + CommsManager.UserProfileCache.AddNewUser(client.AgentId); + CommsManager.TransactionsManager.AddUser(client.AgentId); } protected virtual void SubscribeToClientEvents(IClientAPI client) @@ -818,7 +818,7 @@ namespace OpenSim.Region.Environment.Scenes client.OnGrabUpdate += m_innerScene.MoveObject; client.OnDeRezObject += DeRezObject; client.OnRezObject += RezObject; - client.OnNameFromUUIDRequest += commsManager.HandleUUIDNameRequest; + client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest; client.OnObjectDescription += m_innerScene.PrimDescription; client.OnObjectName += m_innerScene.PrimName; client.OnLinkObjects += m_innerScene.LinkObjects; @@ -837,13 +837,13 @@ namespace OpenSim.Region.Environment.Scenes client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); client.OnCreateNewInventoryItem += CreateNewInventoryItem; - client.OnCreateNewInventoryFolder += commsManager.UserProfileCache.HandleCreateInventoryFolder; - client.OnFetchInventoryDescendents += commsManager.UserProfileCache.HandleFecthInventoryDescendents; + client.OnCreateNewInventoryFolder += CommsManager.UserProfileCache.HandleCreateInventoryFolder; + client.OnFetchInventoryDescendents += CommsManager.UserProfileCache.HandleFecthInventoryDescendents; client.OnRequestTaskInventory += RequestTaskInventory; - client.OnFetchInventory += commsManager.UserProfileCache.HandleFetchInventory; + client.OnFetchInventory += CommsManager.UserProfileCache.HandleFetchInventory; client.OnUpdateInventoryItem += UDPUpdateInventoryItemAsset; - client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; - client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; + client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest; + client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer; client.OnRezScript += RezScript; client.OnRemoveTaskItem += RemoveTaskInventory; @@ -904,7 +904,7 @@ namespace OpenSim.Region.Environment.Scenes avatar.Close(); // Remove client agent from profile, so new logins will work - commsManager.UserService.clearUserAgent(agentID); + CommsManager.UserService.clearUserAgent(agentID); return; } @@ -926,7 +926,7 @@ namespace OpenSim.Region.Environment.Scenes if (Entities.ContainsKey(entID)) { Entities.Remove(entID); - storageManager.DataStore.RemoveObject(entID, m_regInfo.RegionID); + m_storageManager.DataStore.RemoveObject(entID, m_regInfo.RegionID); return true; } return false; @@ -963,7 +963,7 @@ namespace OpenSim.Region.Environment.Scenes if (agent.CapsPath != "") { Caps cap = - new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, + new Caps(AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, agent.CapsPath, agent.AgentID, m_dumpAssetsToFile); Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + @@ -971,18 +971,18 @@ namespace OpenSim.Region.Environment.Scenes cap.RegisterHandlers(); cap.AddNewInventoryItem = AddInventoryItem; cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset; - if (capsHandlers.ContainsKey(agent.AgentID)) + if (m_capsHandlers.ContainsKey(agent.AgentID)) { //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + // agent.AgentID.ToStringHyphenated()); - capsHandlers[agent.AgentID] = cap; + m_capsHandlers[agent.AgentID] = cap; } else { - capsHandlers.Add(agent.AgentID, cap); + m_capsHandlers.Add(agent.AgentID, cap); } } - authenticateHandler.AddNewCircuit(agent.circuitcode, agent); + m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); } } diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 149443789b..b0ec352099 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs @@ -68,7 +68,13 @@ namespace OpenSim.Region.Environment.Scenes protected object m_syncRoot = new object(); private uint m_nextLocalId = 8880000; - protected AssetCache assetCache; + private AssetCache m_assetCache; + + public AssetCache AssetCache + { + get { return m_assetCache; } + set { m_assetCache = value; } + } #endregion diff --git a/bin/Mono.Addins.dll.config b/bin/Mono.Addins.dll.config new file mode 100644 index 0000000000..39e8a66b28 --- /dev/null +++ b/bin/Mono.Addins.dll.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/bin/mono-addins.exe b/bin/mono-addins.exe new file mode 100644 index 0000000000..6cc365819f Binary files /dev/null and b/bin/mono-addins.exe differ diff --git a/prebuild.xml b/prebuild.xml index 307e40be88..b3ca211d2a 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -649,7 +649,6 @@ - @@ -684,6 +683,32 @@ + + + + + + + + + + ../../../bin/ + + + + + ../../../bin/ + + + + ../../../bin/ + + + + + + +