- clean up using references as well as References in prebuild.xml

- comment out a bunch of stuff in OpenSimInventoryFrontendPlugin.cs to
  get rid of warnings
0.6.3-post-fixes
Mike Mazur 2009-02-16 02:28:16 +00:00
parent a928a14c7a
commit f8d51e6949
16 changed files with 280 additions and 328 deletions

View File

@ -29,8 +29,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
using OpenSim.Framework;
using OpenSim.Framework.Servers;

View File

@ -29,9 +29,7 @@
using System;
using System.Collections.Generic;
using System.Net;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
namespace OpenSim.Grid.AssetInventoryServer

View File

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Xml;
using OpenMetaverse;
using OpenMetaverse.StructuredData;

View File

@ -38,7 +38,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public class AuthorizeAllPlugin : IAuthorizationProvider
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
AssetInventoryServer server;
//private AssetInventoryServer m_server;
public AuthorizeAllPlugin()
{
@ -48,7 +48,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public void Initialise(AssetInventoryServer server)
{
this.server = server;
//m_server = server;
m_log.Info("[ASSET] Authorize All loaded.");
}

View File

@ -30,7 +30,6 @@
using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Text;
@ -45,7 +44,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public class BrowseFrontendPlugin : IAssetInventoryServerPlugin
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
AssetInventoryServer m_server;
private AssetInventoryServer m_server;
public BrowseFrontendPlugin()
{

View File

@ -38,7 +38,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public class NullAuthenticationPlugin : IAuthenticationProvider
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
AssetInventoryServer server;
//private AssetInventoryServer m_server;
public NullAuthenticationPlugin()
{
@ -48,7 +48,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public void Initialise(AssetInventoryServer server)
{
this.server = server;
//m_server = server;
m_log.Info("[ASSET] Null Authentication loaded.");
}

View File

@ -37,7 +37,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public class NullMetricsPlugin : IMetricsProvider
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
AssetInventoryServer server;
//private AssetInventoryServer m_server;
public NullMetricsPlugin()
{
@ -122,7 +122,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
public void Initialise(AssetInventoryServer server)
{
this.server = server;
//m_server = server;
}
/// <summary>
@ -130,7 +130,6 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins
/// </summary>
public void Initialise()
{
this.server = null;
m_log.Info("[ASSET] Null metrics loaded.");
}

View File

@ -29,14 +29,12 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using OpenMetaverse;
using HttpServer;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
using log4net;

View File

@ -29,12 +29,9 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
using System.Data;
using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Data;
using Nini.Config;

View File

@ -30,12 +30,9 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System.Xml;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using HttpServer;
using OpenSim.Framework;
using log4net;
@ -44,10 +41,10 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
public class OpenSimInventoryFrontendPlugin : IAssetInventoryServerPlugin
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private AssetInventoryServer server;
private Utils.InventoryItemSerializer itemSerializer = new Utils.InventoryItemSerializer();
private Utils.InventoryFolderSerializer folderSerializer = new Utils.InventoryFolderSerializer();
private Utils.InventoryCollectionSerializer collectionSerializer = new Utils.InventoryCollectionSerializer();
//private AssetInventoryServer m_server;
//private Utils.InventoryItemSerializer itemSerializer = new Utils.InventoryItemSerializer();
//private Utils.InventoryFolderSerializer folderSerializer = new Utils.InventoryFolderSerializer();
//private Utils.InventoryCollectionSerializer collectionSerializer = new Utils.InventoryCollectionSerializer();
public OpenSimInventoryFrontendPlugin()
{
@ -57,18 +54,18 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
public void Initialise(AssetInventoryServer server)
{
this.server = server;
//m_server = server;
//server.HttpServer.AddHandler("post", null, @"^/GetInventory/", GetInventoryHandler);
//server.HttpServer.AddHandler("post", null, @"^/CreateInventory/", CreateInventoryHandler);
//server.HttpServer.AddHandler("post", null, @"^/NewFolder/", NewFolderHandler);
//server.HttpServer.AddHandler("post", null, @"^/UpdateFolder/", UpdateFolderHandler);
//server.HttpServer.AddHandler("post", null, @"^/MoveFolder/", MoveFolderHandler);
//server.HttpServer.AddHandler("post", null, @"^/PurgeFolder/", PurgeFolderHandler);
//server.HttpServer.AddHandler("post", null, @"^/NewItem/", NewItemHandler);
//server.HttpServer.AddHandler("post", null, @"^/DeleteItem/", DeleteItemHandler);
//server.HttpServer.AddHandler("post", null, @"^/RootFolders/", RootFoldersHandler);
//server.HttpServer.AddHandler("post", null, @"^/ActiveGestures/", ActiveGesturesHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/GetInventory/", GetInventoryHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/CreateInventory/", CreateInventoryHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/NewFolder/", NewFolderHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/UpdateFolder/", UpdateFolderHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/MoveFolder/", MoveFolderHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/PurgeFolder/", PurgeFolderHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/NewItem/", NewItemHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/DeleteItem/", DeleteItemHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/RootFolders/", RootFoldersHandler);
//m_server.HttpServer.AddHandler("post", null, @"^/ActiveGestures/", ActiveGesturesHandler);
m_log.Info("[INVENTORY] OpenSim Inventory Frontend loaded.");
}
@ -110,7 +107,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// Uri owner = Utils.GetOpenSimUri(ownerID);
// InventoryCollection inventory;
// BackendResponse storageResponse = server.InventoryProvider.TryFetchInventory(owner, out inventory);
// BackendResponse storageResponse = m_server.InventoryProvider.TryFetchInventory(owner, out inventory);
// if (storageResponse == BackendResponse.Success)
// {
@ -150,7 +147,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// m_log.DebugFormat("Created URI {0} for inventory creation", owner);
// InventoryFolder rootFolder = new InventoryFolder("My Inventory", ownerID, UUID.Zero, (short)AssetType.Folder);
// BackendResponse storageResponse = server.InventoryProvider.TryCreateInventory(owner, rootFolder);
// BackendResponse storageResponse = m_server.InventoryProvider.TryCreateInventory(owner, rootFolder);
// if (storageResponse == BackendResponse.Success)
// {
// CreateFolder("Animations", ownerID, rootFolder.ID, AssetType.Animation);
@ -192,11 +189,11 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// if (String.IsNullOrEmpty(folder.Name))
// {
// InventoryFolder oldFolder;
// if (server.InventoryProvider.TryFetchFolder(owner, folder.ID, out oldFolder) == BackendResponse.Success)
// if (m_server.InventoryProvider.TryFetchFolder(owner, folder.ID, out oldFolder) == BackendResponse.Success)
// folder.Name = oldFolder.Name;
// }
// BackendResponse storageResponse = server.InventoryProvider.TryCreateFolder(owner, folder);
// BackendResponse storageResponse = m_server.InventoryProvider.TryCreateFolder(owner, folder);
// if (storageResponse == BackendResponse.Success)
// {
@ -227,7 +224,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// if (folder != null)
// {
// Uri owner = Utils.GetOpenSimUri(folder.Owner);
// BackendResponse storageResponse = server.InventoryProvider.TryPurgeFolder(owner, folder.ID);
// BackendResponse storageResponse = m_server.InventoryProvider.TryPurgeFolder(owner, folder.ID);
// if (storageResponse == BackendResponse.Success)
// {
@ -248,7 +245,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// if (item != null)
// {
// Uri owner = Utils.GetOpenSimUri(agentID);
// BackendResponse storageResponse = server.InventoryProvider.TryCreateItem(owner, item);
// BackendResponse storageResponse = m_server.InventoryProvider.TryCreateItem(owner, item);
// if (storageResponse == BackendResponse.Success)
// {
@ -269,7 +266,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// if (item != null)
// {
// Uri owner = Utils.GetOpenSimUri(item.Owner);
// BackendResponse storageResponse = server.InventoryProvider.TryDeleteItem(owner, item.ID);
// BackendResponse storageResponse = m_server.InventoryProvider.TryDeleteItem(owner, item.ID);
// if (storageResponse == BackendResponse.Success)
// {
@ -290,7 +287,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// {
// Uri owner = Utils.GetOpenSimUri(ownerID);
// List<InventoryFolder> skeleton;
// BackendResponse storageResponse = server.InventoryProvider.TryFetchFolderList(owner, out skeleton);
// BackendResponse storageResponse = m_server.InventoryProvider.TryFetchFolderList(owner, out skeleton);
// if (storageResponse == BackendResponse.Success)
// {
@ -323,7 +320,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// {
// Uri owner = Utils.GetOpenSimUri(ownerID);
// List<InventoryItem> gestures;
// BackendResponse storageResponse = server.InventoryProvider.TryFetchActiveGestures(owner, out gestures);
// BackendResponse storageResponse = m_server.InventoryProvider.TryFetchActiveGestures(owner, out gestures);
// if (storageResponse == BackendResponse.Success)
// {
@ -347,255 +344,255 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// return true;
//}
BackendResponse CreateFolder(string name, UUID ownerID, UUID parentID, AssetType assetType)
{
InventoryFolder folder = new InventoryFolder(name, ownerID, parentID, (short)assetType);
Uri owner = Utils.GetOpenSimUri(ownerID);
return server.InventoryProvider.TryCreateFolder(owner, folder);
}
//BackendResponse CreateFolder(string name, UUID ownerID, UUID parentID, AssetType assetType)
//{
// InventoryFolder folder = new InventoryFolder(name, ownerID, parentID, (short)assetType);
// Uri owner = Utils.GetOpenSimUri(ownerID);
// return m_server.InventoryProvider.TryCreateFolder(owner, folder);
//}
UUID DeserializeUUID(Stream stream)
{
UUID id = UUID.Zero;
//UUID DeserializeUUID(Stream stream)
//{
// UUID id = UUID.Zero;
try
{
using (XmlReader reader = XmlReader.Create(stream))
{
reader.MoveToContent();
UUID.TryParse(reader.ReadElementContentAsString("guid", String.Empty), out id);
}
}
catch (Exception ex)
{
m_log.Warn("Failed to parse POST data (expecting guid): " + ex.Message);
}
// try
// {
// using (XmlReader reader = XmlReader.Create(stream))
// {
// reader.MoveToContent();
// UUID.TryParse(reader.ReadElementContentAsString("guid", String.Empty), out id);
// }
// }
// catch (Exception ex)
// {
// m_log.Warn("Failed to parse POST data (expecting guid): " + ex.Message);
// }
return id;
}
// return id;
//}
UUID DeserializeUUID(Stream stream, out UUID agentID, out UUID sessionID)
{
UUID id;
//UUID DeserializeUUID(Stream stream, out UUID agentID, out UUID sessionID)
//{
// UUID id;
try
{
using (XmlReader reader = XmlReader.Create(stream))
{
reader.MoveToContent();
reader.ReadStartElement("RestSessionObjectOfGuid");
UUID.TryParse(reader.ReadElementContentAsString("SessionID", String.Empty), out sessionID);
UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
UUID.TryParse(reader.ReadElementContentAsString("Body", String.Empty), out id);
reader.ReadEndElement();
}
}
catch (Exception ex)
{
m_log.Warn("Failed to parse GetInventory POST data: " + ex.Message);
agentID = UUID.Zero;
sessionID = UUID.Zero;
return UUID.Zero;
}
// try
// {
// using (XmlReader reader = XmlReader.Create(stream))
// {
// reader.MoveToContent();
// reader.ReadStartElement("RestSessionObjectOfGuid");
// UUID.TryParse(reader.ReadElementContentAsString("SessionID", String.Empty), out sessionID);
// UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
// UUID.TryParse(reader.ReadElementContentAsString("Body", String.Empty), out id);
// reader.ReadEndElement();
// }
// }
// catch (Exception ex)
// {
// m_log.Warn("Failed to parse GetInventory POST data: " + ex.Message);
// agentID = UUID.Zero;
// sessionID = UUID.Zero;
// return UUID.Zero;
// }
return id;
}
// return id;
//}
InventoryFolder DeserializeFolder(Stream stream, out UUID agentID, out UUID sessionID)
{
InventoryFolder folder = new InventoryFolder();
//InventoryFolder DeserializeFolder(Stream stream, out UUID agentID, out UUID sessionID)
//{
// InventoryFolder folder = new InventoryFolder();
try
{
using (XmlReader reader = XmlReader.Create(stream))
{
reader.MoveToContent();
reader.ReadStartElement("RestSessionObjectOfInventoryFolderBase");
UUID.TryParse(reader.ReadElementContentAsString("SessionID", String.Empty), out sessionID);
UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
reader.ReadStartElement("Body");
if (reader.Name == "Name")
folder.Name = reader.ReadElementContentAsString("Name", String.Empty);
else
folder.Name = String.Empty;
ReadUUID(reader, "Owner", out folder.Owner);
ReadUUID(reader, "ParentID", out folder.ParentID);
ReadUUID(reader, "ID", out folder.ID);
Int16.TryParse(reader.ReadElementContentAsString("Type", String.Empty), out folder.Type);
UInt16.TryParse(reader.ReadElementContentAsString("Version", String.Empty), out folder.Version);
reader.ReadEndElement();
reader.ReadEndElement();
}
}
catch (Exception ex)
{
m_log.Warn("Failed to parse POST data (expecting InventoryFolderBase): " + ex.Message);
agentID = UUID.Zero;
sessionID = UUID.Zero;
return null;
}
// try
// {
// using (XmlReader reader = XmlReader.Create(stream))
// {
// reader.MoveToContent();
// reader.ReadStartElement("RestSessionObjectOfInventoryFolderBase");
// UUID.TryParse(reader.ReadElementContentAsString("SessionID", String.Empty), out sessionID);
// UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
// reader.ReadStartElement("Body");
// if (reader.Name == "Name")
// folder.Name = reader.ReadElementContentAsString("Name", String.Empty);
// else
// folder.Name = String.Empty;
// ReadUUID(reader, "Owner", out folder.Owner);
// ReadUUID(reader, "ParentID", out folder.ParentID);
// ReadUUID(reader, "ID", out folder.ID);
// Int16.TryParse(reader.ReadElementContentAsString("Type", String.Empty), out folder.Type);
// UInt16.TryParse(reader.ReadElementContentAsString("Version", String.Empty), out folder.Version);
// reader.ReadEndElement();
// reader.ReadEndElement();
// }
// }
// catch (Exception ex)
// {
// m_log.Warn("Failed to parse POST data (expecting InventoryFolderBase): " + ex.Message);
// agentID = UUID.Zero;
// sessionID = UUID.Zero;
// return null;
// }
return folder;
}
// return folder;
//}
InventoryItem DeserializeItem(Stream stream, out UUID agentID, out UUID sessionID)
{
InventoryItem item = new InventoryItem();
//InventoryItem DeserializeItem(Stream stream, out UUID agentID, out UUID sessionID)
//{
// InventoryItem item = new InventoryItem();
try
{
using (XmlReader reader = XmlReader.Create(stream))
{
reader.MoveToContent();
reader.ReadStartElement("RestSessionObjectOfInventoryItemBase");
UUID.TryParse(reader.ReadElementContentAsString("SessionID", String.Empty), out sessionID);
UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
reader.ReadStartElement("Body");
ReadUUID(reader, "ID", out item.ID);
Int32.TryParse(reader.ReadElementContentAsString("InvType", String.Empty), out item.InvType);
ReadUUID(reader, "Folder", out item.Folder);
ReadUUID(reader, "Owner", out item.Owner);
ReadUUID(reader, "Creator", out item.Creator);
item.Name = reader.ReadElementContentAsString("Name", String.Empty);
item.Description = reader.ReadElementContentAsString("Description", String.Empty);
UInt32.TryParse(reader.ReadElementContentAsString("NextPermissions", String.Empty), out item.NextPermissions);
UInt32.TryParse(reader.ReadElementContentAsString("CurrentPermissions", String.Empty), out item.CurrentPermissions);
UInt32.TryParse(reader.ReadElementContentAsString("BasePermissions", String.Empty), out item.BasePermissions);
UInt32.TryParse(reader.ReadElementContentAsString("EveryOnePermissions", String.Empty), out item.EveryOnePermissions);
UInt32.TryParse(reader.ReadElementContentAsString("GroupPermissions", String.Empty), out item.GroupPermissions);
Int32.TryParse(reader.ReadElementContentAsString("AssetType", String.Empty), out item.AssetType);
ReadUUID(reader, "AssetID", out item.AssetID);
ReadUUID(reader, "GroupID", out item.GroupID);
Boolean.TryParse(reader.ReadElementContentAsString("GroupOwned", String.Empty), out item.GroupOwned);
Int32.TryParse(reader.ReadElementContentAsString("SalePrice", String.Empty), out item.SalePrice);
Byte.TryParse(reader.ReadElementContentAsString("SaleType", String.Empty), out item.SaleType);
UInt32.TryParse(reader.ReadElementContentAsString("Flags", String.Empty), out item.Flags);
Int32.TryParse(reader.ReadElementContentAsString("CreationDate", String.Empty), out item.CreationDate);
reader.ReadEndElement();
reader.ReadEndElement();
}
}
catch (Exception ex)
{
m_log.Warn("Failed to parse POST data (expecting InventoryItemBase): " + ex.Message);
agentID = UUID.Zero;
sessionID = UUID.Zero;
return null;
}
// try
// {
// using (XmlReader reader = XmlReader.Create(stream))
// {
// reader.MoveToContent();
// reader.ReadStartElement("RestSessionObjectOfInventoryItemBase");
// UUID.TryParse(reader.ReadElementContentAsString("SessionID", String.Empty), out sessionID);
// UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
// reader.ReadStartElement("Body");
// ReadUUID(reader, "ID", out item.ID);
// Int32.TryParse(reader.ReadElementContentAsString("InvType", String.Empty), out item.InvType);
// ReadUUID(reader, "Folder", out item.Folder);
// ReadUUID(reader, "Owner", out item.Owner);
// ReadUUID(reader, "Creator", out item.Creator);
// item.Name = reader.ReadElementContentAsString("Name", String.Empty);
// item.Description = reader.ReadElementContentAsString("Description", String.Empty);
// UInt32.TryParse(reader.ReadElementContentAsString("NextPermissions", String.Empty), out item.NextPermissions);
// UInt32.TryParse(reader.ReadElementContentAsString("CurrentPermissions", String.Empty), out item.CurrentPermissions);
// UInt32.TryParse(reader.ReadElementContentAsString("BasePermissions", String.Empty), out item.BasePermissions);
// UInt32.TryParse(reader.ReadElementContentAsString("EveryOnePermissions", String.Empty), out item.EveryOnePermissions);
// UInt32.TryParse(reader.ReadElementContentAsString("GroupPermissions", String.Empty), out item.GroupPermissions);
// Int32.TryParse(reader.ReadElementContentAsString("AssetType", String.Empty), out item.AssetType);
// ReadUUID(reader, "AssetID", out item.AssetID);
// ReadUUID(reader, "GroupID", out item.GroupID);
// Boolean.TryParse(reader.ReadElementContentAsString("GroupOwned", String.Empty), out item.GroupOwned);
// Int32.TryParse(reader.ReadElementContentAsString("SalePrice", String.Empty), out item.SalePrice);
// Byte.TryParse(reader.ReadElementContentAsString("SaleType", String.Empty), out item.SaleType);
// UInt32.TryParse(reader.ReadElementContentAsString("Flags", String.Empty), out item.Flags);
// Int32.TryParse(reader.ReadElementContentAsString("CreationDate", String.Empty), out item.CreationDate);
// reader.ReadEndElement();
// reader.ReadEndElement();
// }
// }
// catch (Exception ex)
// {
// m_log.Warn("Failed to parse POST data (expecting InventoryItemBase): " + ex.Message);
// agentID = UUID.Zero;
// sessionID = UUID.Zero;
// return null;
// }
return item;
}
// return item;
//}
void SerializeBool(Stream stream, bool value)
{
using (XmlWriter writer = XmlWriter.Create(stream))
{
writer.WriteStartDocument();
writer.WriteStartElement("boolean");
writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema");
writer.WriteString(value.ToString().ToLower());
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Flush();
}
//void SerializeBool(Stream stream, bool value)
//{
// using (XmlWriter writer = XmlWriter.Create(stream))
// {
// writer.WriteStartDocument();
// writer.WriteStartElement("boolean");
// writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
// writer.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema");
// writer.WriteString(value.ToString().ToLower());
// writer.WriteEndElement();
// writer.WriteEndDocument();
// writer.Flush();
// }
stream.Flush();
}
// stream.Flush();
//}
void SerializeFolderList(Stream stream, List<InventoryFolder> folders)
{
using (XmlWriter writer = XmlWriter.Create(stream))
{
writer.WriteStartDocument();
writer.WriteStartElement("ArrayOfInventoryFolderBase");
writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema");
//void SerializeFolderList(Stream stream, List<InventoryFolder> folders)
//{
// using (XmlWriter writer = XmlWriter.Create(stream))
// {
// writer.WriteStartDocument();
// writer.WriteStartElement("ArrayOfInventoryFolderBase");
// writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
// writer.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema");
if (folders != null)
{
foreach (InventoryFolder folder in folders)
{
writer.WriteStartElement("InventoryFolderBase");
writer.WriteElementString("Name", folder.Name);
WriteUUID(writer, "Owner", folder.Owner);
WriteUUID(writer, "ParentID", folder.ParentID);
WriteUUID(writer, "ID", folder.ID);
writer.WriteElementString("Type", XmlConvert.ToString(folder.Type));
writer.WriteElementString("Version", XmlConvert.ToString(folder.Version));
writer.WriteEndElement();
}
}
// if (folders != null)
// {
// foreach (InventoryFolder folder in folders)
// {
// writer.WriteStartElement("InventoryFolderBase");
// writer.WriteElementString("Name", folder.Name);
// WriteUUID(writer, "Owner", folder.Owner);
// WriteUUID(writer, "ParentID", folder.ParentID);
// WriteUUID(writer, "ID", folder.ID);
// writer.WriteElementString("Type", XmlConvert.ToString(folder.Type));
// writer.WriteElementString("Version", XmlConvert.ToString(folder.Version));
// writer.WriteEndElement();
// }
// }
writer.WriteEndElement();
writer.WriteEndDocument();
// writer.WriteEndElement();
// writer.WriteEndDocument();
writer.Flush();
}
// writer.Flush();
// }
stream.Flush();
}
// stream.Flush();
//}
void SerializeItemList(Stream stream, List<InventoryItem> items)
{
using (XmlWriter writer = XmlWriter.Create(stream))
{
writer.WriteStartDocument();
writer.WriteStartElement("ArrayOfInventoryItemBase");
writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema");
//void SerializeItemList(Stream stream, List<InventoryItem> items)
//{
// using (XmlWriter writer = XmlWriter.Create(stream))
// {
// writer.WriteStartDocument();
// writer.WriteStartElement("ArrayOfInventoryItemBase");
// writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
// writer.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema");
if (items != null)
{
foreach (InventoryItem item in items)
{
writer.WriteStartElement("InventoryItemBase");
WriteUUID(writer, "ID", item.ID);
writer.WriteElementString("InvType", XmlConvert.ToString(item.InvType));
WriteUUID(writer, "Folder", item.Folder);
WriteUUID(writer, "Owner", item.Owner);
WriteUUID(writer, "Creator", item.Creator);
writer.WriteElementString("Name", item.Name);
writer.WriteElementString("Description", item.Description);
writer.WriteElementString("NextPermissions", XmlConvert.ToString(item.NextPermissions));
writer.WriteElementString("CurrentPermissions", XmlConvert.ToString(item.CurrentPermissions));
writer.WriteElementString("BasePermissions", XmlConvert.ToString(item.BasePermissions));
writer.WriteElementString("EveryOnePermissions", XmlConvert.ToString(item.EveryOnePermissions));
writer.WriteElementString("GroupPermissions", XmlConvert.ToString(item.GroupPermissions));
writer.WriteElementString("AssetType", XmlConvert.ToString(item.AssetType));
WriteUUID(writer, "AssetID", item.AssetID);
WriteUUID(writer, "GroupID", item.GroupID);
writer.WriteElementString("GroupOwned", XmlConvert.ToString(item.GroupOwned));
writer.WriteElementString("SalePrice", XmlConvert.ToString(item.SalePrice));
writer.WriteElementString("SaleType", XmlConvert.ToString(item.SaleType));
writer.WriteElementString("Flags", XmlConvert.ToString(item.Flags));
writer.WriteElementString("CreationDate", XmlConvert.ToString(item.CreationDate));
writer.WriteEndElement();
}
}
// if (items != null)
// {
// foreach (InventoryItem item in items)
// {
// writer.WriteStartElement("InventoryItemBase");
// WriteUUID(writer, "ID", item.ID);
// writer.WriteElementString("InvType", XmlConvert.ToString(item.InvType));
// WriteUUID(writer, "Folder", item.Folder);
// WriteUUID(writer, "Owner", item.Owner);
// WriteUUID(writer, "Creator", item.Creator);
// writer.WriteElementString("Name", item.Name);
// writer.WriteElementString("Description", item.Description);
// writer.WriteElementString("NextPermissions", XmlConvert.ToString(item.NextPermissions));
// writer.WriteElementString("CurrentPermissions", XmlConvert.ToString(item.CurrentPermissions));
// writer.WriteElementString("BasePermissions", XmlConvert.ToString(item.BasePermissions));
// writer.WriteElementString("EveryOnePermissions", XmlConvert.ToString(item.EveryOnePermissions));
// writer.WriteElementString("GroupPermissions", XmlConvert.ToString(item.GroupPermissions));
// writer.WriteElementString("AssetType", XmlConvert.ToString(item.AssetType));
// WriteUUID(writer, "AssetID", item.AssetID);
// WriteUUID(writer, "GroupID", item.GroupID);
// writer.WriteElementString("GroupOwned", XmlConvert.ToString(item.GroupOwned));
// writer.WriteElementString("SalePrice", XmlConvert.ToString(item.SalePrice));
// writer.WriteElementString("SaleType", XmlConvert.ToString(item.SaleType));
// writer.WriteElementString("Flags", XmlConvert.ToString(item.Flags));
// writer.WriteElementString("CreationDate", XmlConvert.ToString(item.CreationDate));
// writer.WriteEndElement();
// }
// }
writer.WriteEndElement();
writer.WriteEndDocument();
// writer.WriteEndElement();
// writer.WriteEndDocument();
writer.Flush();
}
// writer.Flush();
// }
stream.Flush();
}
// stream.Flush();
//}
void WriteUUID(XmlWriter writer, string name, UUID id)
{
writer.WriteStartElement(name);
writer.WriteElementString("Guid", XmlConvert.ToString(id.Guid));
writer.WriteEndElement();
}
//void WriteUUID(XmlWriter writer, string name, UUID id)
//{
// writer.WriteStartElement(name);
// writer.WriteElementString("Guid", XmlConvert.ToString(id.Guid));
// writer.WriteEndElement();
//}
void ReadUUID(XmlReader reader, string name, out UUID id)
{
reader.ReadStartElement(name);
UUID.TryParse(reader.ReadElementContentAsString("Guid", String.Empty), out id);
reader.ReadEndElement();
}
//void ReadUUID(XmlReader reader, string name, out UUID id)
//{
// reader.ReadStartElement(name);
// UUID.TryParse(reader.ReadElementContentAsString("Guid", String.Empty), out id);
// reader.ReadEndElement();
//}
}
#region OpenSim AssetType

View File

@ -30,11 +30,9 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
using System.Data;
using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Data;
using Nini.Config;

View File

@ -30,12 +30,9 @@
using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
using System.Xml;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using HttpServer;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
using log4net;

View File

@ -30,10 +30,8 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
using System.IO;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using log4net;

View File

@ -30,11 +30,9 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System.Text;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using log4net;

View File

@ -28,14 +28,10 @@
*/
using System;
using System.Collections.Specialized;
using System.Globalization;
using System.Net;
using System.Xml;
using System.Xml.Serialization;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using HttpServer;
using OpenSim.Framework.Servers;
namespace OpenSim.Grid.AssetInventoryServer
@ -791,11 +787,11 @@ namespace OpenSim.Grid.AssetInventoryServer
public class GeneratedWriter : XmlSerializationWriter
{
const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
static readonly System.Reflection.MethodInfo toBinHexStringMethod = typeof(XmlConvert).GetMethod("ToBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new Type[] { typeof(byte[]) }, null);
static string ToBinHexString(byte[] input)
{
return input == null ? null : (string)toBinHexStringMethod.Invoke(null, new object[] { input });
}
//static readonly System.Reflection.MethodInfo toBinHexStringMethod = typeof(XmlConvert).GetMethod("ToBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new Type[] { typeof(byte[]) }, null);
//static string ToBinHexString(byte[] input)
//{
// return input == null ? null : (string)toBinHexStringMethod.Invoke(null, new object[] { input });
//}
public void WriteRoot_InventoryFolder(object o)
{
WriteStartDocument();

View File

@ -760,27 +760,17 @@
<ReferencePath>../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.ServiceProcess"/>
<Reference name="System.Web"/>
<Reference name="System.Xml"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="log4net"/>
<Reference name="OpenMetaverseTypes"/>
<Reference name="OpenMetaverse.StructuredData"/>
<Reference name="HttpServer"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="Nini.dll" />
<!-- for Simple Storage and MySQL storage -->
<Reference name="System.Data"/>
<Reference name="MySql.Data"/>
<Reference name="OpenMetaverse"/>
<Reference name="log4net"/>
<Files>
<Match pattern="*.cs" recurse="false"/>
<Match path="Extensions" pattern="*.cs" recurse="false"/>
<!--Match path="Resources" pattern="*.addin.xml" buildAction="EmbeddedResource" recurse="true"/-->
</Files>
</Project>
@ -799,13 +789,11 @@
<ReferencePath>../../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Web"/>
<Reference name="OpenSim.Grid.AssetInventoryServer" />
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenMetaverse"/>
<Reference name="OpenMetaverseTypes"/>
<Reference name="OpenMetaverse.StructuredData"/>
<Reference name="HttpServer"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Grid.AssetInventoryServer" />
<Reference name="log4net"/>
<Files>
@ -828,19 +816,14 @@
<ReferencePath>../../../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Data" />
<Reference name="OpenSim.Framework" />
<Reference name="OpenSim.Data" />
<Reference name="OpenSim.Grid.AssetInventoryServer" />
<Reference name="System.Xml" />
<Reference name="OpenMetaverse"/>
<Reference name="OpenMetaverseTypes"/>
<Reference name="OpenMetaverse.StructuredData"/>
<Reference name="HttpServer"/>
<Reference name="OpenSim.Framework" />
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Grid.AssetInventoryServer" />
<Reference name="log4net"/>
<!-- Remove these eventually -->
<Reference name="MySql.Data" />
<Files>
<Match pattern="*.cs" recurse="false" />
<Match path="Resources" pattern="*.addin.xml" buildAction="EmbeddedResource" recurse="true" />
@ -861,19 +844,16 @@
<ReferencePath>../../../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Xml" />
<Reference name="System.Data" />
<Reference name="OpenSim.Framework" />
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Data" />
<Reference name="OpenSim.Grid.AssetInventoryServer" />
<Reference name="OpenMetaverseTypes"/>
<Reference name="OpenMetaverse.StructuredData"/>
<Reference name="HttpServer"/>
<Reference name="Nini.dll" />
<Reference name="log4net"/>
<!-- Remove these eventually -->
<Reference name="OpenSim.Data" />
<Reference name="OpenSim.Framework" />
<Reference name="OpenSim.Grid.AssetInventoryServer" />
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="MySql.Data"/>
<Reference name="log4net"/>
<Reference name="Nini.dll" />
<Files>
<Match pattern="*.cs" recurse="false" />