From 8143c597fc5f62ec0d931d2d5b887730e06aec04 Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Thu, 27 Sep 2007 13:25:45 +0000
Subject: * Tleiades grid mode inventory (#444) - thanx Tleiades! * updated
to rev 1413 on libsecondlife.dll and libsecondlife.dll.config (#423)
---
OpenSim/Framework/Communications/CAPSService.cs | 1 -
.../Communications/Cache/CachedUserInfo.cs | 14 +-
.../Communications/Cache/InventoryFolder.cs | 12 +-
.../Communications/Cache/UserProfileCache.cs | 32 ++-
.../Framework/Communications/IInventoryServices.cs | 16 +-
.../Communications/InventoryServiceBase.cs | 255 ++++++++++++++++-----
OpenSim/Framework/Communications/LoginResponse.cs | 48 ++--
OpenSim/Framework/Communications/LoginService.cs | 134 +++++------
OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs | 58 ++---
OpenSim/Framework/Data.MySQL/MySQLManager.cs | 58 +++--
.../Framework/Data.SQLite/SQLiteInventoryStore.cs | 61 +++--
OpenSim/Framework/Data/InventoryData.cs | 33 ++-
.../General/Configuration/InventoryConfig.cs | 67 ++++++
.../Framework/General/Configuration/UserConfig.cs | 11 +
.../Framework/General/Types/NetworkServersInfo.cs | 5 +-
OpenSim/Framework/General/Types/UUID.cs | 4 +-
OpenSim/Grid/InventoryServer/InventoryManager.cs | 131 +++++++----
OpenSim/Grid/InventoryServer/InventoryService.cs | 136 +++++++++++
OpenSim/Grid/InventoryServer/Main.cs | 113 +++++++--
OpenSim/Grid/UserServer/Main.cs | 11 +-
OpenSim/Grid/UserServer/UserLoginService.cs | 39 ++--
.../ClientStack/ClientView.ProcessPackets.cs | 5 +-
OpenSim/Region/ClientStack/ClientView.cs | 1 -
.../Communications/Local/CommunicationsLocal.cs | 2 +-
.../Communications/Local/LocalInventoryService.cs | 3 +-
.../Communications/Local/LocalLoginService.cs | 51 +----
.../Communications/Local/LocalUserServices.cs | 5 +-
.../Communications/OGS1/CommunicationsOGS1.cs | 2 +-
.../Region/Communications/OGS1/OGS1GridServices.cs | 20 +-
.../Communications/OGS1/OGS1InventoryService.cs | 69 +++++-
OpenSim/Region/Environment/Modules/ChatModule.cs | 4 +-
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 6 +-
bin/OpenSim.ini | 16 +-
bin/libsecondlife.dll | Bin 1415168 -> 1515520 bytes
bin/libsecondlife.dll.config | 4 +-
prebuild.xml | 36 +++
share/sql/mysql-inventoryfolders.sql | 2 +
37 files changed, 1033 insertions(+), 432 deletions(-)
create mode 100644 OpenSim/Framework/General/Configuration/InventoryConfig.cs
create mode 100644 OpenSim/Grid/InventoryServer/InventoryService.cs
diff --git a/OpenSim/Framework/Communications/CAPSService.cs b/OpenSim/Framework/Communications/CAPSService.cs
index a8eac26..40d8d37 100644
--- a/OpenSim/Framework/Communications/CAPSService.cs
+++ b/OpenSim/Framework/Communications/CAPSService.cs
@@ -8,7 +8,6 @@ using Nwc.XmlRpc;
using OpenSim.Framework.Console;
using OpenSim.Framework.Data;
using OpenSim.Framework.Interfaces;
-using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Servers;
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 99dc45a..9e8c239 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -38,7 +38,7 @@ using OpenSim.Framework.Utilities;
namespace OpenSim.Framework.Communications.Caches
{
- public class CachedUserInfo
+ public class CachedUserInfo : MarshalByRefObject
{
private CommunicationsManager m_parentCommsManager;
// Fields
@@ -51,7 +51,7 @@ namespace OpenSim.Framework.Communications.Caches
}
// Methods
- public void FolderReceive(LLUUID userID, InventoryFolder folderInfo)
+ public void FolderReceive(LLUUID userID, InventoryFolderBase folderInfo)
{
if (userID == this.UserProfile.UUID)
{
@@ -59,19 +59,19 @@ namespace OpenSim.Framework.Communications.Caches
{
if (folderInfo.parentID == LLUUID.Zero)
{
- this.RootFolder = folderInfo;
+ this.RootFolder = new InventoryFolder(folderInfo);
}
}
else if (this.RootFolder.folderID == folderInfo.parentID)
{
- this.RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo);
+ this.RootFolder.SubFolders.Add(folderInfo.folderID, new InventoryFolder(folderInfo));
}
else
{
InventoryFolder folder = this.RootFolder.HasSubFolder(folderInfo.parentID);
if (folder != null)
{
- folder.SubFolders.Add(folderInfo.folderID, folderInfo);
+ folder.SubFolders.Add(folderInfo.folderID, new InventoryFolder(folderInfo));
}
}
}
@@ -131,3 +131,7 @@ namespace OpenSim.Framework.Communications.Caches
}
+
+
+
+
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
index 885cffc..a212614 100644
--- a/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/InventoryFolder.cs
@@ -35,6 +35,9 @@ using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Data;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
+using OpenSim.Framework.Console;
+
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
namespace OpenSim.Framework.Communications.Caches
{
@@ -60,7 +63,7 @@ namespace OpenSim.Framework.Communications.Caches
}
// Methods
- public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type)
+ public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type, InventoryCategory category)
{
InventoryFolder subFold = new InventoryFolder();
subFold.name = folderName;
@@ -68,7 +71,12 @@ namespace OpenSim.Framework.Communications.Caches
subFold.type = (short) type;
subFold.parentID = this.folderID;
subFold.agentID = this.agentID;
- this.SubFolders.Add(subFold.folderID, subFold);
+ subFold.category = category;
+ if (!SubFolders.ContainsKey(subFold.folderID))
+ this.SubFolders.Add(subFold.folderID, subFold);
+ else
+ MainLog.Instance.Warn("INVENTORYCACHE", "Attempt to create a duplicate folder {0} {1}", folderName, folderID);
+
return subFold;
}
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
index 390b938..3dadf9c 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs
@@ -35,10 +35,11 @@ using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Data;
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
namespace OpenSim.Framework.Communications.Caches
{
- public class UserProfileCache
+ public class UserProfileCache : MarshalByRefObject
{
// Fields
private CommunicationsManager m_parent;
@@ -103,7 +104,7 @@ namespace OpenSim.Framework.Communications.Caches
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
if (info.RootFolder.folderID == parentID)
{
- InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
+ InventoryFolder createdFolder = info.RootFolder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User);
if (createdFolder != null)
{
this.m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder);
@@ -114,7 +115,7 @@ namespace OpenSim.Framework.Communications.Caches
InventoryFolder folder = info.RootFolder.HasSubFolder(parentID);
if (folder != null)
{
- folder.CreateNewSubFolder(folderID, folderName, folderType);
+ folder.CreateNewSubFolder(folderID, folderName, folderType, InventoryCategory.User);
}
}
}
@@ -124,16 +125,21 @@ namespace OpenSim.Framework.Communications.Caches
public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder)
{
InventoryFolder fold = null;
+
if (folderID == libraryRoot.folderID )
{
+ // we are looking for the root of the shared inventory
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems());
}
else if (( fold = libraryRoot.HasSubFolder(folderID)) != null)
{
+ // we are looking for a sub folder of the shared inventory
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems());
}
else if (this.UserProfiles.ContainsKey(remoteClient.AgentId))
{
+ //if we get here, we are looking the inventory of an agent in this sim
+ //now we need to see if we already have the inventory cached
if (this.UserProfiles[remoteClient.AgentId].RootFolder != null)
{
CachedUserInfo info = this.UserProfiles[remoteClient.AgentId];
@@ -153,9 +159,23 @@ namespace OpenSim.Framework.Communications.Caches
}
}
}
+ else
+ {
+ //nope, inventory wasn't cached, so go to the inventory server and ask for the inventory
+ m_parent.InventoryService.RequestInventoryForUser(remoteClient.AgentId, ReceiveFolderInfo, ReceiveItemInfo);
+ }
}
}
+ public void ReceiveFolderInfo(LLUUID userID, InventoryFolderBase folderInfo)
+ {
+ }
+
+ public void ReceiveItemInfo(LLUUID userID, InventoryItemBase itemInfo)
+ {
+ }
+
+
public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
{
if (ownerID == libraryRoot.agentID)
@@ -181,7 +201,7 @@ namespace OpenSim.Framework.Communications.Caches
///
private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo)
{
- this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
+ this.m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive);
}
///
@@ -221,3 +241,7 @@ namespace OpenSim.Framework.Communications.Caches
}
}
+
+
+
+
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 80c2e64..7b2948f 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -1,29 +1,31 @@
using System;
-using System.Collections.Generic;
using System.Text;
-using OpenSim.Framework.Data;
+using System.Collections.Generic;
+
using libsecondlife;
+using OpenSim.Framework.Data;
using OpenSim.Framework.Communications.Caches;
-using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
namespace OpenSim.Framework.Communications
{
- public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolder folderInfo);
+ public delegate void InventoryFolderInfo(LLUUID userID, InventoryFolderBase folderInfo);
public delegate void InventoryItemInfo(LLUUID userID, InventoryItemBase itemInfo);
public interface IInventoryServices
{
void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
- void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
+ void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder);
void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
- void CreateNewUserInventory(LLUUID user);
+ void CreateNewUserInventory(LLUUID libraryRootId, LLUUID user);
+ void GetRootFoldersForUser(LLUUID user, out LLUUID libraryFolder, out LLUUID personalFolder);
///
/// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree)
///
///
///
- List RequestFirstLevelFolders(LLUUID userID);
+ List RequestFirstLevelFolders(LLUUID folderID);
+ List RequestFolderItems(LLUUID folderID);
}
}
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index da7a0ce..6283b60 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -1,4 +1,9 @@
using System;
+using System.Text;
+using System.IO;
+using System.Xml;
+using System.Xml.Serialization;
+using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using libsecondlife;
@@ -6,21 +11,20 @@ using OpenSim.Framework.Communications;
using OpenSim.Framework.Console;
using OpenSim.Framework.Data;
using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
namespace OpenSim.Framework.Communications
{
- public abstract class InventoryServiceBase : IInventoryServices
+ public abstract class InventoryServiceBase : MarshalByRefObject, IInventoryServices
{
- protected Dictionary m_plugins = new Dictionary();
- //protected IAssetServer m_assetServer;
+ protected IInventoryData _databasePlugin;
public InventoryServiceBase()
{
- //m_assetServer = assetServer;
}
///
- /// Adds a new user server plugin - plugins will be requested in the order they were loaded.
+ /// Adds a new inventory data server plugin
///
/// The filename to the user server plugin DLL
public void AddPlugin(string FileName)
@@ -41,8 +45,13 @@ namespace OpenSim.Framework.Communications
IInventoryData plug =
(IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise();
- this.m_plugins.Add(plug.getName(), plug);
+ this._databasePlugin = plug;
+
+ //TODO! find a better place to create inventory skeletons
+ loadInventoryFromXmlFile(InventoryCategory.Library, "Inventory_Library.xml");
+ loadInventoryFromXmlFile(InventoryCategory.Default, "Inventory_Default.xml");
MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface");
+ break;
}
}
}
@@ -54,20 +63,20 @@ namespace OpenSim.Framework.Communications
///
///
///
- public List RequestFirstLevelFolders(LLUUID userID)
+ public List RequestFirstLevelFolders(LLUUID folderID)
{
- List inventoryList = new List();
- foreach (KeyValuePair plugin in m_plugins)
+ InventoryFolderBase root = _databasePlugin.getInventoryFolder(folderID);
+
+ List folders = new List();
+ if (root != null)
{
- InventoryFolderBase rootFolder = plugin.Value.getUserRootFolder(userID);
- if (rootFolder != null)
- {
- inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID);
- inventoryList.Insert(0, rootFolder);
- return inventoryList;
- }
+ folders.Add(root);
+
+ List subFolders = _databasePlugin.getInventoryFolders(root.folderID);
+ foreach (InventoryFolderBase f in subFolders)
+ folders.Add(f);
}
- return inventoryList;
+ return folders;
}
///
@@ -75,11 +84,7 @@ namespace OpenSim.Framework.Communications
///
public InventoryFolderBase RequestUsersRoot(LLUUID userID)
{
- foreach (KeyValuePair plugin in m_plugins)
- {
- return plugin.Value.getUserRootFolder(userID);
- }
- return null;
+ return _databasePlugin.getInventoryFolder(userID); // the id of the root folder, is the user id
}
///
@@ -89,47 +94,27 @@ namespace OpenSim.Framework.Communications
///
public List RequestSubFolders(LLUUID parentFolderID)
{
- List inventoryList = new List();
- foreach (KeyValuePair plugin in m_plugins)
- {
- return plugin.Value.getInventoryFolders(parentFolderID);
- }
- return inventoryList;
+ return _databasePlugin.getInventoryFolders(parentFolderID);
}
public List RequestFolderItems(LLUUID folderID)
{
- List itemsList = new List();
- foreach (KeyValuePair plugin in m_plugins)
- {
- itemsList = plugin.Value.getInventoryInFolder(folderID);
- return itemsList;
- }
- return itemsList;
+ return _databasePlugin.getInventoryInFolder(folderID);
}
public void AddFolder(InventoryFolderBase folder)
{
- foreach (KeyValuePair plugin in m_plugins)
- {
- plugin.Value.addInventoryFolder(folder);
- }
+ _databasePlugin.addInventoryFolder(folder);
}
public void AddItem(InventoryItemBase item)
{
- foreach (KeyValuePair plugin in m_plugins)
- {
- plugin.Value.addInventoryItem(item);
- }
+ _databasePlugin.addInventoryItem(item);
}
public void deleteItem(InventoryItemBase item)
{
- foreach (KeyValuePair plugin in m_plugins)
- {
- plugin.Value.deleteInventoryItem(item);
- }
+ _databasePlugin.deleteInventoryItem(item);
}
///
@@ -144,11 +129,53 @@ namespace OpenSim.Framework.Communications
}
}
- public void CreateNewUserInventory(LLUUID user)
+ public void CreateNewUserInventory(LLUUID defaultFolders, LLUUID user)
{
- UsersInventory inven = new UsersInventory();
- inven.CreateNewInventorySet(user);
- this.AddNewInventorySet(inven);
+ try
+ {
+ // Get Default folder set from the database
+ //TODO! We need to get the whole hierachy and not just one level down
+ List folders = this.RequestFirstLevelFolders(LLUUID.Parse("00000112-000f-0000-0000-000100bba000"));
+
+ // create an index list, where each of the elements has the index of its parent in the hierachy
+ // this algorithm is pretty shoddy O(n^2), but it is only executed once per user.
+ int[] parentIdx = new int[folders.Count];
+ for (int i = 0; i < folders.Count; i++)
+ parentIdx[i] = -1;
+
+ for (int i = 0; i < folders.Count; i++)
+ for (int j = 0; j < folders.Count; j++)
+ if (folders[i].folderID == folders[j].parentID)
+ parentIdx[j] = i;
+
+
+ //assign a new owerid and a new to the folders
+ foreach (InventoryFolderBase ifb in folders)
+ {
+ if (ifb.parentID == LLUUID.Zero)
+ ifb.folderID = user;
+ else
+ ifb.folderID = LLUUID.Random();
+
+ ifb.agentID = user;
+ ifb.category = InventoryCategory.User;
+ }
+
+ // correct the parent id
+ for (int i = 0; i < folders.Count; i++)
+ {
+ if (folders[i].parentID != LLUUID.Zero)
+ folders[i].parentID = folders[parentIdx[i]].folderID; // root folder id is the same as the user id
+ }
+
+ // the list is structurally sound, using new folder id's, so save it
+ foreach (InventoryFolderBase ifb in folders)
+ _databasePlugin.addInventoryFolder(ifb);
+ }
+ catch (Exception e)
+ {
+ MainLog.Instance.Error(e.ToString());
+ }
}
public class UsersInventory
@@ -166,10 +193,11 @@ namespace OpenSim.Framework.Communications
InventoryFolderBase folder = new InventoryFolderBase();
folder.parentID = LLUUID.Zero;
folder.agentID = user;
- folder.folderID = LLUUID.Random();
+ folder.folderID = user; // id of root folder is the same as the agent id
folder.name = "My Inventory";
folder.type = 8;
folder.version = 1;
+ folder.category = InventoryCategory.User;
Folders.Add(folder.folderID, folder);
LLUUID rootFolder = folder.folderID;
@@ -181,6 +209,7 @@ namespace OpenSim.Framework.Communications
folder.name = "Textures";
folder.type = 0;
folder.version = 1;
+ folder.category = InventoryCategory.User;
Folders.Add(folder.folderID, folder);
folder = new InventoryFolderBase();
@@ -190,6 +219,7 @@ namespace OpenSim.Framework.Communications
folder.name = "Objects";
folder.type = 6;
folder.version = 1;
+ folder.category = InventoryCategory.User;
Folders.Add(folder.folderID, folder);
folder = new InventoryFolderBase();
@@ -199,13 +229,130 @@ namespace OpenSim.Framework.Communications
folder.name = "Clothes";
folder.type = 5;
folder.version = 1;
+ folder.category = InventoryCategory.User;
Folders.Add(folder.folderID, folder);
}
}
+
+ public void GetRootFoldersForUser(LLUUID user, out LLUUID libraryFolder, out LLUUID personalFolder)
+ {
+ List folders = _databasePlugin.getUserRootFolders(user);
+ libraryFolder = LLUUID.Zero;
+ personalFolder = LLUUID.Zero;
+
+ for (int i = 0; i < folders.Count; i++)
+ {
+ if (folders[i].category == InventoryCategory.Library)
+ libraryFolder = folders[i].folderID;
+ else if (folders[i].category == InventoryCategory.User)
+ personalFolder = folders[i].folderID;
+ }
+ }
+
+ /*
+ * Dot net has some issues, serializing a dictionary, so we cannot reuse the InventoryFolder
+ * class defined in Communications.Framework.Communications.Caches. So we serialize/deserialize
+ * into this simpler class, and then use that.
+ */
+ [XmlRoot(ElementName = "inventory", IsNullable = true)]
+ public class SerializedInventory
+ {
+ [XmlRoot(ElementName = "folder", IsNullable = true)]
+ public class SerializedFolder : InventoryFolderBase
+ {
+ [XmlArray(ElementName = "folders", IsNullable = true)]
+ [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof(SerializedFolder))]
+ public ArrayList SubFolders;
+
+ [XmlArray(ElementName = "items", IsNullable = true)]
+ [XmlArrayItem(ElementName = "item", IsNullable = true, Type = typeof(InventoryItemBase))]
+ public ArrayList Items;
+ }
+
+ [XmlElement(ElementName = "folder", IsNullable = true)]
+ public SerializedFolder root;
+ }
+
+ public void uploadInventory(SerializedInventory.SerializedFolder folder)
+ {
+ foreach (InventoryItemBase iib in folder.Items)
+ {
+ // assign default values, if they haven't assigned
+ iib.avatarID = folder.agentID;
+ if (iib.assetID == LLUUID.Zero)
+ iib.assetID = LLUUID.Random();
+ if (iib.creatorsID == LLUUID.Zero)
+ iib.creatorsID = folder.agentID;
+ if (iib.inventoryID == LLUUID.Zero)
+ iib.inventoryID = LLUUID.Random();
+ if (iib.inventoryName == null || iib.inventoryName.Length == 0)
+ iib.inventoryName = "new item";
+ iib.parentFolderID = folder.folderID;
+
+ _databasePlugin.addInventoryItem(iib);
+ }
+
+ foreach (SerializedInventory.SerializedFolder sf in folder.SubFolders)
+ {
+ // assign default values, if they haven't assigned
+ sf.agentID = folder.agentID;
+ sf.category = folder.category;
+ if (sf.folderID == LLUUID.Zero)
+ sf.folderID = LLUUID.Random();
+ if (sf.name == null || sf.name.Length == 0)
+ sf.name = "new folder";
+ sf.parentID = folder.folderID;
+
+ _databasePlugin.addInventoryFolder(sf);
+ uploadInventory(sf);
+ }
+ }
+
+ public void loadInventoryFromXmlFile(InventoryCategory inventoryCategory, string fileName)
+ {
+ _databasePlugin.deleteInventoryCategory(inventoryCategory);
+
+ FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
+ XmlReader reader = new XmlTextReader(fs);
+ XmlSerializer x = new XmlSerializer(typeof(SerializedInventory));
+ SerializedInventory inventory = (SerializedInventory)x.Deserialize(reader);
+
+ // the library and default inventories has no owner, so we use a random guid.
+ if (inventory.root.category == InventoryCategory.Library || inventory.root.category == InventoryCategory.Default)
+ {
+ if (inventory.root.folderID != LLUUID.Zero)
+ inventory.root.agentID = inventory.root.folderID;
+ else
+ inventory.root.agentID = LLUUID.Random();
+ }
+ else if (inventory.root.category == InventoryCategory.User)
+ {
+ if (inventory.root.agentID == LLUUID.Zero)
+ inventory.root.agentID = LLUUID.Random();
+ }
+
+ inventory.root.folderID = inventory.root.agentID; // the root folder always has the same id as the owning agent
+ inventory.root.parentID = LLUUID.Zero;
+ inventory.root.version = 0;
+ inventory.root.category = inventoryCategory;
+
+ _databasePlugin.addInventoryFolder(inventory.root);
+ uploadInventory(inventory.root);
+ }
+
+ protected void saveInventoryToXmlFile(SerializedInventory inventory, string fileName)
+ {
+ FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
+ XmlTextWriter writer = new XmlTextWriter(fs, Encoding.UTF8);
+ writer.Formatting = Formatting.Indented;
+ XmlSerializer x = new XmlSerializer(typeof(SerializedInventory));
+ x.Serialize(writer, inventory);
+ }
+
public abstract void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack);
- public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder);
+ public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder);
public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item);
public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item);
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs
index b5a4184..b4280e7 100644
--- a/OpenSim/Framework/Communications/LoginResponse.cs
+++ b/OpenSim/Framework/Communications/LoginResponse.cs
@@ -26,9 +26,10 @@ namespace OpenSim.Framework.UserManagement
private ArrayList classifiedCategories;
private ArrayList inventoryRoot;
private ArrayList initialOutfit;
- private ArrayList agentInventory;
+ private ArrayList inventorySkeleton;
private ArrayList inventoryLibraryOwner;
- private ArrayList inventoryLibrary;
+ private ArrayList inventoryLibraryRoot;
+ private ArrayList inventoryLibrarySkeleton;
private UserInfo userProfile;
@@ -86,11 +87,13 @@ namespace OpenSim.Framework.UserManagement
this.defaultXmlRpcResponse = new XmlRpcResponse();
this.userProfile = new UserInfo();
- this.inventoryRoot = new ArrayList();
+
this.initialOutfit = new ArrayList();
- this.agentInventory = new ArrayList();
- this.inventoryLibrary = new ArrayList();
+ this.inventoryRoot = new ArrayList();
+ this.inventorySkeleton = new ArrayList();
+ this.inventoryLibrarySkeleton = new ArrayList();
this.inventoryLibraryOwner = new ArrayList();
+ this.inventoryLibraryRoot = new ArrayList();
this.xmlRpcResponse = new XmlRpcResponse();
this.defaultXmlRpcResponse = new XmlRpcResponse();
@@ -237,12 +240,15 @@ namespace OpenSim.Framework.UserManagement
responseData["classified_categories"] = this.classifiedCategories;
responseData["ui-config"] = this.uiConfig;
- responseData["inventory-skeleton"] = this.agentInventory;
- responseData["inventory-skel-lib"] = this.inventoryLibrary;
+ responseData["inventory-skeleton"] = this.inventorySkeleton;
+ responseData["inventory-skel-lib"] = this.inventoryLibrarySkeleton;
responseData["inventory-root"] = this.inventoryRoot;
- responseData["gestures"] = new ArrayList(); // todo
responseData["inventory-lib-owner"] = this.inventoryLibraryOwner;
+ responseData["inventory-lib-root"] = this.inventoryLibraryRoot;
+
+ responseData["gestures"] = new ArrayList(); // todo
responseData["initial-outfit"] = this.initialOutfit;
+
responseData["start_location"] = this.startLocation;
responseData["seed_capability"] = this.seedCapability;
responseData["home"] = this.home;
@@ -596,23 +602,23 @@ namespace OpenSim.Framework.UserManagement
{
get
{
- return this.agentInventory;
+ return this.inventorySkeleton;
}
set
{
- this.agentInventory = value;
+ this.inventorySkeleton = value;
}
}
- public ArrayList InventoryLibrary
+ public ArrayList InventoryLibrarySkeleton
{
get
{
- return this.inventoryLibrary;
+ return this.inventoryLibrarySkeleton;
}
set
{
- this.inventoryLibrary = value;
+ this.inventoryLibrarySkeleton = value;
}
}
@@ -628,6 +634,18 @@ namespace OpenSim.Framework.UserManagement
}
}
+ public ArrayList InventoryLibraryRoot
+ {
+ get
+ {
+ return this.inventoryLibraryRoot;
+ }
+ set
+ {
+ this.inventoryLibraryRoot = value;
+ }
+ }
+
public string Home
{
get
@@ -665,3 +683,7 @@ namespace OpenSim.Framework.UserManagement
}
}
+
+
+
+
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 8e7cf80..64e323d 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -8,11 +8,10 @@ using Nwc.XmlRpc;
using OpenSim.Framework.Console;
using OpenSim.Framework.Data;
using OpenSim.Framework.Interfaces;
-using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities;
-
+using OpenSim.Framework.Communications;
using OpenSim.Framework.Configuration;
-using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder;
+
namespace OpenSim.Framework.UserManagement
{
@@ -20,10 +19,12 @@ namespace OpenSim.Framework.UserManagement
{
protected string m_welcomeMessage = "Welcome to OpenSim";
protected UserManagerBase m_userManager = null;
+ protected IInventoryServices m_inventoryServer = null;
- public LoginService(UserManagerBase userManager, string welcomeMess)
+ public LoginService(UserManagerBase userManager, IInventoryServices inventoryServer, string welcomeMess)
{
m_userManager = userManager;
+ m_inventoryServer = inventoryServer;
if (welcomeMess != "")
{
m_welcomeMessage = welcomeMess;
@@ -37,7 +38,6 @@ namespace OpenSim.Framework.UserManagement
/// The response to send
public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
{
-
System.Console.WriteLine("Attempting login now...");
XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable)request.Params[0];
@@ -85,15 +85,41 @@ namespace OpenSim.Framework.UserManagement
{
LLUUID agentID = userProfile.UUID;
- // Inventory Library Section
- InventoryData inventData = this.CreateInventoryData(agentID);
- ArrayList AgentInventoryArray = inventData.InventoryArray;
+ LLUUID libraryFolderID;
+ LLUUID personalFolderID;
+
+ m_inventoryServer.GetRootFoldersForUser(agentID, out libraryFolderID, out personalFolderID);
+ if (personalFolderID == LLUUID.Zero)
+ {
+ m_inventoryServer.CreateNewUserInventory(libraryFolderID, agentID);
+ m_inventoryServer.GetRootFoldersForUser(agentID, out libraryFolderID, out personalFolderID);
+ }
+
+ // The option "inventory-lib-owner" requires that we return the id of the
+ // owner of the library inventory.
+ Hashtable dynamicStruct = new Hashtable();
+ dynamicStruct["agent_id"] = libraryFolderID.ToStringHyphenated();
+ logResponse.InventoryLibraryOwner.Add(dynamicStruct);
+
+ // The option "inventory-lib-root" requires that we return the id of the
+ // root folder of the library inventory.
+ dynamicStruct = new Hashtable();
+ dynamicStruct["folder_id"] = libraryFolderID.ToStringHyphenated();
+ logResponse.InventoryLibraryRoot.Add(dynamicStruct);
- Hashtable InventoryRootHash = new Hashtable();
- InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated();
- ArrayList InventoryRoot = new ArrayList();
- InventoryRoot.Add(InventoryRootHash);
- userProfile.rootInventoryFolderID = inventData.RootFolderID;
+ // The option "inventory-root" requires that we return the id of the
+ // root folder of the users inventory.
+ dynamicStruct = new Hashtable();
+ dynamicStruct["folder_id"] = personalFolderID.ToStringHyphenated();
+ logResponse.InventoryRoot.Add(dynamicStruct);
+
+ // The option "inventory-skeleton" requires that we return the structure of the
+ // users folder hierachy
+ logResponse.InventorySkeleton = GetInventorySkeleton(personalFolderID);
+
+ // The option "inventory-skel-lib" requires that we return the structure of the
+ // library folder hierachy
+ logResponse.InventoryLibrarySkeleton = GetInventorySkeleton(libraryFolderID);
// Circuit Code
uint circode = (uint)(Util.RandomClass.Next());
@@ -103,10 +129,6 @@ namespace OpenSim.Framework.UserManagement
logResponse.AgentID = agentID.ToStringHyphenated();
logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated();
logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated();
- logResponse.InventoryRoot = InventoryRoot;
- logResponse.InventorySkeleton = AgentInventoryArray;
- logResponse.InventoryLibrary = this.GetInventoryLibrary();
- logResponse.InventoryLibraryOwner = this.GetLibraryOwner();
logResponse.CircuitCode = (Int32)circode;
//logResponse.RegionX = 0; //overwritten
//logResponse.RegionY = 0; //overwritten
@@ -212,76 +234,30 @@ namespace OpenSim.Framework.UserManagement
}
///
- ///
- ///
- ///
- protected virtual ArrayList GetInventoryLibrary()
- {
- //return new ArrayList();
- Hashtable TempHash = new Hashtable();
- TempHash["name"] = "OpenSim Library";
- TempHash["parent_id"] = LLUUID.Zero.ToStringHyphenated();
- TempHash["version"] = 1;
- TempHash["type_default"] = -1;
- TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
- ArrayList temp = new ArrayList();
- temp.Add(TempHash);
-
- TempHash = new Hashtable();
- TempHash["name"] = "Texture Library";
- TempHash["parent_id"] = "00000112-000f-0000-0000-000100bba000";
- TempHash["version"] = 1;
- TempHash["type_default"] = -1;
- TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001";
- temp.Add(TempHash);
- return temp;
- }
-
- ///
- ///
+ /// Create a structure of the generic inventory structure of a specified folder
///
///
- protected virtual ArrayList GetLibraryOwner()
+ protected virtual ArrayList GetInventorySkeleton(LLUUID folderID)
{
- //for now create random inventory library owner
- Hashtable TempHash = new Hashtable();
- TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000";
- ArrayList inventoryLibOwner = new ArrayList();
- inventoryLibOwner.Add(TempHash);
- return inventoryLibOwner;
- }
- protected virtual InventoryData CreateInventoryData(LLUUID userID)
- {
- AgentInventory userInventory = new AgentInventory();
- userInventory.CreateRootFolder(userID, false);
+ List folders = m_inventoryServer.RequestFirstLevelFolders(folderID);
- ArrayList AgentInventoryArray = new ArrayList();
- Hashtable TempHash;
- foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
+ ArrayList temp = new ArrayList();
+ foreach (InventoryFolderBase ifb in folders)
{
- TempHash = new Hashtable();
- TempHash["name"] = InvFolder.FolderName;
- TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
- TempHash["version"] = (Int32)InvFolder.Version;
- TempHash["type_default"] = (Int32)InvFolder.DefaultType;
- TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
- AgentInventoryArray.Add(TempHash);
+ LLUUID tempFolderID = ifb.folderID;
+ LLUUID tempParentID = ifb.parentID;
+
+ Hashtable TempHash = new Hashtable();
+ TempHash["folder_id"] = tempFolderID.ToStringHyphenated();
+ TempHash["name"] = ifb.name;
+ TempHash["parent_id"] = tempParentID.ToStringHyphenated();
+ TempHash["type_default"] = ifb.type;
+ TempHash["version"] = ifb.version+1;
+ temp.Add(TempHash);
}
- return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
- }
-
- public class InventoryData
- {
- public ArrayList InventoryArray = null;
- public LLUUID RootFolderID = LLUUID.Zero;
-
- public InventoryData(ArrayList invList, LLUUID rootID)
- {
- InventoryArray = invList;
- RootFolderID = rootID;
- }
+ return temp;
}
}
}
diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
index 5009d9e..8a7e869 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs
@@ -132,7 +132,7 @@ namespace OpenSim.Framework.Data.MySQL
param["?uuid"] = user.ToStringHyphenated();
param["?zero"] = LLUUID.Zero.ToStringHyphenated();
- IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param);
+ IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND (agentID = ?uuid OR category = 0)", param);
IDataReader reader = result.ExecuteReader();
List items = database.readInventoryFolders(reader);
@@ -152,40 +152,6 @@ namespace OpenSim.Framework.Data.MySQL
}
///
- /// Returns the users inventory root folder.
- ///
- ///
- ///
- public InventoryFolderBase getUserRootFolder(LLUUID user)
- {
- try
- {
- lock (database)
- {
- Dictionary param = new Dictionary();
- param["?uuid"] = user.ToStringHyphenated();
- param["?zero"] = LLUUID.Zero.ToStringHyphenated();
-
- IDbCommand result = database.Query("SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", param);
- IDataReader reader = result.ExecuteReader();
-
- List items = database.readInventoryFolders(reader);
- InventoryFolderBase rootFolder = items[0]; //should only be one folder with parent set to zero (the root one).
- reader.Close();
- result.Dispose();
-
- return rootFolder;
- }
- }
- catch (Exception e)
- {
- database.Reconnect();
- Console.WriteLine(e.ToString());
- return null;
- }
- }
-
- ///
/// Returns a list of folders in a users inventory contained within the specified folder
///
/// The folder to search
@@ -348,5 +314,27 @@ namespace OpenSim.Framework.Data.MySQL
{
addInventoryFolder(folder);
}
+
+ public void deleteInventoryCategory(InventoryCategory inventoryCategory)
+ {
+ try
+ {
+ lock (database) {
+ IDbCommand cmd = database.Query(string.Format("DELETE FROM inventoryitems WHERE parentFolderID IN (SELECT folderId FROM inventoryfolders WHERE category={0})", (byte)inventoryCategory), null);
+ cmd.ExecuteNonQuery();
+
+
+ cmd = database.Query(string.Format("DELETE FROM inventoryfolders WHERE category={0}", (byte)inventoryCategory), null);
+ cmd.ExecuteNonQuery();
+ }
+
+ }
+ catch (Exception e)
+ {
+ database.Reconnect();
+ Console.WriteLine(e.ToString());
+ }
+ }
+
}
}
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
index 5037f98..e55606e 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Data.MySQL
///
/// The database connection object
///
- IDbConnection dbcon;
+ MySqlConnection dbcon;
///
/// Connection string for ADO.net
///
@@ -115,10 +115,11 @@ namespace OpenSim.Framework.Data.MySQL
{
MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand();
dbcommand.CommandText = sql;
- foreach (KeyValuePair param in parameters)
- {
- dbcommand.Parameters.Add(param.Key, param.Value);
- }
+ if(parameters != null)
+ foreach (KeyValuePair param in parameters)
+ {
+ dbcommand.Parameters.Add(param.Key, param.Value);
+ }
return (IDbCommand)dbcommand;
}
@@ -149,10 +150,11 @@ namespace OpenSim.Framework.Data.MySQL
{
MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand();
dbcommand.CommandText = sql;
- foreach (KeyValuePair param in parameters)
- {
- dbcommand.Parameters.Add(param.Key, param.Value);
- }
+ if(parameters != null)
+ foreach (KeyValuePair param in parameters)
+ {
+ dbcommand.Parameters.Add(param.Key, param.Value);
+ }
return (IDbCommand)dbcommand;
}
@@ -370,6 +372,8 @@ namespace OpenSim.Framework.Data.MySQL
folder.parentID = new LLUUID((string)reader["parentFolderID"]);
folder.folderID = new LLUUID((string)reader["folderID"]);
folder.name = (string)reader["folderName"];
+ folder.category = (InventoryCategory)((Int16)reader["category"]);
+ folder.type = (Int16)reader["folderType"];
rows.Add(folder);
}
@@ -509,24 +513,32 @@ namespace OpenSim.Framework.Data.MySQL
/// Success?
public bool insertFolder(InventoryFolderBase folder)
{
- string sql = "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName) VALUES ";
- sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName)";
-
- Dictionary parameters = new Dictionary();
- parameters["?folderID"] = folder.folderID.ToStringHyphenated();
- parameters["?agentID"] = folder.agentID.ToStringHyphenated();
- parameters["?parentFolderID"] = folder.parentID.ToStringHyphenated();
- parameters["?folderName"] = folder.name;
-
+ string sql = "REPLACE INTO inventoryfolders (folderID, agentID, parentFolderID, folderName, category, folderType) VALUES ";
+ sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?category, ?folderType)";
+
+ MySqlCommand dbcmd = dbcon.CreateCommand();
+ dbcmd.CommandText = sql;
+
+ LLUUID tmpID = folder.folderID;
+ dbcmd.Parameters.Add(new MySqlParameter("?folderID", tmpID.ToStringHyphenated()));
+ dbcmd.Parameters.Add(new MySqlParameter("?folderID", tmpID.ToStringHyphenated()));
+ tmpID = folder.agentID;
+ dbcmd.Parameters.Add(new MySqlParameter("?agentID", tmpID.ToStringHyphenated()));
+ tmpID = folder.parentID;
+ dbcmd.Parameters.Add(new MySqlParameter("?parentFolderID", tmpID.ToStringHyphenated()));
+ dbcmd.Parameters.Add(new MySqlParameter("?folderName", folder.name));
+ MySqlParameter p = dbcmd.Parameters.Add(new MySqlParameter("?category", MySqlDbType.Byte));
+ p.Value = (byte)folder.category;
+
+ p = dbcmd.Parameters.Add(new MySqlParameter("?folderType", MySqlDbType.Byte));
+ p.Value = (byte)folder.type;
+
+
bool returnval = false;
try
{
- IDbCommand result = Query(sql, parameters);
-
- if (result.ExecuteNonQuery() == 1)
+ if (dbcmd.ExecuteNonQuery() == 1)
returnval = true;
-
- result.Dispose();
}
catch (Exception e)
{
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
index d3d752f..cac992c 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteInventoryStore.cs
@@ -61,6 +61,7 @@ namespace OpenSim.Framework.Data.SQLite
MainLog.Instance.Verbose("DATASTORE", "Populated Intentory Items Definitions");
ds.AcceptChanges();
+
return;
}
@@ -195,43 +196,16 @@ namespace OpenSim.Framework.Data.SQLite
/// A list of folder objects
public List getUserRootFolders(LLUUID user)
{
- return null;
- }
-
- ///
- /// Returns the users inventory root folder.
- ///
- /// The UUID of the user who is having inventory being returned
- /// Root inventory folder
- public InventoryFolderBase getUserRootFolder(LLUUID user)
- {
List folders = new List();
DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
- string selectExp = "agentID = '" + user.ToString() + "' AND parentID = '" + LLUUID.Zero.ToString() + "'";
+
+ string selectExp = "parentID = '" + LLUUID.Zero.ToString() + "' AND (agentID = '" + user.ToString() + "' OR category = 0)";
DataRow[] rows = inventoryFolderTable.Select(selectExp);
foreach (DataRow row in rows)
{
folders.Add(this.buildFolder(row));
}
-
- if (folders.Count == 1)
- {
- //we found the root
- //System.Console.WriteLine("found root inventory folder");
- return folders[0];
- }
- else if (folders.Count > 1)
- {
- //err shouldn't be more than one root
- //System.Console.WriteLine("found more than one root inventory folder");
- }
- else if (folders.Count == 0)
- {
- // no root?
- //System.Console.WriteLine("couldn't find root inventory folder");
- }
-
- return null;
+ return folders;
}
///
@@ -270,7 +244,14 @@ namespace OpenSim.Framework.Data.SQLite
/// A class containing folder information
public InventoryFolderBase getInventoryFolder(LLUUID folder)
{
- return null;
+ DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
+ string selectExp = "UUID = '" + folder.ToString() + "'";
+ DataRow[] rows = inventoryFolderTable.Select(selectExp);
+
+ if (rows.Length == 1)
+ return this.buildFolder(rows[0]);
+ else
+ return null;
}
///
@@ -308,6 +289,11 @@ namespace OpenSim.Framework.Data.SQLite
this.invItemsDa.Update(ds, "inventoryitems");
}
+ //TODO! Implement SQLite deleteInventoryCategory
+ public void deleteInventoryCategory(InventoryCategory inventoryCategory)
+ {
+ }
+
///
/// Adds a new folder specified by folder
///
@@ -326,6 +312,11 @@ namespace OpenSim.Framework.Data.SQLite
this.addFolder(folder);
}
+ //TODO! implement CreateNewUserInventory
+ public void CreateNewUserInventory(LLUUID user)
+ {
+ throw new Exception("Function not implemented");
+ }
/***********************************************************************
*
@@ -350,6 +341,7 @@ namespace OpenSim.Framework.Data.SQLite
createCol(inv, "parentFolderID", typeof(System.String));
createCol(inv, "avatarID", typeof(System.String));
createCol(inv, "creatorsID", typeof(System.String));
+ createCol(inv, "category", typeof(System.Byte));
createCol(inv, "inventoryName", typeof(System.String));
createCol(inv, "inventoryDescription", typeof(System.String));
@@ -373,6 +365,7 @@ namespace OpenSim.Framework.Data.SQLite
createCol(fol, "parentID", typeof(System.String));
createCol(fol, "type", typeof(System.Int32));
createCol(fol, "version", typeof(System.Int32));
+ createCol(fol, "category", typeof(System.Byte));
fol.PrimaryKey = new DataColumn[] { fol.Columns["UUID"] };
return fol;
@@ -415,6 +408,7 @@ namespace OpenSim.Framework.Data.SQLite
folder.parentID = new LLUUID((string)row["parentID"]);
folder.type = Convert.ToInt16(row["type"]);
folder.version = Convert.ToUInt16(row["version"]);
+ folder.category = (InventoryCategory)Convert.ToByte(row["category"]);
return folder;
}
@@ -426,6 +420,7 @@ namespace OpenSim.Framework.Data.SQLite
row["parentID"] = folder.parentID;
row["type"] = folder.type;
row["version"] = folder.version;
+ row["category"] = folder.category;
}
@@ -644,3 +639,7 @@ namespace OpenSim.Framework.Data.SQLite
}
}
+
+
+
+
diff --git a/OpenSim/Framework/Data/InventoryData.cs b/OpenSim/Framework/Data/InventoryData.cs
index 2df26e1..dc857d8 100644
--- a/OpenSim/Framework/Data/InventoryData.cs
+++ b/OpenSim/Framework/Data/InventoryData.cs
@@ -25,15 +25,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+using System;
+using System.Xml.Serialization;
using System.Collections.Generic;
using libsecondlife;
namespace OpenSim.Framework.Data
{
+
+ public enum InventoryCategory : byte { Library, Default, User };
///
/// Inventory Item - contains all the properties associated with an individual inventory piece.
///
- public class InventoryItemBase
+ public class InventoryItemBase : MarshalByRefObject
{
///
/// A UUID containing the ID for the inventory item itself
@@ -66,10 +70,12 @@ namespace OpenSim.Framework.Data
///
/// The name of the inventory item (must be less than 64 characters)
///
+ [XmlElement(ElementName="name")]
public string inventoryName;
///
/// The description of the inventory item (must be less than 64 characters)
///
+ [XmlElement(ElementName = "description")]
public string inventoryDescription;
///
/// A mask containing the permissions for the next owner (cannot be enforced)
@@ -92,7 +98,7 @@ namespace OpenSim.Framework.Data
///
/// A Class for folders which contain users inventory
///
- public class InventoryFolderBase
+ public class InventoryFolderBase : MarshalByRefObject
{
///
/// The name of the folder (64 characters or less)
@@ -118,6 +124,10 @@ namespace OpenSim.Framework.Data
///
///
public ushort version;
+ ///
+ /// Inventory category, Library, Default, System
+ ///
+ public InventoryCategory category;
}
///
@@ -162,13 +172,6 @@ namespace OpenSim.Framework.Data
List getUserRootFolders(LLUUID user);
///
- /// Returns the users inventory root folder.
- ///
- /// The UUID of the user who is having inventory being returned
- /// Root inventory folder
- InventoryFolderBase getUserRootFolder(LLUUID user);
-
- ///
/// Returns a list of inventory folders contained in the folder 'parentID'
///
/// The folder to get subfolders for
@@ -218,5 +221,17 @@ namespace OpenSim.Framework.Data
///
/// The inventory folder
void updateInventoryFolder(InventoryFolderBase folder);
+
+ ///
+ /// Delete a complete inventory category
+ ///
+ /// What folder category shout be deleted
+ void deleteInventoryCategory(InventoryCategory inventoryCategory);
+
+ ///
+ /// Setup the initial folderset of a user
+ ///
+ ///
+ //void CreateNewUserInventory(LLUUID user);
}
}
diff --git a/OpenSim/Framework/General/Configuration/InventoryConfig.cs b/OpenSim/Framework/General/Configuration/InventoryConfig.cs
new file mode 100644
index 0000000..d84609b
--- /dev/null
+++ b/OpenSim/Framework/General/Configuration/InventoryConfig.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OpenSim.Framework.Configuration
+{
+ ///
+ /// UserConfig -- For User Server Configuration
+ ///
+ public class InventoryConfig
+ {
+ public string DefaultStartupMsg = "";
+ public string UserServerURL = "";
+ public string UserSendKey = "";
+ public string UserRecvKey = "";
+
+ public string DatabaseProvider = "";
+
+ public int RemotingPort = 8004;
+
+ private ConfigurationMember configMember;
+
+ public InventoryConfig(string description, string filename)
+ {
+ configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration);
+ configMember.performConfigurationRetrieve();
+ }
+
+ public void loadConfigurationOptions()
+ {
+ configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS", false);
+ configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:8002/", false);
+ configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false);
+ configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false);
+ configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false);
+ configMember.addConfigurationOption("remoting_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Remoting Listener port", "8004", false);
+
+ }
+
+ public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
+ {
+ switch (configuration_key)
+ {
+ case "default_startup_message":
+ this.DefaultStartupMsg = (string)configuration_result;
+ break;
+ case "default_user_server":
+ this.UserServerURL = (string)configuration_result;
+ break;
+ case "user_send_key":
+ this.UserSendKey = (string)configuration_result;
+ break;
+ case "user_recv_key":
+ this.UserRecvKey = (string)configuration_result;
+ break;
+ case "database_provider":
+ this.DatabaseProvider = (string)configuration_result;
+ break;
+ case "remoting_port":
+ RemotingPort = (int)configuration_result;
+ break;
+ }
+
+ return true;
+ }
+ }
+}
diff --git a/OpenSim/Framework/General/Configuration/UserConfig.cs b/OpenSim/Framework/General/Configuration/UserConfig.cs
index 776b911..16a7de4 100644
--- a/OpenSim/Framework/General/Configuration/UserConfig.cs
+++ b/OpenSim/Framework/General/Configuration/UserConfig.cs
@@ -18,6 +18,9 @@ namespace OpenSim.Framework.Configuration
public uint HttpPort = 8002;
+ public int InventoryServerPort;
+ public string InventoryServerName;
+
private ConfigurationMember configMember;
public UserConfig(string description, string filename)
@@ -37,6 +40,8 @@ namespace OpenSim.Framework.Configuration
configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Http Listener port", "8002", false);
+ configMember.addConfigurationOption("inventory_server_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Portnumber inventory is listening on", "8004", false);
+ configMember.addConfigurationOption("inventory_server_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DNS name of the inventory server", "127.0.0.1", false);
}
public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
@@ -59,6 +64,12 @@ namespace OpenSim.Framework.Configuration
this.DatabaseProvider = (string)configuration_result;
break;
+ case "inventory_server_port":
+ this.InventoryServerPort = (int)configuration_result;
+ break;
+ case "inventory_server_name":
+ this.InventoryServerName = (string)configuration_result;
+ break;
case "http_port":
HttpPort = (uint)configuration_result;
break;
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs
index b65488a..cf194fc 100644
--- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs
+++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs
@@ -49,6 +49,8 @@ namespace OpenSim.Framework.Types
public int HttpListenerPort = 9000;
public int RemotingListenerPort = 8895;
+ public int InventoryServerPort;
+ public string InventoryServerName = "";
public NetworkServersInfo()
{
@@ -86,7 +88,8 @@ namespace OpenSim.Framework.Types
UserSendKey = config.Configs["Network"].GetString("user_send_key", "null");
UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null");
AssetURL = config.Configs["Network"].GetString("asset_server_url", "http://127.0.0.1:8003");
-
+ InventoryServerPort = config.Configs["Network"].GetInt("inventory_server_port", 8004);
+ InventoryServerName = config.Configs["Network"].GetString("inventory_server_name", "127.0.0.1");
}
}
}
diff --git a/OpenSim/Framework/General/Types/UUID.cs b/OpenSim/Framework/General/Types/UUID.cs
index 9e9654d..feae4ae 100644
--- a/OpenSim/Framework/General/Types/UUID.cs
+++ b/OpenSim/Framework/General/Types/UUID.cs
@@ -91,12 +91,12 @@ namespace OpenSim.Framework.Types
public void Combine(UUID other)
{
- llUUID.Combine(other.GetLLUUID());
+ LLUUID.Combine(llUUID, other.GetLLUUID());
}
public void Combine(LLUUID other)
{
- llUUID.Combine(other);
+ LLUUID.Combine(llUUID, other);
}
public override bool Equals(Object other)
diff --git a/OpenSim/Grid/InventoryServer/InventoryManager.cs b/OpenSim/Grid/InventoryServer/InventoryManager.cs
index 016b8bb..a46f359 100644
--- a/OpenSim/Grid/InventoryServer/InventoryManager.cs
+++ b/OpenSim/Grid/InventoryServer/InventoryManager.cs
@@ -26,37 +26,34 @@
*
*/
using System;
+using System.Text;
+using System.Reflection;
using System.Collections;
using System.Collections.Generic;
-using System.Text;
-using OpenGrid.Framework.Data;
using libsecondlife;
-using System.Reflection;
using System.Xml;
-using Nwc.XmlRpc;
-using OpenSim.Framework.Sims;
-using OpenSim.Framework.Inventory;
+using OpenSim.Framework.Console;
using OpenSim.Framework.Utilities;
+using OpenSim.Framework.Data;
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
-using System.Security.Cryptography;
-
-namespace OpenGridServices.InventoryServer
+namespace OpenSim.Grid.InventoryServer
{
- class InventoryManager
+ class InventoryManager : IInventoryData
{
- Dictionary _plugins = new Dictionary();
+ IInventoryData _databasePlugin;
///
/// Adds a new inventory server plugin - user servers will be requested in the order they were loaded.
///
/// The filename to the inventory server plugin DLL
- public void AddPlugin(string FileName)
+ public void AddDatabasePlugin(string FileName)
{
- OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Attempting to load " + FileName);
+ MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Invenstorage: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName);
- OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
+ MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (!pluginType.IsAbstract)
@@ -67,8 +64,9 @@ namespace OpenGridServices.InventoryServer
{
IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise();
- this._plugins.Add(plug.getName(), plug);
- OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Added IUserData Interface");
+ _databasePlugin = plug;
+ MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Invenstorage: Added IInventoryData Interface");
+ break;
}
typeInterface = null;
@@ -80,46 +78,87 @@ namespace OpenGridServices.InventoryServer
public List getRootFolders(LLUUID user)
{
- foreach (KeyValuePair kvp in _plugins)
- {
- try
- {
- return kvp.Value.getUserRootFolders(user);
- }
- catch (Exception e)
- {
- OpenSim.Framework.Console.MainConsole.Instance.Notice("Unable to get root folders via " + kvp.Key + " (" + e.ToString() + ")");
- }
- }
return null;
}
- public XmlRpcResponse XmlRpcInventoryRequest(XmlRpcRequest request)
+ #region IInventoryData Members
+
+
+ public List getInventoryInFolder(LLUUID folderID)
+ {
+ return _databasePlugin.getInventoryInFolder(folderID);
+ }
+
+ public List getUserRootFolders(LLUUID user)
{
- XmlRpcResponse response = new XmlRpcResponse();
- Hashtable requestData = (Hashtable)request.Params[0];
+ return _databasePlugin.getUserRootFolders(user);
+ }
- Hashtable responseData = new Hashtable();
+ public List getInventoryFolders(LLUUID parentID)
+ {
+ return _databasePlugin.getInventoryFolders(parentID);
+ }
- // Stuff happens here
+ public InventoryItemBase getInventoryItem(LLUUID item)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
- if (requestData.ContainsKey("Access-type"))
- {
- if (requestData["access-type"] == "rootfolders")
- {
-// responseData["rootfolders"] =
- }
- }
- else
- {
- responseData["error"] = "No access-type specified.";
- }
+ public InventoryFolderBase getInventoryFolder(LLUUID folder)
+ {
+ return _databasePlugin.getInventoryFolder(folder);
+ }
+
+ public void addInventoryItem(InventoryItemBase item)
+ {
+ _databasePlugin.addInventoryItem(item);
+ }
+
+ public void updateInventoryItem(InventoryItemBase item)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void deleteInventoryItem(InventoryItemBase item)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void addInventoryFolder(InventoryFolderBase folder)
+ {
+ _databasePlugin.addInventoryFolder(folder);
+ }
+
+ public void updateInventoryFolder(InventoryFolderBase folder)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void Initialise()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void Close()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+ public string getName()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
- // Stuff stops happening here
+ public string getVersion()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
- response.Value = responseData;
- return response;
+ public void deleteInventoryCategory(InventoryCategory inventoryCategory)
+ {
+ _databasePlugin.deleteInventoryCategory(inventoryCategory);
}
+
+ #endregion
}
}
diff --git a/OpenSim/Grid/InventoryServer/InventoryService.cs b/OpenSim/Grid/InventoryServer/InventoryService.cs
new file mode 100644
index 0000000..cbc0558
--- /dev/null
+++ b/OpenSim/Grid/InventoryServer/InventoryService.cs
@@ -0,0 +1,136 @@
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+using System.Runtime.Serialization.Formatters;
+using System.Collections;
+using System.Collections.Generic;
+
+
+using libsecondlife;
+using OpenSim.Framework.Data;
+using OpenSim.Framework.Communications;
+using OpenSim.Framework.Configuration;
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
+
+namespace OpenSim.Grid.InventoryServer
+{
+ class InventoryServiceSingleton : OpenSim.Framework.Communications.InventoryServiceBase
+ {
+ static InventoryManager _inventoryManager;
+
+ static public InventoryManager InventoryManager
+ {
+ set { _inventoryManager = value; }
+ get { return _inventoryManager; }
+ }
+
+#region Singleton Pattern
+ static InventoryServiceSingleton instance=null;
+
+ InventoryServiceSingleton()
+ {
+ }
+
+ public static InventoryServiceSingleton Instance
+ {
+ get
+ {
+ if (instance==null)
+ {
+ instance = new InventoryServiceSingleton();
+ }
+ return instance;
+ }
+ }
+#endregion
+
+#region IInventoryServices Members
+
+ public override void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
+ {
+ List folders = this.RequestFirstLevelFolders(userID);
+ InventoryFolderBase rootFolder = null;
+
+ //need to make sure we send root folder first
+ foreach (InventoryFolderBase folder in folders)
+ {
+ if (folder.parentID == libsecondlife.LLUUID.Zero)
+ {
+ rootFolder = folder;
+ folderCallBack(userID, folder);
+ }
+ }
+
+ if (rootFolder != null)
+ {
+ foreach (InventoryFolderBase folder in folders)
+ {
+ if (folder.folderID != rootFolder.folderID)
+ {
+ folderCallBack(userID, folder);
+
+ List items = this.RequestFolderItems(folder.folderID);
+ foreach (InventoryItemBase item in items)
+ {
+ itemCallBack(userID, item);
+ }
+ }
+ }
+ }
+
+ }
+
+ public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
+ {
+ _inventoryManager.addInventoryFolder(folder);
+ }
+
+ public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
+ {
+ throw new Exception("Not implemented exception");
+ }
+
+ public override void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
+ {
+ throw new Exception("Not implemented exception");
+ }
+
+ public List RequestFolderItems(LLUUID folderID)
+ {
+ return _inventoryManager.getInventoryInFolder(folderID);
+ }
+
+
+#endregion
+ }
+
+ class InventoryService
+ {
+ InventoryServiceSingleton _inventoryServiceMethods;
+ public InventoryService(InventoryManager inventoryManager, InventoryConfig cfg)
+ {
+ // we only need to register the tcp channel once, and we don't know which other modules use remoting
+ if (ChannelServices.GetChannel("tcp") == null)
+ {
+ // Creating a custom formatter for a TcpChannel sink chain.
+ BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
+ serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
+
+ IDictionary props = new Hashtable();
+ props["port"] = cfg.RemotingPort;
+ props["typeFilterLevel"] = TypeFilterLevel.Full;
+
+ // Pass the properties for the port setting and the server provider in the server chain argument. (Client remains null here.)
+ ChannelServices.RegisterChannel(new TcpChannel(props, null, serverProvider), true);
+ }
+
+ // Register the object
+ RemotingConfiguration.RegisterWellKnownServiceType(typeof(InventoryServiceSingleton), "Inventory", WellKnownObjectMode.Singleton);
+
+ _inventoryServiceMethods = InventoryServiceSingleton.Instance;
+ InventoryServiceSingleton.InventoryManager = inventoryManager;
+ }
+
+ }
+}
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 97addb0..392c741 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -31,49 +31,130 @@ using System.Collections.Generic;
using System.Reflection;
using System.IO;
using System.Text;
+using System.Xml;
+
using libsecondlife;
-using OpenSim.Framework.User;
-using OpenSim.Framework.Sims;
-using OpenSim.Framework.Inventory;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Console;
-using OpenSim.Servers;
using OpenSim.Framework.Utilities;
+using OpenSim.Framework.Configuration;
+using OpenSim.Framework.Data;
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
-namespace OpenGridServices.InventoryServer
+namespace OpenSim.Grid.InventoryServer
{
- public class OpenInventory_Main : BaseServer, conscmd_callback
+
+ public class OpenInventory_Main : conscmd_callback
{
- ConsoleBase m_console;
- InventoryManager m_inventoryManager;
+ public const string MainLogName = "INVENTORY";
+
+ private InventoryConfig m_config;
+ LogBase m_console;
+ InventoryManager m_inventoryManager; ///connection the database backend
+ InventoryService m_inventoryService; ///Remoting interface, where messages arrive
+ [STAThread]
public static void Main(string[] args)
{
+ Console.WriteLine("Launching InventoryServer...");
+
+ OpenInventory_Main inventoryServer = new OpenInventory_Main();
+
+ inventoryServer.Startup();
+
+// inventoryServer.RunCmd("load", new string[] { "library", "inventory_library.xml" });
+// inventoryServer.RunCmd("load", new string[] { "default", "inventory_default.xml" });
+
+ inventoryServer.Work();
}
public OpenInventory_Main()
{
- m_console = new ConsoleBase("opengrid-inventory-console.log", "OpenInventory", this, false);
- MainConsole.Instance = m_console;
+
+ if (!Directory.Exists(Util.logDir()))
+ {
+ Directory.CreateDirectory(Util.logDir());
+ }
+
+ m_console = new LogBase(Path.Combine(Util.logDir(), "opensim-inventory-console.log"), "OpenInventory", this, false);
+ MainLog.Instance = m_console;
+ }
+
+ private void Work()
+ {
+ m_console.Notice(OpenInventory_Main.MainLogName, "Enter help for a list of commands\n");
+
+ while (true)
+ {
+ m_console.MainLogPrompt();
+ }
}
public void Startup()
{
- MainConsole.Instance.Notice("Initialising inventory manager...");
+ MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Initialising inventory manager...");
+
+ m_config = new InventoryConfig(OpenInventory_Main.MainLogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml")));
+
+ // instantiate the manager, responsible for doing the actual storage
m_inventoryManager = new InventoryManager();
+ m_inventoryManager.AddDatabasePlugin(m_config.DatabaseProvider);
+
+ m_inventoryService = new InventoryService(m_inventoryManager, m_config);
- MainConsole.Instance.Notice("Starting HTTP server");
- BaseHttpServer httpServer = new BaseHttpServer(8004);
+ // Dig out the embedded version number of this assembly
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ string serverExeName = assembly.ManifestModule.Name;
+ Version serverExeVersion = AssemblyName.GetAssemblyName(serverExeName).Version;
- httpServer.AddXmlRPCHandler("rootfolders", m_inventoryManager.XmlRpcInventoryRequest);
- //httpServer.AddRestHandler("GET","/rootfolders/",Rest
+ m_console.Status(OpenInventory_Main.MainLogName, "Inventoryserver {0}.{1}.{2}.{3} - Startup complete", serverExeVersion.Major, serverExeVersion.Minor, serverExeVersion.Revision, serverExeVersion.Build);
}
- public void RunCmd(string cmd, string[] cmdparams)
+
+ public void Load(string[] cmdparams)
{
+ string cmd = cmdparams[0];
+ string fileName = cmdparams[1];
+
+ if (cmdparams.Length != 2)
+ {
+ cmd = "help";
+ }
+
switch (cmd)
{
+ case "library":
+ InventoryServiceSingleton.Instance.loadInventoryFromXmlFile(InventoryCategory.Library, fileName);
+ break;
+ case "default":
+ InventoryServiceSingleton.Instance.loadInventoryFromXmlFile(InventoryCategory.Default, fileName);
+ break;
+ case "user":
+ InventoryServiceSingleton.Instance.loadInventoryFromXmlFile(InventoryCategory.User, fileName);
+ break;
+ case "help":
+ m_console.Notice("load library , load library inventory, shared between all users");
+ m_console.Notice("load default , load template inventory, used when creating a new user inventory");
+ m_console.Notice("load user , load inventory for a specific users, warning this will reset the contents of the inventory");
+ break;
+ }
+ }
+
+ public void RunCmd(string cmd, string[] cmdparams)
+ {
+ switch (cmd)
+ {
+ case "help":
+ m_console.Notice("load - load verious inventories, use \"load help\", to see a list of commands");
+ m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)");
+ m_console.Notice("quit - shutdown the grid (USE CAUTION!)");
+ break;
+ case "load":
+ Load(cmdparams);
+ break;
+ case "quit":
case "shutdown":
+ MainLog.Instance.Verbose(OpenInventory_Main.MainLogName, "Shutting down inventory server");
m_console.Close();
Environment.Exit(0);
break;
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs
index c2822b6..28635dd 100644
--- a/OpenSim/Grid/UserServer/Main.cs
+++ b/OpenSim/Grid/UserServer/Main.cs
@@ -36,6 +36,8 @@ using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Configuration;
+using OpenSim.Framework.Communications;
+using OpenSim.Region.Communications.OGS1;
namespace OpenSim.Grid.UserServer
{
@@ -48,6 +50,8 @@ namespace OpenSim.Grid.UserServer
public UserManager m_userManager;
public UserLoginService m_loginService;
+ public IInventoryServices m_inventoryService;
+
LogBase m_console;
[STAThread]
@@ -90,7 +94,11 @@ namespace OpenSim.Grid.UserServer
m_userManager._config = Cfg;
m_userManager.AddPlugin(Cfg.DatabaseProvider);
- m_loginService = new UserLoginService(m_userManager, Cfg, Cfg.DefaultStartupMsg);
+ // prepare connection to the inventory server
+ m_inventoryService = new OGS1InventoryService(Cfg.InventoryServerName, Cfg.InventoryServerPort, null);
+
+
+ m_loginService = new UserLoginService(m_userManager, m_inventoryService, Cfg, Cfg.DefaultStartupMsg);
MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer((int)Cfg.HttpPort);
@@ -103,6 +111,7 @@ namespace OpenSim.Grid.UserServer
httpServer.AddStreamHandler( new RestStreamHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod ));
httpServer.Start();
+
m_console.Status("SERVER", "Userserver 0.3 - Startup complete");
}
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 95192e3..f0140a5 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -6,6 +6,7 @@ using OpenSim.Framework.Data;
using OpenSim.Framework.UserManagement;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Configuration;
+using OpenSim.Framework.Communications;
namespace OpenSim.Grid.UserServer
{
@@ -13,8 +14,8 @@ namespace OpenSim.Grid.UserServer
{
public UserConfig m_config;
- public UserLoginService(UserManagerBase userManager, UserConfig config, string welcomeMess)
- : base(userManager, welcomeMess)
+ public UserLoginService(UserManagerBase userManager, IInventoryServices inventoryServer, UserConfig config, string welcomeMess)
+ : base(userManager, inventoryServer, welcomeMess)
{
m_config = config;
}
@@ -71,25 +72,29 @@ namespace OpenSim.Grid.UserServer
theUser.currentAgent.currentHandle = SimInfo.regionHandle;
System.Console.WriteLine("Informing region --> " + SimInfo.httpServerURI);
- // Send
- try
- {
- XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
- XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000);
+ // Send
+ try
+ {
+ XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
+ XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000);
}
catch( WebException e )
- {
- switch( e.Status )
- {
- case WebExceptionStatus.Timeout:
- //TODO: Send him to nearby or default region instead
- break;
-
- default:
- throw;
- }
+ {
+ switch( e.Status )
+ {
+ case WebExceptionStatus.Timeout:
+ //TODO: Send him to nearby or default region instead
+ break;
+
+ default:
+ throw;
+ }
}
}
}
}
+
+
+
+
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index e526f73..b35a9d3 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -30,7 +30,6 @@ using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
-using OpenSim.Framework.Inventory;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Interfaces;
@@ -353,7 +352,7 @@ namespace OpenSim.Region.ClientStack
// Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionID).ToStringHyphenated());
if (OnAssetUploadRequest != null)
{
- OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
+ OnAssetUploadRequest(this, LLUUID.Combine(request.AssetBlock.TransactionID, this.SecureSessionID), request.AssetBlock.TransactionID, request.AssetBlock.Type, request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
}
break;
case PacketType.RequestXfer:
@@ -418,7 +417,7 @@ namespace OpenSim.Region.ClientStack
{
if (update.InventoryData[i].TransactionID != LLUUID.Zero)
{
- OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, update.InventoryData[i].TransactionID.Combine(this.SecureSessionID), update.InventoryData[i].ItemID);
+ OnUpdateInventoryItem(this, update.InventoryData[i].TransactionID, LLUUID.Combine(update.InventoryData[i].TransactionID, this.SecureSessionID), update.InventoryData[i].ItemID);
}
}
}
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 2489739..ecf78cb 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -37,7 +37,6 @@ using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console;
using OpenSim.Framework.Interfaces;
-using OpenSim.Framework.Inventory;
using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities;
using Timer = System.Timers.Timer;
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index a00b35f..7e08297 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.Communications.Local
}
else
{
- this.m_inventoryService.CreateNewUserInventory(userProf.UUID);
+ this.m_inventoryService.CreateNewUserInventory(LLUUID.Zero, userProf.UUID);
Console.WriteLine("Created new inventory set for " + firstName + " " + lastName);
return userProf.UUID;
}
diff --git a/OpenSim/Region/Communications/Local/LocalInventoryService.cs b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
index 53f6ffa..5bd3277 100644
--- a/OpenSim/Region/Communications/Local/LocalInventoryService.cs
+++ b/OpenSim/Region/Communications/Local/LocalInventoryService.cs
@@ -3,6 +3,7 @@ using libsecondlife;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Data;
using InventoryFolder=OpenSim.Framework.Communications.Caches.InventoryFolder;
+using InventoryCategory = OpenSim.Framework.Data.InventoryCategory;
namespace OpenSim.Region.Communications.Local
{
@@ -49,7 +50,7 @@ namespace OpenSim.Region.Communications.Local
}
}
- public override void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder)
+ public override void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
{
this.AddFolder(folder);
}
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index ab8e397..95fdf5a 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -7,7 +7,6 @@ using OpenSim.Framework.Data;
using OpenSim.Framework.Types;
using OpenSim.Framework.UserManagement;
using OpenSim.Framework.Utilities;
-using OpenSim.Framework.Inventory;
namespace OpenSim.Region.Communications.Local
{
@@ -25,7 +24,7 @@ namespace OpenSim.Region.Communications.Local
public event LoginToRegionEvent OnLoginToRegion;
public LocalLoginService(UserManagerBase userManager, string welcomeMess, CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate)
- : base(userManager, welcomeMess)
+ : base(userManager, parent.InventoryService, welcomeMess)
{
m_Parent = parent;
this.serversInfo = serversInfo;
@@ -53,7 +52,7 @@ namespace OpenSim.Region.Communications.Local
profile = this.m_userManager.GetUserProfile(firstname, lastname);
if (profile != null)
{
- m_Parent.InventoryService.CreateNewUserInventory(profile.UUID);
+ m_Parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID);
}
return profile;
@@ -123,51 +122,5 @@ namespace OpenSim.Region.Communications.Local
}
}
-
- protected override InventoryData CreateInventoryData(LLUUID userID)
- {
- List folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID);
- if (folders.Count > 0)
- {
- LLUUID rootID = LLUUID.Zero;
- ArrayList AgentInventoryArray = new ArrayList();
- Hashtable TempHash;
- foreach (InventoryFolderBase InvFolder in folders)
- {
- if (InvFolder.parentID == LLUUID.Zero)
- {
- rootID = InvFolder.folderID;
- }
- TempHash = new Hashtable();
- TempHash["name"] = InvFolder.name;
- TempHash["parent_id"] = InvFolder.parentID.ToStringHyphenated();
- TempHash["version"] = (Int32)InvFolder.version;
- TempHash["type_default"] = (Int32)InvFolder.type;
- TempHash["folder_id"] = InvFolder.folderID.ToStringHyphenated();
- AgentInventoryArray.Add(TempHash);
- }
- return new InventoryData(AgentInventoryArray, rootID);
- }
- else
- {
- AgentInventory userInventory = new AgentInventory();
- userInventory.CreateRootFolder(userID, false);
-
- ArrayList AgentInventoryArray = new ArrayList();
- Hashtable TempHash;
- foreach (OpenSim.Framework.Inventory.InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
- {
- TempHash = new Hashtable();
- TempHash["name"] = InvFolder.FolderName;
- TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
- TempHash["version"] = (Int32)InvFolder.Version;
- TempHash["type_default"] = (Int32)InvFolder.DefaultType;
- TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
- AgentInventoryArray.Add(TempHash);
- }
-
- return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
- }
- }
}
}
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index 3bc4301..61b8633 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -1,4 +1,5 @@
using System;
+using libsecondlife;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Data;
using OpenSim.Framework.Types;
@@ -48,10 +49,10 @@ namespace OpenSim.Region.Communications.Local
}
else
{
- m_parent.InventoryService.CreateNewUserInventory(profile.UUID);
+ m_parent.InventoryService.CreateNewUserInventory(LLUUID.Zero, profile.UUID);
}
return profile;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index 96f1933..1aa6498 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -14,8 +14,8 @@ namespace OpenSim.Region.Communications.OGS1
m_gridService = gridInterComms;
m_interRegion = gridInterComms;
- m_inventoryService = new OGS1InventoryService();
m_userService = new OGS1UserServices(this);
+ m_inventoryService = new OGS1InventoryService(serversInfo, m_userService);
}
}
}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 1b4b54c..0b78c83 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -5,6 +5,7 @@ using System.Net;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
+using System.Runtime.Serialization.Formatters;
using libsecondlife;
using Nwc.XmlRpc;
using OpenSim.Framework;
@@ -302,8 +303,23 @@ namespace OpenSim.Region.Communications.OGS1
///
private void StartRemoting()
{
- TcpChannel ch = new TcpChannel(this.serversInfo.RemotingListenerPort);
- ChannelServices.RegisterChannel(ch, true);
+ // we only need to register the tcp channel once, and we don't know which other modules use remoting
+ if (ChannelServices.GetChannel("tcp") == null)
+ {
+ // Creating a custom formatter for a TcpChannel sink chain.
+ BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
+ serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
+
+ BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
+
+ IDictionary props = new Hashtable();
+ props["port"] = this.serversInfo.RemotingListenerPort;
+ props["typeFilterLevel"] = TypeFilterLevel.Full;
+
+ TcpChannel ch = new TcpChannel(props, clientProvider, serverProvider);
+
+ ChannelServices.RegisterChannel(ch, true);
+ }
WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(wellType);
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 45188c1..2ec4d10 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -1,8 +1,15 @@
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+using System.Runtime.Serialization.Formatters;
+using System.Collections;
using System.Collections.Generic;
+
using libsecondlife;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Data;
-using InventoryFolder = OpenSim.Framework.Communications.Caches.InventoryFolder;
+using OpenSim.Framework.Types;
namespace OpenSim.Region.Communications.OGS1
@@ -10,43 +17,83 @@ namespace OpenSim.Region.Communications.OGS1
public class OGS1InventoryService : IInventoryServices
{
- public OGS1InventoryService()
+ IUserServices _userServices;
+ IInventoryServices _inventoryServices;
+
+ public OGS1InventoryService(NetworkServersInfo networkConfig, IUserServices userServices) :
+ this(networkConfig.InventoryServerName, networkConfig.InventoryServerPort, userServices)
+ {
+ }
+
+ public OGS1InventoryService(string serverName, int serverPort, IUserServices userServices)
{
+ _userServices = userServices;
+
+ // we only need to register the tcp channel once, and we don't know which other modules use remoting
+ if (ChannelServices.GetChannel("tcp") == null)
+ {
+ // Creating a custom formatter for a TcpChannel sink chain.
+ BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
+ serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
+
+ BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider();
+
+ IDictionary props = new Hashtable();
+ props["typeFilterLevel"] = TypeFilterLevel.Full;
+
+ // Pass the properties for the port setting and the server provider in the server chain argument. (Client remains null here.)
+ TcpChannel chan = new TcpChannel(props, clientProvider, serverProvider);
+
+ ChannelServices.RegisterChannel(chan, true);
+ }
+
+
+ string remotingUrl = string.Format("tcp://{0}:{1}/Inventory", serverName, serverPort);
+ _inventoryServices = (IInventoryServices)Activator.GetObject(typeof(IInventoryServices), remotingUrl);
}
#region IInventoryServices Members
public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack)
{
-
+ _inventoryServices.RequestInventoryForUser(userID, folderCallBack, itemCallBack);
}
- public void AddNewInventoryFolder(LLUUID userID, InventoryFolder folder)
+ public void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder)
{
-
+ _inventoryServices.AddNewInventoryFolder(userID, folder);
}
public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
{
-
+ _inventoryServices.AddNewInventoryItem(userID, item);
}
public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
{
-
+ _inventoryServices.DeleteInventoryItem(userID, item);
+ }
+
+ public List RequestFirstLevelFolders(LLUUID folderID)
+ {
+ return _inventoryServices.RequestFirstLevelFolders(folderID);
}
- public void CreateNewUserInventory(LLUUID user)
+ public List RequestFolderItems(LLUUID folderID)
{
-
+ return _inventoryServices.RequestFolderItems(folderID);
}
- public List RequestFirstLevelFolders(LLUUID userID)
+ public void GetRootFoldersForUser(LLUUID user, out LLUUID libraryFolder, out LLUUID personalFolder)
{
- return new List();
+ _inventoryServices.GetRootFoldersForUser(user, out libraryFolder, out personalFolder);
}
+ public void CreateNewUserInventory(LLUUID libraryRootId, LLUUID user)
+ {
+ throw new Exception("method not implemented");
+ }
#endregion
}
}
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index 1c7b806..d76ffe3 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -162,7 +162,7 @@ namespace OpenSim.Region.Environment.Modules
avatar = m_scene.GetScenePresence(presence.ControllingClient.AgentId);
if (avatar != null)
{
- dis = (int) avatar.AbsolutePosition.GetDistanceTo(fromPos);
+ dis = (int)LLVector3.Mag(avatar.AbsolutePosition-fromPos);
}
switch (type)
@@ -211,4 +211,4 @@ namespace OpenSim.Region.Environment.Modules
}
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index e6b8364..5b6fe46 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -561,7 +561,7 @@ namespace OpenSim.Region.Environment.Scenes
}
/// check for physics-related movement
- else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02)
+ else if (LLVector3.Dist(lastPhysPos,AbsolutePosition) > 0.02)
{
SendTerseUpdateToAllClients();
m_updateCount = 0;
@@ -748,7 +748,7 @@ namespace OpenSim.Region.Environment.Scenes
protected void CheckForSignificantMovement()
{
- if (Helpers.VecDist(AbsolutePosition, posLastSignificantMove) > 2.0)
+ if (LLVector3.Dist(AbsolutePosition, posLastSignificantMove) > 2.0)
{
posLastSignificantMove = AbsolutePosition;
if (OnSignificantClientMovement != null)
@@ -919,4 +919,4 @@ namespace OpenSim.Region.Environment.Scenes
RemoveFromPhysicalScene();
}
}
-}
\ No newline at end of file
+}
diff --git a/bin/OpenSim.ini b/bin/OpenSim.ini
index f4efeb5..a6cc18b 100644
--- a/bin/OpenSim.ini
+++ b/bin/OpenSim.ini
@@ -1,5 +1,5 @@
[Startup]
-gridmode = false
+gridmode = true
physics = basicphysics
; Prim Storage
; if you would like to use sqlite uncomment the following line (and
@@ -28,13 +28,13 @@ default_location_y = 1000
http_listener_port = 9000
remoting_listener_port = 8895
-grid_server_url = "http://127.0.0.1:8001"
-grid_send_key = "null"
-grid_recv_key = "null"
+grid_server_url = "http://osgrid.org:8001/"
+grid_send_key = "1234"
+grid_recv_key = "1234"
-user_server_url = "http://127.0.0.1:8002"
-user_send_key = "null"
-user_recv_key = "null"
+user_server_url = "http://osgrid.org:8002/"
+user_send_key = "1234"
+user_recv_key = "1234"
-asset_server_url = "http://127.0.0.1:8003"
+asset_server_url = "http://osgrid.org:8003/"
diff --git a/bin/libsecondlife.dll b/bin/libsecondlife.dll
index 8b9596d..b9741bc 100644
Binary files a/bin/libsecondlife.dll and b/bin/libsecondlife.dll differ
diff --git a/bin/libsecondlife.dll.config b/bin/libsecondlife.dll.config
index d8f6677..cc35d6e 100644
--- a/bin/libsecondlife.dll.config
+++ b/bin/libsecondlife.dll.config
@@ -1,5 +1,5 @@
-
-
+
+
diff --git a/prebuild.xml b/prebuild.xml
index bbd403c..4222832 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -823,6 +823,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ../../../bin/
+
+
+
+
+ ../../../bin/
+
+
+
+ ../../../bin/
+
+
+
+
+
+
+
@@ -981,3 +1013,7 @@
+
+
+
+
diff --git a/share/sql/mysql-inventoryfolders.sql b/share/sql/mysql-inventoryfolders.sql
index 8704702..ebda3bb 100644
--- a/share/sql/mysql-inventoryfolders.sql
+++ b/share/sql/mysql-inventoryfolders.sql
@@ -3,6 +3,8 @@ CREATE TABLE `inventoryfolders` (
`agentID` varchar(36) default NULL,
`parentFolderID` varchar(36) default NULL,
`folderName` varchar(64) default NULL,
+ `category` TINYINT NOT NULL,
+ `folderType` TINYINT NOT NULL,
PRIMARY KEY (`folderID`),
KEY `owner` (`agentID`),
KEY `parent` (`parentFolderID`)
--
cgit v1.1