From 4fad66f855544b9298ae2216c58c0f44009358a5 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 1 Nov 2007 19:19:05 +0000 Subject: * Diuerse beavtificatems --- .../Framework/Communications/Cache/AssetCache.cs | 4 +-- .../Communications/Cache/UserProfileCache.cs | 6 ++-- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Framework/InventoryConfig.cs | 42 ++++++++++++---------- OpenSim/Framework/InventoryItemBase.cs | 20 +++++------ OpenSim/Framework/NetworkServersInfo.cs | 5 +-- OpenSim/Framework/Servers/BaseHttpServer.cs | 3 +- OpenSim/Framework/Servers/IStreamHandler.cs | 1 - .../Framework/Servers/RestDeserialiseHandler.cs | 17 ++++----- 9 files changed, 49 insertions(+), 51 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 6222649..6be0852 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -52,10 +52,10 @@ namespace OpenSim.Framework.Communications.Cache public List TextureRequests = new List(); //textures ready to be sent public Dictionary RequestedAssets = new Dictionary(); - //Assets requested from the asset server + //Assets requested from the asset server public Dictionary RequestedTextures = new Dictionary(); - //Textures requested from the asset server + //Textures requested from the asset server public Dictionary SendingTextures = new Dictionary(); private BlockingQueue QueueTextures = new BlockingQueue(); diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs index ccf5024..74b2440 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCache.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCache.cs @@ -90,7 +90,7 @@ namespace OpenSim.Framework.Communications.Cache { InventoryFolderImpl createdFolder = userProfile.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); - + if (createdFolder != null) { m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdFolder); @@ -119,7 +119,7 @@ namespace OpenSim.Framework.Communications.Cache return; } - + if ((fold = libraryRoot.HasSubFolder(folderID)) != null) { remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems()); @@ -129,7 +129,7 @@ namespace OpenSim.Framework.Communications.Cache CachedUserInfo userProfile; if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) - { + { if (userProfile.RootFolder != null) { if (userProfile.RootFolder.folderID == folderID) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 887be3b..62c50d5 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -444,4 +444,4 @@ namespace OpenSim.Framework event Action OnConnectionClosed; void SendLogoutPacket(); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/InventoryConfig.cs b/OpenSim/Framework/InventoryConfig.cs index 8e64b68..1233196 100644 --- a/OpenSim/Framework/InventoryConfig.cs +++ b/OpenSim/Framework/InventoryConfig.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace OpenSim.Framework { /// @@ -23,18 +19,28 @@ namespace OpenSim.Framework public InventoryConfig(string description, string filename) { - configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); + configMember = + new ConfigurationMember(filename, description, loadConfigurationOptions, 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:" + UserConfig.DefaultHttpPort.ToString(), 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("http_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Http Listener port", DefaultHttpPort.ToString(), false); + 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:" + UserConfig.DefaultHttpPort.ToString(), 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("http_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, + "Http Listener port", DefaultHttpPort.ToString(), false); } public bool handleIncomingConfiguration(string configuration_key, object configuration_result) @@ -42,26 +48,26 @@ namespace OpenSim.Framework switch (configuration_key) { case "default_startup_message": - this.DefaultStartupMsg = (string)configuration_result; + DefaultStartupMsg = (string) configuration_result; break; case "default_user_server": - this.UserServerURL = (string)configuration_result; + UserServerURL = (string) configuration_result; break; case "user_send_key": - this.UserSendKey = (string)configuration_result; + UserSendKey = (string) configuration_result; break; case "user_recv_key": - this.UserRecvKey = (string)configuration_result; + UserRecvKey = (string) configuration_result; break; case "database_provider": - this.DatabaseProvider = (string)configuration_result; + DatabaseProvider = (string) configuration_result; break; case "http_port": - HttpPort = (int)configuration_result; + HttpPort = (int) configuration_result; break; } return true; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 331013f..80f631e 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -25,10 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Xml.Serialization; using System.Collections; using System.Collections.Generic; +using System.Xml.Serialization; using libsecondlife; namespace OpenSim.Framework @@ -251,23 +250,20 @@ namespace OpenSim.Framework * 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 SerializableInventory { [XmlRoot(ElementName = "folder", IsNullable = true)] public class SerializableFolder : InventoryFolderBase { - [XmlArray(ElementName = "folders", IsNullable = true)] - [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof(SerializableFolder))] - public ArrayList SubFolders; + [XmlArray(ElementName = "folders", IsNullable = true)] [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof (SerializableFolder))] public + ArrayList SubFolders; - [XmlArray(ElementName = "items", IsNullable = true)] - [XmlArrayItem(ElementName = "item", IsNullable = true, Type = typeof(InventoryItemBase))] - public ArrayList Items; + [XmlArray(ElementName = "items", IsNullable = true)] [XmlArrayItem(ElementName = "item", IsNullable = true, Type = typeof (InventoryItemBase))] public ArrayList + Items; } - [XmlElement(ElementName = "folder", IsNullable = true)] - public SerializableFolder root; + [XmlElement(ElementName = "folder", IsNullable = true)] public SerializableFolder root; } - -} +} \ No newline at end of file diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs index b9ce143..1c76320 100644 --- a/OpenSim/Framework/NetworkServersInfo.cs +++ b/OpenSim/Framework/NetworkServersInfo.cs @@ -94,7 +94,8 @@ namespace OpenSim.Framework UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null"); AssetURL = config.Configs["Network"].GetString("asset_server_url", AssetURL); InventoryURL = config.Configs["Network"].GetString("inventory_server_url", - "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString()); + "http://127.0.0.1:" + + InventoryConfig.DefaultHttpPort.ToString()); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index a4a7b2b..e645e7b 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -107,11 +107,10 @@ namespace OpenSim.Framework.Servers { IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; buffer = streamedRequestHandler.Handle(path, request.InputStream); - } else { - IStreamHandler streamHandler = (IStreamHandler)requestHandler; + IStreamHandler streamHandler = (IStreamHandler) requestHandler; using (MemoryStream memoryStream = new MemoryStream()) { diff --git a/OpenSim/Framework/Servers/IStreamHandler.cs b/OpenSim/Framework/Servers/IStreamHandler.cs index 6dc7189..c87937a 100644 --- a/OpenSim/Framework/Servers/IStreamHandler.cs +++ b/OpenSim/Framework/Servers/IStreamHandler.cs @@ -53,5 +53,4 @@ namespace OpenSim.Framework.Servers // Handle request stream, return byte array void Handle(string path, Stream request, Stream response); } - } \ No newline at end of file diff --git a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs index 28084e2..adf5c3f 100644 --- a/OpenSim/Framework/Servers/RestDeserialiseHandler.cs +++ b/OpenSim/Framework/Servers/RestDeserialiseHandler.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; using System.IO; using System.Xml; using System.Xml.Serialization; @@ -20,22 +17,22 @@ namespace OpenSim.Framework.Servers m_method = method; } - public void Handle(string path, Stream request, Stream responseStream ) + public void Handle(string path, Stream request, Stream responseStream) { TRequest deserial; using (XmlTextReader xmlReader = new XmlTextReader(request)) { - XmlSerializer deserializer = new XmlSerializer(typeof(TRequest)); - deserial = (TRequest)deserializer.Deserialize(xmlReader); + XmlSerializer deserializer = new XmlSerializer(typeof (TRequest)); + deserial = (TRequest) deserializer.Deserialize(xmlReader); } TResponse response = m_method(deserial); - using (XmlWriter xmlWriter = XmlTextWriter.Create( responseStream )) + using (XmlWriter xmlWriter = XmlTextWriter.Create(responseStream)) { - XmlSerializer serializer = new XmlSerializer(typeof(TResponse)); - serializer.Serialize(xmlWriter, response ); + XmlSerializer serializer = new XmlSerializer(typeof (TResponse)); + serializer.Serialize(xmlWriter, response); } } } -} +} \ No newline at end of file -- cgit v1.1