aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorMW2007-09-10 06:45:54 +0000
committerMW2007-09-10 06:45:54 +0000
commit15423539f98d47201a819e35f80b0c30ee459556 (patch)
tree3eb7831bfaaf5e0309c49f966d19869a9fe72e2b /OpenSim/Region/Environment
parent* Fixed: Accessing xmlrpc with invalid xml data would crash the sim. (diff)
downloadopensim-SC_OLD-15423539f98d47201a819e35f80b0c30ee459556.zip
opensim-SC_OLD-15423539f98d47201a819e35f80b0c30ee459556.tar.gz
opensim-SC_OLD-15423539f98d47201a819e35f80b0c30ee459556.tar.bz2
opensim-SC_OLD-15423539f98d47201a819e35f80b0c30ee459556.tar.xz
hooked up sdague new sqlite asset database provider to the old asset system. So we can still use sqlite for assets while we wait for the rest of the new asset system to be wrote.
Needs more testing, so if it causes problems will have to swap back to db4o.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Interfaces/IXfer.cs11
-rw-r--r--OpenSim/Region/Environment/ModuleLoader.cs33
-rw-r--r--OpenSim/Region/Environment/Modules/XferModule.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs5
-rw-r--r--OpenSim/Region/Environment/Types/UpdateQueue.cs33
8 files changed, 75 insertions, 30 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/IXfer.cs b/OpenSim/Region/Environment/Interfaces/IXfer.cs
new file mode 100644
index 0000000..a19ba8d
--- /dev/null
+++ b/OpenSim/Region/Environment/Interfaces/IXfer.cs
@@ -0,0 +1,11 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Region.Environment.Interfaces
6{
7 public interface IXfer
8 {
9 bool AddNewFile(string fileName, byte[] data);
10 }
11}
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index be3384b..ea416cb 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -28,27 +28,23 @@ namespace OpenSim.Region.Environment
28 /// <param name="scene"></param> 28 /// <param name="scene"></param>
29 public void CreateDefaultModules(Scene scene, string exceptModules) 29 public void CreateDefaultModules(Scene scene, string exceptModules)
30 { 30 {
31 XferModule xferManager = new XferModule(); 31 IRegionModule module = new XferModule();
32 xferManager.Initialise(scene); 32 InitialiseModule(module, scene);
33 scene.AddModule(xferManager.GetName(), xferManager);
34 LoadedModules.Add(xferManager);
35 33
36 ChatModule chatModule = new ChatModule(); 34 module = new ChatModule();
37 chatModule.Initialise(scene); 35 InitialiseModule(module, scene);
38 scene.AddModule(chatModule.GetName(), chatModule); 36
39 LoadedModules.Add(chatModule); 37 module = new AvatarProfilesModule();
40 38 InitialiseModule(module, scene);
41 AvatarProfilesModule avatarProfiles = new AvatarProfilesModule();
42 avatarProfiles.Initialise(scene);
43 scene.AddModule(avatarProfiles.GetName(), avatarProfiles);
44 LoadedModules.Add(avatarProfiles);
45 39
46 this.LoadRegionModule("OpenSim.Region.ExtensionsScriptModule.dll", "ExtensionsScriptingModule", scene); 40 this.LoadRegionModule("OpenSim.Region.ExtensionsScriptModule.dll", "ExtensionsScriptingModule", scene);
47 41
48 string lslPath = System.IO.Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine.DotNetEngine.dll"); 42 string lslPath = System.IO.Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine.DotNetEngine.dll");
49 this.LoadRegionModule(lslPath, "LSLScriptingModule", scene); 43 this.LoadRegionModule(lslPath, "LSLScriptingModule", scene);
44
50 } 45 }
51 46
47
52 public void LoadDefaultSharedModules(string exceptModules) 48 public void LoadDefaultSharedModules(string exceptModules)
53 { 49 {
54 DynamicTextureModule dynamicModule = new DynamicTextureModule(); 50 DynamicTextureModule dynamicModule = new DynamicTextureModule();
@@ -64,6 +60,13 @@ namespace OpenSim.Region.Environment
64 } 60 }
65 } 61 }
66 62
63 private void InitialiseModule(IRegionModule module, Scene scene)
64 {
65 module.Initialise(scene);
66 scene.AddModule(module.GetName(), module);
67 LoadedModules.Add(module);
68 }
69
67 /// <summary> 70 /// <summary>
68 /// Loads/initialises a Module instance that can be used by mutliple Regions 71 /// Loads/initialises a Module instance that can be used by mutliple Regions
69 /// </summary> 72 /// </summary>
@@ -84,9 +87,7 @@ namespace OpenSim.Region.Environment
84 IRegionModule module = this.LoadModule(dllName, moduleName); 87 IRegionModule module = this.LoadModule(dllName, moduleName);
85 if (module != null) 88 if (module != null)
86 { 89 {
87 module.Initialise(scene); 90 this.InitialiseModule(module, scene);
88 scene.AddModule(module.GetName(), module);
89 LoadedModules.Add(module);
90 } 91 }
91 } 92 }
92 93
diff --git a/OpenSim/Region/Environment/Modules/XferModule.cs b/OpenSim/Region/Environment/Modules/XferModule.cs
index eec9f97..44b4d7a 100644
--- a/OpenSim/Region/Environment/Modules/XferModule.cs
+++ b/OpenSim/Region/Environment/Modules/XferModule.cs
@@ -10,7 +10,7 @@ using OpenSim.Region.Environment.Interfaces;
10 10
11namespace OpenSim.Region.Environment.Modules 11namespace OpenSim.Region.Environment.Modules
12{ 12{
13 public class XferModule : IRegionModule 13 public class XferModule : IRegionModule, IXfer
14 { 14 {
15 public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>(); 15 public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
16 public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>(); 16 public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
@@ -27,7 +27,7 @@ namespace OpenSim.Region.Environment.Modules
27 m_scene = scene; 27 m_scene = scene;
28 m_scene.EventManager.OnNewClient += NewClient; 28 m_scene.EventManager.OnNewClient += NewClient;
29 29
30 m_scene.RegisterAPIMethod("API_AddXferFile", new ModuleAPIMethod2<bool, string, byte[]>(this.AddNewFile)); 30 m_scene.RegisterModuleInterface<IXfer>(this);
31 } 31 }
32 32
33 public void PostInitialise() 33 public void PostInitialise()
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index e5ab41f..70b34cf 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -201,9 +201,9 @@ namespace OpenSim.Region.Environment.Scenes
201 bool fileChange = ((SceneObjectGroup)ent).GetPartInventoryFileName(remoteClient, primLocalID); 201 bool fileChange = ((SceneObjectGroup)ent).GetPartInventoryFileName(remoteClient, primLocalID);
202 if (fileChange) 202 if (fileChange)
203 { 203 {
204 if (this.AddXferFile != null) 204 if (this.XferManager != null)
205 { 205 {
206 ((SceneObjectGroup)ent).RequestInventoryFile(primLocalID, AddXferFile); 206 ((SceneObjectGroup)ent).RequestInventoryFile(primLocalID, XferManager);
207 } 207 }
208 } 208 }
209 break; 209 break;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 1af41be..d0edcda 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -91,10 +91,9 @@ namespace OpenSim.Region.Environment.Scenes
91 public Dictionary<Type, object> ModuleInterfaces = new Dictionary<Type, object>(); 91 public Dictionary<Type, object> ModuleInterfaces = new Dictionary<Type, object>();
92 protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); 92 protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>();
93 93
94 //API method Delegates and interfaces 94 //API module interfaces
95 95
96 // this most likely shouldn't be handled as a API method like this, but doing it for testing purposes 96 public IXfer XferManager;
97 public ModuleAPIMethod2<bool, string, byte[]> AddXferFile = null;
98 97
99 private IHttpRequests m_httpRequestModule = null; 98 private IHttpRequests m_httpRequestModule = null;
100 private ISimChat m_simChatModule = null; 99 private ISimChat m_simChatModule = null;
@@ -206,8 +205,7 @@ namespace OpenSim.Region.Environment.Scenes
206 m_simChatModule = this.RequestModuleInterface<ISimChat>(); 205 m_simChatModule = this.RequestModuleInterface<ISimChat>();
207 m_httpRequestModule = this.RequestModuleInterface<IHttpRequests>(); 206 m_httpRequestModule = this.RequestModuleInterface<IHttpRequests>();
208 207
209 //should change so it uses the module interface functions 208 XferManager = this.RequestModuleInterface<IXfer>();
210 AddXferFile = (ModuleAPIMethod2<bool, string, byte[]>)this.RequestAPIMethod("API_AddXferFile");
211 } 209 }
212 210
213 #region Script Handling Methods 211 #region Script Handling Methods
@@ -605,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes
605 { 603 {
606 if (!Entities.ContainsKey(sceneObject.UUID)) 604 if (!Entities.ContainsKey(sceneObject.UUID))
607 { 605 {
608 QuadTree.AddObject(sceneObject); 606 // QuadTree.AddObject(sceneObject);
609 Entities.Add(sceneObject.UUID, sceneObject); 607 Entities.Add(sceneObject.UUID, sceneObject);
610 } 608 }
611 } 609 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 45d975c..eff622a 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -11,6 +11,7 @@ using OpenSim.Framework.Interfaces;
11using OpenSim.Framework.Types; 11using OpenSim.Framework.Types;
12using OpenSim.Region.Physics.Manager; 12using OpenSim.Region.Physics.Manager;
13using OpenSim.Framework.Data; 13using OpenSim.Framework.Data;
14using OpenSim.Region.Environment.Interfaces;
14 15
15namespace OpenSim.Region.Environment.Scenes 16namespace OpenSim.Region.Environment.Scenes
16{ 17{
@@ -676,12 +677,12 @@ namespace OpenSim.Region.Environment.Scenes
676 return false; 677 return false;
677 } 678 }
678 679
679 public string RequestInventoryFile(uint localID, ModuleAPIMethod2<bool, string, byte[]> addXferFile) 680 public string RequestInventoryFile(uint localID, IXfer xferManager)
680 { 681 {
681 SceneObjectPart part = this.GetChildPart(localID); 682 SceneObjectPart part = this.GetChildPart(localID);
682 if (part != null) 683 if (part != null)
683 { 684 {
684 part.RequestInventoryFile(addXferFile); 685 part.RequestInventoryFile(xferManager);
685 } 686 }
686 return ""; 687 return "";
687 } 688 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 9e207c8..2122a4f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -12,6 +12,7 @@ using OpenSim.Framework.Types;
12using OpenSim.Region.Environment.Scenes.Scripting; 12using OpenSim.Region.Environment.Scenes.Scripting;
13using OpenSim.Framework.Utilities; 13using OpenSim.Framework.Utilities;
14using OpenSim.Region.Physics.Manager; 14using OpenSim.Region.Physics.Manager;
15using OpenSim.Region.Environment.Interfaces;
15 16
16namespace OpenSim.Region.Environment.Scenes 17namespace OpenSim.Region.Environment.Scenes
17{ 18{
@@ -494,7 +495,7 @@ namespace OpenSim.Region.Environment.Scenes
494 return false; 495 return false;
495 } 496 }
496 497
497 public string RequestInventoryFile(ModuleAPIMethod2<bool, string, byte[]> addXferFile) 498 public string RequestInventoryFile(IXfer xferManager)
498 { 499 {
499 byte[] fileData = new byte[0]; 500 byte[] fileData = new byte[0];
500 InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, this.UUID); 501 InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, this.UUID);
@@ -528,7 +529,7 @@ namespace OpenSim.Region.Environment.Scenes
528 fileData = Helpers.StringToField(invString.BuildString); 529 fileData = Helpers.StringToField(invString.BuildString);
529 if (fileData.Length > 2) 530 if (fileData.Length > 2)
530 { 531 {
531 addXferFile(m_inventoryFileName, fileData); 532 xferManager.AddNewFile(m_inventoryFileName, fileData);
532 } 533 }
533 return ""; 534 return "";
534 } 535 }
diff --git a/OpenSim/Region/Environment/Types/UpdateQueue.cs b/OpenSim/Region/Environment/Types/UpdateQueue.cs
index d7eb6ee..dab4258 100644
--- a/OpenSim/Region/Environment/Types/UpdateQueue.cs
+++ b/OpenSim/Region/Environment/Types/UpdateQueue.cs
@@ -12,10 +12,43 @@ namespace OpenSim.Region.Environment.Types
12 12
13 private List<LLUUID> m_ids; 13 private List<LLUUID> m_ids;
14 14
15 public int Count
16 {
17 get { return m_queue.Count; }
18 }
19
15 public UpdateQueue() 20 public UpdateQueue()
16 { 21 {
17 m_queue = new Queue<SceneObjectPart>(); 22 m_queue = new Queue<SceneObjectPart>();
18 m_ids = new List<LLUUID>(); 23 m_ids = new List<LLUUID>();
19 } 24 }
25
26 public void Enqueue(SceneObjectPart part)
27 {
28 lock (m_ids)
29 {
30 if (!m_ids.Contains(part.UUID))
31 {
32 m_ids.Add(part.UUID);
33 m_queue.Enqueue(part);
34 }
35 }
36 }
37
38 public SceneObjectPart Dequeue()
39 {
40 SceneObjectPart part = null;
41 if (m_queue.Count > 0)
42 {
43 part = m_queue.Dequeue();
44 lock (m_ids)
45 {
46 m_ids.Remove(part.UUID);
47 }
48 }
49
50 return part;
51 }
52
20 } 53 }
21} 54}