From efd90b56b761219af6425b1c7a2cdd3b6ffb4de2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 27 Dec 2007 21:41:48 +0000 Subject: * Optimized usings * shortened references * Removed redundant 'this' * Normalized EOF --- .../Framework/Communications/Cache/AssetCache.cs | 49 +++++++------ .../Framework/Communications/Cache/AssetServer.cs | 6 +- .../Communications/Cache/AssetServerBase.cs | 10 +-- .../Cache/AssetTransactionManager.cs | 2 +- .../Communications/Cache/AssetTransactions.cs | 6 +- .../Communications/Cache/CachedUserInfo.cs | 2 +- .../Communications/Cache/GridAssetClient.cs | 15 ++-- .../Communications/Cache/InventoryFolderImpl.cs | 4 +- .../Communications/Cache/LibraryRootFolder.cs | 37 ++++++---- .../Communications/Cache/SQLAssetServer.cs | 8 +-- .../Cache/UserProfileCacheService.cs | 37 +++++----- .../Framework/Communications/Capabilities/Caps.cs | 82 +++++++++++----------- .../Framework/Communications/Capabilities/LLSD.cs | 42 ++++++----- .../Communications/Capabilities/LLSDArray.cs | 2 +- .../Capabilities/LLSDAssetUploadComplete.cs | 2 +- .../Communications/Capabilities/LLSDCapEvent.cs | 2 +- .../Communications/Capabilities/LLSDCapsDetails.cs | 2 +- .../Communications/Capabilities/LLSDEmpty.cs | 2 +- .../Communications/Capabilities/LLSDHelpers.cs | 15 ++-- .../Communications/Capabilities/LLSDMapLayer.cs | 2 +- .../Capabilities/LLSDMapLayerResponse.cs | 2 +- .../Capabilities/LLSDStreamHandler.cs | 8 +-- .../LLSDTaskInventoryUploadComplete.cs | 14 ++-- .../Capabilities/LLSDTaskScriptUpdate.cs | 12 ++-- .../Communications/Capabilities/LLSDTest.cs | 2 +- .../Communications/Capabilities/LLSDType.cs | 2 +- .../Communications/CommunicationsManager.cs | 7 +- OpenSim/Framework/Communications/IGridServices.cs | 4 +- .../Communications/IInterRegionCommunications.cs | 6 +- .../Framework/Communications/IInventoryServices.cs | 2 +- .../Communications/InventoryServiceBase.cs | 5 +- OpenSim/Framework/Communications/LoginResponse.cs | 6 +- OpenSim/Framework/Communications/LoginService.cs | 25 ++++--- .../Communications/Properties/AssemblyInfo.cs | 2 +- .../Communications/RestClient/RestClient.cs | 16 ++--- .../Framework/Communications/UserManagerBase.cs | 32 +++++---- 36 files changed, 241 insertions(+), 231 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 4765548..664625e 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; -using System.IO; using System.Threading; using libsecondlife; using libsecondlife.Packets; @@ -92,7 +91,7 @@ namespace OpenSim.Framework.Communications.Cache Thread.Sleep(500); } catch (Exception e) - { + { m_log.Error("ASSETCACHE", e.ToString()); } } @@ -177,30 +176,29 @@ namespace OpenSim.Framework.Communications.Cache // packets from the client. int pollPeriod = 200; int maxPolls = 15; - + AssetBase asset = GetCachedAsset(assetID); if (asset != null) { return asset; } - - m_assetServer.RequestAsset(assetID, isTexture); - + + m_assetServer.RequestAsset(assetID, isTexture); + do { Thread.Sleep(pollPeriod); - + asset = GetCachedAsset(assetID); if (asset != null) { return asset; } - } - while (--maxPolls > 0); - + } while (--maxPolls > 0); + MainLog.Instance.Warn( "ASSETCACHE", "Asset {0} was not received before the retrieval timeout was reached"); - + return null; } @@ -368,12 +366,13 @@ namespace OpenSim.Framework.Communications.Cache { // over max number of bytes so split up file long restData = data.LongLength - m_maxPacketSize; - int restPackets = (int) ((restData + m_maxPacketSize - 1) / m_maxPacketSize); + int restPackets = (int) ((restData + m_maxPacketSize - 1)/m_maxPacketSize); numPackets += restPackets; } return numPackets; } + #region Assets /// @@ -448,7 +447,7 @@ namespace OpenSim.Framework.Communications.Cache AssetRequest req; for (int i = 0; i < num; i++) { - req = (AssetRequest)AssetRequests[i]; + req = (AssetRequest) AssetRequests[i]; //Console.WriteLine("sending asset " + req.RequestAssetID); TransferInfoPacket Transfer = new TransferInfoPacket(); Transfer.TransferInfo.ChannelType = 2; @@ -458,7 +457,7 @@ namespace OpenSim.Framework.Communications.Cache { Transfer.TransferInfo.Params = new byte[20]; Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); - int assType = (int)req.AssetInf.Type; + int assType = (int) req.AssetInf.Type; Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); } else if (req.AssetRequestSource == 3) @@ -468,7 +467,7 @@ namespace OpenSim.Framework.Communications.Cache //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16); } - Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length; + Transfer.TransferInfo.Size = (int) req.AssetInf.Data.Length; Transfer.TransferInfo.TransferID = req.TransferRequestID; req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset); @@ -488,20 +487,20 @@ namespace OpenSim.Framework.Communications.Cache // libsecondlife hardcodes 1500 as the maximum data chunk size int maxChunkSize = 1500; int packetNumber = 0; - + while (processedLength < req.AssetInf.Data.Length) { TransferPacketPacket TransferPacket = new TransferPacketPacket(); TransferPacket.TransferData.Packet = packetNumber; TransferPacket.TransferData.ChannelType = 2; TransferPacket.TransferData.TransferID = req.TransferRequestID; - - int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize); + + int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize); byte[] chunk = new byte[chunkSize]; - Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length); - + Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length); + TransferPacket.TransferData.Data = chunk; - + // 0 indicates more packets to come, 1 indicates last packet if (req.AssetInf.Data.Length - processedLength > maxChunkSize) { @@ -510,10 +509,10 @@ namespace OpenSim.Framework.Communications.Cache else { TransferPacket.TransferData.Status = 1; - } - + } + req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); - + processedLength += chunkSize; packetNumber++; } @@ -609,4 +608,4 @@ namespace OpenSim.Framework.Communications.Cache } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/AssetServer.cs b/OpenSim/Framework/Communications/Cache/AssetServer.cs index ae6494f..692ee1e 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServer.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServer.cs @@ -80,7 +80,7 @@ namespace OpenSim.Framework.Communications.Cache IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID)); if (result.Count > 0) { - foundAsset = (AssetStorage)result.Next(); + foundAsset = (AssetStorage) result.Next(); found = true; } @@ -93,7 +93,7 @@ namespace OpenSim.Framework.Communications.Cache asset.Name = foundAsset.Name; idata = foundAsset.Data; asset.Data = idata; - + return asset; } else @@ -141,4 +141,4 @@ namespace OpenSim.Framework.Communications.Cache return (asset.UUID == _findID); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index 43d3dd9..1b2c836 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -69,7 +69,7 @@ namespace OpenSim.Framework.Communications.Cache { MainLog.Instance.Verbose( "ASSET", "Asset {0} received from asset server", req.AssetID); - + _receiver.AssetReceived(asset, req.IsTexture); } else @@ -112,9 +112,9 @@ namespace OpenSim.Framework.Communications.Cache ProcessRequest(req); } - catch(Exception e) + catch (Exception e) { - MainLog.Instance.Error("ASSETSERVER", e.Message ); + MainLog.Instance.Error("ASSETSERVER", e.Message); } } } @@ -149,7 +149,7 @@ namespace OpenSim.Framework.Communications.Cache req.AssetID = assetID; req.IsTexture = isTexture; _assetRequests.Enqueue(req); - + MainLog.Instance.Verbose("ASSET", "Added {0} to request queue", assetID); } @@ -253,4 +253,4 @@ namespace OpenSim.Framework.Communications.Cache assets.ForEach(action); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs index 7de84fa..c9c9541 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactionManager.cs @@ -106,4 +106,4 @@ namespace OpenSim.Framework.Communications.Cache } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs index 57c1fa6..8aa567c 100644 --- a/OpenSim/Framework/Communications/Cache/AssetTransactions.cs +++ b/OpenSim/Framework/Communications/Cache/AssetTransactions.cs @@ -182,7 +182,7 @@ namespace OpenSim.Framework.Communications.Cache Asset.Description = "empty"; Asset.Local = storeLocal; Asset.Temporary = tempFile; - + TransactionID = transaction; m_storeLocal = storeLocal; if (Asset.Data.Length > 2) @@ -312,6 +312,7 @@ namespace OpenSim.Framework.Communications.Cache } #region Nested Classes currently not in use (waiting for them to be enabled) + public class AssetCapsUploader { // Fields @@ -424,6 +425,7 @@ namespace OpenSim.Framework.Communications.Cache return text; } } + #endregion } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index a547c8a..1cf95b7 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -130,4 +130,4 @@ namespace OpenSim.Framework.Communications.Cache return result; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index 9c460c7..cf54fa4 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs @@ -27,10 +27,8 @@ */ using System; -using System.Collections.Generic; using System.IO; using System.Xml.Serialization; -using libsecondlife; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; @@ -65,9 +63,9 @@ namespace OpenSim.Framework.Communications.Cache if (s.Length > 0) { - XmlSerializer xs = new XmlSerializer(typeof(AssetBase)); - - return (AssetBase)xs.Deserialize(s); + XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); + + return (AssetBase) xs.Deserialize(s); } } catch (Exception e) @@ -76,12 +74,11 @@ namespace OpenSim.Framework.Communications.Cache MainLog.Instance.Debug("ASSETCACHE", "Getting asset {0}", req.AssetID.ToString()); MainLog.Instance.Error("ASSETCACHE", e.StackTrace); } - + return null; } - public override void UpdateAsset(AssetBase asset) { throw new Exception("The method or operation is not implemented."); @@ -119,8 +116,6 @@ namespace OpenSim.Framework.Communications.Cache throw new Exception("The method or operation is not implemented."); } - - #endregion } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index 1d2c920..a1e79b2 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -65,7 +65,7 @@ namespace OpenSim.Framework.Communications.Cache InventoryFolderImpl subFold = new InventoryFolderImpl(); subFold.name = folderName; subFold.folderID = folderID; - subFold.type = (short)type; + subFold.type = (short) type; subFold.parentID = this.folderID; subFold.agentID = agentID; SubFolders.Add(subFold.folderID, subFold); @@ -153,4 +153,4 @@ namespace OpenSim.Framework.Communications.Cache return folderList; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs index 4c8eddf..fd93b19 100644 --- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs +++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs @@ -49,8 +49,8 @@ namespace OpenSim.Framework.Communications.Cache folderID = new LLUUID("00000112-000f-0000-0000-000100bba000"); name = "OpenSim Library"; parentID = LLUUID.Zero; - type = (short)-1; - version = (ushort)1; + type = (short) -1; + version = (ushort) 1; InventoryFolderImpl folderInfo = new InventoryFolderImpl(); folderInfo.agentID = libOwner; @@ -81,28 +81,41 @@ namespace OpenSim.Framework.Communications.Cache private void CreateLibraryItems() { - InventoryItemBase item = CreateItem(new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9"), new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"), "Default Shape", "Default Shape", (int)AssetType.Bodypart, (int)InventoryType.Wearable, folderID); + InventoryItemBase item = + CreateItem(new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9"), + new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73"), "Default Shape", "Default Shape", + (int) AssetType.Bodypart, (int) InventoryType.Wearable, folderID); item.inventoryCurrentPermissions = 0; item.inventoryNextPermissions = 0; Items.Add(item.inventoryID, item); - item = CreateItem(new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9"), new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"), "Default Skin", "Default Skin", (int)AssetType.Bodypart, (int)InventoryType.Wearable, folderID); + item = + CreateItem(new LLUUID("77c41e39-38f9-f75a-024e-585989bfabc9"), + new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb"), "Default Skin", "Default Skin", + (int) AssetType.Bodypart, (int) InventoryType.Wearable, folderID); item.inventoryCurrentPermissions = 0; item.inventoryNextPermissions = 0; Items.Add(item.inventoryID, item); - item = CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-585989bf0000"), new LLUUID("00000000-38f9-1111-024e-222222111110"), "Default Shirt", "Default Shirt", (int)AssetType.Clothing, (int)InventoryType.Wearable, folderID); + item = + CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-585989bf0000"), + new LLUUID("00000000-38f9-1111-024e-222222111110"), "Default Shirt", "Default Shirt", + (int) AssetType.Clothing, (int) InventoryType.Wearable, folderID); item.inventoryCurrentPermissions = 0; item.inventoryNextPermissions = 0; Items.Add(item.inventoryID, item); - item = CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-5859892f1111"), new LLUUID("00000000-38f9-1111-024e-222222111120"), "Default Pants", "Default Pants", (int)AssetType.Clothing, (int)InventoryType.Wearable, folderID); + item = + CreateItem(new LLUUID("77c41e39-38f9-f75a-0000-5859892f1111"), + new LLUUID("00000000-38f9-1111-024e-222222111120"), "Default Pants", "Default Pants", + (int) AssetType.Clothing, (int) InventoryType.Wearable, folderID); item.inventoryCurrentPermissions = 0; item.inventoryNextPermissions = 0; Items.Add(item.inventoryID, item); } - public InventoryItemBase CreateItem(LLUUID inventoryID, LLUUID assetID, string name, string description, int assetType, int invType, LLUUID parentFolderID) + public InventoryItemBase CreateItem(LLUUID inventoryID, LLUUID assetID, string name, string description, + int assetType, int invType, LLUUID parentFolderID) { InventoryItemBase item = new InventoryItemBase(); item.avatarID = libOwner; @@ -135,10 +148,10 @@ namespace OpenSim.Framework.Communications.Cache item.inventoryName = source.Configs[i].GetString("name", ""); item.assetType = source.Configs[i].GetInt("assetType", 0); item.invType = source.Configs[i].GetInt("inventoryType", 0); - item.inventoryCurrentPermissions = (uint)source.Configs[i].GetLong("currentPermissions", 0x7FFFFFFF); - item.inventoryNextPermissions = (uint)source.Configs[i].GetLong("nextPermissions", 0x7FFFFFFF); - item.inventoryEveryOnePermissions = (uint)source.Configs[i].GetLong("everyonePermissions", 0x7FFFFFFF); - item.inventoryBasePermissions = (uint)source.Configs[i].GetLong("basePermissions", 0x7FFFFFFF); + item.inventoryCurrentPermissions = (uint) source.Configs[i].GetLong("currentPermissions", 0x7FFFFFFF); + item.inventoryNextPermissions = (uint) source.Configs[i].GetLong("nextPermissions", 0x7FFFFFFF); + item.inventoryEveryOnePermissions = (uint) source.Configs[i].GetLong("everyonePermissions", 0x7FFFFFFF); + item.inventoryBasePermissions = (uint) source.Configs[i].GetLong("basePermissions", 0x7FFFFFFF); if (item.assetType == 0) { item.parentFolderID = m_textureFolder.folderID; @@ -152,4 +165,4 @@ namespace OpenSim.Framework.Communications.Cache } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs index 7fcff10..e4c278f 100644 --- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs +++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs @@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications.Cache if (typeInterface != null) { IAssetProvider plug = - (IAssetProvider)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + (IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); m_assetProviderPlugin = plug; m_assetProviderPlugin.Initialise(); @@ -84,8 +84,8 @@ namespace OpenSim.Framework.Communications.Cache { asset = m_assetProviderPlugin.FetchAsset(req.AssetID); } - - return asset; + + return asset; } protected override void StoreAsset(AssetBase asset) @@ -98,4 +98,4 @@ namespace OpenSim.Framework.Communications.Cache m_assetProviderPlugin.CommitAssets(); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 47f970e..14670fd 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -130,7 +130,8 @@ namespace OpenSim.Framework.Communications.Cache } } - public void HandleUpdateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort type, string name, LLUUID parentID) + public void HandleUpdateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort type, string name, + LLUUID parentID) { CachedUserInfo userProfile; @@ -143,7 +144,7 @@ namespace OpenSim.Framework.Communications.Cache baseFolder.folderID = folderID; baseFolder.name = name; baseFolder.parentID = parentID; - baseFolder.type = (short)type; + baseFolder.type = (short) type; baseFolder.version = userProfile.RootFolder.version; m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, baseFolder); } @@ -180,12 +181,12 @@ namespace OpenSim.Framework.Communications.Cache bool fetchFolders, bool fetchItems, int sortOrder) { // XXX We're not handling sortOrder yet! - + InventoryFolderImpl fold = null; if (folderID == libraryRoot.folderID) { remoteClient.SendInventoryFolderDetails( - libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems(), + libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems(), libraryRoot.RequestListOfFolders(), fetchFolders, fetchItems); return; @@ -194,7 +195,7 @@ namespace OpenSim.Framework.Communications.Cache if ((fold = libraryRoot.HasSubFolder(folderID)) != null) { remoteClient.SendInventoryFolderDetails( - libraryRoot.agentID, folderID, fold.RequestListOfItems(), + libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fetchFolders, fetchItems); return; @@ -209,9 +210,9 @@ namespace OpenSim.Framework.Communications.Cache { remoteClient.SendInventoryFolderDetails( remoteClient.AgentId, folderID, userProfile.RootFolder.RequestListOfItems(), - userProfile.RootFolder.RequestListOfFolders(), + userProfile.RootFolder.RequestListOfFolders(), fetchFolders, fetchItems); - + return; } else @@ -219,9 +220,9 @@ namespace OpenSim.Framework.Communications.Cache if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null) { remoteClient.SendInventoryFolderDetails( - remoteClient.AgentId, folderID, fold.RequestListOfItems(), + remoteClient.AgentId, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fetchFolders, fetchItems); - + return; } } @@ -230,20 +231,20 @@ namespace OpenSim.Framework.Communications.Cache { MainLog.Instance.Error( "INVENTORYCACHE", "Could not find root folder for user {0}", remoteClient.Name); - + return; } } else { MainLog.Instance.Error( - "INVENTORYCACHE", - "Could not find user profile for {0} for folder {1}", - remoteClient.Name, folderID); - + "INVENTORYCACHE", + "Could not find user profile for {0} for folder {1}", + remoteClient.Name, folderID); + return; } - + // If we've reached this point then we couldn't find the folder, even though the client thinks // it exists MainLog.Instance.Error( @@ -262,8 +263,8 @@ namespace OpenSim.Framework.Communications.Cache InventoryFolderImpl subFolder = userProfile.RootFolder.HasSubFolder(folderID); if (subFolder != null) { - List items=subFolder.RequestListOfItems(); - foreach(InventoryItemBase item in items) + List items = subFolder.RequestListOfItems(); + foreach (InventoryItemBase item in items) { userProfile.DeleteItem(remoteClient.AgentId, item); } @@ -300,4 +301,4 @@ namespace OpenSim.Framework.Communications.Cache m_parent.InventoryService.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index e00f49d..4b42046 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -38,33 +38,33 @@ using OpenSim.Framework.Servers; namespace OpenSim.Region.Capabilities { public delegate void UpLoadedAsset( - string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, + string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, byte[] data, string inventoryType, string assetType); public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data); - + public delegate void UpdateTaskScript(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data); public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item); public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data); - - public delegate void TaskScriptUpdatedCallback(LLUUID userID, LLUUID itemID, LLUUID primID, - bool isScriptRunning, byte[] data); + + public delegate void TaskScriptUpdatedCallback(LLUUID userID, LLUUID itemID, LLUUID primID, + bool isScriptRunning, byte[] data); public class Caps { private string m_httpListenerHostName; private uint m_httpListenPort; - + private string m_capsObjectPath = "00001-"; private string m_requestPath = "0000/"; private string m_mapLayerPath = "0001/"; private string m_newInventory = "0002/"; - //private string m_requestTexture = "0003/"; + //private string m_requestTexture = "0003/"; private string m_notecardUpdatePath = "0004/"; private string m_notecardTaskUpdatePath = "0005/"; - + //private string eventQueue = "0100/"; private BaseHttpServer m_httpListener; private LLUUID m_agentID; @@ -78,7 +78,7 @@ namespace OpenSim.Region.Capabilities public NewInventoryItem AddNewInventoryItem = null; public ItemUpdatedCallback ItemUpdatedCall = null; public TaskScriptUpdatedCallback TaskScriptUpdatedCall = null; - + public Caps(AssetCache assetCache, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent, bool dumpAssetsToFile) { @@ -138,7 +138,7 @@ namespace OpenSim.Region.Capabilities /// public string CapsRequest(string request, string path, string param) { - //Console.WriteLine("caps request " + request); + //Console.WriteLine("caps request " + request); string result = LLSDHelpers.SerialiseLLSDReply(GetCapabilities()); return result; } @@ -153,7 +153,7 @@ namespace OpenSim.Region.Capabilities string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; caps.MapLayer = capsBaseUrl + m_mapLayerPath; - // caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; + // caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; caps.UpdateScriptAgentInventory = capsBaseUrl + m_notecardUpdatePath; @@ -262,7 +262,7 @@ namespace OpenSim.Region.Capabilities } #endregion - + /// /// Callback for a client request for an upload url for a script task /// inventory update @@ -272,28 +272,28 @@ namespace OpenSim.Region.Capabilities /// /// public string ScriptTaskInventory(string request, string path, string param) - { + { try { // MainLog.Instance.Debug("CAPS", "request: {0}, path: {1}, param: {2}", request, path, param); - - Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); + + Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request)); LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); LLSDHelpers.DeserialiseLLSDMap(hash, llsdUpdateRequest); - + string capsBase = "/CAPS/" + m_capsObjectPath; string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); - + TaskInventoryScriptUpdater uploader = new TaskInventoryScriptUpdater( - llsdUpdateRequest.item_id, - llsdUpdateRequest.task_id, - llsdUpdateRequest.is_script_running, - capsBase + uploaderPath, - m_httpListener, - m_dumpAssetsToFile); + llsdUpdateRequest.item_id, + llsdUpdateRequest.task_id, + llsdUpdateRequest.is_script_running, + capsBase + uploaderPath, + m_httpListener, + m_dumpAssetsToFile); uploader.OnUpLoad += TaskScriptUpdated; - + m_httpListener.AddStreamHandler( new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + @@ -302,13 +302,13 @@ namespace OpenSim.Region.Capabilities LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); uploadResponse.uploader = uploaderURL; uploadResponse.state = "upload"; - + // MainLog.Instance.Verbose( // "CAPS", // "ScriptTaskInventory response: {0}", // LLSDHelpers.SerialiseLLSDReply(uploadResponse)); - - return LLSDHelpers.SerialiseLLSDReply(uploadResponse); + + return LLSDHelpers.SerialiseLLSDReply(uploadResponse); } catch (Exception e) { @@ -329,7 +329,7 @@ namespace OpenSim.Region.Capabilities public string NoteCardAgentInventory(string request, string path, string param) { //libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)libsecondlife.StructuredData.LLSDParser.DeserializeBinary(Helpers.StringToField(request)); - Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); + Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request)); LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); @@ -353,7 +353,7 @@ namespace OpenSim.Region.Capabilities // "CAPS", // "NoteCardAgentInventory response: {0}", // LLSDHelpers.SerialiseLLSDReply(uploadResponse)); - + return LLSDHelpers.SerialiseLLSDReply(uploadResponse); } @@ -453,7 +453,7 @@ namespace OpenSim.Region.Capabilities { return ItemUpdatedCall(m_agentID, itemID, data); } - + return LLUUID.Zero; } @@ -613,7 +613,7 @@ namespace OpenSim.Region.Capabilities fs.Close(); } } - + /// /// This class is a callback invoked when a client sends asset data to /// a task inventory script update url @@ -629,17 +629,17 @@ namespace OpenSim.Region.Capabilities private BaseHttpServer httpListener; private bool m_dumpAssetToFile; - public TaskInventoryScriptUpdater(LLUUID inventoryItemID, LLUUID primID, int isScriptRunning, + public TaskInventoryScriptUpdater(LLUUID inventoryItemID, LLUUID primID, int isScriptRunning, string path, BaseHttpServer httpServer, bool dumpAssetToFile) { m_dumpAssetToFile = dumpAssetToFile; this.inventoryItemID = inventoryItemID; this.primID = primID; - + // This comes in over the packet as an integer, but actually appears to be treated as a bool this.isScriptRunning = (0 == isScriptRunning ? false : true); - + uploaderPath = path; httpListener = httpServer; } @@ -659,7 +659,7 @@ namespace OpenSim.Region.Capabilities // "CAPS", // "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", // data, path, param); - + string res = ""; LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); @@ -668,7 +668,7 @@ namespace OpenSim.Region.Capabilities OnUpLoad(inventoryItemID, primID, isScriptRunning, data); } - uploadComplete.item_id = inventoryItemID; + uploadComplete.item_id = inventoryItemID; uploadComplete.task_id = primID; uploadComplete.state = "complete"; @@ -680,7 +680,7 @@ namespace OpenSim.Region.Capabilities { SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data); } - + // MainLog.Instance.Verbose("CAPS", "TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); return res; @@ -689,9 +689,9 @@ namespace OpenSim.Region.Capabilities { MainLog.Instance.Error("CAPS", e.ToString()); } - + // XXX Maybe this should be some meaningful error packet - return null; + return null; } private void SaveAssetToFile(string filename, byte[] data) @@ -702,6 +702,6 @@ namespace OpenSim.Region.Capabilities bw.Close(); fs.Close(); } - } + } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSD.cs b/OpenSim/Framework/Communications/Capabilities/LLSD.cs index 987d6e6..dab926c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSD.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSD.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -28,12 +28,12 @@ using System; using System.Collections; -using System.Collections.Generic; -using System.Xml; +using System.Globalization; using System.IO; -using libsecondlife; using System.Security.Cryptography; using System.Text; +using System.Xml; +using libsecondlife; namespace OpenSim.Region.Capabilities { @@ -47,7 +47,9 @@ namespace OpenSim.Region.Capabilities /// public class LLSDParseException : Exception { - public LLSDParseException(string message) : base(message) { } + public LLSDParseException(string message) : base(message) + { + } } /// @@ -55,7 +57,9 @@ namespace OpenSim.Region.Capabilities /// public class LLSDSerializeException : Exception { - public LLSDSerializeException(string message) : base(message) { } + public LLSDSerializeException(string message) : base(message) + { + } } /// @@ -129,7 +133,7 @@ namespace OpenSim.Region.Capabilities if (obj is string) { writer.WriteStartElement(String.Empty, "string", String.Empty); - writer.WriteString((string)obj); + writer.WriteString((string) obj); writer.WriteEndElement(); } else if (obj is int) @@ -146,7 +150,7 @@ namespace OpenSim.Region.Capabilities } else if (obj is bool) { - bool b = (bool)obj; + bool b = (bool) obj; writer.WriteStartElement(String.Empty, "boolean", String.Empty); writer.WriteString(b ? "1" : "0"); writer.WriteEndElement(); @@ -157,7 +161,7 @@ namespace OpenSim.Region.Capabilities } else if (obj is LLUUID) { - LLUUID u = (LLUUID)obj; + LLUUID u = (LLUUID) obj; writer.WriteStartElement(String.Empty, "uuid", String.Empty); writer.WriteString(u.ToString()); writer.WriteEndElement(); @@ -463,7 +467,7 @@ namespace OpenSim.Region.Capabilities } else if (obj is string) { - return GetSpaces(indent) + "- string \"" + (string)obj + "\"\n"; + return GetSpaces(indent) + "- string \"" + (string) obj + "\"\n"; } else if (obj is int) { @@ -475,13 +479,13 @@ namespace OpenSim.Region.Capabilities } else if (obj is LLUUID) { - return GetSpaces(indent) + "- uuid " + ((LLUUID)obj).ToString() + Environment.NewLine; + return GetSpaces(indent) + "- uuid " + ((LLUUID) obj).ToString() + Environment.NewLine; } else if (obj is Hashtable) { StringBuilder ret = new StringBuilder(); ret.Append(GetSpaces(indent) + "- map" + Environment.NewLine); - Hashtable map = (Hashtable)obj; + Hashtable map = (Hashtable) obj; foreach (string key in map.Keys) { @@ -495,7 +499,7 @@ namespace OpenSim.Region.Capabilities { StringBuilder ret = new StringBuilder(); ret.Append(GetSpaces(indent) + "- array\n"); - ArrayList list = (ArrayList)obj; + ArrayList list = (ArrayList) obj; foreach (object item in list) { @@ -506,8 +510,8 @@ namespace OpenSim.Region.Capabilities } else if (obj is byte[]) { - return GetSpaces(indent) + "- binary\n" + Helpers.FieldToHexString((byte[])obj, GetSpaces(indent)) + - Environment.NewLine; + return GetSpaces(indent) + "- binary\n" + Helpers.FieldToHexString((byte[]) obj, GetSpaces(indent)) + + Environment.NewLine; } else { @@ -557,8 +561,8 @@ namespace OpenSim.Region.Capabilities double value; endPos = FindEnd(llsd, 1); - if (Double.TryParse(llsd.Substring(1, endPos - 1), System.Globalization.NumberStyles.Float, - Helpers.EnUsCulture.NumberFormat, out value)) + if (Double.TryParse(llsd.Substring(1, endPos - 1), NumberStyles.Float, + Helpers.EnUsCulture.NumberFormat, out value)) return value; else throw new LLSDParseException("Failed to parse double value type"); @@ -652,7 +656,7 @@ namespace OpenSim.Region.Capabilities private static int FindEnd(string llsd, int start) { - int end = llsd.IndexOfAny(new char[] { ',', ']', '}' }); + int end = llsd.IndexOfAny(new char[] {',', ']', '}'}); if (end == -1) end = llsd.Length - 1; return end; } @@ -673,4 +677,4 @@ namespace OpenSim.Region.Capabilities } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs b/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs index 2bc1643..d641b5c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs @@ -38,4 +38,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs index 307e3e3..f838c85 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs @@ -41,4 +41,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs b/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs index eb76d64..3b8c077 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs @@ -37,4 +37,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs b/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs index dfb1683..7b09cb3 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs @@ -34,7 +34,7 @@ namespace OpenSim.Region.Capabilities public string MapLayer = ""; public string NewFileAgentInventory = ""; //public string EventQueueGet = ""; - // public string RequestTextureDownload = ""; + // public string RequestTextureDownload = ""; // public string ChatSessionRequest = ""; public string UpdateNotecardAgentInventory = ""; public string UpdateScriptAgentInventory = ""; diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs b/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs index 101d9c0..5e6e917 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs @@ -34,4 +34,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs index 60aa60c..28f838d 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs @@ -30,7 +30,6 @@ using System.Collections; using System.IO; using System.Reflection; using System.Xml; -using libsecondlife; namespace OpenSim.Region.Capabilities { @@ -77,7 +76,7 @@ namespace OpenSim.Region.Capabilities writer.WriteString(fields[i].Name); writer.WriteEndElement(); LLSD.LLSDWriteOne(writer, fieldValue); - // libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( + // libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( // writer, libsecondlife.StructuredData.LLSD.FromObject(fieldValue)); } } @@ -102,8 +101,8 @@ namespace OpenSim.Region.Capabilities else { LLSD.LLSDWriteOne(writer, obj); - //libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( - // writer, libsecondlife.StructuredData.LLSD.FromObject(obj)); + //libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( + // writer, libsecondlife.StructuredData.LLSD.FromObject(obj)); } } @@ -122,12 +121,12 @@ namespace OpenSim.Region.Capabilities FieldInfo field = myType.GetField((string) enumerator.Key); if (field != null) { - // if (enumerator.Value is libsecondlife.StructuredData.LLSDMap) + // if (enumerator.Value is libsecondlife.StructuredData.LLSDMap) if (enumerator.Value is Hashtable) { object fieldValue = field.GetValue(obj); - DeserialiseLLSDMap((Hashtable)enumerator.Value, fieldValue); - // DeserialiseLLSDMap((libsecondlife.StructuredData.LLSDMap) enumerator.Value, fieldValue); + DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); + // DeserialiseLLSDMap((libsecondlife.StructuredData.LLSDMap) enumerator.Value, fieldValue); } else if (enumerator.Value is ArrayList) { @@ -149,4 +148,4 @@ namespace OpenSim.Region.Capabilities return obj; } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs index 214b9c7..121b36a 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs @@ -42,4 +42,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs index 48130b1..93b0f83 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs @@ -37,4 +37,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs index 71cc358..4321d7b 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs @@ -29,9 +29,7 @@ using System.Collections; using System.IO; using System.Text; -using libsecondlife; using OpenSim.Framework.Servers; -using System.Xml; namespace OpenSim.Region.Capabilities { @@ -54,10 +52,10 @@ namespace OpenSim.Region.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); + Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request); TRequest llsdRequest = new TRequest(); LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); @@ -68,4 +66,4 @@ namespace OpenSim.Region.Capabilities return encoding.GetBytes(LLSDHelpers.SerialiseLLSDReply(response)); } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs index 3703efc..8d6550b 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs @@ -25,10 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using libsecondlife; - +using libsecondlife; + namespace OpenSim.Region.Capabilities -{ +{ [LLSDMap] public class LLSDTaskInventoryUploadComplete { @@ -36,15 +36,15 @@ namespace OpenSim.Region.Capabilities /// The task inventory item that was updated /// public LLUUID item_id; - + /// /// The task that was updated /// - public LLUUID task_id; - + public LLUUID task_id; + /// /// State of the upload. So far have only even seen this set to "complete" /// public string state; } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs index 6dcf2b5..e9c77b8 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs @@ -26,10 +26,10 @@ * */ -using libsecondlife; - +using libsecondlife; + namespace OpenSim.Region.Capabilities -{ +{ [LLSDMap] public class LLSDTaskScriptUpdate { @@ -37,15 +37,15 @@ namespace OpenSim.Region.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/LLSDTest.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs index 70bfd2c..d10b0c0 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs @@ -37,4 +37,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDType.cs b/OpenSim/Framework/Communications/Capabilities/LLSDType.cs index 7bbe16e..e851742 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDType.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDType.cs @@ -52,4 +52,4 @@ namespace OpenSim.Region.Capabilities { } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 4614756..02c54e1 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -26,9 +26,9 @@ * */ using System; +using System.Collections.Generic; using libsecondlife; using OpenSim.Framework.Communications.Cache; -using System.Collections.Generic; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; @@ -173,12 +173,13 @@ namespace OpenSim.Framework.Communications } } } + public List GenerateAgentPickerRequestResponse(LLUUID queryID, string query) { - List pickerlist = m_userService.GenerateAgentPickerRequestResponse(queryID, query); + List pickerlist = m_userService.GenerateAgentPickerRequestResponse(queryID, query); return pickerlist; } #endregion } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs index d51f234..e2c2661 100644 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ b/OpenSim/Framework/Communications/IGridServices.cs @@ -25,7 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System.Collections; using System.Collections.Generic; namespace OpenSim.Framework.Communications @@ -39,6 +38,5 @@ namespace OpenSim.Framework.Communications RegionInfo RequestNeighbourInfo(ulong regionHandle); Dictionary GetGridSettings(); List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); - } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/IInterRegionCommunications.cs b/OpenSim/Framework/Communications/IInterRegionCommunications.cs index 3aa20a3..e2a96f6 100644 --- a/OpenSim/Framework/Communications/IInterRegionCommunications.cs +++ b/OpenSim/Framework/Communications/IInterRegionCommunications.cs @@ -31,8 +31,7 @@ namespace OpenSim.Framework.Communications { public interface IInterRegionCommunications { - - string rdebugRegionName{ get; set; } + string rdebugRegionName { get; set; } bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData); bool RegionUp(SearializableRegionInfo region, ulong regionhandle); @@ -45,6 +44,5 @@ namespace OpenSim.Framework.Communications bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID); void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID); - } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs index 9c493d4..f2e5cc5 100644 --- a/OpenSim/Framework/Communications/IInventoryServices.cs +++ b/OpenSim/Framework/Communications/IInventoryServices.cs @@ -52,4 +52,4 @@ namespace OpenSim.Framework.Communications /// List RequestFirstLevelFolders(LLUUID userID); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 534383a..098d08e 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -30,7 +30,6 @@ using System; using System.Collections.Generic; using System.Reflection; using libsecondlife; -using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Console; namespace OpenSim.Framework.Communications @@ -65,7 +64,7 @@ namespace OpenSim.Framework.Communications if (typeInterface != null) { IInventoryData plug = - (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Initialise(); m_plugins.Add(plug.getName(), plug); MainLog.Instance.Verbose("AGENTINVENTORY", "Added IInventoryData Interface"); @@ -370,4 +369,4 @@ namespace OpenSim.Framework.Communications public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index ede3148..954aecb 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs @@ -525,9 +525,9 @@ namespace OpenSim.Framework.UserManagement set { welcomeMessage = value; } } - public BuddyList BuddList + public BuddyList BuddList { - get{return m_buddyList;} + get { return m_buddyList; } set { m_buddyList = value; } } @@ -591,4 +591,4 @@ namespace OpenSim.Framework.UserManagement } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 6d4cb68..a284910 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -64,7 +64,7 @@ namespace OpenSim.Framework.UserManagement //CFK: CustomizeResponse contains sufficient strings to alleviate the need for this. //CKF: MainLog.Instance.Verbose("LOGIN", "Attempting login now..."); XmlRpcResponse response = new XmlRpcResponse(); - Hashtable requestData = (Hashtable)request.Params[0]; + Hashtable requestData = (Hashtable) request.Params[0]; bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); @@ -75,17 +75,17 @@ namespace OpenSim.Framework.UserManagement if (GoodXML) { - string firstname = (string)requestData["first"]; - string lastname = (string)requestData["last"]; - string passwd = (string)requestData["passwd"]; + string firstname = (string) requestData["first"]; + string lastname = (string) requestData["last"]; + string passwd = (string) requestData["passwd"]; userProfile = GetTheUser(firstname, lastname); if (userProfile == null) { MainLog.Instance.Verbose( - "LOGIN", + "LOGIN", "Could not find a profile for " + firstname + " " + lastname); - + return logResponse.CreateLoginFailedResponse(); } @@ -103,15 +103,14 @@ namespace OpenSim.Framework.UserManagement else { // If we already have a session... - + if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline) { userProfile.currentAgent = null; m_userManager.CommitAgent(ref userProfile); - + // Reject the login return logResponse.CreateAlreadyLoggedInResponse(); - } // Otherwise... // Create a new agent session @@ -132,7 +131,7 @@ namespace OpenSim.Framework.UserManagement userProfile.rootInventoryFolderID = inventData.RootFolderID; // Circuit Code - uint circode = (uint)(Util.RandomClass.Next()); + uint circode = (uint) (Util.RandomClass.Next()); logResponse.Lastname = userProfile.surname; logResponse.Firstname = userProfile.username; @@ -150,7 +149,7 @@ namespace OpenSim.Framework.UserManagement logResponse.InventoryLibRoot = InventoryLibRoot; logResponse.InventoryLibraryOwner = GetLibraryOwner(); - logResponse.CircuitCode = (Int32)circode; + logResponse.CircuitCode = (Int32) circode; //logResponse.RegionX = 0; //overwritten //logResponse.RegionY = 0; //overwritten logResponse.Home = "!!null temporary value {home}!!"; // Overwritten @@ -277,7 +276,7 @@ namespace OpenSim.Framework.UserManagement TempHash["type_default"] = -1; TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001"; temp.Add(TempHash); - + return temp; } @@ -328,4 +327,4 @@ namespace OpenSim.Framework.UserManagement } } } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs b/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs index fd8ce38..e9c7bf3 100644 --- a/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/Communications/Properties/AssemblyInfo.cs @@ -62,4 +62,4 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: [assembly : AssemblyVersion("1.0.0.0")] -[assembly : AssemblyFileVersion("1.0.0.0")] +[assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs index 5c77193..1aaf68e 100644 --- a/OpenSim/Framework/Communications/RestClient/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs @@ -238,7 +238,7 @@ namespace OpenSim.Framework.Communications } } realuri = sb.ToString(); - MainLog.Instance.Verbose("REST", "RestURL: {0}", realuri); + MainLog.Instance.Verbose("REST", "RestURL: {0}", realuri); return new Uri(sb.ToString()); } @@ -365,7 +365,7 @@ namespace OpenSim.Framework.Communications } public Stream Request(Stream src) - { + { _request = (HttpWebRequest) WebRequest.Create(buildUri()); _request.KeepAlive = false; _request.ContentType = "application/xml"; @@ -374,16 +374,16 @@ namespace OpenSim.Framework.Communications _asyncException = null; _request.ContentLength = src.Length; - MainLog.Instance.Verbose("REST", "Request Length {0}", _request.ContentLength); - MainLog.Instance.Verbose("REST", "Sending Web Request {0}", buildUri()); + MainLog.Instance.Verbose("REST", "Request Length {0}", _request.ContentLength); + MainLog.Instance.Verbose("REST", "Sending Web Request {0}", buildUri()); src.Seek(0, SeekOrigin.Begin); - MainLog.Instance.Verbose("REST", "Seek is ok"); + MainLog.Instance.Verbose("REST", "Seek is ok"); Stream dst = _request.GetRequestStream(); - MainLog.Instance.Verbose("REST", "GetRequestStream is ok"); + MainLog.Instance.Verbose("REST", "GetRequestStream is ok"); byte[] buf = new byte[1024]; int length = src.Read(buf, 0, 1024); - MainLog.Instance.Verbose("REST", "First Read is ok"); + MainLog.Instance.Verbose("REST", "First Read is ok"); while (length > 0) { dst.Write(buf, 0, length); @@ -440,4 +440,4 @@ namespace OpenSim.Framework.Communications #endregion Async Invocation } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index d946e00..f913d2c 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -27,7 +27,6 @@ */ using System; -using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Security.Cryptography; @@ -93,13 +92,13 @@ namespace OpenSim.Framework.UserManagement foreach (KeyValuePair plugin in _plugins) { UserProfileData profile = plugin.Value.GetUserByUUID(uuid); - + if (null != profile) { profile.currentAgent = getUserAgent(profile.UUID); return profile; - } - } + } + } return null; } @@ -112,11 +111,11 @@ namespace OpenSim.Framework.UserManagement try { pickerlist = plugin.Value.GeneratePickerResults(queryID, query); - } catch (Exception) { - MainLog.Instance.Verbose("USERSTORAGE", "Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")"); + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")"); return new List(); } } @@ -162,7 +161,8 @@ namespace OpenSim.Framework.UserManagement } catch (Exception e) { - MainLog.Instance.Verbose("USERSTORAGE", "Unable to set user via " + plugin.Key + "(" + e.ToString() + ")"); + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to set user via " + plugin.Key + "(" + e.ToString() + ")"); } } @@ -188,7 +188,8 @@ namespace OpenSim.Framework.UserManagement } catch (Exception e) { - MainLog.Instance.Verbose("USERSTORAGE", "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); } } @@ -210,7 +211,8 @@ namespace OpenSim.Framework.UserManagement } catch (Exception e) { - MainLog.Instance.Verbose("USERSTORAGE", "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); } } @@ -222,7 +224,7 @@ namespace OpenSim.Framework.UserManagement { UserProfileData profile = GetUserProfile(agentID); profile.currentAgent = null; - + setUserProfile(profile); } @@ -242,7 +244,8 @@ namespace OpenSim.Framework.UserManagement } catch (Exception e) { - MainLog.Instance.Verbose("USERSTORAGE", "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); } } @@ -356,7 +359,8 @@ namespace OpenSim.Framework.UserManagement } catch (Exception e) { - MainLog.Instance.Verbose("USERSTORAGE", "Unable to add user via " + plugin.Key + "(" + e.ToString() + ")"); + MainLog.Instance.Verbose("USERSTORAGE", + "Unable to add user via " + plugin.Key + "(" + e.ToString() + ")"); } } @@ -365,6 +369,6 @@ namespace OpenSim.Framework.UserManagement public abstract UserProfileData SetupMasterUser(string firstName, string lastName); public abstract UserProfileData SetupMasterUser(string firstName, string lastName, string password); - public abstract UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid); + public abstract UserProfileData SetupMasterUser(LLUUID uuid); } -} +} \ No newline at end of file -- cgit v1.1