From 65c5efe43b68700bad94076d4cd421160203c5de Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 16 May 2008 01:22:11 +0000 Subject: Formatting cleanup. --- OpenSim/Framework/AssemblyInfo.cs | 8 +- .../Filesystem/AssetLoaderFileSystem.cs | 20 +- OpenSim/Framework/AvatarAppearance.cs | 6 +- OpenSim/Framework/ClientManager.cs | 2 +- .../Framework/Communications/Cache/AssetCache.cs | 22 +-- .../Communications/Cache/AssetServerBase.cs | 8 +- .../Communications/Cache/CachedUserInfo.cs | 220 ++++++++++----------- .../Communications/Cache/GridAssetClient.cs | 8 +- .../Communications/Cache/InventoryFolderImpl.cs | 46 ++--- .../Communications/Cache/LibraryRootFolder.cs | 72 +++---- .../Cache/UserProfileCacheService.cs | 78 ++++---- .../Framework/Communications/Capabilities/Caps.cs | 130 ++++++------ .../Communications/Capabilities/CapsHandlers.cs | 16 +- .../Framework/Communications/Capabilities/LLSD.cs | 26 +-- .../Communications/Capabilities/LLSDHelpers.cs | 10 +- .../Capabilities/LLSDInventoryItem.cs | 2 +- .../Capabilities/LLSDParcelVoiceInfoResponse.cs | 4 +- .../Capabilities/LLSDStreamHandler.cs | 2 +- .../LLSDTaskInventoryUploadComplete.cs | 2 +- .../Capabilities/LLSDTaskScriptUpdate.cs | 6 +- .../Capabilities/LLSDVoiceAccountResponse.cs | 4 +- .../Communications/CommunicationsManager.cs | 2 +- .../Framework/Communications/GenericAsyncResult.cs | 4 +- .../Framework/Communications/IInventoryServices.cs | 22 +-- OpenSim/Framework/Communications/IUserService.cs | 8 +- .../Communications/InventoryServiceBase.cs | 122 ++++++------ .../Communications/Limit/IRequestLimitStrategy.cs | 10 +- .../Communications/Limit/NullLimitStrategy.cs | 6 +- .../Communications/Limit/RepeatLimitStrategy.cs | 38 ++-- .../Communications/Limit/TimeLimitStrategy.cs | 50 ++--- OpenSim/Framework/Communications/LoginResponse.cs | 4 +- OpenSim/Framework/Communications/LoginService.cs | 108 +++++----- .../Communications/Properties/AssemblyInfo.cs | 10 +- OpenSim/Framework/Communications/RestClient.cs | 12 +- .../Framework/Communications/UserManagerBase.cs | 26 +-- OpenSim/Framework/Console/ConsoleBase.cs | 8 +- OpenSim/Framework/Console/OpenSimAppender.cs | 16 +- OpenSim/Framework/IClientAPI.cs | 34 ++-- OpenSim/Framework/IClientAPI2.cs | 4 +- OpenSim/Framework/IInventoryData.cs | 2 +- OpenSim/Framework/IUserData.cs | 6 +- OpenSim/Framework/InventoryFolderBase.cs | 2 +- OpenSim/Framework/InventoryItemBase.cs | 20 +- OpenSim/Framework/RegionCommsListener.cs | 6 +- OpenSim/Framework/RegionInfo.cs | 8 +- OpenSim/Framework/Remoting.cs | 2 +- OpenSim/Framework/SerializableInventory.cs | 2 +- OpenSim/Framework/SerializableRegionInfo.cs | 4 +- OpenSim/Framework/Servers/BaseHttpServer.cs | 42 ++-- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 28 +-- .../Framework/Servers/RestObjectPosterResponse.cs | 10 +- OpenSim/Framework/Servers/RestStreamHandler.cs | 2 +- .../Servers/SynchronousRestObjectPoster.cs | 2 +- .../Framework/Statistics/AssetStatsCollector.cs | 28 +-- .../Statistics/Interfaces/IStatsCollector.cs | 4 +- .../Framework/Statistics/SimExtraStatsCollector.cs | 62 +++--- OpenSim/Framework/Statistics/StatsManager.cs | 28 +-- OpenSim/Framework/Statistics/UserStatsCollector.cs | 24 +-- OpenSim/Framework/TaskInventoryItem.cs | 12 +- OpenSim/Framework/Util.cs | 20 +- 60 files changed, 745 insertions(+), 745 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AssemblyInfo.cs b/OpenSim/Framework/AssemblyInfo.cs index d43b259..3cd3def 100644 --- a/OpenSim/Framework/AssemblyInfo.cs +++ b/OpenSim/Framework/AssemblyInfo.cs @@ -28,7 +28,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. @@ -41,8 +41,8 @@ using System.Runtime.InteropServices; [assembly : AssemblyTrademark("")] [assembly : AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly : ComVisible(false)] @@ -54,7 +54,7 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index 945163c..7adcb4a 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs @@ -38,7 +38,7 @@ using Nini.Config; /// Loads assets from the filesystem location. Not yet a plugin, though it should be. /// namespace OpenSim.Framework.AssetLoader.Filesystem -{ +{ public class AssetLoaderFileSystem : IAssetLoader { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -63,7 +63,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem return asset; } - + protected static void LoadAsset(AssetBase info, bool image, string path) { FileInfo fInfo = new FileInfo(path); @@ -77,7 +77,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem info.Data = idata; //info.loaded=true; } - + public void ForEachDefaultXmlAsset(Action action) { string assetSetFilename = Path.Combine(Util.assetsDir(), "AssetSets.xml"); @@ -91,28 +91,28 @@ namespace OpenSim.Framework.AssetLoader.Filesystem if (File.Exists(assetSetFilename)) { string assetSetPath = "ERROR"; - + try { XmlConfigSource source = new XmlConfigSource(assetSetFilename); - + for (int i = 0; i < source.Configs.Count; i++) { assetSetPath = source.Configs[i].GetString("file", String.Empty); - + LoadXmlAssetSet(Path.Combine(Util.assetsDir(), assetSetPath), assets); } } catch (XmlException e) { m_log.ErrorFormat("[ASSETS]: Error loading {0} : {1}", assetSetPath, e); - } + } } else { m_log.Error("[ASSETS]: Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); } - + assets.ForEach(action); } @@ -124,7 +124,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem protected static void LoadXmlAssetSet(string assetSetPath, List assets) { m_log.InfoFormat("[ASSETS]: Loading asset set {0}", assetSetPath); - + if (File.Exists(assetSetPath)) { try @@ -156,6 +156,6 @@ namespace OpenSim.Framework.AssetLoader.Filesystem { m_log.ErrorFormat("[ASSETS]: Asset set file {0} does not exist!", assetSetPath); } - } + } } } diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index cf9ff58..365df1a 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -56,7 +56,7 @@ namespace OpenSim.Framework public readonly static int SKIRT = 12; private readonly static int MAX_WEARABLES = 13; - + private static LLUUID BODY_ASSET = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"); private static LLUUID BODY_ITEM = new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9"); private static LLUUID SKIN_ASSET = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"); @@ -204,7 +204,7 @@ namespace OpenSim.Framework set { m_wearables[SKIRT].AssetID = value; } } - public void SetDefaultWearables() + public void SetDefaultWearables() { m_wearables[BODY].AssetID = BODY_ASSET; m_wearables[BODY].ItemID = BODY_ITEM; @@ -257,7 +257,7 @@ namespace OpenSim.Framework } /// - /// + /// /// /// /// diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index 2395c99..a70f7fa 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs @@ -72,7 +72,7 @@ namespace OpenSim.Framework public void Remove(uint id) { - //m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count); + //m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count); lock (m_clients) { m_clients.Remove(id); diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 1414260..0669ce9 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -40,12 +40,12 @@ namespace OpenSim.Framework.Communications.Cache /// /// Manages local cache of assets and their sending to viewers. - /// + /// /// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either /// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and /// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and /// AssetNotFound(), which means they do share the same asset and texture caches. - /// + /// /// TODO Assets in this cache are effectively immortal (they are never disposed off through old age). /// This is not a huge problem at the moment since other memory use usually dwarfs that used by assets /// but it's something to bear in mind. @@ -281,8 +281,8 @@ namespace OpenSim.Framework.Communications.Cache /// /// Synchronously retreive an asset. If the asset isn't in the cache, a request will be made to the persistent store to - /// load it into the cache. - /// + /// load it into the cache. + /// /// XXX We'll keep polling the cache until we get the asset or we exceed /// the allowed number of polls. This isn't a very good way of doing things since a single thread /// is processing inbound packets, so if the asset server is slow, we could block this for up to @@ -431,11 +431,11 @@ namespace OpenSim.Framework.Communications.Cache //making a copy of the list is not ideal //but the old method of locking around this whole block of code was causing a multi-thread lock //between this and the TextureDownloadModule - //while the localAsset thread running this and trying to send a texture to the callback in the + //while the localAsset thread running this and trying to send a texture to the callback in the //texturedownloadmodule , and hitting a lock in there. While the texturedownload thread (which was holding - // the lock in the texturedownload module) was trying to + // the lock in the texturedownload module) was trying to //request a new asset and hitting a lock in here on the RequestLists. - + List theseRequests = new List(reqList.Requests); reqList.Requests.Clear(); @@ -460,7 +460,7 @@ namespace OpenSim.Framework.Communications.Cache { // m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); - // Notify requesters for this asset + // Notify requesters for this asset AssetRequestsList reqList = null; lock (RequestLists) { @@ -552,7 +552,7 @@ namespace OpenSim.Framework.Communications.Cache } return; } - //it is in our cache + //it is in our cache AssetInfo asset = Assets[requestID]; // add to the AssetRequests list @@ -679,14 +679,14 @@ namespace OpenSim.Framework.Communications.Cache public byte AssetRequestSource = 2; public byte[] Params = null; //public bool AssetInCache; - //public int TimeRequested; + //public int TimeRequested; public int DiscardLevel = -1; public AssetRequest() { } } - + public class AssetInfo : AssetBase { public AssetInfo() diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index 1a7f872..b16512c 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications.Cache { public abstract class AssetServerBase : IAssetServer { - private static readonly ILog m_log + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected IAssetReceiver m_receiver; @@ -47,12 +47,12 @@ namespace OpenSim.Framework.Communications.Cache // Temporarily hardcoded - should be a plugin protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); - + protected abstract void StoreAsset(AssetBase asset); protected abstract void CommitAssets(); /// - /// This method must be implemented by a subclass to retrieve the asset named in the + /// This method must be implemented by a subclass to retrieve the asset named in the /// AssetRequest. If the asset is not found, null should be returned. /// /// @@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache protected abstract AssetBase GetAsset(AssetRequest req); /// - /// Process an asset request. This method will call GetAsset(AssetRequest req) + /// Process an asset request. This method will call GetAsset(AssetRequest req) /// on the subclass. /// /// diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 218fd5a..f40f078 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -36,55 +36,55 @@ using log4net; namespace OpenSim.Framework.Communications.Cache { internal delegate void AddItemDelegate(InventoryItemBase itemInfo); - internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo); + internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo); internal delegate void DeleteItemDelegate(LLUUID itemID); - + internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID); - internal delegate void MoveFolderDelegate(LLUUID folderID, LLUUID parentID); + internal delegate void MoveFolderDelegate(LLUUID folderID, LLUUID parentID); internal delegate void PurgeFolderDelegate(LLUUID folderID); internal delegate void UpdateFolderDelegate(string name, LLUUID folderID, ushort type, LLUUID parentID); - + internal delegate void SendInventoryDescendentsDelegate( IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems); - + /// /// Stores user profile and inventory data received from backend services for a particular user. /// public class CachedUserInfo { - private static readonly ILog m_log + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// The comms manager holds references to services (user, grid, inventory, etc.) - /// + /// private readonly CommunicationsManager m_commsManager; - + public UserProfileData UserProfile { get { return m_userProfile; } } - private readonly UserProfileData m_userProfile; + private readonly UserProfileData m_userProfile; /// /// Has we received the user's inventory from the inventory service? /// private bool m_hasInventory; - + /// /// Inventory requests waiting for receipt of this user's inventory from the inventory service. /// - private readonly IList m_pendingRequests = new List(); - + private readonly IList m_pendingRequests = new List(); + /// /// Has this user info object yet received its inventory information from the invetnroy service? /// public bool HasInventory { get { return m_hasInventory; } } - + private InventoryFolderImpl m_rootFolder; - public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } - + public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } + /// /// FIXME: This could be contained within a local variable - it doesn't need to be a field /// - private IDictionary> pendingCategorizationFolders + private IDictionary> pendingCategorizationFolders = new Dictionary>(); /// @@ -97,7 +97,7 @@ namespace OpenSim.Framework.Communications.Cache m_commsManager = commsManager; m_userProfile = userProfile; } - + /// /// This allows a request to be added to be processed once we receive a user's inventory /// from the inventory service. If we already have the inventory, the request @@ -118,7 +118,7 @@ namespace OpenSim.Framework.Communications.Cache } } } - + /// /// Store a folder pending arrival of its parent /// @@ -126,7 +126,7 @@ namespace OpenSim.Framework.Communications.Cache private void AddPendingFolder(InventoryFolderImpl folder) { LLUUID parentFolderId = folder.ParentID; - + if (pendingCategorizationFolders.ContainsKey(parentFolderId)) { pendingCategorizationFolders[parentFolderId].Add(folder); @@ -135,11 +135,11 @@ namespace OpenSim.Framework.Communications.Cache { IList folders = new List(); folders.Add(folder); - + pendingCategorizationFolders[parentFolderId] = folders; } } - + /// /// Add any pending folders which were received before the given folder /// @@ -155,18 +155,18 @@ namespace OpenSim.Framework.Communications.Cache // m_log.DebugFormat( // "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}", // folder.name, folder.folderID, parent.name, parent.folderID); - + lock (newFolder.SubFolders) { if (!newFolder.SubFolders.ContainsKey(folder.ID)) { newFolder.SubFolders.Add(folder.ID, folder); - } + } } } } } - + /// /// Callback invoked when the inventory is received from an async request to the inventory service /// @@ -177,12 +177,12 @@ namespace OpenSim.Framework.Communications.Cache // FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these // are simply being swallowed try - { + { foreach (InventoryFolderImpl folder in folders) { FolderReceive(folder); } - + foreach (InventoryItemBase item in items) { ItemReceive(item); @@ -191,15 +191,15 @@ namespace OpenSim.Framework.Communications.Cache catch (Exception e) { m_log.ErrorFormat("[INVENTORY CACHE]: Error processing inventory received from inventory service, {0}", e); - } - + } + // Deal with pending requests lock (m_pendingRequests) { // We're going to change inventory status within the lock to avoid a race condition // where requests are processed after the AddRequest() method has been called. m_hasInventory = true; - + foreach (IInventoryRequest request in m_pendingRequests) { request.Execute(); @@ -215,7 +215,7 @@ namespace OpenSim.Framework.Communications.Cache private void FolderReceive(InventoryFolderImpl newFolder) { // m_log.DebugFormat( -// "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", +// "[INVENTORY CACHE]: Received folder {0} {1} for user {2}", // folderInfo.Name, folderInfo.ID, userID); if (RootFolder == null) @@ -232,7 +232,7 @@ namespace OpenSim.Framework.Communications.Cache else { InventoryFolderImpl parentFolder = RootFolder.FindFolder(newFolder.ParentID); - + if (parentFolder != null) { lock (parentFolder.SubFolders) @@ -252,44 +252,44 @@ namespace OpenSim.Framework.Communications.Cache else { AddPendingFolder(newFolder); - } + } } - + ResolvePendingFolders(newFolder); } /// /// Callback invoked when an item is received from an async request to the inventory service. - /// + /// /// We're assuming here that items are always received after all the folders /// received. /// - /// + /// private void ItemReceive(InventoryItemBase itemInfo) { // m_log.DebugFormat( -// "[INVENTORY CACHE]: Received item {0} {1} for user {2}", +// "[INVENTORY CACHE]: Received item {0} {1} for user {2}", // itemInfo.Name, itemInfo.ID, userID); InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder); - + if (null == folder) { m_log.WarnFormat( - "Received item {0} {1} but its folder {2} does not exist", + "Received item {0} {1} but its folder {2} does not exist", itemInfo.Name, itemInfo.ID, itemInfo.Folder); - + return; } - + lock (folder.Items) { folder.Items[itemInfo.ID] = itemInfo; } } - + /// - /// Create a folder in this agent's inventory. - /// + /// Create a folder in this agent's inventory. + /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. /// @@ -299,20 +299,20 @@ namespace OpenSim.Framework.Communications.Cache { // m_log.DebugFormat( // "[AGENT INVENTORY]: Creating inventory folder {0} {1} for {2} {3}", folderID, folderName, remoteClient.Name, remoteClient.AgentId); - + if (HasInventory) { InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID); - + if (null == parentFolder) { m_log.WarnFormat( "[AGENT INVENTORY]: Tried to create folder {0} {1} but the parent {2} does not exist", folderName, folderID, parentID); - + return false; } - + InventoryFolderImpl createdFolder = parentFolder.CreateChildFolder(folderID, folderName, folderType); if (createdFolder != null) @@ -324,17 +324,17 @@ namespace OpenSim.Framework.Communications.Cache createdBaseFolder.ParentID = createdFolder.ParentID; createdBaseFolder.Type = createdFolder.Type; createdBaseFolder.Version = createdFolder.Version; - + m_commsManager.InventoryService.AddFolder(createdBaseFolder); - + return true; } else { m_log.WarnFormat( - "[AGENT INVENTORY]: Tried to create folder {0} {1} but the folder already exists", + "[AGENT INVENTORY]: Tried to create folder {0} {1} but the folder already exists", folderName, folderID); - + return false; } } @@ -344,22 +344,22 @@ namespace OpenSim.Framework.Communications.Cache new InventoryRequest( Delegate.CreateDelegate(typeof(CreateFolderDelegate), this, "CreateFolder"), new object[] { folderName, folderID, folderType, parentID })); - + return true; - } + } } - + /// /// Handle a client request to update the inventory folder - /// + /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. - /// + /// /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, /// and needs to be changed. /// - /// + /// /// /// /// @@ -367,7 +367,7 @@ namespace OpenSim.Framework.Communications.Cache public bool UpdateFolder(string name, LLUUID folderID, ushort type, LLUUID parentID) { // m_log.DebugFormat( -// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); +// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); if (HasInventory) { @@ -378,7 +378,7 @@ namespace OpenSim.Framework.Communications.Cache baseFolder.ParentID = parentID; baseFolder.Type = (short) type; baseFolder.Version = RootFolder.Version; - + m_commsManager.InventoryService.AddFolder(baseFolder); } else @@ -387,18 +387,18 @@ namespace OpenSim.Framework.Communications.Cache new InventoryRequest( Delegate.CreateDelegate(typeof(UpdateFolderDelegate), this, "UpdateFolder"), new object[] { name, folderID, type, parentID })); - } - + } + return true; - } - + } + /// /// Handle an inventory folder move request from the client. - /// + /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. /// - /// + /// /// /// public bool MoveFolder(LLUUID folderID, LLUUID parentID) @@ -413,9 +413,9 @@ namespace OpenSim.Framework.Communications.Cache baseFolder.Owner = m_userProfile.ID; baseFolder.ID = folderID; baseFolder.ParentID = parentID; - + m_commsManager.InventoryService.MoveFolder(baseFolder); - + return true; } else @@ -424,30 +424,30 @@ namespace OpenSim.Framework.Communications.Cache new InventoryRequest( Delegate.CreateDelegate(typeof(MoveFolderDelegate), this, "MoveFolder"), new object[] { folderID, parentID })); - + return true; - } - } - + } + } + /// /// This method will delete all the items and folders in the given folder. - /// + /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. /// - /// + /// /// public bool PurgeFolder(LLUUID folderID) { -// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", +// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}", // folderID, remoteClient.Name, remoteClient.AgentId); - + if (HasInventory) { InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID); - + if (purgedFolder != null) - { + { // XXX Nasty - have to create a new object to hold details we already have InventoryFolderBase purgedBaseFolder = new InventoryFolderBase(); purgedBaseFolder.Owner = purgedFolder.Owner; @@ -455,12 +455,12 @@ namespace OpenSim.Framework.Communications.Cache purgedBaseFolder.Name = purgedFolder.Name; purgedBaseFolder.ParentID = purgedFolder.ParentID; purgedBaseFolder.Type = purgedFolder.Type; - purgedBaseFolder.Version = purgedFolder.Version; - - m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder); - + purgedBaseFolder.Version = purgedFolder.Version; + + m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder); + purgedFolder.Purge(); - + return true; } } @@ -470,12 +470,12 @@ namespace OpenSim.Framework.Communications.Cache new InventoryRequest( Delegate.CreateDelegate(typeof(PurgeFolderDelegate), this, "PurgeFolder"), new object[] { folderID })); - + return true; - } - + } + return false; - } + } /// /// Add an item to the user's inventory @@ -494,7 +494,7 @@ namespace OpenSim.Framework.Communications.Cache new InventoryRequest( Delegate.CreateDelegate(typeof(AddItemDelegate), this, "AddItem"), new object[] { item })); - } + } } /// @@ -514,18 +514,18 @@ namespace OpenSim.Framework.Communications.Cache new InventoryRequest( Delegate.CreateDelegate(typeof(UpdateItemDelegate), this, "UpdateItem"), new object[] { item })); - } + } } /// /// Delete an item from the user's inventory - /// + /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. /// /// /// - /// true on a successful delete or a if the request is queued. + /// true on a successful delete or a if the request is queued. /// Returns false on an immediate failure /// public bool DeleteItem(LLUUID itemID) @@ -535,14 +535,14 @@ namespace OpenSim.Framework.Communications.Cache // XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though // really only the item id is required. InventoryItemBase item = RootFolder.FindItem(itemID); - + if (null == item) { m_log.WarnFormat("[AGENT INVENTORY]: Tried to delete item {0} which does not exist", itemID); - + return false; } - + if (RootFolder.DeleteItem(item.ID)) { return m_commsManager.InventoryService.DeleteItem(item); @@ -554,13 +554,13 @@ namespace OpenSim.Framework.Communications.Cache new InventoryRequest( Delegate.CreateDelegate(typeof(DeleteItemDelegate), this, "DeleteItem"), new object[] { itemID })); - + return true; - } - + } + return false; } - + /// /// Send details of the inventory items and/or folders in a given folder to the client. /// @@ -574,13 +574,13 @@ namespace OpenSim.Framework.Communications.Cache if (HasInventory) { InventoryFolderImpl folder; - + if ((folder = RootFolder.FindFolder(folderID)) != null) { // m_log.DebugFormat( -// "[AGENT INVENTORY]: Found folder {0} for client {1}", +// "[AGENT INVENTORY]: Found folder {0} for client {1}", // folderID, remoteClient.AgentId); - + client.SendInventoryFolderDetails( client.AgentId, folderID, folder.RequestListOfItems(), folder.RequestListOfFolders(), fetchFolders, fetchItems); @@ -592,7 +592,7 @@ namespace OpenSim.Framework.Communications.Cache m_log.WarnFormat( "[AGENT INVENTORY]: Could not find folder {0} requested by user {1} {2}", folderID, client.Name, client.AgentId); - + return false; } } @@ -604,13 +604,13 @@ namespace OpenSim.Framework.Communications.Cache new object[] { client, folderID, fetchFolders, fetchItems })); return true; - } + } } } - + /// /// Should be implemented by callers which require a callback when the user's inventory is received - /// + /// public interface IInventoryRequest { /// @@ -618,7 +618,7 @@ namespace OpenSim.Framework.Communications.Cache /// void Execute(); } - + /// /// Generic inventory request /// @@ -626,16 +626,16 @@ namespace OpenSim.Framework.Communications.Cache { private Delegate m_delegate; private Object[] m_args; - + internal InventoryRequest(Delegate delegat, Object[] args) { - m_delegate = delegat; + m_delegate = delegat; m_args = args; } - + public void Execute() { m_delegate.DynamicInvoke(m_args); } - } + } } diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index d5b7fea..4b4ef17 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs @@ -95,9 +95,9 @@ namespace OpenSim.Framework.Communications.Cache // XmlSerializer xs = new XmlSerializer(typeof(AssetBase)); // xs.Serialize(s, asset); // RestClient rc = new RestClient(_assetServerUrl); - - string assetUrl = _assetServerUrl + "/assets/"; - + + string assetUrl = _assetServerUrl + "/assets/"; + //rc.AddResourcePath("assets"); // rc.RequestMethod = "POST"; @@ -105,7 +105,7 @@ namespace OpenSim.Framework.Communications.Cache //m_log.InfoFormat("[ASSET]: Stored {0}", rc); m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID); - + RestObjectPoster.BeginPostObject(assetUrl, asset); } catch (Exception e) diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index c8cec69..0fbc427 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications.Cache public class InventoryFolderImpl : InventoryFolderBase { //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + // Fields public Dictionary Items = new Dictionary(); public Dictionary SubFolders = new Dictionary(); @@ -82,14 +82,14 @@ namespace OpenSim.Framework.Communications.Cache subFold.ParentID = this.ID; subFold.Owner = Owner; SubFolders.Add(subFold.ID, subFold); - + return subFold; } } - + return null; } - + /// /// Delete all the folders and items in this folder. /// @@ -97,9 +97,9 @@ namespace OpenSim.Framework.Communications.Cache { foreach (InventoryFolderImpl folder in SubFolders.Values) { - folder.Purge(); + folder.Purge(); } - + SubFolders.Clear(); Items.Clear(); } @@ -118,20 +118,20 @@ namespace OpenSim.Framework.Communications.Cache return Items[itemID]; } } - + lock (SubFolders) { foreach (InventoryFolderImpl folder in SubFolders.Values) { InventoryItemBase item = folder.FindItem(itemID); - + if (item != null) { return item; } } } - + return null; } @@ -143,7 +143,7 @@ namespace OpenSim.Framework.Communications.Cache public bool DeleteItem(LLUUID itemID) { bool found = false; - + lock (Items) { if (Items.ContainsKey(itemID)) @@ -152,20 +152,20 @@ namespace OpenSim.Framework.Communications.Cache return true; } } - + lock (SubFolders) { foreach (InventoryFolderImpl folder in SubFolders.Values) { found = folder.DeleteItem(itemID); - + if (found == true) { break; } } } - + return found; } @@ -175,25 +175,25 @@ namespace OpenSim.Framework.Communications.Cache /// /// The requested folder if it exists, null if it does not. public InventoryFolderImpl FindFolder(LLUUID folderID) - { + { if (folderID == ID) { return this; } - + lock (SubFolders) { foreach (InventoryFolderImpl folder in SubFolders.Values) { InventoryFolderImpl returnFolder = folder.FindFolder(folderID); - + if (returnFolder != null) { return returnFolder; } } } - + return null; } @@ -203,7 +203,7 @@ namespace OpenSim.Framework.Communications.Cache public List RequestListOfItems() { List itemList = new List(); - + lock (Items) { foreach (InventoryItemBase item in Items.Values) @@ -211,9 +211,9 @@ namespace OpenSim.Framework.Communications.Cache itemList.Add(item); } } - + //m_log.DebugFormat("[INVENTORY FOLDER IMPL]: Found {0} items", itemList.Count); - + return itemList; } @@ -221,9 +221,9 @@ namespace OpenSim.Framework.Communications.Cache /// Return the list of immediate child folders in this folder. /// public List RequestListOfFolders() - { + { List folderList = new List(); - + lock (SubFolders) { foreach (InventoryFolderBase folder in SubFolders.Values) @@ -231,7 +231,7 @@ namespace OpenSim.Framework.Communications.Cache folderList.Add(folder); } } - + return folderList; } } diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs index b3852c0..ca7eb13 100644 --- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs +++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs @@ -45,34 +45,34 @@ namespace OpenSim.Framework.Communications.Cache private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000"); - + /// /// Holds the root library folder and all its descendents. This is really only used during inventory /// setup so that we don't have to repeatedly search the tree of library folders. /// - protected Dictionary libraryFolders + protected Dictionary libraryFolders = new Dictionary(); public LibraryRootFolder() { m_log.Info("[LIBRARY INVENTORY]: Loading library inventory"); - + Owner = libOwner; ID = new LLUUID("00000112-000f-0000-0000-000100bba000"); Name = "OpenSim Library"; ParentID = LLUUID.Zero; Type = (short) 8; Version = (ushort) 1; - + libraryFolders.Add(ID, this); - + LoadLibraries(Path.Combine(Util.inventoryDir(), "Libraries.xml")); // CreateLibraryItems(); } /// - /// Hardcoded item creation. Please don't add any more items here - future items should be created + /// Hardcoded item creation. Please don't add any more items here - future items should be created /// in the xml in the bin/inventory folder. /// /// @@ -132,7 +132,7 @@ namespace OpenSim.Framework.Communications.Cache item.NextPermissions = 0x7FFFFFFF; return item; } - + /// /// Use the asset set information at path to load assets /// @@ -142,49 +142,49 @@ namespace OpenSim.Framework.Communications.Cache { m_log.InfoFormat( "[LIBRARY INVENTORY]: Loading libraries control file {0}", librariesControlPath); - + LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig); } - + /// /// Read a library set from config /// /// protected void ReadLibraryFromConfig(IConfig config) { - string foldersPath + string foldersPath = Path.Combine( Util.inventoryDir(), config.GetString("foldersFile", String.Empty)); - + LoadFromFile(foldersPath, "Library folders", ReadFolderFromConfig); - - string itemsPath + + string itemsPath = Path.Combine( Util.inventoryDir(), config.GetString("itemsFile", String.Empty)); - + LoadFromFile(itemsPath, "Library items", ReadItemFromConfig); } - + /// /// Read a library inventory folder from a loaded configuration /// /// private void ReadFolderFromConfig(IConfig config) - { + { InventoryFolderImpl folderInfo = new InventoryFolderImpl(); - + folderInfo.ID = new LLUUID(config.GetString("folderID", ID.ToString())); - folderInfo.Name = config.GetString("name", "unknown"); + folderInfo.Name = config.GetString("name", "unknown"); folderInfo.ParentID = new LLUUID(config.GetString("parentFolderID", ID.ToString())); folderInfo.Type = (short)config.GetInt("type", 8); - - folderInfo.Owner = libOwner; - folderInfo.Version = 1; - + + folderInfo.Owner = libOwner; + folderInfo.Version = 1; + if (libraryFolders.ContainsKey(folderInfo.ParentID)) - { + { InventoryFolderImpl parentFolder = libraryFolders[folderInfo.ParentID]; - + libraryFolders.Add(folderInfo.ID, folderInfo); parentFolder.SubFolders.Add(folderInfo.ID, folderInfo); @@ -201,7 +201,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// Read a library inventory item metadata from a loaded configuration /// - /// + /// private void ReadItemFromConfig(IConfig config) { InventoryItemBase item = new InventoryItemBase(); @@ -218,11 +218,11 @@ namespace OpenSim.Framework.Communications.Cache item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); - + if (libraryFolders.ContainsKey(item.Folder)) { InventoryFolderImpl parentFolder = libraryFolders[item.Folder]; - + parentFolder.Items.Add(item.ID, item); } else @@ -230,11 +230,11 @@ namespace OpenSim.Framework.Communications.Cache m_log.WarnFormat( "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!", item.Name, item.ID, item.Folder); - } + } } - - private delegate void ConfigAction(IConfig config); - + + private delegate void ConfigAction(IConfig config); + /// /// Load the given configuration at a path and perform an action on each Config contained within it /// @@ -242,7 +242,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// private static void LoadFromFile(string path, string fileDescription, ConfigAction action) - { + { if (File.Exists(path)) { try @@ -250,21 +250,21 @@ namespace OpenSim.Framework.Communications.Cache XmlConfigSource source = new XmlConfigSource(path); for (int i = 0; i < source.Configs.Count; i++) - { + { action(source.Configs[i]); } } catch (XmlException e) { m_log.ErrorFormat("[LIBRARY INVENTORY]: Error loading {0} : {1}", path, e); - } + } } else { m_log.ErrorFormat("[LIBRARY INVENTORY]: {0} file {1} does not exist!", fileDescription, path); - } + } } - + /// /// Looks like a simple getter, but is written like this for some consistency with the other Request /// methods in the superclass diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 7f911dc..fe61406 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -33,7 +33,7 @@ using libsecondlife; using log4net; namespace OpenSim.Framework.Communications.Cache -{ +{ /// /// Holds user profile information and retrieves it from backend services. /// @@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache /// The comms manager holds references to services (user, grid, inventory, etc.) /// private readonly CommunicationsManager m_commsManager; - + /// /// Each user has a cached profile. /// @@ -84,8 +84,8 @@ namespace OpenSim.Framework.Communications.Cache } } } - } - + } + /// /// Remove this user's profile cache. /// @@ -103,9 +103,9 @@ namespace OpenSim.Framework.Communications.Cache else { m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID); - } + } } - + return false; } @@ -118,14 +118,14 @@ namespace OpenSim.Framework.Communications.Cache { CachedUserInfo userInfo = GetUserDetails(userID); if (userInfo != null) - { + { m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive); } else { m_log.ErrorFormat("[USER CACHE]: RequestInventoryForUser() - user profile for user {0} not found", userID); } - } + } /// /// Get the details of the given user. A caller should try this method first if it isn't sure that @@ -151,7 +151,7 @@ namespace OpenSim.Framework.Communications.Cache /// public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID) - { + { CachedUserInfo userProfile; if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) @@ -159,21 +159,21 @@ namespace OpenSim.Framework.Communications.Cache if (!userProfile.CreateFolder(folderName, folderID, folderType, parentID)) { m_log.ErrorFormat( - "[AGENT INVENTORY]: Failed to create folder for user {0} {1}", + "[AGENT INVENTORY]: Failed to create folder for user {0} {1}", remoteClient.Name, remoteClient.AgentId); } } else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not find user profile for {0} {1}", + "[AGENT INVENTORY]: Could not find user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId); } } /// /// Handle a client request to update the inventory folder - /// + /// /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, /// and needs to be changed. @@ -188,7 +188,7 @@ namespace OpenSim.Framework.Communications.Cache { // m_log.DebugFormat( // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); - + CachedUserInfo userProfile; if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile)) @@ -196,16 +196,16 @@ namespace OpenSim.Framework.Communications.Cache if (!userProfile.UpdateFolder(name, folderID, type, parentID)) { m_log.ErrorFormat( - "[AGENT INVENTORY]: Failed to update folder for user {0} {1}", + "[AGENT INVENTORY]: Failed to update folder for user {0} {1}", remoteClient.Name, remoteClient.AgentId); } } else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not find user profile for {0} {1}", + "[AGENT INVENTORY]: Could not find user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId); - } + } } /// @@ -223,16 +223,16 @@ namespace OpenSim.Framework.Communications.Cache if (!userProfile.MoveFolder(folderID, parentID)) { m_log.ErrorFormat( - "[AGENT INVENTORY]: Failed to move folder for user {0} {1}", + "[AGENT INVENTORY]: Failed to move folder for user {0} {1}", remoteClient.Name, remoteClient.AgentId); } } else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not find user profile for {0} {1}", + "[AGENT INVENTORY]: Could not find user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId); - } + } } /// @@ -267,14 +267,14 @@ namespace OpenSim.Framework.Communications.Cache else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not find user profile for {0} {1}", + "[AGENT INVENTORY]: Could not find user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId); - } + } } /// /// Handle the caps inventory descendents fetch. - /// + /// /// Since the folder structure is sent to the client on login, I believe we only need to handle items. /// /// @@ -288,20 +288,20 @@ namespace OpenSim.Framework.Communications.Cache bool fetchFolders, bool fetchItems, int sortOrder) { // m_log.DebugFormat( -// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", +// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}", // fetchFolders, fetchItems, folderID, agentID); - + // FIXME MAYBE: We're not handling sortOrder! InventoryFolderImpl fold; if ((fold = libraryRoot.FindFolder(folderID)) != null) { return fold.RequestListOfItems(); - } + } CachedUserInfo userProfile; if (m_userProfiles.TryGetValue(agentID, out userProfile)) - { + { // XXX: When a client crosses into a scene, their entire inventory is fetched // asynchronously. If the client makes a request before the inventory is received, we need // to give the inventory a chance to come in. @@ -315,18 +315,18 @@ namespace OpenSim.Framework.Communications.Cache while (attempts++ < 30) { m_log.DebugFormat( - "[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}", + "[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}", attempts, folderID, agentID); - + Thread.Sleep(2000); - + if (userProfile.HasInventory) { break; } } - } - + } + if (userProfile.HasInventory) { if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null) @@ -338,9 +338,9 @@ namespace OpenSim.Framework.Communications.Cache m_log.WarnFormat( "[AGENT INVENTORY]: Could not find folder {0} requested by user {1}", folderID, agentID); - + return null; - } + } } else { @@ -352,7 +352,7 @@ namespace OpenSim.Framework.Communications.Cache else { m_log.ErrorFormat("[AGENT INVENTORY]: Could not find user profile for {0}", agentID); - + return null; } } @@ -371,16 +371,16 @@ namespace OpenSim.Framework.Communications.Cache if (!userProfile.PurgeFolder(folderID)) { m_log.ErrorFormat( - "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}", + "[AGENT INVENTORY]: Failed to purge folder for user {0} {1}", remoteClient.Name, remoteClient.AgentId); } } else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not find user profile for {0} {1}", + "[AGENT INVENTORY]: Could not find user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId); - } + } } public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) @@ -407,9 +407,9 @@ namespace OpenSim.Framework.Communications.Cache else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not find user profile for {0} {1}", + "[AGENT INVENTORY]: Could not find user profile for {0} {1}", remoteClient.Name, remoteClient.AgentId); - } + } } } } diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 705f369..dac2f34 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -64,16 +64,16 @@ namespace OpenSim.Framework.Communications.Capabilities public class Caps { - private static readonly ILog m_log = + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private string m_httpListenerHostName; private uint m_httpListenPort; - + /// /// This is the uuid portion of every CAPS path. It is used to make capability urls private to the requester. /// - private string m_capsObjectPath; + private string m_capsObjectPath; public string CapsObjectPath { get { return m_capsObjectPath; } } private CapsHandlers m_capsHandlers; @@ -88,7 +88,7 @@ namespace OpenSim.Framework.Communications.Capabilities // The following two entries are in a module, however, there also here so that we don't re-assign // the path to another cap by mistake. - private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module. + private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module. private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. //private string eventQueue = "0100/"; @@ -100,7 +100,7 @@ namespace OpenSim.Framework.Communications.Capabilities private bool m_dumpAssetsToFile; private string m_regionName; - // These are callbacks which will be setup by the scene so that we can update scene data when we + // These are callbacks which will be setup by the scene so that we can update scene data when we // receive capability calls public NewInventoryItem AddNewInventoryItem = null; public ItemUpdatedCallback ItemUpdatedCall = null; @@ -128,46 +128,46 @@ namespace OpenSim.Framework.Communications.Capabilities public void RegisterHandlers() { DeregisterHandlers(); - - string capsBase = "/CAPS/" + m_capsObjectPath; - + + string capsBase = "/CAPS/" + m_capsObjectPath; + try { // the root of all evil m_capsHandlers["SEED"] = new RestStreamHandler("POST", capsBase + m_requestPath, CapsRequest); - m_capsHandlers["MapLayer"] = - new LLSDStreamhandler("POST", - capsBase + m_mapLayerPath, + m_capsHandlers["MapLayer"] = + new LLSDStreamhandler("POST", + capsBase + m_mapLayerPath, GetMapLayer); - m_capsHandlers["NewFileAgentInventory"] = + m_capsHandlers["NewFileAgentInventory"] = new LLSDStreamhandler("POST", capsBase + m_newInventory, NewAgentInventoryRequest); - m_capsHandlers["UpdateNotecardAgentInventory"] = + m_capsHandlers["UpdateNotecardAgentInventory"] = new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory); m_capsHandlers["UpdateScriptAgentInventory"] = m_capsHandlers["UpdateNotecardAgentInventory"]; - m_capsHandlers["UpdateScriptTaskInventory"] = + m_capsHandlers["UpdateScriptTaskInventory"] = new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); - - // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and - // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires - // enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service, - // but when I went on the Linden grid, the + + // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and + // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires + // enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service, + // but when I went on the Linden grid, the // simulators I visited (version 1.21) were, surprisingly, no longer supplying this capability. Instead, // the 1.19.1.4 client appeared to be happily flowing inventory data over UDP // - // This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid - // we will be + // This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid + // we will be // able to get the data we need to implement the necessary part of the protocol to fix the issue above. -// m_capsHandlers["FetchInventoryDescendents"] = +// m_capsHandlers["FetchInventoryDescendents"] = // new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryRequest); - - // m_capsHandlers["FetchInventoryDescendents"] = + + // m_capsHandlers["FetchInventoryDescendents"] = // new LLSDStreamhandler("POST", // capsBase + m_fetchInventory, // FetchInventory)); // m_capsHandlers["RequestTextureDownload"] = new RestStreamHandler("POST", - // capsBase + m_requestTexture, + // capsBase + m_requestTexture, // RequestTexture); } catch (Exception e) @@ -181,7 +181,7 @@ namespace OpenSim.Framework.Communications.Capabilities /// /// /// - public void RegisterHandler(string capName, IRequestHandler handler) + public void RegisterHandler(string capName, IRequestHandler handler) { m_capsHandlers[capName] = handler; m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path); @@ -189,14 +189,14 @@ namespace OpenSim.Framework.Communications.Capabilities /// /// Remove all CAPS service handlers. - /// + /// /// /// /// /// public void DeregisterHandlers() { - foreach (string capsName in m_capsHandlers.Caps) + foreach (string capsName in m_capsHandlers.Caps) { m_capsHandlers.Remove(capsName); } @@ -220,7 +220,7 @@ namespace OpenSim.Framework.Communications.Capabilities // FIXME: these all should probably go into the respective region // modules - + /// /// Processes a fetch inventory request and sends the reply @@ -229,7 +229,7 @@ namespace OpenSim.Framework.Communications.Capabilities /// /// /// - // Request is like: + // Request is like: // // folders // @@ -240,14 +240,14 @@ namespace OpenSim.Framework.Communications.Capabilities // // // - // multiple fetch-folder maps are allowed within the larger folders map. + // multiple fetch-folder maps are allowed within the larger folders map. public string FetchInventoryRequest(string request, string path, string param) { string unmodifiedRequest = request.ToString(); - + //m_log.DebugFormat("[AGENT INVENTORY]: Received CAPS fetch inventory request {0}", unmodifiedRequest); m_log.Debug("[CAPS]: Inventory Request in region: " + m_regionName); - + Hashtable hash = new Hashtable(); try { @@ -258,7 +258,7 @@ namespace OpenSim.Framework.Communications.Capabilities m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message); m_log.Error("Request: " + request.ToString()); } - + ArrayList foldersrequested = (ArrayList)hash["folders"]; string response = ""; @@ -275,15 +275,15 @@ namespace OpenSim.Framework.Communications.Capabilities inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply); inventoryitemstr = inventoryitemstr.Replace("folders", ""); inventoryitemstr = inventoryitemstr.Replace("", ""); - + response += inventoryitemstr; } - + if (response.Length == 0) { // Ter-guess: If requests fail a lot, the client seems to stop requesting descendants. // Therefore, I'm concluding that the client only has so many threads available to do requests - // and when a thread stalls.. is stays stalled. + // and when a thread stalls.. is stays stalled. // Therefore we need to return something valid response = "folders"; } @@ -291,7 +291,7 @@ namespace OpenSim.Framework.Communications.Capabilities { response = "folders" + response + ""; } - + //m_log.DebugFormat("[AGENT INVENTORY]: Replying to CAPS fetch inventory request with following xml"); //m_log.Debug(Util.GetFormattedXml(response)); @@ -310,7 +310,7 @@ namespace OpenSim.Framework.Communications.Capabilities contents.agent___id = m_agentID; contents.owner___id = invFetch.owner_id; contents.folder___id = invFetch.folder_id; - + // The version number being sent back was originally 1. // Unfortunately, on 1.19.1.4, this means that we see a problem where on subsequent logins // without clearing client cache, objects in the root folder disappear until the cache is cleared, @@ -318,8 +318,8 @@ namespace OpenSim.Framework.Communications.Capabilities // // Seeing the version to something other than 0 may be the right thing to do, but there is // a greater subtlety of the second life protocol that needs to be understood first. - contents.version = 0; - + contents.version = 0; + contents.descendents = 0; reply.folders.Array.Add(contents); List itemList = null; @@ -327,7 +327,7 @@ namespace OpenSim.Framework.Communications.Capabilities { itemList = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order); } - + if (itemList != null) { foreach (InventoryItemBase invItem in itemList) @@ -336,12 +336,12 @@ namespace OpenSim.Framework.Communications.Capabilities } } else - { + { IClientAPI client = GetClient(m_agentID); - - // We're going to both notify the client of inventory service failure and send back a 'no folder contents' response. + + // We're going to both notify the client of inventory service failure and send back a 'no folder contents' response. // If we don't send back the response, - // the client becomes unhappy (see Teravus' comment in FetchInventoryRequest()) + // the client becomes unhappy (see Teravus' comment in FetchInventoryRequest()) if (client != null) { client.SendAgentAlertMessage( @@ -351,11 +351,11 @@ namespace OpenSim.Framework.Communications.Capabilities else { m_log.ErrorFormat( - "[AGENT INVENTORY]: Could not lookup controlling client for {0} in order to notify them of the inventory service failure", + "[AGENT INVENTORY]: Could not lookup controlling client for {0} in order to notify them of the inventory service failure", m_agentID); } } - + contents.descendents = contents.items.Array.Count; return reply; } @@ -375,7 +375,7 @@ namespace OpenSim.Framework.Communications.Capabilities llsdItem.item_id = invItem.ID; llsdItem.name = invItem.Name; llsdItem.parent_id = invItem.Folder; - llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower(); + llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower(); llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.InvType).ToLower(); llsdItem.permissions = new LLSDPermissions(); llsdItem.permissions.creator_id = invItem.Creator; @@ -395,7 +395,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -408,7 +408,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// protected static LLSDMapLayer GetLLSDMapLayerResponse() @@ -421,7 +421,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -437,7 +437,7 @@ namespace OpenSim.Framework.Communications.Capabilities #region EventQueue (Currently not enabled) /// - /// + /// /// /// /// @@ -463,7 +463,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -482,7 +482,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// public string CreateEmptyEventResponse() @@ -590,7 +590,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -622,7 +622,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -708,7 +708,7 @@ namespace OpenSim.Framework.Communications.Capabilities /// Item to update /// Prim containing item to update /// Signals whether the script to update is currently running - /// New asset data + /// New asset data public void TaskScriptUpdated(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data) { if (TaskScriptUpdatedCall != null) @@ -751,7 +751,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -807,7 +807,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// This class is a callback invoked when a client sends asset data to + /// This class is a callback invoked when a client sends asset data to /// an agent inventory notecard update url /// public class ItemUpdater @@ -831,7 +831,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -889,7 +889,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// This class is a callback invoked when a client sends asset data to + /// This class is a callback invoked when a client sends asset data to /// a task inventory script update url /// public class TaskInventoryScriptUpdater @@ -921,7 +921,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -931,7 +931,7 @@ namespace OpenSim.Framework.Communications.Capabilities { try { -// m_log.InfoFormat("[CAPS]: " + +// m_log.InfoFormat("[CAPS]: " + // "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", // data, path, param)); diff --git a/OpenSim/Framework/Communications/Capabilities/CapsHandlers.cs b/OpenSim/Framework/Communications/Capabilities/CapsHandlers.cs index e76a5c5..4a3d00f 100644 --- a/OpenSim/Framework/Communications/Capabilities/CapsHandlers.cs +++ b/OpenSim/Framework/Communications/Capabilities/CapsHandlers.cs @@ -64,14 +64,14 @@ namespace OpenSim.Framework.Communications.Capabilities /// /// name of the capability of the cap /// handler to be removed - public void Remove(string capsName) + public void Remove(string capsName) { // This line must be here, or caps will break! m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); m_capsHandlers.Remove(capsName); } - public bool ContainsCap(string cap) + public bool ContainsCap(string cap) { return m_capsHandlers.ContainsKey(cap); } @@ -85,14 +85,14 @@ namespace OpenSim.Framework.Communications.Capabilities /// retrieve a cap handler for a cap that is not contained in /// CapsHandlers. /// - public IRequestHandler this[string idx] + public IRequestHandler this[string idx] { - get + get { return m_capsHandlers[idx]; } - set + set { if (m_capsHandlers.ContainsKey(idx)) { @@ -111,9 +111,9 @@ namespace OpenSim.Framework.Communications.Capabilities /// Return the list of cap names for which this CapsHandlers /// object contains cap handlers. /// - public string[] Caps + public string[] Caps { - get + get { string[] __keys = new string[m_capsHandlers.Keys.Count]; m_capsHandlers.Keys.CopyTo(__keys, 0); @@ -125,7 +125,7 @@ namespace OpenSim.Framework.Communications.Capabilities /// Return an LLSD-serializable Hashtable describing the /// capabilities and their handler details. /// - public Hashtable CapsDetails + public Hashtable CapsDetails { get { diff --git a/OpenSim/Framework/Communications/Capabilities/LLSD.cs b/OpenSim/Framework/Communications/Capabilities/LLSD.cs index e869267..bcf7a88 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSD.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSD.cs @@ -37,12 +37,12 @@ using libsecondlife; namespace OpenSim.Framework.Communications.Capabilities { /// - /// Borrowed from (a older version of) libsl for now, as their new llsd code doesn't work we our decoding code. + /// Borrowed from (a older version of) libsl for now, as their new llsd code doesn't work we our decoding code. /// public static class LLSD { /// - /// + /// /// public class LLSDParseException : Exception { @@ -52,7 +52,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// public class LLSDSerializeException : Exception { @@ -62,7 +62,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -96,7 +96,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -116,7 +116,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -217,7 +217,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -360,7 +360,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -405,7 +405,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -441,7 +441,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -453,7 +453,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// /// @@ -661,7 +661,7 @@ namespace OpenSim.Framework.Communications.Capabilities } /// - /// + /// /// /// private static void SkipWS(XmlTextReader reader) diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs index 409d2e0..507f12b 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs @@ -35,9 +35,9 @@ namespace OpenSim.Framework.Communications.Capabilities { public class LLSDHelpers { -// private static readonly log4net.ILog m_log +// private static readonly log4net.ILog m_log // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - + public static string SerialiseLLSDReply(object obj) { StringWriter sw = new StringWriter(); @@ -47,9 +47,9 @@ namespace OpenSim.Framework.Communications.Capabilities SerializeLLSDType(writer, obj); writer.WriteEndElement(); writer.Close(); - + //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); - + return sw.ToString(); } @@ -146,7 +146,7 @@ namespace OpenSim.Framework.Communications.Capabilities fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); //TODO // the LLSD map/array types in the array need to be deserialised - // but first we need to know the right class to deserialise them into. + // but first we need to know the right class to deserialise them into. } else { diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDInventoryItem.cs b/OpenSim/Framework/Communications/Capabilities/LLSDInventoryItem.cs index 31896c2..1a75aba 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDInventoryItem.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDInventoryItem.cs @@ -91,7 +91,7 @@ namespace OpenSim.Framework.Communications.Capabilities public int descendents; public LLUUID folder___id; //as LL can't decide if they are going to use "_" or "-" to separate words in the field names public LLSDArray items = new LLSDArray(); - public LLUUID owner___id; // and of course we can't have field names with "-" in + public LLUUID owner___id; // and of course we can't have field names with "-" in public int version; } } \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDParcelVoiceInfoResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDParcelVoiceInfoResponse.cs index fb5eaa8..c045dcf 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDParcelVoiceInfoResponse.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDParcelVoiceInfoResponse.cs @@ -23,7 +23,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* +* */ using System.Collections; @@ -41,7 +41,7 @@ namespace OpenSim.Framework.Communications.Capabilities { } - public LLSDParcelVoiceInfoResponse(string region, int localID, Hashtable creds) + public LLSDParcelVoiceInfoResponse(string region, int localID, Hashtable creds) { region_name = region; parcel_local_id = localID; diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs index 5e8a08f..8683cea 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs @@ -51,7 +51,7 @@ namespace OpenSim.Framework.Communications.Capabilities //string requestBody = streamReader.ReadToEnd(); //streamReader.Close(); - // libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap) + // libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap) // libsecondlife.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request)); Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request); diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs index ee9ff1b..8bfd20c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs @@ -34,7 +34,7 @@ namespace OpenSim.Framework.Communications.Capabilities { /// /// The task inventory item that was updated - /// + /// public LLUUID item_id; /// diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs index df32d1a..e45d9de 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs @@ -34,17 +34,17 @@ namespace OpenSim.Framework.Communications.Capabilities { /// /// The item containing the script to update - /// + /// public LLUUID item_id; /// /// The task containing the script - /// + /// public LLUUID task_id; /// /// Signals whether the script is currently active - /// + /// public int is_script_running; } } \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDVoiceAccountResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDVoiceAccountResponse.cs index 67064b0..8143233 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDVoiceAccountResponse.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDVoiceAccountResponse.cs @@ -23,7 +23,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* +* */ namespace OpenSim.Framework.Communications.Capabilities @@ -38,7 +38,7 @@ namespace OpenSim.Framework.Communications.Capabilities { } - public LLSDVoiceAccountResponse(string user, string pass) + public LLSDVoiceAccountResponse(string user, string pass) { username = user; password = pass; diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 2813aa0..37020f6 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -236,7 +236,7 @@ namespace OpenSim.Framework.Communications public void UpdateAvatarPropertiesRequest(IClientAPI remote_client, UserProfileData UserProfile) { - m_userService.UpdateUserProfileProperties(UserProfile); + m_userService.UpdateUserProfileProperties(UserProfile); return; } diff --git a/OpenSim/Framework/Communications/GenericAsyncResult.cs b/OpenSim/Framework/Communications/GenericAsyncResult.cs index 6c5f5f7..48f72a0 100644 --- a/OpenSim/Framework/Communications/GenericAsyncResult.cs +++ b/OpenSim/Framework/Communications/GenericAsyncResult.cs @@ -112,7 +112,7 @@ namespace OpenSim.Framework.Communications public void EndInvoke() { - // This method assumes that only 1 thread calls EndInvoke + // This method assumes that only 1 thread calls EndInvoke if (!IsCompleted) { // If the operation isn't done, wait for it @@ -142,7 +142,7 @@ namespace OpenSim.Framework.Communications // Save the asynchronous operation's result m_result = result; - // Tell the base class that the operation completed + // Tell the base class that the operation completed // sucessfully (no exception) base.SetAsCompleted(completedSynchronously); } diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index c8a3c85..f7a8857 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -43,62 +43,62 @@ namespace OpenSim.Framework.Communications public interface IInventoryServices { /// - /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the + /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the /// inventory has been received /// /// /// void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); - + /// /// Add a new folder to the user's inventory /// /// /// true if the folder was successfully added bool AddFolder(InventoryFolderBase folder); - + /// /// Move an inventory folder to a new location /// /// A folder containing the details of the new location /// true if the folder was successfully moved bool MoveFolder(InventoryFolderBase folder); - + /// /// Purge an inventory folder of all its items and subfolders. /// /// /// true if the folder was successfully purged bool PurgeFolder(InventoryFolderBase folder); - + /// /// Add a new item to the user's inventory /// /// /// true if the item was successfully added bool AddItem(InventoryItemBase item); - + /// /// Update an item in the user's inventory /// /// /// true if the item was successfully updated bool UpdateItem(InventoryItemBase item); - + /// /// Delete an item from the user's inventory /// /// /// true if the item was successfully deleted bool DeleteItem(InventoryItemBase item); - + /// /// Create a new inventory for the given user. /// /// /// true if the inventory was successfully created, false otherwise bool CreateNewUserInventory(LLUUID user); - + bool HasInventoryForUser(LLUUID userID); /// @@ -107,12 +107,12 @@ namespace OpenSim.Framework.Communications /// /// null if no root folder was found InventoryFolderBase RequestRootFolder(LLUUID userID); - + /// /// Returns a list of all the folders in a given user's inventory. /// /// - /// A flat list of the user's inventory folder tree, + /// A flat list of the user's inventory folder tree, /// null if there is no inventory for this user List GetInventorySkeleton(LLUUID userId); } diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 7d71d02..67a8c78 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs @@ -37,7 +37,7 @@ namespace OpenSim.Framework.Communications /// /// First name /// Last name - /// A user profile. Returns null if no profile is found + /// A user profile. Returns null if no profile is found UserProfileData GetUserProfile(string firstName, string lastName); //UserProfileData GetUserProfile(string name); @@ -46,7 +46,7 @@ namespace OpenSim.Framework.Communications /// Loads a user profile from a database by UUID /// /// The target UUID - /// A user profile. Returns null if no user profile is found. + /// A user profile. Returns null if no user profile is found. UserProfileData GetUserProfile(LLUUID userId); void clearUserAgent(LLUUID avatarID); @@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications UserProfileData SetupMasterUser(LLUUID userId); /// - /// + /// /// /// LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); @@ -110,7 +110,7 @@ namespace OpenSim.Framework.Communications List GetUserFriendList(LLUUID friendlistowner); /// - /// Get's the User Appearance + /// Get's the User Appearance AvatarAppearance GetUserAppearance(LLUUID user); void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance); diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index e81d8c4..dffeed3 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -40,13 +40,13 @@ namespace OpenSim.Framework.Communications /// public abstract class InventoryServiceBase : IInventoryServices { - private static readonly ILog m_log + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Dictionary m_plugins = new Dictionary(); #region Plugin methods - + /// /// Adds a new user server plugin - plugins will be requested in the order they were loaded. /// @@ -76,42 +76,42 @@ namespace OpenSim.Framework.Communications } } } - + #endregion - - #region IInventoryServices methods - + + #region IInventoryServices methods + // See IInventoryServices public List GetInventorySkeleton(LLUUID userId) { // m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); - + InventoryFolderBase rootFolder = RequestRootFolder(userId); - + // Agent has no inventory structure yet. if (null == rootFolder) { - return null; - } - - List userFolders = new List(); - + return null; + } + + List userFolders = new List(); + userFolders.Add(rootFolder); - + foreach (KeyValuePair plugin in m_plugins) { IList folders = plugin.Value.getFolderHierarchy(rootFolder.ID); userFolders.AddRange(folders); - } - + } + // foreach (InventoryFolderBase folder in userFolders) // { // m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID); // } - + return userFolders; } - + // See IInventoryServices public virtual bool HasInventoryForUser(LLUUID userID) { @@ -133,31 +133,31 @@ namespace OpenSim.Framework.Communications public bool CreateNewUserInventory(LLUUID user) { InventoryFolderBase existingRootFolder = RequestRootFolder(user); - + if (null != existingRootFolder) { m_log.WarnFormat( "[AGENT INVENTORY]: Did not create a new inventory for user {0} since they already have " - + "a root inventory folder with id {1}", + + "a root inventory folder with id {1}", user, existingRootFolder.ID); } else - { + { UsersInventory inven = new UsersInventory(); inven.CreateNewInventorySet(user); AddNewInventorySet(inven); - + return true; } - + return false; - } - + } + // See IInventoryServices - public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); - + public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); + #endregion - + #region Methods used by GridInventoryService public List RequestSubFolders(LLUUID parentFolderID) @@ -180,21 +180,21 @@ namespace OpenSim.Framework.Communications } return itemsList; } - + #endregion // See IInventoryServices public bool AddFolder(InventoryFolderBase folder) { m_log.DebugFormat( - "[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); - + "[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); + foreach (KeyValuePair plugin in m_plugins) { plugin.Value.addInventoryFolder(folder); } - - // FIXME: Should return false on failure + + // FIXME: Should return false on failure return true; } @@ -203,14 +203,14 @@ namespace OpenSim.Framework.Communications { m_log.DebugFormat( "[AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); - + foreach (KeyValuePair plugin in m_plugins) { plugin.Value.moveInventoryFolder(folder); } - - // FIXME: Should return false on failure - return true; + + // FIXME: Should return false on failure + return true; } // See IInventoryServices @@ -218,14 +218,14 @@ namespace OpenSim.Framework.Communications { m_log.DebugFormat( "[AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); - + foreach (KeyValuePair plugin in m_plugins) { plugin.Value.addInventoryItem(item); } - - // FIXME: Should return false on failure - return true; + + // FIXME: Should return false on failure + return true; } // See IInventoryServices @@ -233,14 +233,14 @@ namespace OpenSim.Framework.Communications { m_log.InfoFormat( "[AGENT INVENTORY]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); - + foreach (KeyValuePair plugin in m_plugins) { plugin.Value.updateInventoryItem(item); } - - // FIXME: Should return false on failure - return true; + + // FIXME: Should return false on failure + return true; } // See IInventoryServices @@ -248,19 +248,19 @@ namespace OpenSim.Framework.Communications { m_log.InfoFormat( "[AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); - + foreach (KeyValuePair plugin in m_plugins) { plugin.Value.deleteInventoryItem(item.ID); } - - // FIXME: Should return false on failure - return true; + + // FIXME: Should return false on failure + return true; } - + /// /// Purge a folder of all items items and subfolders. - /// + /// /// FIXME: Really nasty in a sense, because we have to query the database to get information we may /// already know... Needs heavy refactoring. /// @@ -269,13 +269,13 @@ namespace OpenSim.Framework.Communications { m_log.DebugFormat( "[AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); - + List subFolders = RequestSubFolders(folder.ID); - + foreach (InventoryFolderBase subFolder in subFolders) { // m_log.DebugFormat("[AGENT INVENTORY]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); - + foreach (KeyValuePair plugin in m_plugins) { plugin.Value.deleteInventoryFolder(subFolder.ID); @@ -288,17 +288,17 @@ namespace OpenSim.Framework.Communications { DeleteItem(item); } - - // FIXME: Should return false on failure - return true; + + // FIXME: Should return false on failure + return true; } - + private void AddNewInventorySet(UsersInventory inventory) { foreach (InventoryFolderBase folder in inventory.Folders.Values) { AddFolder(folder); - } + } } /// @@ -340,7 +340,7 @@ namespace OpenSim.Framework.Communications folder.Type = (short)AssetType.Bodypart; folder.Version = 1; Folders.Add(folder.ID, folder); - + folder = new InventoryFolderBase(); folder.ParentID = rootFolder; folder.Owner = user; @@ -348,7 +348,7 @@ namespace OpenSim.Framework.Communications folder.Name = "Calling Cards"; folder.Type = (short)AssetType.CallingCard; folder.Version = 1; - Folders.Add(folder.ID, folder); + Folders.Add(folder.ID, folder); folder = new InventoryFolderBase(); folder.ParentID = rootFolder; diff --git a/OpenSim/Framework/Communications/Limit/IRequestLimitStrategy.cs b/OpenSim/Framework/Communications/Limit/IRequestLimitStrategy.cs index 6ec21d9..1a9cc24 100644 --- a/OpenSim/Framework/Communications/Limit/IRequestLimitStrategy.cs +++ b/OpenSim/Framework/Communications/Limit/IRequestLimitStrategy.cs @@ -31,9 +31,9 @@ namespace OpenSim.Framework.Communications.Limit /// Interface for strategies that can limit requests from the client. Currently only used in the /// texture modules to deal with repeated requests for certain textures. However, limiting strategies /// could be used with other requests. - /// + /// public interface IRequestLimitStrategy - { + { /// /// Should the request be allowed? If the id is not monitored, then the request is always allowed. /// Otherwise, the strategy criteria will be applied. @@ -41,21 +41,21 @@ namespace OpenSim.Framework.Communications.Limit /// /// bool AllowRequest(TId id); - + /// /// Has the request been refused just once? /// /// False if the request has not yet been refused, or if the request has been refused more /// than once. bool IsFirstRefusal(TId id); - + /// /// Start monitoring for future AllowRequest calls. If the id is already monitored, then monitoring /// continues. /// /// void MonitorRequests(TId id); - + /// /// Is the id being monitored? /// diff --git a/OpenSim/Framework/Communications/Limit/NullLimitStrategy.cs b/OpenSim/Framework/Communications/Limit/NullLimitStrategy.cs index 72d0586..932f780 100644 --- a/OpenSim/Framework/Communications/Limit/NullLimitStrategy.cs +++ b/OpenSim/Framework/Communications/Limit/NullLimitStrategy.cs @@ -26,15 +26,15 @@ */ namespace OpenSim.Framework.Communications.Limit -{ +{ /// /// Strategy which polices no limits /// public class NullLimitStrategy : IRequestLimitStrategy - { + { public bool AllowRequest(TId id) { return true; } public bool IsFirstRefusal(TId id) { return false; } public void MonitorRequests(TId id) { /* intentionally blank */ } - public bool IsMonitoringRequests(TId id) { return false; } + public bool IsMonitoringRequests(TId id) { return false; } } } diff --git a/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs b/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs index dfa05fa..bb72029 100644 --- a/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs +++ b/OpenSim/Framework/Communications/Limit/RepeatLimitStrategy.cs @@ -31,14 +31,14 @@ namespace OpenSim.Framework.Communications.Limit { /// /// Limit requests by discarding them after they've been repeated a certain number of times. - /// + /// public class RepeatLimitStrategy : IRequestLimitStrategy { /// /// Record each asset request that we're notified about. /// private readonly Dictionary requestCounts = new Dictionary(); - + /// /// The maximum number of requests that can be made before we drop subsequent requests. /// @@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications.Limit { get { return m_maxRequests; } } - + /// /// The maximum number of requests that may be served before all further /// requests are dropped. @@ -55,52 +55,52 @@ namespace OpenSim.Framework.Communications.Limit { m_maxRequests = maxRequests; } - + /// /// /// public bool AllowRequest(TId id) - { + { if (requestCounts.ContainsKey(id)) { requestCounts[id] += 1; - + if (requestCounts[id] > m_maxRequests) - { + { return false; - } + } } - + return true; } - + /// /// - /// + /// public bool IsFirstRefusal(TId id) { if (requestCounts.ContainsKey(id) && m_maxRequests + 1 == requestCounts[id]) { return true; - } - + } + return false; } - + /// /// - /// + /// public void MonitorRequests(TId id) { if (!IsMonitoringRequests(id)) { requestCounts.Add(id, 1); - } - } - + } + } + /// /// - /// + /// public bool IsMonitoringRequests(TId id) { return requestCounts.ContainsKey(id); diff --git a/OpenSim/Framework/Communications/Limit/TimeLimitStrategy.cs b/OpenSim/Framework/Communications/Limit/TimeLimitStrategy.cs index 34b01ff..b5b925e 100644 --- a/OpenSim/Framework/Communications/Limit/TimeLimitStrategy.cs +++ b/OpenSim/Framework/Communications/Limit/TimeLimitStrategy.cs @@ -32,17 +32,17 @@ namespace OpenSim.Framework.Communications.Limit { /// /// Limit requests by discarding repeat attempts that occur within a given time period - /// + /// /// XXX Don't use this for limiting texture downloading, at least not until we better handle multiple requests /// for the same texture at different resolutions. - /// + /// public class TimeLimitStrategy : IRequestLimitStrategy { /// /// Record the time at which an asset request occurs. /// - private readonly Dictionary requests = new Dictionary(); - + private readonly Dictionary requests = new Dictionary(); + /// /// The minimum time period between which requests for the same data will be serviced. /// @@ -53,37 +53,37 @@ namespace OpenSim.Framework.Communications.Limit } /// - /// + /// public TimeLimitStrategy(TimeSpan repeatPeriod) { m_repeatPeriod = repeatPeriod; } - + /// /// /// public bool AllowRequest(TId id) - { + { if (IsMonitoringRequests(id)) { DateTime now = DateTime.Now; TimeSpan elapsed = now - requests[id].Time; - + if (elapsed < RepeatPeriod) { requests[id].Refusals += 1; return false; } - - requests[id].Time = now; + + requests[id].Time = now; } - + return true; } - + /// /// - /// + /// public bool IsFirstRefusal(TId id) { if (IsMonitoringRequests(id)) @@ -92,31 +92,31 @@ namespace OpenSim.Framework.Communications.Limit { return true; } - } - + } + return false; } - + /// /// - /// + /// public void MonitorRequests(TId id) { if (!IsMonitoringRequests(id)) { requests.Add(id, new Request(DateTime.Now)); - } - } - + } + } + /// /// - /// + /// public bool IsMonitoringRequests(TId id) { return requests.ContainsKey(id); - } + } } - + /// /// Private request details. /// @@ -126,12 +126,12 @@ namespace OpenSim.Framework.Communications.Limit /// Time of last request /// public DateTime Time; - + /// /// Number of refusals associated with this request /// public int Refusals; - + public Request(DateTime time) { Time = time; diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index bccac74..6fdd06a 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs @@ -239,7 +239,7 @@ namespace OpenSim.Framework.Communications "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "false"); } - + /// /// Response to indicate that login failed because the agent's inventory was not available. /// @@ -249,7 +249,7 @@ namespace OpenSim.Framework.Communications return GenerateFailureResponse( "key", "The avatar inventory service is not responding. Please notify your login region operator.", - "false"); + "false"); } public XmlRpcResponse CreateAlreadyLoggedInResponse() diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index fa78a30..bd0fa53 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -48,8 +48,8 @@ namespace OpenSim.Framework.Communications protected string m_welcomeMessage = "Welcome to OpenSim"; protected UserManagerBase m_userManager = null; - protected Mutex m_loginMutex = new Mutex(false); - + protected Mutex m_loginMutex = new Mutex(false); + /// /// Used during login to send the skeleton of the OpenSim Library to the client. /// @@ -61,12 +61,12 @@ namespace OpenSim.Framework.Communications /// /// /// - public LoginService(UserManagerBase userManager, LibraryRootFolder libraryRootFolder, + public LoginService(UserManagerBase userManager, LibraryRootFolder libraryRootFolder, string welcomeMess) { m_userManager = userManager; m_libraryRootFolder = libraryRootFolder; - + if (welcomeMess != String.Empty) { m_welcomeMessage = welcomeMess; @@ -79,15 +79,15 @@ namespace OpenSim.Framework.Communications /// The existing response /// The user profile public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); - + /// /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user. /// /// /// /// This will be thrown if there is a problem with the inventory service - protected abstract InventoryData GetInventorySkeleton(LLUUID userID); - + protected abstract InventoryData GetInventorySkeleton(LLUUID userID); + /// /// Called when we receive the client's initial XMLRPC login_to_simulator request message /// @@ -112,7 +112,7 @@ namespace OpenSim.Framework.Communications UserProfileData userProfile; LoginResponse logResponse = new LoginResponse(); - + string firstname = String.Empty; string lastname = String.Empty; @@ -120,23 +120,23 @@ namespace OpenSim.Framework.Communications { firstname = (string) requestData["first"]; lastname = (string) requestData["last"]; - + m_log.InfoFormat( - "[LOGIN BEGIN]: Received login request message from user {0} {1}", + "[LOGIN BEGIN]: Received login request message from user {0} {1}", firstname, lastname); string clientVersion = "Unknown"; - + if (requestData.Contains("version")) { - clientVersion = (string)requestData["version"]; + clientVersion = (string)requestData["version"]; } - + if (requestData.Contains("start")) { startLocationRequest = (string)requestData["start"]; - } - + } + m_log.DebugFormat( "[LOGIN]: Client is {0}, start location is {1}", clientVersion, startLocationRequest); @@ -163,9 +163,9 @@ namespace OpenSim.Framework.Communications catch (Exception e) { m_log.InfoFormat( - "[LOGIN END]: Bad web_login_key: {0} for user {1} {2}, exception {3}", + "[LOGIN END]: Bad web_login_key: {0} for user {1} {2}, exception {3}", requestData["web_login_key"], firstname, lastname, e); - + return logResponse.CreateFailedResponse(); } GoodLogin = AuthenticateUser(userProfile, webloginkey); @@ -176,14 +176,14 @@ namespace OpenSim.Framework.Communications { m_log.Info( "[LOGIN END]: login_to_simulator login message did not contain all the required data"); - + return logResponse.CreateGridErrorResponse(); } if (!GoodLogin) { m_log.InfoFormat("[LOGIN END]: User {0} {1} failed authentication", firstname, lastname); - + return logResponse.CreateLoginFailedResponse(); } else @@ -199,11 +199,11 @@ namespace OpenSim.Framework.Communications m_userManager.CommitAgent(ref userProfile); // Reject the login - + m_log.InfoFormat( - "[LOGIN END]: Notifying user {0} {1} that they are already logged in", + "[LOGIN END]: Notifying user {0} {1} that they are already logged in", firstname, lastname); - + return logResponse.CreateAlreadyLoggedInResponse(); } // Otherwise... @@ -214,9 +214,9 @@ namespace OpenSim.Framework.Communications { LLUUID agentID = userProfile.ID; InventoryData inventData = null; - + try - { + { inventData = GetInventorySkeleton(agentID); } catch (Exception e) @@ -224,10 +224,10 @@ namespace OpenSim.Framework.Communications m_log.ErrorFormat( "[LOGIN END]: Error retrieving inventory skeleton of agent {0}, {1} - {2}", agentID, e.GetType(), e.Message); - - return logResponse.CreateLoginInventoryFailedResponse(); - } - + + return logResponse.CreateLoginInventoryFailedResponse(); + } + ArrayList AgentInventoryArray = inventData.InventoryArray; Hashtable InventoryRootHash = new Hashtable(); @@ -235,7 +235,7 @@ namespace OpenSim.Framework.Communications ArrayList InventoryRoot = new ArrayList(); InventoryRoot.Add(InventoryRootHash); userProfile.RootInventoryFolderID = inventData.RootFolderID; - + // Inventory Library Section Hashtable InventoryLibRootHash = new Hashtable(); InventoryLibRootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000"; @@ -244,10 +244,10 @@ namespace OpenSim.Framework.Communications logResponse.InventoryLibRoot = InventoryLibRoot; logResponse.InventoryLibraryOwner = GetLibraryOwner(); - + logResponse.InventoryRoot = InventoryRoot; logResponse.InventorySkeleton = AgentInventoryArray; - logResponse.InventoryLibrary = GetInventoryLibrary(); + logResponse.InventoryLibrary = GetInventoryLibrary(); // Circuit Code uint circode = (uint) (Util.RandomClass.Next()); @@ -280,15 +280,15 @@ namespace OpenSim.Framework.Communications //return logResponse.ToXmlRpcResponse(); } CommitAgent(ref userProfile); - + // If we reach this point, then the login has successfully logged onto the grid if (StatsManager.UserStats != null) StatsManager.UserStats.AddSuccessfulLogin(); - + m_log.DebugFormat( "[LOGIN END]: Authentication of user {0} {1} successful. Sending response to client.", firstname, lastname); - + return logResponse.ToXmlRpcResponse(); } catch (Exception e) @@ -422,10 +422,10 @@ namespace OpenSim.Framework.Communications } CommitAgent(ref userProfile); - + // If we reach this point, then the login has successfully logged onto the grid if (StatsManager.UserStats != null) - StatsManager.UserStats.AddSuccessfulLogin(); + StatsManager.UserStats.AddSuccessfulLogin(); return logResponse.ToLLSDResponse(); } @@ -449,7 +449,7 @@ namespace OpenSim.Framework.Communications // period, space, parens, and dash. Regex wfcut = new Regex("[^a-zA-Z0-9_\\.\\$ \\(\\)\\-]"); - + Hashtable returnactions = new Hashtable(); int statuscode = 200; @@ -467,7 +467,7 @@ namespace OpenSim.Framework.Communications // the client requires the HTML form field be named 'username' // however, the data it sends when it loads the first time is 'firstname' // another one of those little nuances. - + if (keysvals.Contains("firstname")) firstname = wfcut.Replace((string)keysvals["firstname"], String.Empty, 99999); @@ -494,7 +494,7 @@ namespace OpenSim.Framework.Communications if (keysvals.Contains("lang")) lang = wfcut.Replace((string)keysvals["lang"], String.Empty, 99999); - + if (keysvals.Contains("password")) password = wfcut.Replace((string)keysvals["password"], String.Empty, 99999); @@ -541,8 +541,8 @@ namespace OpenSim.Framework.Communications return returnactions; } - public string GetLoginForm(string firstname, string lastname, string location, string region, - string grid, string channel, string version, string lang, + public string GetLoginForm(string firstname, string lastname, string location, string region, + string grid, string channel, string version, string lang, string password, string errormessages) { // inject our values in the form at the markers @@ -559,7 +559,7 @@ namespace OpenSim.Framework.Communications loginform = sr.ReadToEnd(); sr.Close(); } - + loginform = loginform.Replace("[$firstname]", firstname); loginform = loginform.Replace("[$lastname]", lastname); loginform = loginform.Replace("[$location]", location); @@ -586,7 +586,7 @@ namespace OpenSim.Framework.Communications responseString += "OpenSim Login"; responseString += "
"; responseString += "
"; - + responseString += "
"; responseString += "
[$errors]
"; @@ -670,13 +670,13 @@ namespace OpenSim.Framework.Communications password = "$1$" + Util.Md5Hash(password); password = password.Remove(0, 3); //remove $1$ - + string s = Util.Md5Hash(password + ":" + profile.PasswordSalt); - // Testing... + // Testing... //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash); //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password); - passwordSuccess = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) + passwordSuccess = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) || profile.PasswordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase)); return passwordSuccess; @@ -694,7 +694,7 @@ namespace OpenSim.Framework.Communications } /// - /// + /// /// /// /// @@ -709,7 +709,7 @@ namespace OpenSim.Framework.Communications } /// - /// + /// /// /// /// @@ -720,7 +720,7 @@ namespace OpenSim.Framework.Communications } /// - /// + /// /// /// public virtual string GetMessage() @@ -741,17 +741,17 @@ namespace OpenSim.Framework.Communications } return buddylistreturn; } - + /// /// Converts the inventory library skeleton into the form required by the rpc request. /// /// protected virtual ArrayList GetInventoryLibrary() { - Dictionary rootFolders + Dictionary rootFolders = m_libraryRootFolder.RequestSelfAndDescendentFolders(); ArrayList folderHashes = new ArrayList(); - + foreach (InventoryFolderBase folder in rootFolders.Values) { Hashtable TempHash = new Hashtable(); @@ -762,12 +762,12 @@ namespace OpenSim.Framework.Communications TempHash["folder_id"] = folder.ID.ToString(); folderHashes.Add(TempHash); } - + return folderHashes; } /// - /// + /// /// /// protected virtual ArrayList GetLibraryOwner() diff --git a/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs b/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs index 9a53499..2df5fbc 100644 --- a/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs @@ -28,7 +28,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. @@ -41,8 +41,8 @@ using System.Runtime.InteropServices; [assembly : AssemblyTrademark("")] [assembly : AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly : ComVisible(false)] @@ -54,11 +54,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Revision and Build Numbers +// You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly : AssemblyVersion("1.0.0.0")] diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index 4ed62bf..7c8876a 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs @@ -16,14 +16,14 @@ namespace OpenSim.Framework.Communications /// /// This class is a generic implementation of a REST (Representational State Transfer) web service. This /// class is designed to execute both synchronously and asynchronously. - /// + /// /// Internally the implementation works as a two stage asynchronous web-client. /// When the request is initiated, RestClient will query asynchronously for for a web-response, /// sleeping until the initial response is returned by the server. Once the initial response is retrieved /// the second stage of asynchronous requests will be triggered, in an attempt to read of the response /// object into a memorystream as a sequence of asynchronous reads. - /// - /// The asynchronisity of RestClient is designed to move as much processing into the back-ground, allowing + /// + /// The asynchronisity of RestClient is designed to move as much processing into the back-ground, allowing /// other threads to execute, while it waits for a response from the web-service. RestClient itself can be /// invoked by the caller in either synchronous mode or asynchronous modes. /// @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications #region member variables /// - /// The base Uri of the web-service e.g. http://www.google.com + /// The base Uri of the web-service e.g. http://www.google.com /// private string _url; @@ -92,7 +92,7 @@ namespace OpenSim.Framework.Communications /// - /// if an exception occours during async processing, we need to save it, so it can be + /// if an exception occours during async processing, we need to save it, so it can be /// rethrown on the primary thread; /// private Exception _asyncException; @@ -341,7 +341,7 @@ namespace OpenSim.Framework.Communications { AsyncResult ar = (AsyncResult) asyncResult; - // Wait for operation to complete, then return result or + // Wait for operation to complete, then return result or // throw exception return ar.EndInvoke(); } diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 8e0b75c..5a62682 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -43,12 +43,12 @@ namespace OpenSim.Framework.Communications /// public abstract class UserManagerBase : IUserService { - private static readonly ILog m_log + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public UserConfig _config; private Dictionary _plugins = new Dictionary(); - + /// /// Adds a new user server plugin - user servers will be requested in the order they were loaded. /// @@ -85,7 +85,7 @@ namespace OpenSim.Framework.Communications m_log.Info("[USERSTORAGE]: Added IUserData Interface"); } - #region Get UserProfile + #region Get UserProfile // see IUserService public UserProfileData GetUserProfile(string fname, string lname) @@ -103,8 +103,8 @@ namespace OpenSim.Framework.Communications return null; } - - // see IUserService + + // see IUserService public UserProfileData GetUserProfile(LLUUID uuid) { foreach (KeyValuePair plugin in _plugins) @@ -408,7 +408,7 @@ namespace OpenSim.Framework.Communications profile.CurrentAgent = agent; } - + /// /// Process a user logoff from OpenSim. /// @@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications { if (StatsManager.UserStats != null) StatsManager.UserStats.AddLogout(); - + UserProfileData userProfile; UserAgentData userAgent; LLVector3 currentPos = new LLVector3(posx, posy, posz); @@ -433,7 +433,7 @@ namespace OpenSim.Framework.Communications { // This line needs to be in side the above if statement or the UserServer will crash on some logouts. m_log.Info("[LOGOUT]: " + userProfile.FirstName + " " + userProfile.SurName + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")"); - + userAgent = userProfile.CurrentAgent; if (userAgent != null) { @@ -462,7 +462,7 @@ namespace OpenSim.Framework.Communications m_log.Warn("[LOGOUT]: Unknown User logged out"); } } - + public void CreateAgent(UserProfileData profile, LLSD request) { UserAgentData agent = new UserAgentData(); @@ -516,7 +516,7 @@ namespace OpenSim.Framework.Communications #endregion /// - /// + /// /// /// public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) @@ -598,7 +598,7 @@ namespace OpenSim.Framework.Communications /// Appearance /// TODO: stubs for now to get us to a compiling state gently - public AvatarAppearance GetUserAppearance(LLUUID user) + public AvatarAppearance GetUserAppearance(LLUUID user) { foreach (KeyValuePair plugin in _plugins) { @@ -643,7 +643,7 @@ namespace OpenSim.Framework.Communications } } } - + public void RemoveAttachment(LLUUID user, LLUUID item) { foreach (KeyValuePair plugin in _plugins) @@ -658,7 +658,7 @@ namespace OpenSim.Framework.Communications } } } - + public List GetAttachments(LLUUID user) { foreach (KeyValuePair plugin in _plugins) diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index 79fe1d4..74e64e3 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -58,7 +58,7 @@ namespace OpenSim.Framework.Console } /// - /// derive an ansi color from a string, ignoring the darker colors. + /// derive an ansi color from a string, ignoring the darker colors. /// This is used to help automatically bin component tags with colors /// in various print functions. /// @@ -195,7 +195,7 @@ namespace OpenSim.Framework.Console System.Console.WriteLine(args); } } - } + } catch (ObjectDisposedException) { } @@ -232,7 +232,7 @@ namespace OpenSim.Framework.Console { } } - + public string ReadLine() { try @@ -245,7 +245,7 @@ namespace OpenSim.Framework.Console return String.Empty; } } - + public int Read() { return System.Console.Read(); diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index d381179..ddd6d9a 100644 --- a/OpenSim/Framework/Console/OpenSimAppender.cs +++ b/OpenSim/Framework/Console/OpenSimAppender.cs @@ -40,32 +40,32 @@ namespace OpenSim.Framework.Console string loggingMessage = RenderLoggingEvent(le); string regex = @"^(?.*?)\[(?[^\]]+)\]:?(?.*)"; - + Regex RE = new Regex(regex, RegexOptions.Multiline); MatchCollection matches = RE.Matches(loggingMessage); - // Get some direct matches $1 $4 is a + // Get some direct matches $1 $4 is a if (matches.Count == 1) { System.Console.Write(matches[0].Groups["Front"].Value); System.Console.Write("["); - + WriteColorText(DeriveColor(matches[0].Groups["Category"].Value), matches[0].Groups["Category"].Value); System.Console.Write("]:"); - - if (le.Level == Level.Error) + + if (le.Level == Level.Error) { WriteColorText(ConsoleColor.Red, matches[0].Groups["End"].Value); } - else if (le.Level == Level.Warn) + else if (le.Level == Level.Warn) { WriteColorText(ConsoleColor.Yellow, matches[0].Groups["End"].Value); } - else + else { System.Console.Write(matches[0].Groups["End"].Value); } System.Console.WriteLine(); - } + } else { System.Console.Write(loggingMessage); diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 098e721..343b5a6 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -156,7 +156,7 @@ namespace OpenSim.Framework } /// - /// + /// /// public IScene Scene { @@ -181,7 +181,7 @@ namespace OpenSim.Framework } /// - /// + /// /// public uint PacketNumber { @@ -190,7 +190,7 @@ namespace OpenSim.Framework } /// - /// + /// /// public sbyte DiscardLevel { @@ -199,7 +199,7 @@ namespace OpenSim.Framework } /// - /// + /// /// public LLUUID RequestedAssetID { @@ -213,7 +213,7 @@ namespace OpenSim.Framework private List m_nowWearing = new List(); /// - /// + /// /// public List NowWearing { @@ -381,7 +381,7 @@ namespace OpenSim.Framework public delegate void ImprovedInstantMessage(IClientAPI remoteclient, LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, uint ParentEstateID, - LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down... + LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down... // especially if we're ever going to implement groups, presence, estate message dialogs... public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, @@ -607,7 +607,7 @@ namespace OpenSim.Framework public delegate void RequestPayPrice(IClientAPI remoteClient, LLUUID objectID); public delegate void ForceReleaseControls(IClientAPI remoteClient, LLUUID agentID); - + //Estate Requests public delegate void DetailedEstateDataRequest(IClientAPI remoteClient, LLUUID invoice); public delegate void SetEstateFlagsRequest(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges); @@ -764,7 +764,7 @@ namespace OpenSim.Framework event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; event ParcelSelectObjects OnParcelSelectObjects; event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; - event ParcelAbandonRequest OnParcelAbandonRequest; + event ParcelAbandonRequest OnParcelAbandonRequest; event RegionInfoRequest OnRegionInfoRequest; event EstateCovenantRequest OnEstateCovenantRequest; @@ -808,7 +808,7 @@ namespace OpenSim.Framework event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; - + [Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")] void OutPacket(Packet newPack, ThrottleOutPacketType packType); void SendWearables(AvatarWearable[] wearables, int serial); @@ -858,16 +858,16 @@ namespace OpenSim.Framework void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint); void SetChildAgentThrottle(byte[] throttle); - void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId); - - void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, + + void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel, - uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, + uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, byte clickAction); void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, @@ -889,7 +889,7 @@ namespace OpenSim.Framework void SendInventoryItemCreateUpdate(InventoryItemBase Item); void SendRemoveInventoryItem(LLUUID itemID); - + void SendTakeControls(int controls, bool passToAgent, bool TakeControls); void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName); @@ -950,7 +950,7 @@ namespace OpenSim.Framework void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID); void SendConfirmXfer(ulong xferID, uint PacketID); void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName); - + void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec); void SendShutdownConnectionNotice(); @@ -973,9 +973,9 @@ namespace OpenSim.Framework LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook); void SendAdminResponse(LLUUID Token, uint AdminLevel); - + void SendGroupMembership(GroupData[] GroupMembership); - + byte[] GetThrottlesPacked(float multiplier); diff --git a/OpenSim/Framework/IClientAPI2.cs b/OpenSim/Framework/IClientAPI2.cs index 684f3e8..aa70dc3 100644 --- a/OpenSim/Framework/IClientAPI2.cs +++ b/OpenSim/Framework/IClientAPI2.cs @@ -5,14 +5,14 @@ namespace OpenSim.Framework #region Args Classes public class ICA2_ConnectionArgs : EventArgs { - + } public class ICA2_DisconnectionArgs : EventArgs { public bool Forced; - // Static Constructor + // Static Constructor // Allows us to recycle these classes later more easily from a pool. public static ICA2_DisconnectionArgs Create(bool forced) { diff --git a/OpenSim/Framework/IInventoryData.cs b/OpenSim/Framework/IInventoryData.cs index f283085..fabcbe2 100644 --- a/OpenSim/Framework/IInventoryData.cs +++ b/OpenSim/Framework/IInventoryData.cs @@ -120,7 +120,7 @@ namespace OpenSim.Framework void updateInventoryItem(InventoryItemBase item); /// - /// + /// /// /// void deleteInventoryItem(LLUUID item); diff --git a/OpenSim/Framework/IUserData.cs b/OpenSim/Framework/IUserData.cs index be05094..0b25f7e 100644 --- a/OpenSim/Framework/IUserData.cs +++ b/OpenSim/Framework/IUserData.cs @@ -87,7 +87,7 @@ namespace OpenSim.Framework void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey); /// - /// Adds a new User profile to the database + /// Adds a new User profile to the database /// /// UserProfile to add void AddNewUserProfile(UserProfileData user); @@ -181,8 +181,8 @@ namespace OpenSim.Framework AvatarAppearance GetUserAppearance(LLUUID user); void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance); - - + + void AddAttachment(LLUUID user, LLUUID item); void RemoveAttachment(LLUUID user, LLUUID item); List GetAttachments(LLUUID user); diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index 910f7da..31bb02f 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework private LLUUID _owner; /// - /// The folder this folder is contained in + /// The folder this folder is contained in /// private LLUUID _parentID; diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index dbf2085..8d873db 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -45,7 +45,7 @@ namespace OpenSim.Framework private int _assetType; /// - /// + /// /// private uint _basePermissions; @@ -69,12 +69,12 @@ namespace OpenSim.Framework private string _description; /// - /// + /// /// private uint _everyOnePermissions; /// - /// The folder this item is contained in + /// The folder this item is contained in /// private LLUUID _folder; @@ -93,34 +93,34 @@ namespace OpenSim.Framework /// private string _name; - + /// - /// + /// /// private LLUUID _groupID; /// - /// + /// /// private bool _groupOwned; /// - /// + /// /// private int _salePrice; /// - /// + /// /// private byte _saleType; /// - /// + /// /// private uint _flags; /// - /// + /// /// public int _creationDate; diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 422c939..c4c5813 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs @@ -63,7 +63,7 @@ namespace OpenSim.Framework #endregion /// - /// + /// /// /// /// @@ -171,7 +171,7 @@ namespace OpenSim.Framework } /// - /// + /// /// /// TODO: Doesnt take any args?? /// @@ -188,7 +188,7 @@ namespace OpenSim.Framework } /// - /// + /// /// /// Added to avoid a unused compiler warning on OnNeighboursUpdate, TODO: Check me /// diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 158ddde..d9d41d6 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -37,7 +37,7 @@ namespace OpenSim.Framework [Serializable] public class SimpleRegionInfo { - // private static readonly log4net.ILog m_log + // private static readonly log4net.ILog m_log // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); protected bool Allow_Alternate_Ports; @@ -114,7 +114,7 @@ namespace OpenSim.Framework /// /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. - /// + /// /// XXX Isn't this really doing too much to be a simple getter, rather than an explict method? /// public IPEndPoint ExternalEndPoint @@ -187,7 +187,7 @@ namespace OpenSim.Framework public class RegionInfo : SimpleRegionInfo { - // private static readonly log4net.ILog m_log + // private static readonly log4net.ILog m_log // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public bool commFailTF = false; @@ -327,7 +327,7 @@ namespace OpenSim.Framework if (errorMessage != String.Empty) { - // a error + // a error } } diff --git a/OpenSim/Framework/Remoting.cs b/OpenSim/Framework/Remoting.cs index cb0911e..4f56d52 100644 --- a/OpenSim/Framework/Remoting.cs +++ b/OpenSim/Framework/Remoting.cs @@ -87,7 +87,7 @@ namespace OpenSim.Framework /// /// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message. - /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the + /// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the /// hashes will get out of sync and throw an exception when validation is attempted. /// /// The outgoing data diff --git a/OpenSim/Framework/SerializableInventory.cs b/OpenSim/Framework/SerializableInventory.cs index 81f993c..fcf13a8 100644 --- a/OpenSim/Framework/SerializableInventory.cs +++ b/OpenSim/Framework/SerializableInventory.cs @@ -30,7 +30,7 @@ using System.Xml.Serialization; namespace OpenSim.Framework { - /* + /* * .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. diff --git a/OpenSim/Framework/SerializableRegionInfo.cs b/OpenSim/Framework/SerializableRegionInfo.cs index 44081b2..4965a43 100644 --- a/OpenSim/Framework/SerializableRegionInfo.cs +++ b/OpenSim/Framework/SerializableRegionInfo.cs @@ -40,8 +40,8 @@ namespace OpenSim.Framework /// /// The port by which http communication occurs with the region (most noticeably, CAPS communication) - /// - /// FIXME: Defaulting to 9000 temporarily (on the basis that this is the http port most region + /// + /// FIXME: Defaulting to 9000 temporarily (on the basis that this is the http port most region /// servers are running) until the revision in which this change is made propogates around grids. /// protected uint m_httpPort = 9000; diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 50f4e23..1eb1da9 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -82,10 +82,10 @@ namespace OpenSim.Framework.Servers string path = handler.Path; string handlerKey = GetHandlerKey(httpMethod, path); - + if (!m_streamHandlers.ContainsKey(handlerKey)) { - //m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey); + //m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey); m_streamHandlers.Add(handlerKey, handler); } } @@ -135,20 +135,20 @@ namespace OpenSim.Framework.Servers try { HttpListenerContext context = (HttpListenerContext) stateinfo; - + HttpListenerRequest request = context.Request; HttpListenerResponse response = context.Response; - + response.KeepAlive = false; response.SendChunked = false; - + string path = request.RawUrl; string handlerKey = GetHandlerKey(request.HttpMethod, path); - + //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); - + IRequestHandler requestHandler; - + if (TryGetStreamHandler(handlerKey, out requestHandler)) { // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. @@ -156,13 +156,13 @@ namespace OpenSim.Framework.Servers if (requestHandler is IStreamedRequestHandler) { IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; - + buffer = streamedRequestHandler.Handle(path, request.InputStream); } else { IStreamHandler streamHandler = (IStreamHandler) requestHandler; - + using (MemoryStream memoryStream = new MemoryStream()) { streamHandler.Handle(path, request.InputStream, memoryStream); @@ -170,11 +170,11 @@ namespace OpenSim.Framework.Servers buffer = memoryStream.ToArray(); } } - + request.InputStream.Close(); response.ContentType = requestHandler.ContentType; response.ContentLength64 = buffer.LongLength; - + try { response.OutputStream.Write(buffer, 0, buffer.Length); @@ -273,7 +273,7 @@ namespace OpenSim.Framework.Servers return true; } } - + /// /// Try all the registered xmlrpc handlers when an xmlrpc request is received. /// Sends back an XMLRPC unknown request response if no handler is registered for the requested method. @@ -434,7 +434,7 @@ namespace OpenSim.Framework.Servers { // This is a test. There's a workable alternative.. as this way sucks. // We'd like to put this into a text file parhaps that's easily editable. - // + // // For this test to work, I used the following secondlife.exe parameters // "C:\Program Files\SecondLifeWindLight\SecondLifeWindLight.exe" -settings settings_windlight.xml -channel "Second Life WindLight" -set SystemLanguage en-us -loginpage http://10.1.1.2:8002/?show_login_form=TRUE -loginuri http://10.1.1.2:8002 -user 10.1.1.2 // @@ -461,7 +461,7 @@ namespace OpenSim.Framework.Servers string[] querystringkeys = request.QueryString.AllKeys; string[] rHeaders = request.Headers.AllKeys; - + foreach (string queryname in querystringkeys) { keysvals.Add(queryname, request.QueryString[queryname]); @@ -489,7 +489,7 @@ namespace OpenSim.Framework.Servers { Hashtable responsedata = requestprocessor(keysvals); DoHTTPGruntWork(responsedata,response); - + //SendHTML500(response); } else @@ -519,7 +519,7 @@ namespace OpenSim.Framework.Servers contentType = "text/html"; } - // We're forgoing the usual error status codes here because the client + // We're forgoing the usual error status codes here because the client // ignores anything but 200 and 301 response.StatusCode = 200; @@ -649,10 +649,10 @@ namespace OpenSim.Framework.Servers public void RemoveStreamHandler(string httpMethod, string path) { - string handlerKey = GetHandlerKey(httpMethod, path); - + string handlerKey = GetHandlerKey(httpMethod, path); + //m_log.DebugFormat("[BASE HTTP SERVER]: Removing handler key {0}", handlerKey); - + m_streamHandlers.Remove(handlerKey); } @@ -660,7 +660,7 @@ namespace OpenSim.Framework.Servers { m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); } - + public string GetHTTP404(string host) { string file = Path.Combine(Util.configDir(), "http_404.html"); diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 811a0db..fcbc5a1 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -44,16 +44,16 @@ namespace OpenSim.Framework.Servers { get { return m_httpServer; } } - + /// /// Holds the non-viewer statistics collection object for this service/server /// protected IStatsCollector m_stats; - + public BaseOpenSimServer() { m_startuptime = DateTime.Now; - } + } /// /// Should be overriden by descendents if they need to perform extra shutdown processing @@ -66,7 +66,7 @@ namespace OpenSim.Framework.Servers } Environment.Exit(0); } - + /// /// Runs commands issued by the server console from the operator /// @@ -75,17 +75,17 @@ namespace OpenSim.Framework.Servers public virtual void RunCmd(string command, string[] cmdparams) { switch (command) - { + { case "help": Notice("quit - equivalent to shutdown."); - + if (m_stats != null) Notice("show stats - statistical information for this server"); - + Notice("show uptime - show server startup and uptime."); Notice("shutdown - shutdown the server.\n"); break; - + case "show": if (cmdparams.Length > 0) { @@ -96,10 +96,10 @@ namespace OpenSim.Framework.Servers case "quit": case "shutdown": Shutdown(); - break; + break; } } - + /// /// Outputs to the console information about the region /// @@ -107,18 +107,18 @@ namespace OpenSim.Framework.Servers public virtual void Show(string ShowWhat) { switch (ShowWhat) - { + { case "stats": if (m_stats != null) { Notice(m_stats.Report()); } - break; - + break; + case "uptime": Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString()); Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString()); - break; + break; } } diff --git a/OpenSim/Framework/Servers/RestObjectPosterResponse.cs b/OpenSim/Framework/Servers/RestObjectPosterResponse.cs index 1410afd..05bfaa1 100644 --- a/OpenSim/Framework/Servers/RestObjectPosterResponse.cs +++ b/OpenSim/Framework/Servers/RestObjectPosterResponse.cs @@ -38,12 +38,12 @@ namespace OpenSim.Framework.Servers /// /// Makes an asynchronous REST request with a callback to invoke with the response. - /// + /// public class RestObjectPosterResponse { -// private static readonly log4net.ILog m_log +// private static readonly log4net.ILog m_log // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - + public ReturnResponse ResponseCallback; public void BeginPostObject(string requestUrl, TRequest obj) @@ -87,11 +87,11 @@ namespace OpenSim.Framework.Servers TResponse deserial; XmlSerializer deserializer = new XmlSerializer(typeof (TResponse)); Stream stream = resp.GetResponseStream(); - + // This is currently a bad debug stanza since it gobbles us the response... // StreamReader reader = new StreamReader(stream); // m_log.DebugFormat("[REST OBJECT POSTER RESPONSE]: Received {0}", reader.ReadToEnd()); - + deserial = (TResponse) deserializer.Deserialize(stream); if (deserial != null && ResponseCallback != null) diff --git a/OpenSim/Framework/Servers/RestStreamHandler.cs b/OpenSim/Framework/Servers/RestStreamHandler.cs index cab5208..76dbd73 100644 --- a/OpenSim/Framework/Servers/RestStreamHandler.cs +++ b/OpenSim/Framework/Servers/RestStreamHandler.cs @@ -34,7 +34,7 @@ namespace OpenSim.Framework.Servers { private RestMethod m_restMethod; - public RestMethod Method + public RestMethod Method { get { return m_restMethod; } } diff --git a/OpenSim/Framework/Servers/SynchronousRestObjectPoster.cs b/OpenSim/Framework/Servers/SynchronousRestObjectPoster.cs index 103fbe5..1b8e4ea 100644 --- a/OpenSim/Framework/Servers/SynchronousRestObjectPoster.cs +++ b/OpenSim/Framework/Servers/SynchronousRestObjectPoster.cs @@ -75,7 +75,7 @@ namespace OpenSim.Framework.Servers using (WebResponse resp = request.GetResponse()) { XmlSerializer deserializer = new XmlSerializer(typeof (TResponse)); - deserial = (TResponse) deserializer.Deserialize(resp.GetResponseStream()); + deserial = (TResponse) deserializer.Deserialize(resp.GetResponseStream()); } return deserial; } diff --git a/OpenSim/Framework/Statistics/AssetStatsCollector.cs b/OpenSim/Framework/Statistics/AssetStatsCollector.cs index bd36c3f..ed6779d 100644 --- a/OpenSim/Framework/Statistics/AssetStatsCollector.cs +++ b/OpenSim/Framework/Statistics/AssetStatsCollector.cs @@ -37,35 +37,35 @@ namespace OpenSim.Framework.Statistics { private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000); private DateTime startTime = DateTime.Now; - - private long assetRequestsToday; + + private long assetRequestsToday; private long assetRequestsNotFoundToday; private long assetRequestsYesterday; private long assetRequestsNotFoundYesterday; - + public long AssetRequestsToday { get { return assetRequestsToday; } } - public long AssetRequestsNotFoundToday { get { return assetRequestsNotFoundToday; } } + public long AssetRequestsNotFoundToday { get { return assetRequestsNotFoundToday; } } public long AssetRequestsYesterday { get { return assetRequestsYesterday; } } - public long AssetRequestsNotFoundYesterday { get { return assetRequestsNotFoundYesterday; } } - + public long AssetRequestsNotFoundYesterday { get { return assetRequestsNotFoundYesterday; } } + public AssetStatsCollector() { ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing); ageStatsTimer.Enabled = true; } - + private void OnAgeing(object source, ElapsedEventArgs e) { assetRequestsYesterday = assetRequestsToday; - + // There is a possibility that an asset request could occur between the execution of these // two statements. But we're better off without the synchronization overhead. - assetRequestsToday = 0; - + assetRequestsToday = 0; + assetRequestsNotFoundYesterday = assetRequestsNotFoundToday; assetRequestsNotFoundToday = 0; } - + /// /// Record that an asset request failed to find an asset /// @@ -73,7 +73,7 @@ namespace OpenSim.Framework.Statistics { assetRequestsNotFoundToday++; } - + /// /// Record that a request was made to the asset server /// @@ -90,10 +90,10 @@ namespace OpenSim.Framework.Statistics { double elapsedHours = (DateTime.Now - startTime).TotalHours; if (elapsedHours <= 0) { elapsedHours = 1; } // prevent divide by zero - + long assetRequestsTodayPerHour = (long)Math.Round(AssetRequestsToday / elapsedHours); long assetRequestsYesterdayPerHour = (long)Math.Round(AssetRequestsYesterday / 24.0); - + return string.Format( @"Asset requests today : {0} ({1} per hour) of which {2} were not found Asset requests yesterday : {3} ({4} per hour) of which {5} were not found", diff --git a/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs b/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs index 768cd22..e468fb2 100644 --- a/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs +++ b/OpenSim/Framework/Statistics/Interfaces/IStatsCollector.cs @@ -26,7 +26,7 @@ */ namespace OpenSim.Framework.Statistics -{ +{ /// /// Implemented by classes which collect up non-viewer statistical information /// @@ -36,6 +36,6 @@ namespace OpenSim.Framework.Statistics /// Report back collected statistical information. /// /// - string Report(); + string Report(); } } diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index fd021bc..2e7278b 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs @@ -32,20 +32,20 @@ using libsecondlife; using OpenSim.Framework.Statistics.Interfaces; namespace OpenSim.Framework.Statistics -{ +{ /// /// Collects sim statistics which aren't already being collected for the linden viewer's statistics pane /// public class SimExtraStatsCollector : IStatsCollector - { + { private long assetsInCache; - private long texturesInCache; + private long texturesInCache; private long assetCacheMemoryUsage; private long textureCacheMemoryUsage; private long blockedMissingTextureRequests; - + private long inventoryServiceRetrievalFailures; - + public long AssetsInCache { get { return assetsInCache; } } public long TexturesInCache { get { return texturesInCache; } } public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } @@ -58,47 +58,47 @@ namespace OpenSim.Framework.Statistics /// driver bugs on clients (though this seems less likely). /// public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } } - + /// /// Number of known failures to retrieve avatar inventory from the inventory service. This does not /// cover situations where the inventory service accepts the request but never returns any data, since /// we do not yet timeout this situation. /// public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } } - + /// /// Retain a dictionary of all packet queues stats reporters /// private IDictionary packetQueueStatsCollectors = new Dictionary(); - + public void AddAsset(AssetBase asset) { assetsInCache++; assetCacheMemoryUsage += asset.Data.Length; } - + public void AddTexture(AssetBase image) { if (image.Data != null) { texturesInCache++; - + // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates textureCacheMemoryUsage += image.Data.Length; } - } - + } + public void AddBlockedMissingTextureRequest() { blockedMissingTextureRequests++; } - + public void AddInventoryServiceRetrievalFailure() { inventoryServiceRetrievalFailures++; } - + /// /// Register as a packet queue stats provider /// @@ -111,7 +111,7 @@ namespace OpenSim.Framework.Statistics packetQueueStatsCollectors[uuid] = new PacketQueueStatsCollector(provider); } } - + /// /// Deregister a packet queue stats provider /// @@ -129,25 +129,25 @@ namespace OpenSim.Framework.Statistics /// /// public string Report() - { + { StringBuilder sb = new StringBuilder(Environment.NewLine); sb.Append("ASSET STATISTICS"); - sb.Append(Environment.NewLine); + sb.Append(Environment.NewLine); sb.Append( string.Format( @"Asset cache contains {0,6} assets using {1,10:0.000}K" + Environment.NewLine, AssetsInCache, AssetCacheMemoryUsage / 1024.0)); - + sb.Append(Environment.NewLine); sb.Append("TEXTURE STATISTICS"); - sb.Append(Environment.NewLine); + sb.Append(Environment.NewLine); sb.Append( string.Format( @"Texture cache contains {0,6} textures using {1,10:0.000}K Blocked requests for missing textures: {2}" + Environment.NewLine, TexturesInCache, TextureCacheMemoryUsage / 1024.0, - BlockedMissingTextureRequests)); - + BlockedMissingTextureRequests)); + sb.Append(Environment.NewLine); sb.Append("INVENTORY STATISTICS"); sb.Append(Environment.NewLine); @@ -155,26 +155,26 @@ Blocked requests for missing textures: {2}" + Environment.NewLine, string.Format( "Initial inventory caching failures: {0}" + Environment.NewLine, InventoryServiceRetrievalFailures)); - + sb.Append(Environment.NewLine); sb.Append("PACKET QUEUE STATISTICS"); sb.Append(Environment.NewLine); sb.Append("Agent UUID "); sb.Append( string.Format( - " {0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}", + " {0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}", "Send", "In", "Out", "Resend", "Land", "Wind", "Cloud", "Task", "Texture", "Asset")); - sb.Append(Environment.NewLine); - + sb.Append(Environment.NewLine); + foreach (LLUUID key in packetQueueStatsCollectors.Keys) { sb.Append(string.Format("{0}: ", key)); sb.Append(packetQueueStatsCollectors[key].Report()); sb.Append(Environment.NewLine); } - + return sb.ToString(); - } + } } /// @@ -183,16 +183,16 @@ Blocked requests for missing textures: {2}" + Environment.NewLine, public class PacketQueueStatsCollector : IStatsCollector { private IPullStatsProvider m_statsProvider; - + public PacketQueueStatsCollector(IPullStatsProvider provider) { - m_statsProvider = provider; + m_statsProvider = provider; } - + /// /// Report back collected statistical information. /// - /// + /// public string Report() { return m_statsProvider.GetStats(); diff --git a/OpenSim/Framework/Statistics/StatsManager.cs b/OpenSim/Framework/Statistics/StatsManager.cs index 3c97dde..41de3f3 100644 --- a/OpenSim/Framework/Statistics/StatsManager.cs +++ b/OpenSim/Framework/Statistics/StatsManager.cs @@ -26,7 +26,7 @@ */ namespace OpenSim.Framework.Statistics -{ +{ /// /// Singleton used to provide access to statistics reporters /// @@ -34,44 +34,44 @@ namespace OpenSim.Framework.Statistics { private static AssetStatsCollector assetStats; private static UserStatsCollector userStats; - private static SimExtraStatsCollector simExtraStats; - + private static SimExtraStatsCollector simExtraStats; + public static AssetStatsCollector AssetStats { get { return assetStats; } } public static UserStatsCollector UserStats { get { return userStats; } } public static SimExtraStatsCollector SimExtraStats { get { return simExtraStats; } } - + private StatsManager() {} - + /// /// Start collecting statistics related to assets. /// Should only be called once. - /// + /// public static AssetStatsCollector StartCollectingAssetStats() { assetStats = new AssetStatsCollector(); - + return assetStats; } - + /// /// Start collecting statistics related to users. /// Should only be called once. - /// + /// public static UserStatsCollector StartCollectingUserStats() { userStats = new UserStatsCollector(); - + return userStats; - } - + } + /// - /// Start collecting extra sim statistics apart from those collected for the client. + /// Start collecting extra sim statistics apart from those collected for the client. /// Should only be called once. /// public static SimExtraStatsCollector StartCollectingSimExtraStats() { simExtraStats = new SimExtraStatsCollector(); - + return simExtraStats; } } diff --git a/OpenSim/Framework/Statistics/UserStatsCollector.cs b/OpenSim/Framework/Statistics/UserStatsCollector.cs index f0f0417..c7fe7c2 100644 --- a/OpenSim/Framework/Statistics/UserStatsCollector.cs +++ b/OpenSim/Framework/Statistics/UserStatsCollector.cs @@ -35,43 +35,43 @@ namespace OpenSim.Framework.Statistics public class UserStatsCollector : IStatsCollector { private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000); - + private int successfulLoginsToday; public int SuccessfulLoginsToday { get { return successfulLoginsToday; } } - + private int successfulLoginsYesterday; - public int SuccessfulLoginsYesterday { get { return successfulLoginsYesterday; } } - + public int SuccessfulLoginsYesterday { get { return successfulLoginsYesterday; } } + private int successfulLogins; public int SuccessfulLogins { get { return successfulLogins; } } - + private int logouts; public int Logouts { get { return logouts; } } - + public UserStatsCollector() { ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing); ageStatsTimer.Enabled = true; } - + private void OnAgeing(object source, ElapsedEventArgs e) { successfulLoginsYesterday = successfulLoginsToday; - + // There is a possibility that an asset request could occur between the execution of these // two statements. But we're better off without the synchronization overhead. - successfulLoginsToday = 0; + successfulLoginsToday = 0; } - + /// /// Record a successful login /// public void AddSuccessfulLogin() { - successfulLogins++; + successfulLogins++; successfulLoginsToday++; } - + public void AddLogout() { logouts++; diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index d01c4c1..f92d150 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework { /// /// A dictionary for task inventory. - /// + /// /// This class is not thread safe. Callers must synchronize on Dictionary methods. /// public class TaskInventoryDictionary : Dictionary, @@ -72,10 +72,10 @@ namespace OpenSim.Framework // // System.TypeInitializationException: An exception was thrown by the type initializer for OpenSim.Framework.TaskInventoryDictionary ---> System.ArgumentOutOfRangeException: < 0 // Parameter name: length - // at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.2.4/mcs/class/corlib/System/String.cs:381 - // at System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type runtimeType, System.String xmlDataType) [0x001f6] in /build/buildd/mono-1.2.4/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs:217 + // at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.2.4/mcs/class/corlib/System/String.cs:381 + // at System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type runtimeType, System.String xmlDataType) [0x001f6] in /build/buildd/mono-1.2.4/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs:217 // ... -// private static XmlSerializer tiiSerializer +// private static XmlSerializer tiiSerializer // = new XmlSerializer(typeof(Dictionary.ValueCollection)); // see IXmlSerializable @@ -110,7 +110,7 @@ namespace OpenSim.Framework m_log.DebugFormat("[TASK INVENTORY]: Skipping empty element {0}", reader.Name); } - // For some .net implementations, this last read is necessary so that we advance beyond the end tag + // For some .net implementations, this last read is necessary so that we advance beyond the end tag // of the element wrapping this object so that the rest of the serialization can complete normally. reader.Read(); @@ -221,7 +221,7 @@ namespace OpenSim.Framework public uint NextOwnerMask = FULL_MASK_PERMISSIONS_GENERAL; public LLUUID OwnerID = LLUUID.Zero; public uint OwnerMask = FULL_MASK_PERMISSIONS_GENERAL; - public LLUUID ParentID = LLUUID.Zero; //parent folder id + public LLUUID ParentID = LLUUID.Zero; //parent folder id public LLUUID ParentPartID = LLUUID.Zero; public LLUUID PermsGranter; public int PermsMask; diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 5577140..8e5b02d 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -165,10 +165,10 @@ namespace OpenSim.Framework // (but those probably wont work anyway) return file; } - + /// /// Debug utility function to convert unbroken strings of XML into something human readable for occasional debugging purposes. - /// + /// /// Please don't delete me even if I appear currently unused! /// /// @@ -177,22 +177,22 @@ namespace OpenSim.Framework { XmlDocument xd = new XmlDocument(); xd.LoadXml(rawXml); - + StringBuilder sb = new StringBuilder(); - StringWriter sw = new StringWriter(sb); - + StringWriter sw = new StringWriter(sb); + XmlTextWriter xtw = new XmlTextWriter(sw); xtw.Formatting = Formatting.Indented; - + try { xd.WriteTo(xtw); } finally { - xtw.Close(); + xtw.Close(); } - + return sb.ToString(); } @@ -284,11 +284,11 @@ namespace OpenSim.Framework /// Convert a variable length field (byte array) to a string, with a /// field name prepended to each line of the output /// - /// If the byte array has unprintable characters in it, a + /// If the byte array has unprintable characters in it, a /// hex dump will be put in the string instead /// The byte array to convert to a string /// A field name to prepend to each line of output - /// An ASCII string or a string containing a hex dump, minus + /// An ASCII string or a string containing a hex dump, minus /// the null terminator public static string FieldToString(byte[] bytes, string fieldName) { -- cgit v1.1