aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/CAPSService.cs16
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs14
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetTransactions.cs28
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs9
-rw-r--r--OpenSim/Framework/Communications/Cache/InventoryFolder.cs26
-rw-r--r--OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs10
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCache.cs23
-rw-r--r--OpenSim/Framework/Communications/Capabilities/Caps.cs46
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs5
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs7
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs4
-rw-r--r--OpenSim/Grid/AssetServer/Main.cs8
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs103
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs11
-rw-r--r--OpenSim/Region/Communications/Local/LocalInventoryService.cs10
-rw-r--r--OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs2
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs4
-rw-r--r--OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs13
-rw-r--r--OpenSim/Region/Environment/ModuleLoader.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs57
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs29
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs75
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs2
26 files changed, 300 insertions, 213 deletions
diff --git a/OpenSim/Framework/Communications/CAPSService.cs b/OpenSim/Framework/Communications/CAPSService.cs
index 6f65551..b60ef02 100644
--- a/OpenSim/Framework/Communications/CAPSService.cs
+++ b/OpenSim/Framework/Communications/CAPSService.cs
@@ -26,21 +26,9 @@
26* 26*
27*/ 27*/
28 28
29using System;
30using System.Collections;
31using System.Collections.Generic;
32using System.Reflection;
33using System.Security.Cryptography;
34using libsecondlife;
35using Nwc.XmlRpc;
36using OpenSim.Framework.Console;
37using OpenSim.Framework.Data;
38using OpenSim.Framework.Interfaces;
39using OpenSim.Framework.Inventory;
40using OpenSim.Framework.Utilities;
41using OpenSim.Framework.Servers; 29using OpenSim.Framework.Servers;
42 30
43namespace OpenSim.Framework.UserManagement 31namespace OpenSim.Framework.Communications
44{ 32{
45 public class CAPSService 33 public class CAPSService
46 { 34 {
@@ -63,4 +51,4 @@ namespace OpenSim.Framework.UserManagement
63 return ""; 51 return "";
64 } 52 }
65 } 53 }
66} 54} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
index 42c0a8e..2c1e5c8 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs
@@ -36,17 +36,19 @@ using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 36using OpenSim.Framework.Utilities;
37using OpenSim.Framework.Data; 37using OpenSim.Framework.Data;
38 38
39namespace OpenSim.Framework.Communications.Caches 39namespace OpenSim.Framework.Communications.Cache
40{ 40{
41 public class AssetTransactionManager 41 public class AssetTransactionManager
42 { 42 {
43 // Fields 43 // Fields
44 public CommunicationsManager CommsManager; 44 public CommunicationsManager CommsManager;
45 public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = new Dictionary<LLUUID, AgentAssetTransactions>(); 45 public Dictionary<LLUUID, AgentAssetTransactions> AgentTransactions = new Dictionary<LLUUID, AgentAssetTransactions>();
46 private bool m_dumpAssetsToFile;
46 47
47 public AssetTransactionManager(CommunicationsManager commsManager) 48 public AssetTransactionManager(CommunicationsManager commsManager, bool dumpAssetsToFile)
48 { 49 {
49 CommsManager = commsManager; 50 CommsManager = commsManager;
51 m_dumpAssetsToFile = dumpAssetsToFile;
50 } 52 }
51 53
52 // Methods 54 // Methods
@@ -54,7 +56,7 @@ namespace OpenSim.Framework.Communications.Caches
54 { 56 {
55 if (!this.AgentTransactions.ContainsKey(userID)) 57 if (!this.AgentTransactions.ContainsKey(userID))
56 { 58 {
57 AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this); 59 AgentAssetTransactions transactions = new AgentAssetTransactions(userID, this, m_dumpAssetsToFile);
58 this.AgentTransactions.Add(userID, transactions); 60 this.AgentTransactions.Add(userID, transactions);
59 return transactions; 61 return transactions;
60 } 62 }
@@ -82,7 +84,7 @@ namespace OpenSim.Framework.Communications.Caches
82 84
83 public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal) 85 public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal)
84 { 86 {
85 // Console.WriteLine("asset upload of " + assetID); 87 // Console.WriteLine("asset upload of " + assetID);
86 AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId); 88 AgentAssetTransactions transactions = this.GetUserTransActions(remoteClient.AgentId);
87 if (transactions != null) 89 if (transactions != null)
88 { 90 {
@@ -103,6 +105,4 @@ namespace OpenSim.Framework.Communications.Caches
103 } 105 }
104 } 106 }
105 } 107 }
106} 108} \ No newline at end of file
107
108
diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
index 51fc462..581e300 100644
--- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs
@@ -39,7 +39,7 @@ using OpenSim.Framework.Utilities;
39using OpenSim.Region.Capabilities; 39using OpenSim.Region.Capabilities;
40using OpenSim.Framework.Servers; 40using OpenSim.Framework.Servers;
41 41
42namespace OpenSim.Framework.Communications.Caches 42namespace OpenSim.Framework.Communications.Cache
43{ 43{
44 public class AgentAssetTransactions 44 public class AgentAssetTransactions
45 { 45 {
@@ -49,12 +49,14 @@ namespace OpenSim.Framework.Communications.Caches
49 public LLUUID UserID; 49 public LLUUID UserID;
50 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>(); 50 public Dictionary<LLUUID, AssetXferUploader> XferUploaders = new Dictionary<LLUUID, AssetXferUploader>();
51 public AssetTransactionManager Manager; 51 public AssetTransactionManager Manager;
52 private bool m_dumpAssetsToFile;
52 53
53 // Methods 54 // Methods
54 public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager) 55 public AgentAssetTransactions(LLUUID agentID, AssetTransactionManager manager, bool dumpAssetsToFile)
55 { 56 {
56 this.UserID = agentID; 57 this.UserID = agentID;
57 Manager = manager; 58 Manager = manager;
59 m_dumpAssetsToFile = dumpAssetsToFile;
58 } 60 }
59 61
60 public AssetCapsUploader RequestCapsUploader() 62 public AssetCapsUploader RequestCapsUploader()
@@ -75,7 +77,7 @@ namespace OpenSim.Framework.Communications.Caches
75 { 77 {
76 if (!this.XferUploaders.ContainsKey(transactionID)) 78 if (!this.XferUploaders.ContainsKey(transactionID))
77 { 79 {
78 AssetXferUploader uploader = new AssetXferUploader(this); 80 AssetXferUploader uploader = new AssetXferUploader(this, m_dumpAssetsToFile);
79 81
80 this.XferUploaders.Add(transactionID, uploader); 82 this.XferUploaders.Add(transactionID, uploader);
81 return uploader; 83 return uploader;
@@ -122,14 +124,14 @@ namespace OpenSim.Framework.Communications.Caches
122 private string m_assetName = ""; 124 private string m_assetName = "";
123 private LLUUID m_folderID; 125 private LLUUID m_folderID;
124 private LLUUID newAssetID; 126 private LLUUID newAssetID;
125 private bool SaveImages = false; 127 private bool m_dumpImageToFile;
126 private string uploaderPath = ""; 128 private string uploaderPath = "";
127 129
128 // Events 130 // Events
129 public event UpLoadedAsset OnUpLoad; 131 public event UpLoadedAsset OnUpLoad;
130 132
131 // Methods 133 // Methods
132 public void Initialise(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID folderID, string path, BaseHttpServer httpServer) 134 public void Initialise(string assetName, string assetDescription, LLUUID assetID, LLUUID inventoryItem, LLUUID folderID, string path, BaseHttpServer httpServer, bool dumpImageToFile)
133 { 135 {
134 this.m_assetName = assetName; 136 this.m_assetName = assetName;
135 this.m_assetDescription = assetDescription; 137 this.m_assetDescription = assetDescription;
@@ -138,6 +140,7 @@ namespace OpenSim.Framework.Communications.Caches
138 this.inventoryItemID = inventoryItem; 140 this.inventoryItemID = inventoryItem;
139 this.uploaderPath = path; 141 this.uploaderPath = path;
140 this.httpListener = httpServer; 142 this.httpListener = httpServer;
143 m_dumpImageToFile = dumpImageToFile;
141 } 144 }
142 145
143 private void SaveImageToFile(string filename, byte[] data) 146 private void SaveImageToFile(string filename, byte[] data)
@@ -159,7 +162,7 @@ namespace OpenSim.Framework.Communications.Caches
159 complete.state = "complete"; 162 complete.state = "complete";
160 text = LLSDHelpers.SerialiseLLSDReply(complete); 163 text = LLSDHelpers.SerialiseLLSDReply(complete);
161 this.httpListener.RemoveStreamHandler("POST", this.uploaderPath); 164 this.httpListener.RemoveStreamHandler("POST", this.uploaderPath);
162 if (this.SaveImages) 165 if (this.m_dumpImageToFile)
163 { 166 {
164 this.SaveImageToFile(this.m_assetName + ".jp2", data); 167 this.SaveImageToFile(this.m_assetName + ".jp2", data);
165 } 168 }
@@ -190,10 +193,12 @@ namespace OpenSim.Framework.Communications.Caches
190 private bool m_createItem = false; 193 private bool m_createItem = false;
191 private AgentAssetTransactions m_userTransactions; 194 private AgentAssetTransactions m_userTransactions;
192 private bool m_storeLocal; 195 private bool m_storeLocal;
196 private bool m_dumpAssetToFile;
193 197
194 public AssetXferUploader(AgentAssetTransactions transactions) 198 public AssetXferUploader(AgentAssetTransactions transactions, bool dumpAssetToFile)
195 { 199 {
196 this.m_userTransactions = transactions; 200 this.m_userTransactions = transactions;
201 m_dumpAssetToFile = dumpAssetToFile;
197 } 202 }
198 203
199 // Methods 204 // Methods
@@ -278,9 +283,14 @@ namespace OpenSim.Framework.Communications.Caches
278 this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset); 283 this.m_userTransactions.Manager.CommsManager.AssetCache.AddAsset(this.Asset);
279 } 284 }
280 285
281 // Console.WriteLine("upload complete "+ this.TransactionID); 286 // Console.WriteLine("upload complete "+ this.TransactionID);
282 //SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data); 287
288 if (m_dumpAssetToFile)
289 {
290 SaveAssetToFile("testudpupload" + Util.RandomClass.Next(1, 1000) + ".dat", this.Asset.Data);
291 }
283 } 292 }
293
284 private void SaveAssetToFile(string filename, byte[] data) 294 private void SaveAssetToFile(string filename, byte[] data)
285 { 295 {
286 FileStream fs = File.Create(filename); 296 FileStream fs = File.Create(filename);
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index b1432ff..92b21a8 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -27,7 +27,6 @@
27*/ 27*/
28using libsecondlife; 28using libsecondlife;
29using OpenSim.Framework.Types; 29using OpenSim.Framework.Types;
30using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
31 30
32namespace OpenSim.Framework.Communications.Cache 31namespace OpenSim.Framework.Communications.Cache
33{ 32{
@@ -35,7 +34,7 @@ namespace OpenSim.Framework.Communications.Cache
35 { 34 {
36 private readonly CommunicationsManager m_parentCommsManager; 35 private readonly CommunicationsManager m_parentCommsManager;
37 // Fields 36 // Fields
38 public InventoryFolder RootFolder = null; 37 public InventoryFolderImpl RootFolder = null;
39 public UserProfileData UserProfile = null; 38 public UserProfileData UserProfile = null;
40 39
41 public CachedUserInfo(CommunicationsManager commsManager) 40 public CachedUserInfo(CommunicationsManager commsManager)
@@ -44,7 +43,7 @@ namespace OpenSim.Framework.Communications.Cache
44 } 43 }
45 44
46 // Methods 45 // Methods
47 public void FolderReceive(LLUUID userID, InventoryFolder folderInfo) 46 public void FolderReceive(LLUUID userID, InventoryFolderImpl folderInfo)
48 { 47 {
49 if (userID == this.UserProfile.UUID) 48 if (userID == this.UserProfile.UUID)
50 { 49 {
@@ -61,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
61 } 60 }
62 else 61 else
63 { 62 {
64 InventoryFolder folder = this.RootFolder.HasSubFolder(folderInfo.parentID); 63 InventoryFolderImpl folder = this.RootFolder.HasSubFolder(folderInfo.parentID);
65 if (folder != null) 64 if (folder != null)
66 { 65 {
67 folder.SubFolders.Add(folderInfo.folderID, folderInfo); 66 folder.SubFolders.Add(folderInfo.folderID, folderInfo);
@@ -80,7 +79,7 @@ namespace OpenSim.Framework.Communications.Cache
80 } 79 }
81 else 80 else
82 { 81 {
83 InventoryFolder folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID); 82 InventoryFolderImpl folder = this.RootFolder.HasSubFolder(itemInfo.parentFolderID);
84 if (folder != null) 83 if (folder != null)
85 { 84 {
86 folder.Items.Add(itemInfo.inventoryID, itemInfo); 85 folder.Items.Add(itemInfo.inventoryID, itemInfo);
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
index fbe1bd0..af3346f 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
@@ -35,15 +35,15 @@ using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types; 35using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 36using OpenSim.Framework.Utilities;
37 37
38namespace OpenSim.Framework.Communications.Caches 38namespace OpenSim.Framework.Communications.Cache
39{ 39{
40 public class InventoryFolder : InventoryFolderBase 40 public class InventoryFolderImpl : InventoryFolderBase
41 { 41 {
42 // Fields 42 // Fields
43 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); 43 public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
44 public Dictionary<LLUUID, InventoryFolder> SubFolders = new Dictionary<LLUUID, InventoryFolder>(); 44 public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
45 45
46 public InventoryFolder(InventoryFolderBase folderbase) 46 public InventoryFolderImpl(InventoryFolderBase folderbase)
47 { 47 {
48 this.agentID = folderbase.agentID; 48 this.agentID = folderbase.agentID;
49 this.folderID = folderbase.folderID; 49 this.folderID = folderbase.folderID;
@@ -53,15 +53,15 @@ namespace OpenSim.Framework.Communications.Caches
53 this.version = folderbase.version; 53 this.version = folderbase.version;
54 } 54 }
55 55
56 public InventoryFolder() 56 public InventoryFolderImpl()
57 { 57 {
58 58
59 } 59 }
60 60
61 // Methods 61 // Methods
62 public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) 62 public InventoryFolderImpl CreateNewSubFolder(LLUUID folderID, string folderName, ushort type)
63 { 63 {
64 InventoryFolder subFold = new InventoryFolder(); 64 InventoryFolderImpl subFold = new InventoryFolderImpl();
65 subFold.name = folderName; 65 subFold.name = folderName;
66 subFold.folderID = folderID; 66 subFold.folderID = folderID;
67 subFold.type = (short) type; 67 subFold.type = (short) type;
@@ -78,7 +78,7 @@ namespace OpenSim.Framework.Communications.Caches
78 { 78 {
79 return this.Items[itemID]; 79 return this.Items[itemID];
80 } 80 }
81 foreach (InventoryFolder folder in this.SubFolders.Values) 81 foreach (InventoryFolderImpl folder in this.SubFolders.Values)
82 { 82 {
83 base2 = folder.HasItem(itemID); 83 base2 = folder.HasItem(itemID);
84 if (base2 != null) 84 if (base2 != null)
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.Communications.Caches
97 Items.Remove(itemID); 97 Items.Remove(itemID);
98 return true; 98 return true;
99 } 99 }
100 foreach (InventoryFolder folder in this.SubFolders.Values) 100 foreach (InventoryFolderImpl folder in this.SubFolders.Values)
101 { 101 {
102 found = folder.DeleteItem(itemID); 102 found = folder.DeleteItem(itemID);
103 if (found == true) 103 if (found == true)
@@ -109,16 +109,16 @@ namespace OpenSim.Framework.Communications.Caches
109 } 109 }
110 110
111 111
112 public InventoryFolder HasSubFolder(LLUUID folderID) 112 public InventoryFolderImpl HasSubFolder(LLUUID folderID)
113 { 113 {
114 InventoryFolder returnFolder = null; 114 InventoryFolderImpl returnFolder = null;
115 if (this.SubFolders.ContainsKey(folderID)) 115 if (this.SubFolders.ContainsKey(folderID))
116 { 116 {
117 returnFolder = this.SubFolders[folderID]; 117 returnFolder = this.SubFolders[folderID];
118 } 118 }
119 else 119 else
120 { 120 {
121 foreach (InventoryFolder folder in this.SubFolders.Values) 121 foreach (InventoryFolderImpl folder in this.SubFolders.Values)
122 { 122 {
123 returnFolder = folder.HasSubFolder(folderID); 123 returnFolder = folder.HasSubFolder(folderID);
124 if (returnFolder != null) 124 if (returnFolder != null)
@@ -140,4 +140,4 @@ namespace OpenSim.Framework.Communications.Caches
140 return itemList; 140 return itemList;
141 } 141 }
142 } 142 }
143} 143} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index 13ce39e..86e26f0 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -35,16 +35,16 @@ using OpenSim.Framework.Types;
35using OpenSim.Framework.Utilities; 35using OpenSim.Framework.Utilities;
36using Nini.Config; 36using Nini.Config;
37 37
38namespace OpenSim.Framework.Communications.Caches 38namespace OpenSim.Framework.Communications.Cache
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// Basically a hack to give us a Inventory library while we don't have a inventory server 41 /// Basically a hack to give us a Inventory library while we don't have a inventory server
42 /// once the server is fully implemented then should read the data from that 42 /// once the server is fully implemented then should read the data from that
43 /// </summary> 43 /// </summary>
44 public class LibraryRootFolder : InventoryFolder 44 public class LibraryRootFolder : Cache.InventoryFolderImpl
45 { 45 {
46 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000"); 46 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
47 private InventoryFolder m_textureFolder; 47 private Cache.InventoryFolderImpl m_textureFolder;
48 48
49 public LibraryRootFolder() 49 public LibraryRootFolder()
50 { 50 {
@@ -55,7 +55,7 @@ namespace OpenSim.Framework.Communications.Caches
55 this.type = (short)-1; 55 this.type = (short)-1;
56 this.version = (ushort)1; 56 this.version = (ushort)1;
57 57
58 InventoryFolder folderInfo = new InventoryFolder(); 58 Cache.InventoryFolderImpl folderInfo = new InventoryFolderImpl();
59 folderInfo.agentID = libOwner; 59 folderInfo.agentID = libOwner;
60 folderInfo.folderID = new LLUUID("00000112-000f-0000-0000-000100bba001"); 60 folderInfo.folderID = new LLUUID("00000112-000f-0000-0000-000100bba001");
61 folderInfo.name = "Texture Library"; 61 folderInfo.name = "Texture Library";
@@ -242,4 +242,4 @@ namespace OpenSim.Framework.Communications.Caches
242 } 242 }
243 243
244 } 244 }
245} 245} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index 362ab17..bd7aeef 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -36,7 +36,7 @@ using OpenSim.Framework.Interfaces;
36using OpenSim.Framework.Types; 36using OpenSim.Framework.Types;
37using OpenSim.Framework.Utilities; 37using OpenSim.Framework.Utilities;
38 38
39namespace OpenSim.Framework.Communications.Caches 39namespace OpenSim.Framework.Communications.Cache
40{ 40{
41 public class UserProfileCache 41 public class UserProfileCache
42 { 42 {
@@ -107,15 +107,15 @@ namespace OpenSim.Framework.Communications.Caches
107 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId]; 107 CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
108 if (info.RootFolder.folderID == parentID) 108 if (info.RootFolder.folderID == parentID)
109 { 109 {
110 InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); 110 InventoryFolderImpl createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
111 if (createdFolder != null) 111 if (createdFolder != null)
112 { 112 {
113 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); 113 this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
114 } 114 }
115 } 115 }
116 else 116 else
117 { 117 {
118 InventoryFolder folder = info.RootFolder.HasSubFolder(parentID); 118 InventoryFolderImpl folder = info.RootFolder.HasSubFolder(parentID);
119 if (folder != null) 119 if (folder != null)
120 { 120 {
121 folder.CreateNewSubFolder(folderID, folderName, folderType); 121 folder.CreateNewSubFolder(folderID, folderName, folderType);
@@ -127,7 +127,7 @@ namespace OpenSim.Framework.Communications.Caches
127 127
128 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) 128 public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
129 { 129 {
130 InventoryFolder fold = null; 130 InventoryFolderImpl fold = null;
131 if (folderID == libraryRoot.folderID ) 131 if (folderID == libraryRoot.folderID )
132 { 132 {
133 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems()); 133 remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
@@ -150,7 +150,7 @@ namespace OpenSim.Framework.Communications.Caches
150 } 150 }
151 else 151 else
152 { 152 {
153 InventoryFolder folder = info.RootFolder.HasSubFolder(folderID); 153 InventoryFolderImpl folder = info.RootFolder.HasSubFolder(folderID);
154 if ((folder != null) && fetchItems) 154 if ((folder != null) && fetchItems)
155 { 155 {
156 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems()); 156 remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems());
@@ -185,7 +185,7 @@ namespace OpenSim.Framework.Communications.Caches
185 /// <param name="userID"></param> 185 /// <param name="userID"></param>
186 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) 186 private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
187 { 187 {
188 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); 188 this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
189 } 189 }
190 190
191 /// <summary> 191 /// <summary>
@@ -223,5 +223,4 @@ namespace OpenSim.Framework.Communications.Caches
223 { 223 {
224 } 224 }
225 } 225 }
226} 226} \ No newline at end of file
227
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs
index 899fb61..095a5b1 100644
--- a/OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -61,8 +61,9 @@ namespace OpenSim.Region.Capabilities
61 private Queue<string> CapsEventQueue = new Queue<string>(); 61 private Queue<string> CapsEventQueue = new Queue<string>();
62 public NewInventoryItem AddNewInventoryItem = null; 62 public NewInventoryItem AddNewInventoryItem = null;
63 public ItemUpdatedCallback ItemUpdatedCall = null; 63 public ItemUpdatedCallback ItemUpdatedCall = null;
64 private bool m_dumpAssetsToFile;
64 65
65 public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent) 66 public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent, bool dumpAssetsToFile)
66 { 67 {
67 assetCache = assetCach; 68 assetCache = assetCach;
68 m_capsObjectPath = capsPath; 69 m_capsObjectPath = capsPath;
@@ -70,6 +71,7 @@ namespace OpenSim.Region.Capabilities
70 m_httpListenerHostName = httpListen; 71 m_httpListenerHostName = httpListen;
71 m_httpListenPort = httpPort; 72 m_httpListenPort = httpPort;
72 agentID = agent; 73 agentID = agent;
74 m_dumpAssetsToFile = dumpAssetsToFile;
73 } 75 }
74 76
75 /// <summary> 77 /// <summary>
@@ -250,7 +252,7 @@ namespace OpenSim.Region.Capabilities
250 LLUUID newInvItem = llsdRequest.item_id; 252 LLUUID newInvItem = llsdRequest.item_id;
251 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 253 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
252 254
253 ItemUpdater uploader = new ItemUpdater(newInvItem, capsBase + uploaderPath, this.httpListener); 255 ItemUpdater uploader = new ItemUpdater(newInvItem, capsBase + uploaderPath, this.httpListener, m_dumpAssetsToFile );
254 uploader.OnUpLoad += this.ItemUpdated; 256 uploader.OnUpLoad += this.ItemUpdated;
255 257
256 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 258 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
@@ -280,7 +282,7 @@ namespace OpenSim.Region.Capabilities
280 LLUUID parentFolder = llsdRequest.folder_id; 282 LLUUID parentFolder = llsdRequest.folder_id;
281 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 283 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
282 284
283 AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener); 285 AssetUploader uploader = new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, llsdRequest.asset_type, capsBase + uploaderPath, this.httpListener, m_dumpAssetsToFile);
284 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); 286 httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
285 string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; 287 string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath;
286 288
@@ -360,21 +362,14 @@ namespace OpenSim.Region.Capabilities
360 private LLUUID inventoryItemID; 362 private LLUUID inventoryItemID;
361 private LLUUID parentFolder; 363 private LLUUID parentFolder;
362 private BaseHttpServer httpListener; 364 private BaseHttpServer httpListener;
363 private bool SaveAssets = false; 365 private bool m_dumpAssetsToFile;
364 private string m_assetName = ""; 366 private string m_assetName = "";
365 private string m_assetDes = ""; 367 private string m_assetDes = "";
366 368
367 private string m_invType = ""; 369 private string m_invType = "";
368 private string m_assetType = ""; 370 private string m_assetType = "";
369 371
370 /// <summary> 372 public AssetUploader(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolderID, string invType, string assetType, string path, BaseHttpServer httpServer, bool dumpAssetsToFile)
371 ///
372 /// </summary>
373 /// <param name="assetID"></param>
374 /// <param name="inventoryItem"></param>
375 /// <param name="path"></param>
376 /// <param name="httpServer"></param>
377 public AssetUploader(string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolderID, string invType, string assetType, string path, BaseHttpServer httpServer)
378 { 373 {
379 m_assetName = assetName; 374 m_assetName = assetName;
380 m_assetDes = description; 375 m_assetDes = description;
@@ -385,7 +380,7 @@ namespace OpenSim.Region.Capabilities
385 parentFolder = parentFolderID; 380 parentFolder = parentFolderID;
386 m_assetType = assetType; 381 m_assetType = assetType;
387 m_invType = invType; 382 m_invType = invType;
388 383 m_dumpAssetsToFile = dumpAssetsToFile;
389 } 384 }
390 385
391 /// <summary> 386 /// <summary>
@@ -408,8 +403,10 @@ namespace OpenSim.Region.Capabilities
408 403
409 httpListener.RemoveStreamHandler("POST", uploaderPath); 404 httpListener.RemoveStreamHandler("POST", uploaderPath);
410 405
411 if(this.SaveAssets) 406 if (this.m_dumpAssetsToFile)
407 {
412 this.SaveAssetToFile(m_assetName + ".jp2", data); 408 this.SaveAssetToFile(m_assetName + ".jp2", data);
409 }
413 410
414 if (OnUpLoad != null) 411 if (OnUpLoad != null)
415 { 412 {
@@ -436,19 +433,12 @@ namespace OpenSim.Region.Capabilities
436 private string uploaderPath = ""; 433 private string uploaderPath = "";
437 private LLUUID inventoryItemID; 434 private LLUUID inventoryItemID;
438 private BaseHttpServer httpListener; 435 private BaseHttpServer httpListener;
439 private bool SaveAssets = false; 436 private bool m_dumpAssetToFile;
440
441 437
442 /// <summary> 438 public ItemUpdater( LLUUID inventoryItem, string path, BaseHttpServer httpServer, bool dumpAssetToFile)
443 ///
444 /// </summary>
445 /// <param name="assetID"></param>
446 /// <param name="inventoryItem"></param>
447 /// <param name="path"></param>
448 /// <param name="httpServer"></param>
449 public ItemUpdater( LLUUID inventoryItem, string path, BaseHttpServer httpServer)
450 { 439 {
451 440 m_dumpAssetToFile = dumpAssetToFile;
441
452 inventoryItemID = inventoryItem; 442 inventoryItemID = inventoryItem;
453 uploaderPath = path; 443 uploaderPath = path;
454 httpListener = httpServer; 444 httpListener = httpServer;
@@ -481,8 +471,10 @@ namespace OpenSim.Region.Capabilities
481 471
482 httpListener.RemoveStreamHandler("POST", uploaderPath); 472 httpListener.RemoveStreamHandler("POST", uploaderPath);
483 473
484 if (this.SaveAssets) 474 if (this.m_dumpAssetToFile)
485 this.SaveAssetToFile("updateditem"+Util.RandomClass.Next(1,1000) + ".dat", data); 475 {
476 this.SaveAssetToFile("updateditem" + Util.RandomClass.Next(1, 1000) + ".dat", data);
477 }
486 478
487 return res; 479 return res;
488 } 480 }
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 5af07f7..7a157be 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -28,7 +28,6 @@
28using System; 28using System;
29using libsecondlife; 29using libsecondlife;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
31using OpenSim.Framework.Communications.Caches;
32using OpenSim.Framework.Interfaces; 31using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Servers; 32using OpenSim.Framework.Servers;
34using OpenSim.Framework.Types; 33using OpenSim.Framework.Types;
@@ -87,12 +86,12 @@ namespace OpenSim.Framework.Communications
87 get { return m_networkServersInfo; } 86 get { return m_networkServersInfo; }
88 } 87 }
89 88
90 public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache) 89 public CommunicationsManager(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool dumpAssetsToFile)
91 { 90 {
92 m_networkServersInfo = serversInfo; 91 m_networkServersInfo = serversInfo;
93 m_assetCache = assetCache; 92 m_assetCache = assetCache;
94 m_userProfileCache = new UserProfileCache(this); 93 m_userProfileCache = new UserProfileCache(this);
95 m_transactionsManager = new AssetTransactionManager(this); 94 m_transactionsManager = new AssetTransactionManager(this, dumpAssetsToFile );
96 } 95 }
97 96
98 public void doCreate(string[] cmmdParams) 97 public void doCreate(string[] cmmdParams)
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index bfc3ee7..5643d78 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -30,19 +30,18 @@ using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text; 31using System.Text;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Framework.Communications.Caches; 33using OpenSim.Framework.Communications.Cache;
34using OpenSim.Framework.Types; 34using OpenSim.Framework.Types;
35using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
36 35
37namespace OpenSim.Framework.Communications 36namespace OpenSim.Framework.Communications
38{ 37{
39 public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolder folderInfo); 38 public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolderImpl folderInfo);
40 public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo); 39 public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo);
41 40
42 public interface IInventoryServices 41 public interface IInventoryServices
43 { 42 {
44 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); 43 void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
45 void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); 44 void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder);
46 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); 45 void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
47 void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); 46 void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
48 void CreateNewUserInventory(LLUUID user); 47 void CreateNewUserInventory(LLUUID user);
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 06a1ca8..6549966 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -31,9 +31,9 @@ using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Framework.Communications; 33using OpenSim.Framework.Communications;
34using OpenSim.Framework.Communications.Cache;
34using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
35using OpenSim.Framework.Types; 36using OpenSim.Framework.Types;
36using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
37 37
38namespace OpenSim.Framework.Communications 38namespace OpenSim.Framework.Communications
39{ 39{
@@ -232,7 +232,7 @@ namespace OpenSim.Framework.Communications
232 } 232 }
233 233
234 public abstract void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack); 234 public abstract void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
235 public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder); 235 public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder);
236 public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); 236 public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
237 public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); 237 public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
238 } 238 }
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs
index dabacd4..542f87f 100644
--- a/OpenSim/Grid/AssetServer/Main.cs
+++ b/OpenSim/Grid/AssetServer/Main.cs
@@ -38,16 +38,10 @@ using OpenSim.Framework.Communications.Cache;
38using OpenSim.Framework.Configuration; 38using OpenSim.Framework.Configuration;
39using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
40using OpenSim.Framework.Interfaces; 40using OpenSim.Framework.Interfaces;
41using OpenSim.Framework.Servers;
41using OpenSim.Framework.Utilities; 42using OpenSim.Framework.Utilities;
42using OpenSim.Framework.Servers; 43using OpenSim.Framework.Servers;
43 44
44/*
45using System.Text;
46using Db4objects.Db4o;
47using OpenSim.Framework.Types;
48using OpenSim.Framework.Utilities;
49using OpenSim.Framework.Communications.Caches;
50*/
51namespace OpenSim.Grid.AssetServer 45namespace OpenSim.Grid.AssetServer
52{ 46{
53 /// <summary> 47 /// <summary>
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index f550ee2..fdaaa51 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -44,7 +44,7 @@ using OpenSim.Region.Environment;
44using OpenSim.Region.Environment.Scenes; 44using OpenSim.Region.Environment.Scenes;
45using OpenSim.Region.Physics.Manager; 45using OpenSim.Region.Physics.Manager;
46using System.Globalization; 46using System.Globalization;
47using RegionInfo=OpenSim.Framework.Types.RegionInfo; 47using RegionInfo = OpenSim.Framework.Types.RegionInfo;
48 48
49namespace OpenSim 49namespace OpenSim
50{ 50{
@@ -78,21 +78,25 @@ namespace OpenSim
78 private readonly string m_logFilename = ("region-console.log"); 78 private readonly string m_logFilename = ("region-console.log");
79 private bool m_permissions = false; 79 private bool m_permissions = false;
80 80
81 private bool standaloneAuthenticate = false; 81 private bool m_standaloneAuthenticate = false;
82 private string standaloneWelcomeMessage = null; 82 private string m_standaloneWelcomeMessage = null;
83 private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; 83 private string m_standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
84 private string standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll"; 84 private string m_standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll";
85 private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll"; 85 private string m_standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll";
86 86
87 private string m_assetStorage = "db4o"; 87 private string m_assetStorage = "db4o";
88 88
89 public ConsoleCommand CreateAccount = null; 89 public ConsoleCommand CreateAccount = null;
90 private bool m_dumpAssetsToFile;
90 91
91 public OpenSimMain(IConfigSource configSource) 92 public OpenSimMain(IConfigSource configSource)
92 : base() 93 : base()
93 { 94 {
94 string iniFile = configSource.Configs["Startup"].GetString("inifile", "OpenSim.ini"); 95 IConfig startupConfig = configSource.Configs["Startup"];
95 string useExecutePathString = configSource.Configs["Startup"].GetString("useexecutepath", "false").ToLower(); 96
97 string iniFile = startupConfig.GetString("inifile", "OpenSim.ini");
98 string useExecutePathString = startupConfig.GetString("useexecutepath", "false").ToLower();
99
96 bool useExecutePath = false; 100 bool useExecutePath = false;
97 if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes") 101 if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes")
98 { 102 {
@@ -112,38 +116,57 @@ namespace OpenSim
112 //(as if someone has bothered to enter a command line arg, we should take notice of it) 116 //(as if someone has bothered to enter a command line arg, we should take notice of it)
113 m_config.Merge(configSource); 117 m_config.Merge(configSource);
114 } 118 }
119 else
120 {
121 m_config = configSource;
122 }
115 123
116 ReadConfigSettings(); 124 ReadConfigSettings();
117
118 } 125 }
119 126
120 protected void ReadConfigSettings() 127 protected void ReadConfigSettings()
121 { 128 {
122 m_networkServersInfo = new NetworkServersInfo(); 129 m_networkServersInfo = new NetworkServersInfo();
123 m_sandbox = !m_config.Configs["Startup"].GetBoolean("gridmode", false);
124 m_physicsEngine = m_config.Configs["Startup"].GetString("physics", "basicphysics");
125 m_verbose = m_config.Configs["Startup"].GetBoolean("verbose", true);
126 m_permissions = m_config.Configs["Startup"].GetBoolean("serverside_object_permissions", false);
127 130
128 m_storageDLL = m_config.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); 131 IConfig startupConfig = m_config.Configs["Startup"];
132
133 if (startupConfig != null )
134 {
135 m_sandbox = !startupConfig.GetBoolean("gridmode", false);
136 m_physicsEngine = startupConfig.GetString("physics", "basicphysics");
137 m_verbose = startupConfig.GetBoolean("verbose", true);
138 m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false);
139
140 m_storageDLL = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
129 141
130 m_startupCommandsFile = m_config.Configs["Startup"].GetString("startup_console_commands_file", ""); 142 m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "");
131 m_shutdownCommandsFile = m_config.Configs["Startup"].GetString("shutdown_console_commands_file", ""); 143 m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "");
132 144
133 m_scriptEngine = m_config.Configs["Startup"].GetString("script_engine", "DotNetEngine"); 145 m_scriptEngine = startupConfig.GetString("script_engine", "DotNetEngine");
134 146
135 m_assetStorage = m_config.Configs["Startup"].GetString("asset_database", "db4o"); 147 m_assetStorage = startupConfig.GetString("asset_database", "db4o");
136 148
137 m_config.Configs["Startup"].GetBoolean("default_modules", true); 149 // wtf?
138 m_config.Configs["Startup"].GetBoolean("default_shared_modules", true); 150 startupConfig.GetBoolean("default_modules", true);
139 m_config.Configs["Startup"].GetString("except_modules", ""); 151 startupConfig.GetBoolean("default_shared_modules", true);
140 m_config.Configs["Startup"].GetString("except_shared_modules", ""); 152 startupConfig.GetString("except_modules", "");
153 startupConfig.GetString("except_shared_modules", "");
154 }
155
156 IConfig standaloneConfig = m_config.Configs["StandAlone"];
157 if (standaloneConfig != null)
158 {
159 m_standaloneAuthenticate = standaloneConfig.GetBoolean("accounts_authenticate", false);
160 m_standaloneWelcomeMessage = standaloneConfig.GetString("welcome_message", "Welcome to OpenSim");
161 m_standaloneInventoryPlugin =
162 standaloneConfig.GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
163 m_standaloneUserPlugin =
164 standaloneConfig.GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
165 m_standaloneAssetPlugin = standaloneConfig.GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
166
167 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
168 }
141 169
142 standaloneAuthenticate = m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate", false);
143 standaloneWelcomeMessage = m_config.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
144 standaloneInventoryPlugin = m_config.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
145 standaloneUserPlugin = m_config.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
146 standaloneAssetPlugin = m_config.Configs["StandAlone"].GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
147 m_networkServersInfo.loadFromConfiguration(m_config); 170 m_networkServersInfo.loadFromConfiguration(m_config);
148 } 171 }
149 172
@@ -168,22 +191,22 @@ namespace OpenSim
168 if (m_sandbox) 191 if (m_sandbox)
169 { 192 {
170 LocalInventoryService inventoryService = new LocalInventoryService(); 193 LocalInventoryService inventoryService = new LocalInventoryService();
171 inventoryService.AddPlugin(standaloneInventoryPlugin); 194 inventoryService.AddPlugin(m_standaloneInventoryPlugin);
172 195
173 LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService ); 196 LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService);
174 userService.AddPlugin( standaloneUserPlugin ); 197 userService.AddPlugin(m_standaloneUserPlugin);
175 198
176 LocalBackEndServices backendService = new LocalBackEndServices(); 199 LocalBackEndServices backendService = new LocalBackEndServices();
177 200
178 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService); 201 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService, m_dumpAssetsToFile);
179 m_commsManager = localComms; 202 m_commsManager = localComms;
180 203
181 m_loginService = new LocalLoginService(userService, standaloneWelcomeMessage, localComms, m_networkServersInfo, standaloneAuthenticate); 204 m_loginService = new LocalLoginService(userService, m_standaloneWelcomeMessage, localComms, m_networkServersInfo, m_standaloneAuthenticate);
182 m_loginService.OnLoginToRegion += backendService.AddNewSession; 205 m_loginService.OnLoginToRegion += backendService.AddNewSession;
183 206
184 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); 207 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
185 208
186 if (standaloneAuthenticate) 209 if (m_standaloneAuthenticate)
187 { 210 {
188 this.CreateAccount = localComms.doCreate; 211 this.CreateAccount = localComms.doCreate;
189 } 212 }
@@ -209,7 +232,7 @@ namespace OpenSim
209 configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 232 configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
210 } 233 }
211 234
212 m_moduleLoader = new ModuleLoader( m_log, m_config ); 235 m_moduleLoader = new ModuleLoader(m_log, m_config);
213 MainLog.Instance.Verbose("Loading Shared Modules"); 236 MainLog.Instance.Verbose("Loading Shared Modules");
214 m_moduleLoader.LoadDefaultSharedModules(); 237 m_moduleLoader.LoadDefaultSharedModules();
215 238
@@ -240,10 +263,10 @@ namespace OpenSim
240 } 263 }
241 else 264 else
242 { 265 {
243 MainLog.Instance.Verbose("STARTUP","No startup command script specified. Moving on..."); 266 MainLog.Instance.Verbose("STARTUP", "No startup command script specified. Moving on...");
244 } 267 }
245 268
246 MainLog.Instance.Status("STARTUP","Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)"); 269 MainLog.Instance.Status("STARTUP", "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
247 } 270 }
248 271
249 public UDPServer CreateRegion(RegionInfo regionInfo) 272 public UDPServer CreateRegion(RegionInfo regionInfo)
@@ -289,7 +312,7 @@ namespace OpenSim
289 312
290 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) 313 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
291 { 314 {
292 return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader); 315 return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader, m_dumpAssetsToFile);
293 } 316 }
294 317
295 protected override void Initialize() 318 protected override void Initialize()
@@ -307,7 +330,7 @@ namespace OpenSim
307 } 330 }
308 else 331 else
309 { 332 {
310 SQLAssetServer sqlAssetServer = new SQLAssetServer(standaloneAssetPlugin); 333 SQLAssetServer sqlAssetServer = new SQLAssetServer(m_standaloneAssetPlugin);
311 sqlAssetServer.LoadDefaultAssets(); 334 sqlAssetServer.LoadDefaultAssets();
312 assetServer = sqlAssetServer; 335 assetServer = sqlAssetServer;
313 } 336 }
@@ -408,7 +431,7 @@ namespace OpenSim
408 } 431 }
409 else 432 else
410 { 433 {
411 MainLog.Instance.Error("COMMANDFILE","Command script missing. Can not run commands"); 434 MainLog.Instance.Error("COMMANDFILE", "Command script missing. Can not run commands");
412 } 435 }
413 } 436 }
414 437
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index e57e445..13af96c 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -35,8 +35,15 @@ namespace OpenSim.Region.Communications.Local
35{ 35{
36 public class CommunicationsLocal : CommunicationsManager 36 public class CommunicationsLocal : CommunicationsManager
37 { 37 {
38 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, IUserService userService, LocalInventoryService inventoryService, IInterRegionCommunications interRegionService, IGridServices gridService) 38 public CommunicationsLocal(
39 : base(serversInfo, httpServer, assetCache) 39 NetworkServersInfo serversInfo,
40 BaseHttpServer httpServer,
41 AssetCache assetCache,
42 IUserService userService,
43 LocalInventoryService inventoryService,
44 IInterRegionCommunications interRegionService,
45 IGridServices gridService, bool dumpAssetsToFile )
46 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile)
40 { 47 {
41 m_inventoryService = inventoryService; 48 m_inventoryService = inventoryService;
42 m_userService = userService; 49 m_userService = userService;
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index 5d450bb..fd6002a 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -29,8 +29,8 @@
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework.Communications; 31using OpenSim.Framework.Communications;
32using OpenSim.Framework.Communications.Cache;
32using OpenSim.Framework.Types; 33using OpenSim.Framework.Types;
33using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
34 34
35namespace OpenSim.Region.Communications.Local 35namespace OpenSim.Region.Communications.Local
36{ 36{
@@ -45,14 +45,14 @@ namespace OpenSim.Region.Communications.Local
45 public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) 45 public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
46 { 46 {
47 List<InventoryFolderBase> folders = this.RequestFirstLevelFolders(userID); 47 List<InventoryFolderBase> folders = this.RequestFirstLevelFolders(userID);
48 InventoryFolder rootFolder = null; 48 InventoryFolderImpl rootFolder = null;
49 49
50 //need to make sure we send root folder first 50 //need to make sure we send root folder first
51 foreach (InventoryFolderBase folder in folders) 51 foreach (InventoryFolderBase folder in folders)
52 { 52 {
53 if (folder.parentID == libsecondlife.LLUUID.Zero) 53 if (folder.parentID == libsecondlife.LLUUID.Zero)
54 { 54 {
55 InventoryFolder newfolder = new InventoryFolder(folder); 55 InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
56 rootFolder = newfolder; 56 rootFolder = newfolder;
57 folderCallBack(userID, newfolder); 57 folderCallBack(userID, newfolder);
58 } 58 }
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Communications.Local
64 { 64 {
65 if (folder.folderID != rootFolder.folderID) 65 if (folder.folderID != rootFolder.folderID)
66 { 66 {
67 InventoryFolder newfolder = new InventoryFolder(folder); 67 InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
68 folderCallBack(userID, newfolder); 68 folderCallBack(userID, newfolder);
69 69
70 List<InventoryItemBase> items = this.RequestFolderItems(newfolder.folderID); 70 List<InventoryItemBase> items = this.RequestFolderItems(newfolder.folderID);
@@ -77,7 +77,7 @@ namespace OpenSim.Region.Communications.Local
77 } 77 }
78 } 78 }
79 79
80 public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) 80 public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder)
81 { 81 {
82 this.AddFolder(folder); 82 this.AddFolder(folder);
83 } 83 }
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index 8ebeeca..4be31d8 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Region.Communications.OGS1
36{ 36{
37 public class CommunicationsOGS1 : CommunicationsManager 37 public class CommunicationsOGS1 : CommunicationsManager
38 { 38 {
39 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache) 39 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache, false)
40 { 40 {
41 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); 41 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
42 m_gridService = gridInterComms; 42 m_gridService = gridInterComms;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 77713af..d8f5a22 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -29,8 +29,8 @@
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework.Communications; 31using OpenSim.Framework.Communications;
32using OpenSim.Framework.Communications.Cache;
32using OpenSim.Framework.Types; 33using OpenSim.Framework.Types;
33using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
34 34
35 35
36namespace OpenSim.Region.Communications.OGS1 36namespace OpenSim.Region.Communications.OGS1
@@ -50,7 +50,7 @@ namespace OpenSim.Region.Communications.OGS1
50 50
51 } 51 }
52 52
53 public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder) 53 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder)
54 { 54 {
55 55
56 } 56 }
diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
new file mode 100644
index 0000000..b6f24c3
--- /dev/null
+++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
@@ -0,0 +1,13 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Types;
6
7namespace OpenSim.Region.Environment.Interfaces
8{
9 public interface IAvatarFactory : IRegionModule
10 {
11 bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams);
12 }
13}
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index 4fc45a0..160b740 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -67,12 +67,18 @@ namespace OpenSim.Region.Environment
67 { 67 {
68 DynamicTextureModule dynamicModule = new DynamicTextureModule(); 68 DynamicTextureModule dynamicModule = new DynamicTextureModule();
69 LoadedSharedModules.Add(dynamicModule.Name, dynamicModule); 69 LoadedSharedModules.Add(dynamicModule.Name, dynamicModule);
70
70 ChatModule chat = new ChatModule(); 71 ChatModule chat = new ChatModule();
71 LoadedSharedModules.Add(chat.Name, chat); 72 LoadedSharedModules.Add(chat.Name, chat);
73
72 InstantMessageModule imMod = new InstantMessageModule(); 74 InstantMessageModule imMod = new InstantMessageModule();
73 LoadedSharedModules.Add(imMod.Name, imMod); 75 LoadedSharedModules.Add(imMod.Name, imMod);
76
74 LoadImageURLModule loadMod = new LoadImageURLModule(); 77 LoadImageURLModule loadMod = new LoadImageURLModule();
75 LoadedSharedModules.Add(loadMod.Name, loadMod); 78 LoadedSharedModules.Add(loadMod.Name, loadMod);
79
80 AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
81 LoadedSharedModules.Add(avatarFactory.Name, avatarFactory);
76 } 82 }
77 83
78 public void InitialiseSharedModules(Scene scene) 84 public void InitialiseSharedModules(Scene scene)
diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
new file mode 100644
index 0000000..f825b7a
--- /dev/null
+++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
@@ -0,0 +1,57 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using Nini.Config;
6using OpenSim.Framework.Types;
7using OpenSim.Region.Environment.Interfaces;
8using OpenSim.Region.Environment.Scenes;
9
10namespace OpenSim.Region.Environment.Modules
11{
12 public class AvatarFactoryModule : IAvatarFactory
13 {
14 public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, out byte[] visualParams)
15 {
16 GetDefaultAvatarAppearance(out wearables, out visualParams);
17 return true;
18 }
19
20 public void Initialise(Scene scene, IConfigSource source)
21 {
22 scene.RegisterModuleInterface<IAvatarFactory>(this);
23 }
24
25 public void PostInitialise()
26 {
27 }
28
29 public void Close()
30 {
31 }
32
33 public string Name
34 {
35 get { return "Default Avatar Factory"; }
36 }
37
38 public bool IsSharedModule
39 {
40 get { return true; }
41 }
42
43 public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams)
44 {
45 visualParams = new byte[218];
46 for (int i = 0; i < 218; i++)
47 {
48 visualParams[i] = 100;
49 }
50
51 wearables = AvatarWearable.DefaultWearables;
52 }
53 }
54
55
56
57}
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index 2fe308d..c2611d0 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -126,7 +126,9 @@ namespace OpenSim.Region.Environment.Modules
126 LLUUID fromAgentID = LLUUID.Zero; 126 LLUUID fromAgentID = LLUUID.Zero;
127 127
128 if (e.Sender != null) 128 if (e.Sender != null)
129 {
129 avatar = scene.GetScenePresence(e.Sender.AgentId); 130 avatar = scene.GetScenePresence(e.Sender.AgentId);
131 }
130 132
131 if (avatar != null) 133 if (avatar != null)
132 { 134 {
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 96beb05..4c04592 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -30,7 +30,6 @@ using Axiom.Math;
30using libsecondlife; 30using libsecondlife;
31using libsecondlife.Packets; 31using libsecondlife.Packets;
32using OpenSim.Framework.Communications.Cache; 32using OpenSim.Framework.Communications.Cache;
33using OpenSim.Framework.Communications.Caches;
34using OpenSim.Framework.Interfaces; 33using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types; 34using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 35using OpenSim.Framework.Utilities;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 69c3f9e..e86562d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -50,6 +50,7 @@ using OpenSim.Region.Environment.Types;
50using OpenSim.Region.Physics.Manager; 50using OpenSim.Region.Physics.Manager;
51using OpenSim.Region.Terrain; 51using OpenSim.Region.Terrain;
52using Timer = System.Timers.Timer; 52using Timer = System.Timers.Timer;
53using OpenSim.Region.Environment.Modules;
53 54
54namespace OpenSim.Region.Environment.Scenes 55namespace OpenSim.Region.Environment.Scenes
55{ 56{
@@ -90,11 +91,11 @@ namespace OpenSim.Region.Environment.Scenes
90 91
91 public IXfer XferManager; 92 public IXfer XferManager;
92 93
93 private IHttpRequests m_httpRequestModule = null; 94 private IHttpRequests m_httpRequestModule;
94 private ISimChat m_simChatModule = null; 95 private ISimChat m_simChatModule;
95 private IXMLRPC m_xmlrpcModule = null; 96 private IXMLRPC m_xmlrpcModule;
96 private IWorldComm m_worldCommModule = null; 97 private IWorldComm m_worldCommModule;
97 98 private IAvatarFactory m_AvatarFactory;
98 99
99 // Central Update Loop 100 // Central Update Loop
100 101
@@ -165,7 +166,7 @@ namespace OpenSim.Region.Environment.Scenes
165 166
166 public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, 167 public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan,
167 AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, 168 AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
168 ModuleLoader moduleLoader) 169 ModuleLoader moduleLoader, bool dumpAssetsToFile)
169 { 170 {
170 updateLock = new Mutex(false); 171 updateLock = new Mutex(false);
171 172
@@ -205,6 +206,7 @@ namespace OpenSim.Region.Environment.Scenes
205 ScenePresence.LoadAnims(); 206 ScenePresence.LoadAnims();
206 207
207 httpListener = httpServer; 208 httpListener = httpServer;
209 m_dumpAssetsToFile = dumpAssetsToFile;
208 } 210 }
209 211
210 #endregion 212 #endregion
@@ -215,7 +217,6 @@ namespace OpenSim.Region.Environment.Scenes
215 m_httpRequestModule = RequestModuleInterface<IHttpRequests>(); 217 m_httpRequestModule = RequestModuleInterface<IHttpRequests>();
216 m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); 218 m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
217 m_worldCommModule = RequestModuleInterface<IWorldComm>(); 219 m_worldCommModule = RequestModuleInterface<IWorldComm>();
218
219 XferManager = RequestModuleInterface<IXfer>(); 220 XferManager = RequestModuleInterface<IXfer>();
220 } 221 }
221 222
@@ -855,7 +856,15 @@ namespace OpenSim.Region.Environment.Scenes
855 { 856 {
856 ScenePresence newAvatar = null; 857 ScenePresence newAvatar = null;
857 858
858 newAvatar = new ScenePresence(client, this, m_regInfo); 859 byte[] visualParams;
860 AvatarWearable[] wearables;
861
862 if( m_AvatarFactory == null || !m_AvatarFactory.TryGetIntialAvatarAppearance( client.AgentId, out wearables, out visualParams))
863 {
864 AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams);
865 }
866
867 newAvatar = new ScenePresence(client, this, m_regInfo, visualParams, wearables);
859 newAvatar.IsChildAgent = child; 868 newAvatar.IsChildAgent = child;
860 869
861 if (child) 870 if (child)
@@ -1096,7 +1105,8 @@ namespace OpenSim.Region.Environment.Scenes
1096 //Console.WriteLine("new user, so creating caps handler for it"); 1105 //Console.WriteLine("new user, so creating caps handler for it");
1097 Caps cap = 1106 Caps cap =
1098 new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, 1107 new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port,
1099 agent.CapsPath, agent.AgentID); 1108 agent.CapsPath, agent.AgentID, m_dumpAssetsToFile);
1109
1100 Util.SetCapsURL(agent.AgentID, 1110 Util.SetCapsURL(agent.AgentID,
1101 "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + 1111 "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() +
1102 "/CAPS/" + agent.CapsPath + "0000/"); 1112 "/CAPS/" + agent.CapsPath + "0000/");
@@ -1456,6 +1466,7 @@ namespace OpenSim.Region.Environment.Scenes
1456 #region Script Engine 1466 #region Script Engine
1457 1467
1458 private List<ScriptEngineInterface> ScriptEngines = new List<ScriptEngineInterface>(); 1468 private List<ScriptEngineInterface> ScriptEngines = new List<ScriptEngineInterface>();
1469 private bool m_dumpAssetsToFile;
1459 1470
1460 public void AddScriptEngine(ScriptEngineInterface ScriptEngine, LogBase m_logger) 1471 public void AddScriptEngine(ScriptEngineInterface ScriptEngine, LogBase m_logger)
1461 { 1472 {
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 99f78c9..256b6b5 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -53,8 +53,8 @@ namespace OpenSim.Region.Environment.Scenes
53 private short m_updateCount = 0; 53 private short m_updateCount = 0;
54 54
55 private Quaternion bodyRot; 55 private Quaternion bodyRot;
56 private byte[] visualParams; 56 private byte[] m_visualParams;
57 private AvatarWearable[] Wearables; 57 private AvatarWearable[] m_wearables;
58 private LLObject.TextureEntry m_textureEntry; 58 private LLObject.TextureEntry m_textureEntry;
59 59
60 public bool IsRestrictedToRegion = false; 60 public bool IsRestrictedToRegion = false;
@@ -90,10 +90,10 @@ namespace OpenSim.Region.Environment.Scenes
90 90
91 //public List<SceneObjectGroup> InterestList = new List<SceneObjectGroup>(); 91 //public List<SceneObjectGroup> InterestList = new List<SceneObjectGroup>();
92 92
93 // private string m_currentQuadNode = " "; 93 // private string m_currentQuadNode = " ";
94 94
95 // private Queue<SceneObjectPart> m_fullPartUpdates = new Queue<SceneObjectPart>(); 95 // private Queue<SceneObjectPart> m_fullPartUpdates = new Queue<SceneObjectPart>();
96 //private Queue<SceneObjectPart> m_tersePartUpdates = new Queue<SceneObjectPart>(); 96 //private Queue<SceneObjectPart> m_tersePartUpdates = new Queue<SceneObjectPart>();
97 97
98 private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); 98 private UpdateQueue m_partsUpdateQueue = new UpdateQueue();
99 private Dictionary<LLUUID, ScenePartUpdate> m_updateTimes = new Dictionary<LLUUID, ScenePartUpdate>(); 99 private Dictionary<LLUUID, ScenePartUpdate> m_updateTimes = new Dictionary<LLUUID, ScenePartUpdate>();
@@ -173,8 +173,8 @@ namespace OpenSim.Region.Environment.Scenes
173 173
174 m_pos = value; 174 m_pos = value;
175 } 175 }
176 } 176 }
177 177
178 public override LLVector3 Velocity 178 public override LLVector3 Velocity
179 { 179 {
180 get 180 get
@@ -220,14 +220,7 @@ namespace OpenSim.Region.Environment.Scenes
220 220
221 #region Constructor(s) 221 #region Constructor(s)
222 222
223 /// <summary> 223 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, AvatarWearable[] wearables)
224 ///
225 /// </summary>
226 /// <param name="client"></param>
227 /// <param name="world"></param>
228 /// <param name="clientThreads"></param>
229 /// <param name="regionDat"></param>
230 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
231 { 224 {
232 m_scene = world; 225 m_scene = world;
233 m_uuid = client.AgentId; 226 m_uuid = client.AgentId;
@@ -240,13 +233,9 @@ namespace OpenSim.Region.Environment.Scenes
240 m_localId = m_scene.NextLocalId; 233 m_localId = m_scene.NextLocalId;
241 AbsolutePosition = m_controllingClient.StartPos; 234 AbsolutePosition = m_controllingClient.StartPos;
242 235
243 visualParams = new byte[218]; 236 m_visualParams = visualParams;
244 for (int i = 0; i < 218; i++) 237 m_wearables = wearables;
245 {
246 visualParams[i] = 100;
247 }
248 238
249 Wearables = AvatarWearable.DefaultWearables;
250 Animations = new AvatarAnimations(); 239 Animations = new AvatarAnimations();
251 Animations.LoadAnims(); 240 Animations.LoadAnims();
252 241
@@ -351,7 +340,7 @@ namespace OpenSim.Region.Environment.Scenes
351 340
352 AbsolutePosition = pos; 341 AbsolutePosition = pos;
353 342
354 AddToPhysicalScene( ); 343 AddToPhysicalScene();
355 m_physicsActor.Flying = isFlying; 344 m_physicsActor.Flying = isFlying;
356 345
357 346
@@ -410,7 +399,7 @@ namespace OpenSim.Region.Environment.Scenes
410 399
411 for (int i = 0; i < visualParam.Length; i++) 400 for (int i = 0; i < visualParam.Length; i++)
412 { 401 {
413 visualParams[i] = visualParam[i].ParamValue; 402 m_visualParams[i] = visualParam[i].ParamValue;
414 } 403 }
415 404
416 SendAppearanceToAllOtherAgents(); 405 SendAppearanceToAllOtherAgents();
@@ -459,7 +448,7 @@ namespace OpenSim.Region.Environment.Scenes
459 Vector3 agent_control_v3 = new Vector3(0, 0, 0); 448 Vector3 agent_control_v3 = new Vector3(0, 0, 0);
460 Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); 449 Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
461 bool oldflying = PhysicsActor.Flying; 450 bool oldflying = PhysicsActor.Flying;
462 PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); 451 PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
463 if (PhysicsActor.Flying != oldflying) 452 if (PhysicsActor.Flying != oldflying)
464 { 453 {
465 update_movementflag = true; 454 update_movementflag = true;
@@ -470,23 +459,23 @@ namespace OpenSim.Region.Environment.Scenes
470 bodyRot = q; 459 bodyRot = q;
471 update_rotation = true; 460 update_rotation = true;
472 } 461 }
473 foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags))) 462 foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof(Dir_ControlFlags)))
474 { 463 {
475 if ((flags & (uint) DCF) != 0) 464 if ((flags & (uint)DCF) != 0)
476 { 465 {
477 DCFlagKeyPressed = true; 466 DCFlagKeyPressed = true;
478 agent_control_v3 += Dir_Vectors[i]; 467 agent_control_v3 += Dir_Vectors[i];
479 if ((m_movementflag & (uint) DCF) == 0) 468 if ((m_movementflag & (uint)DCF) == 0)
480 { 469 {
481 m_movementflag += (byte) (uint) DCF; 470 m_movementflag += (byte)(uint)DCF;
482 update_movementflag = true; 471 update_movementflag = true;
483 } 472 }
484 } 473 }
485 else 474 else
486 { 475 {
487 if ((m_movementflag & (uint) DCF) != 0) 476 if ((m_movementflag & (uint)DCF) != 0)
488 { 477 {
489 m_movementflag -= (byte) (uint) DCF; 478 m_movementflag -= (byte)(uint)DCF;
490 update_movementflag = true; 479 update_movementflag = true;
491 } 480 }
492 } 481 }
@@ -531,10 +520,10 @@ namespace OpenSim.Region.Environment.Scenes
531 } 520 }
532 521
533 NewForce newVelocity = new NewForce(); 522 NewForce newVelocity = new NewForce();
534 Vector3 direc = rotation*vec; 523 Vector3 direc = rotation * vec;
535 direc.Normalize(); 524 direc.Normalize();
536 525
537 direc = direc*((0.03f)*128f); 526 direc = direc * ((0.03f) * 128f);
538 if (m_physicsActor.Flying) 527 if (m_physicsActor.Flying)
539 direc *= 4; 528 direc *= 4;
540 529
@@ -619,7 +608,7 @@ namespace OpenSim.Region.Environment.Scenes
619 /// </summary> 608 /// </summary>
620 public void SendTerseUpdateToAllClients() 609 public void SendTerseUpdateToAllClients()
621 { 610 {
622 m_scene.Broadcast( SendTerseUpdateToClient ); 611 m_scene.Broadcast(SendTerseUpdateToClient);
623 } 612 }
624 613
625 public void SendCoarseLocations() 614 public void SendCoarseLocations()
@@ -628,7 +617,7 @@ namespace OpenSim.Region.Environment.Scenes
628 List<ScenePresence> avatars = m_scene.GetAvatars(); 617 List<ScenePresence> avatars = m_scene.GetAvatars();
629 for (int i = 0; i < avatars.Count; i++) 618 for (int i = 0; i < avatars.Count; i++)
630 { 619 {
631 if (avatars[i] != this ) 620 if (avatars[i] != this)
632 { 621 {
633 CoarseLocations.Add(avatars[i].AbsolutePosition); 622 CoarseLocations.Add(avatars[i].AbsolutePosition);
634 } 623 }
@@ -642,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes
642 m_newCoarseLocations = true; 631 m_newCoarseLocations = true;
643 } 632 }
644 633
645 634
646 635
647 636
648 /// <summary> 637 /// <summary>
@@ -695,7 +684,7 @@ namespace OpenSim.Region.Environment.Scenes
695 /// <param name="OurClient"></param> 684 /// <param name="OurClient"></param>
696 public void SendOurAppearance(IClientAPI OurClient) 685 public void SendOurAppearance(IClientAPI OurClient)
697 { 686 {
698 m_controllingClient.SendWearables(Wearables); 687 m_controllingClient.SendWearables(m_wearables);
699 688
700 //this.SendFullUpdateToAllClients(); 689 //this.SendFullUpdateToAllClients();
701 //this.SendAppearanceToAllOtherAgents(); 690 //this.SendAppearanceToAllOtherAgents();
@@ -734,7 +723,7 @@ namespace OpenSim.Region.Environment.Scenes
734 /// <param name="avatarInfo"></param> 723 /// <param name="avatarInfo"></param>
735 public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) 724 public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
736 { 725 {
737 avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, visualParams, 726 avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams,
738 m_textureEntry.ToBytes()); 727 m_textureEntry.ToBytes());
739 } 728 }
740 729
@@ -793,9 +782,9 @@ namespace OpenSim.Region.Environment.Scenes
793 LLVector3 vel = Velocity; 782 LLVector3 vel = Velocity;
794 783
795 float timeStep = 0.1f; 784 float timeStep = 0.1f;
796 pos2.X = pos2.X + (vel.X*timeStep); 785 pos2.X = pos2.X + (vel.X * timeStep);
797 pos2.Y = pos2.Y + (vel.Y*timeStep); 786 pos2.Y = pos2.Y + (vel.Y * timeStep);
798 pos2.Z = pos2.Z + (vel.Z*timeStep); 787 pos2.Z = pos2.Z + (vel.Z * timeStep);
799 788
800 if ((pos2.X < 0) || (pos2.X > 256)) 789 if ((pos2.X < 0) || (pos2.X > 256))
801 { 790 {
@@ -840,7 +829,7 @@ namespace OpenSim.Region.Environment.Scenes
840 } 829 }
841 830
842 LLVector3 vel = m_velocity; 831 LLVector3 vel = m_velocity;
843 ulong neighbourHandle = Helpers.UIntsToLong((uint) (neighbourx*256), (uint) (neighboury*256)); 832 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256));
844 RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); 833 RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
845 if (neighbourRegion != null) 834 if (neighbourRegion != null)
846 { 835 {
@@ -940,7 +929,7 @@ namespace OpenSim.Region.Environment.Scenes
940 throw new Exception("Can't set Text on avatar."); 929 throw new Exception("Can't set Text on avatar.");
941 } 930 }
942 931
943 public void AddToPhysicalScene( ) 932 public void AddToPhysicalScene()
944 { 933 {
945 PhysicsScene scene = m_scene.PhysScene; 934 PhysicsScene scene = m_scene.PhysScene;
946 935
@@ -948,7 +937,7 @@ namespace OpenSim.Region.Environment.Scenes
948 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, 937 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
949 AbsolutePosition.Z); 938 AbsolutePosition.Z);
950 939
951 m_physicsActor = scene.AddAvatar(this.Firstname+"."+this.Lastname, pVec); 940 m_physicsActor = scene.AddAvatar(this.Firstname + "." + this.Lastname, pVec);
952 } 941 }
953 942
954 internal void Close() 943 internal void Close()
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index 8492aa5..d642103 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -47,7 +47,7 @@ namespace SimpleApp
47 private List<ScenePresence> m_avatars; 47 private List<ScenePresence> m_avatars;
48 48
49 public MyWorld( RegionInfo regionInfo, AgentCircuitManager authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, ModuleLoader moduleLoader) 49 public MyWorld( RegionInfo regionInfo, AgentCircuitManager authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, ModuleLoader moduleLoader)
50 : base( regionInfo, authen, commsMan, assetCach, storeMan, httpServer, moduleLoader) 50 : base( regionInfo, authen, commsMan, assetCach, storeMan, httpServer, moduleLoader, false)
51 { 51 {
52 m_avatars = new List<Avatar>(); 52 m_avatars = new List<Avatar>();
53 } 53 }
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 36be3e8..4783a17 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -72,7 +72,7 @@ namespace SimpleApp
72 LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService); 72 LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService);
73 LocalBackEndServices backendService = new LocalBackEndServices(); 73 LocalBackEndServices backendService = new LocalBackEndServices();
74 74
75 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService); 75 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService, false);
76 m_commsManager = localComms; 76 m_commsManager = localComms;
77 77
78 LocalLoginService loginService = new LocalLoginService(userService, "", localComms, m_networkServersInfo, false); 78 LocalLoginService loginService = new LocalLoginService(userService, "", localComms, m_networkServersInfo, false);