aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMW2007-11-04 13:48:15 +0000
committerMW2007-11-04 13:48:15 +0000
commit039f2c46c057569463ba970f4b3f33990debf7e2 (patch)
treec73edc783228c43080a5a0878fd8f8b62af5b487 /OpenSim/Region/Environment/Scenes/Scene.cs
parentadd a IAssetProvider.CommitAssets() call to the grid asset server, when a ass... (diff)
downloadopensim-SC_OLD-039f2c46c057569463ba970f4b3f33990debf7e2.zip
opensim-SC_OLD-039f2c46c057569463ba970f4b3f33990debf7e2.tar.gz
opensim-SC_OLD-039f2c46c057569463ba970f4b3f33990debf7e2.tar.bz2
opensim-SC_OLD-039f2c46c057569463ba970f4b3f33990debf7e2.tar.xz
Added support for OpenSim application plugins (as requested by Adam), which use Mono.addins for loading/management. (which is a pure .net solution so works on both Mono and MS .net, and is under the MIT license, will add the source code for the library later). I also suggest we look into switching to using Mono.addins for our Region module loading management.
A little bit more refactoring of Scene.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs62
1 files changed, 31 insertions, 31 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index a956eb2..49d2268 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -70,13 +70,13 @@ namespace OpenSim.Region.Environment.Scenes
70 private readonly Mutex updateLock; 70 private readonly Mutex updateLock;
71 71
72 protected ModuleLoader m_moduleLoader; 72 protected ModuleLoader m_moduleLoader;
73 protected StorageManager storageManager; 73 protected StorageManager m_storageManager;
74 protected AgentCircuitManager authenticateHandler; 74 protected AgentCircuitManager m_authenticateHandler;
75 public CommunicationsManager commsManager; 75 public CommunicationsManager CommsManager;
76 // protected XferManager xferManager; 76 // protected XferManager xferManager;
77 protected SceneCommunicationService m_sceneGridService; 77 protected SceneCommunicationService m_sceneGridService;
78 78
79 protected Dictionary<LLUUID, Caps> capsHandlers = new Dictionary<LLUUID, Caps>(); 79 protected Dictionary<LLUUID, Caps> m_capsHandlers = new Dictionary<LLUUID, Caps>();
80 protected BaseHttpServer httpListener; 80 protected BaseHttpServer httpListener;
81 81
82 protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>(); 82 protected Dictionary<string, IRegionModule> Modules = new Dictionary<string, IRegionModule>();
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Environment.Scenes
116 116
117 public AgentCircuitManager AuthenticateHandler 117 public AgentCircuitManager AuthenticateHandler
118 { 118 {
119 get { return authenticateHandler; } 119 get { return m_authenticateHandler; }
120 } 120 }
121 121
122 private readonly LandManager m_LandManager; 122 private readonly LandManager m_LandManager;
@@ -191,11 +191,11 @@ namespace OpenSim.Region.Environment.Scenes
191 updateLock = new Mutex(false); 191 updateLock = new Mutex(false);
192 192
193 m_moduleLoader = moduleLoader; 193 m_moduleLoader = moduleLoader;
194 authenticateHandler = authen; 194 m_authenticateHandler = authen;
195 commsManager = commsMan; 195 CommsManager = commsMan;
196 m_sceneGridService = sceneGridService; 196 m_sceneGridService = sceneGridService;
197 storageManager = storeManager; 197 m_storageManager = storeManager;
198 assetCache = assetCach; 198 AssetCache = assetCach;
199 m_regInfo = regInfo; 199 m_regInfo = regInfo;
200 m_regionHandle = m_regInfo.RegionHandle; 200 m_regionHandle = m_regInfo.RegionHandle;
201 m_regionName = m_regInfo.RegionName; 201 m_regionName = m_regInfo.RegionName;
@@ -393,7 +393,7 @@ namespace OpenSim.Region.Environment.Scenes
393 phyScene.SetTerrain(Terrain.GetHeights1D()); 393 phyScene.SetTerrain(Terrain.GetHeights1D());
394 } 394 }
395 395
396 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); 396 m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
397 397
398 float[] terData = Terrain.GetHeights1D(); 398 float[] terData = Terrain.GetHeights1D();
399 399
@@ -470,7 +470,7 @@ namespace OpenSim.Region.Environment.Scenes
470 /// <returns></returns> 470 /// <returns></returns>
471 public bool Backup() 471 public bool Backup()
472 { 472 {
473 EventManager.TriggerOnBackup(storageManager.DataStore); 473 EventManager.TriggerOnBackup(m_storageManager.DataStore);
474 return true; 474 return true;
475 } 475 }
476 476
@@ -486,7 +486,7 @@ namespace OpenSim.Region.Environment.Scenes
486 { 486 {
487 try 487 try
488 { 488 {
489 double[,] map = storageManager.DataStore.LoadTerrain(RegionInfo.RegionID); 489 double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID);
490 if (map == null) 490 if (map == null)
491 { 491 {
492 if (string.IsNullOrEmpty(m_regInfo.EstateSettings.terrainFile)) 492 if (string.IsNullOrEmpty(m_regInfo.EstateSettings.terrainFile))
@@ -494,7 +494,7 @@ namespace OpenSim.Region.Environment.Scenes
494 MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain."); 494 MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain.");
495 Terrain.HillsGenerator(); 495 Terrain.HillsGenerator();
496 496
497 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); 497 m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
498 } 498 }
499 else 499 else
500 { 500 {
@@ -509,7 +509,7 @@ namespace OpenSim.Region.Environment.Scenes
509 "No terrain found in database or default. Generating a new terrain."); 509 "No terrain found in database or default. Generating a new terrain.");
510 Terrain.HillsGenerator(); 510 Terrain.HillsGenerator();
511 } 511 }
512 storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID); 512 m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
513 } 513 }
514 } 514 }
515 else 515 else
@@ -539,7 +539,7 @@ namespace OpenSim.Region.Environment.Scenes
539 asset.Name = "terrainImage"; 539 asset.Name = "terrainImage";
540 asset.Type = 0; 540 asset.Type = 0;
541 asset.Temporary = true; 541 asset.Temporary = true;
542 commsManager.AssetCache.AddAsset(asset); 542 AssetCache.AddAsset(asset);
543 } 543 }
544 544
545 #endregion 545 #endregion
@@ -552,7 +552,7 @@ namespace OpenSim.Region.Environment.Scenes
552 public virtual void LoadPrimsFromStorage() 552 public virtual void LoadPrimsFromStorage()
553 { 553 {
554 MainLog.Instance.Verbose("Loading objects from datastore"); 554 MainLog.Instance.Verbose("Loading objects from datastore");
555 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.RegionID); 555 List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(m_regInfo.RegionID);
556 foreach (SceneObjectGroup prim in PrimsFromDB) 556 foreach (SceneObjectGroup prim in PrimsFromDB)
557 { 557 {
558 AddEntityFromStorage(prim); 558 AddEntityFromStorage(prim);
@@ -790,8 +790,8 @@ namespace OpenSim.Region.Environment.Scenes
790 CreateAndAddScenePresence(client, child); 790 CreateAndAddScenePresence(client, child);
791 791
792 m_LandManager.sendParcelOverlay(client); 792 m_LandManager.sendParcelOverlay(client);
793 commsManager.UserProfileCache.AddNewUser(client.AgentId); 793 CommsManager.UserProfileCache.AddNewUser(client.AgentId);
794 commsManager.TransactionsManager.AddUser(client.AgentId); 794 CommsManager.TransactionsManager.AddUser(client.AgentId);
795 } 795 }
796 796
797 protected virtual void SubscribeToClientEvents(IClientAPI client) 797 protected virtual void SubscribeToClientEvents(IClientAPI client)
@@ -818,7 +818,7 @@ namespace OpenSim.Region.Environment.Scenes
818 client.OnGrabUpdate += m_innerScene.MoveObject; 818 client.OnGrabUpdate += m_innerScene.MoveObject;
819 client.OnDeRezObject += DeRezObject; 819 client.OnDeRezObject += DeRezObject;
820 client.OnRezObject += RezObject; 820 client.OnRezObject += RezObject;
821 client.OnNameFromUUIDRequest += commsManager.HandleUUIDNameRequest; 821 client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest;
822 client.OnObjectDescription += m_innerScene.PrimDescription; 822 client.OnObjectDescription += m_innerScene.PrimDescription;
823 client.OnObjectName += m_innerScene.PrimName; 823 client.OnObjectName += m_innerScene.PrimName;
824 client.OnLinkObjects += m_innerScene.LinkObjects; 824 client.OnLinkObjects += m_innerScene.LinkObjects;
@@ -837,13 +837,13 @@ namespace OpenSim.Region.Environment.Scenes
837 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); 837 client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
838 838
839 client.OnCreateNewInventoryItem += CreateNewInventoryItem; 839 client.OnCreateNewInventoryItem += CreateNewInventoryItem;
840 client.OnCreateNewInventoryFolder += commsManager.UserProfileCache.HandleCreateInventoryFolder; 840 client.OnCreateNewInventoryFolder += CommsManager.UserProfileCache.HandleCreateInventoryFolder;
841 client.OnFetchInventoryDescendents += commsManager.UserProfileCache.HandleFecthInventoryDescendents; 841 client.OnFetchInventoryDescendents += CommsManager.UserProfileCache.HandleFecthInventoryDescendents;
842 client.OnRequestTaskInventory += RequestTaskInventory; 842 client.OnRequestTaskInventory += RequestTaskInventory;
843 client.OnFetchInventory += commsManager.UserProfileCache.HandleFetchInventory; 843 client.OnFetchInventory += CommsManager.UserProfileCache.HandleFetchInventory;
844 client.OnUpdateInventoryItem += UDPUpdateInventoryItemAsset; 844 client.OnUpdateInventoryItem += UDPUpdateInventoryItemAsset;
845 client.OnAssetUploadRequest += commsManager.TransactionsManager.HandleUDPUploadRequest; 845 client.OnAssetUploadRequest += CommsManager.TransactionsManager.HandleUDPUploadRequest;
846 client.OnXferReceive += commsManager.TransactionsManager.HandleXfer; 846 client.OnXferReceive += CommsManager.TransactionsManager.HandleXfer;
847 client.OnRezScript += RezScript; 847 client.OnRezScript += RezScript;
848 client.OnRemoveTaskItem += RemoveTaskInventory; 848 client.OnRemoveTaskItem += RemoveTaskInventory;
849 849
@@ -904,7 +904,7 @@ namespace OpenSim.Region.Environment.Scenes
904 avatar.Close(); 904 avatar.Close();
905 905
906 // Remove client agent from profile, so new logins will work 906 // Remove client agent from profile, so new logins will work
907 commsManager.UserService.clearUserAgent(agentID); 907 CommsManager.UserService.clearUserAgent(agentID);
908 908
909 return; 909 return;
910 } 910 }
@@ -926,7 +926,7 @@ namespace OpenSim.Region.Environment.Scenes
926 if (Entities.ContainsKey(entID)) 926 if (Entities.ContainsKey(entID))
927 { 927 {
928 Entities.Remove(entID); 928 Entities.Remove(entID);
929 storageManager.DataStore.RemoveObject(entID, m_regInfo.RegionID); 929 m_storageManager.DataStore.RemoveObject(entID, m_regInfo.RegionID);
930 return true; 930 return true;
931 } 931 }
932 return false; 932 return false;
@@ -963,7 +963,7 @@ namespace OpenSim.Region.Environment.Scenes
963 if (agent.CapsPath != "") 963 if (agent.CapsPath != "")
964 { 964 {
965 Caps cap = 965 Caps cap =
966 new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, 966 new Caps(AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port,
967 agent.CapsPath, agent.AgentID, m_dumpAssetsToFile); 967 agent.CapsPath, agent.AgentID, m_dumpAssetsToFile);
968 968
969 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + 969 Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() +
@@ -971,18 +971,18 @@ namespace OpenSim.Region.Environment.Scenes
971 cap.RegisterHandlers(); 971 cap.RegisterHandlers();
972 cap.AddNewInventoryItem = AddInventoryItem; 972 cap.AddNewInventoryItem = AddInventoryItem;
973 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset; 973 cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
974 if (capsHandlers.ContainsKey(agent.AgentID)) 974 if (m_capsHandlers.ContainsKey(agent.AgentID))
975 { 975 {
976 //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + 976 //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +
977 // agent.AgentID.ToStringHyphenated()); 977 // agent.AgentID.ToStringHyphenated());
978 capsHandlers[agent.AgentID] = cap; 978 m_capsHandlers[agent.AgentID] = cap;
979 } 979 }
980 else 980 else
981 { 981 {
982 capsHandlers.Add(agent.AgentID, cap); 982 m_capsHandlers.Add(agent.AgentID, cap);
983 } 983 }
984 } 984 }
985 authenticateHandler.AddNewCircuit(agent.circuitcode, agent); 985 m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
986 } 986 }
987 } 987 }
988 988