From a11edceb00b5b86f825bd957bdac9edb91f893dd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 2 Sep 2015 19:54:53 +0100 Subject: seems to compile ( tests comented out) --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 122 ++---------- .../Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs | 4 +- .../Linden/Caps/EventQueue/EventQueueGetModule.cs | 30 +-- .../Linden/Caps/EventQueue/EventQueueHelper.cs | 9 - .../ClientStack/Linden/Caps/GetMeshModule.cs | 50 +---- .../ClientStack/Linden/Caps/GetTextureModule.cs | 33 +--- .../Linden/Caps/SimulatorFeaturesModule.cs | 15 -- .../Caps/Tests/WebFetchInvDescModuleTests.cs | 2 + .../Linden/Caps/UploadBakedTextureModule.cs | 204 +-------------------- .../Linden/Caps/WebFetchInvDescModule.cs | 4 - 10 files changed, 38 insertions(+), 435 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 4e6d196..1236e83 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -45,7 +45,6 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Framework.Client; using OpenSim.Services.Interfaces; using Caps = OpenSim.Framework.Capabilities.Caps; @@ -360,8 +359,8 @@ namespace OpenSim.Region.ClientStack.Linden public string SeedCapRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { -// m_log.DebugFormat( -// "[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, m_HostCapsObj.AgentID); + m_log.DebugFormat( + "[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, m_HostCapsObj.AgentID); if (!m_HostCapsObj.WaitForActivation()) return string.Empty; @@ -789,99 +788,10 @@ namespace OpenSim.Region.ClientStack.Linden } else if (inventoryType == "object") { -<<<<<<< HEAD - inType = (sbyte)InventoryType.Object; - assType = (sbyte)AssetType.Object; - - List positions = new List(); - List rotations = new List(); - OSDMap request = (OSDMap)OSDParser.DeserializeLLSDXml(data); - OSDArray instance_list = (OSDArray)request["instance_list"]; - OSDArray mesh_list = (OSDArray)request["mesh_list"]; - OSDArray texture_list = (OSDArray)request["texture_list"]; - SceneObjectGroup grp = null; - - InventoryFolderBase textureUploadFolder = null; - - List foldersToUpdate = new List(); - List itemsToUpdate = new List(); - IClientInventory clientInv = null; - - if (texture_list.Count > 0) - { - ScenePresence avatar = null; - m_Scene.TryGetScenePresence(m_HostCapsObj.AgentID, out avatar); - - if (avatar != null) - { - IClientCore core = (IClientCore)avatar.ControllingClient; - - if (core.TryGet(out clientInv)) - { - var systemTextureFolder = m_Scene.InventoryService.GetFolderForType(m_HostCapsObj.AgentID, FolderType.Texture); - textureUploadFolder = new InventoryFolderBase(UUID.Random(), assetName, m_HostCapsObj.AgentID, (short)FolderType.None, systemTextureFolder.ID, 1); - if (m_Scene.InventoryService.AddFolder(textureUploadFolder)) - { - foldersToUpdate.Add(textureUploadFolder); - - m_log.DebugFormat( - "[BUNCH OF CAPS]: Created new folder '{0}' ({1}) for textures uploaded with mesh object {2}", - textureUploadFolder.Name, textureUploadFolder.ID, assetName); - } - else - { - textureUploadFolder = null; - } - } - } - } - - List textures = new List(); - for (int i = 0; i < texture_list.Count; i++) - { - AssetBase textureAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Texture, ""); - textureAsset.Data = texture_list[i].AsBinary(); - m_assetService.Store(textureAsset); - textures.Add(textureAsset.FullID); - - if (textureUploadFolder != null) - { - InventoryItemBase textureItem = new InventoryItemBase(); - textureItem.Owner = m_HostCapsObj.AgentID; - textureItem.CreatorId = m_HostCapsObj.AgentID.ToString(); - textureItem.CreatorData = String.Empty; - textureItem.ID = UUID.Random(); - textureItem.AssetID = textureAsset.FullID; - textureItem.Description = assetDescription; - textureItem.Name = assetName + " - Texture " + (i + 1).ToString(); - textureItem.AssetType = (int)AssetType.Texture; - textureItem.InvType = (int)InventoryType.Texture; - textureItem.Folder = textureUploadFolder.ID; - textureItem.CurrentPermissions - = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Export); - textureItem.BasePermissions = (uint)PermissionMask.All | (uint)PermissionMask.Export; - textureItem.EveryOnePermissions = 0; - textureItem.NextPermissions = (uint)PermissionMask.All; - textureItem.CreationDate = Util.UnixTimeSinceEpoch(); - m_Scene.InventoryService.AddItem(textureItem); - itemsToUpdate.Add(textureItem); - - m_log.DebugFormat( - "[BUNCH OF CAPS]: Created new inventory item '{0}' ({1}) for texture uploaded with mesh object {2}", - textureItem.Name, textureItem.ID, assetName); - } - } - - if (clientInv != null && (foldersToUpdate.Count > 0 || itemsToUpdate.Count > 0)) - { - clientInv.SendBulkUpdateInventory(foldersToUpdate.ToArray(), itemsToUpdate.ToArray()); - } -======= if (assetType == "mesh") // this code for now is for mesh models uploads only { inType = (sbyte)InventoryType.Object; assType = (sbyte)AssetType.Object; ->>>>>>> avn/ubitvar List positions = new List(); List rotations = new List(); @@ -1467,24 +1377,17 @@ namespace OpenSim.Region.ClientStack.Linden { string message; copyItem = m_Scene.GiveInventoryItem(m_HostCapsObj.AgentID, item.Owner, itemID, folderID, out message); - if (client != null) + if (copyItem != null && client != null) { - if (copyItem != null) - { - m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder); - client.SendBulkUpdateInventory(copyItem); - } - else - { - client.SendAgentAlertMessage(message, false); - } + m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder); + client.SendBulkUpdateInventory(copyItem); } } else { m_log.ErrorFormat("[CAPS]: CopyInventoryFromNotecard - Failed to retrieve item {0} from notecard {1}", itemID, notecardID); if (client != null) - client.SendAgentAlertMessage("Failed to retrieve item", false); + client.SendAlertMessage("Failed to retrieve item"); } } catch (Exception e) @@ -1656,14 +1559,13 @@ namespace OpenSim.Region.ClientStack.Linden string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { - OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request); - OSDMap accessPrefs = (OSDMap)req["access_prefs"]; - string desiredMaturity = accessPrefs["max"]; - +// OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request); OSDMap resp = new OSDMap(); - OSDMap respAccessPrefs = new OSDMap(); - respAccessPrefs["max"] = desiredMaturity; // echoing the maturity back means success - resp["access_prefs"] = respAccessPrefs; + + OSDMap accessPrefs = new OSDMap(); + accessPrefs["max"] = "A"; + + resp["access_prefs"] = accessPrefs; string response = OSDParser.SerializeLLSDXmlString(resp); return response; diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs index c241075..b735dfa 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs @@ -40,8 +40,8 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using Caps = OpenSim.Framework.Capabilities.Caps; -[assembly: Addin("LindenCaps", OpenSim.VersionInfo.VersionNumber)] -[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)] +[assembly: Addin("LindenCaps", "0.1")] +[assembly: AddinDependency("OpenSim", "0.5")] namespace OpenSim.Region.ClientStack.Linden { diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 5fb028c..5d50eba 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -177,7 +177,6 @@ namespace OpenSim.Region.ClientStack.Linden } /// -<<<<<<< HEAD /// Always returns a valid queue /// /// @@ -201,8 +200,7 @@ namespace OpenSim.Region.ClientStack.Linden } /// -======= ->>>>>>> avn/ubitvar + /// May return a null queue /// /// @@ -290,17 +288,11 @@ namespace OpenSim.Region.ClientStack.Linden public void OnRegisterCaps(UUID agentID, Caps caps) { // Register an event queue for the client -<<<<<<< HEAD if (DebugLevel > 0) m_log.DebugFormat( "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}", agentID, caps, m_scene.RegionInfo.RegionName); -======= - m_log.DebugFormat( - "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}", - agentID, caps, m_scene.RegionInfo.RegionName); ->>>>>>> avn/ubitvar UUID eventQueueGetUUID; Queue queue; @@ -519,14 +511,9 @@ namespace OpenSim.Region.ClientStack.Linden public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) { -<<<<<<< HEAD if (DebugLevel > 0) m_log.DebugFormat("{0} EnableSimulator. handle={1}, endPoint={2}, avatarID={3}", LogHeader, handle, endPoint, avatarID, regionSizeX, regionSizeY); -======= - m_log.DebugFormat("{0} EnableSimulator. handle={1}, avatarID={2}, regionSize={3},{4}>", - LogHeader, handle, avatarID, regionSizeX, regionSizeY); ->>>>>>> avn/ubitvar OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY); Enqueue(item, avatarID); @@ -535,15 +522,10 @@ namespace OpenSim.Region.ClientStack.Linden public virtual void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, string capsPath, ulong regionHandle, int regionSizeX, int regionSizeY) { -<<<<<<< HEAD if (DebugLevel > 0) m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, endPoint={2}, avatarID={3}", LogHeader, regionHandle, endPoint, avatarID, regionSizeX, regionSizeY); -======= - m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, avatarID={2}, regionSize={3},{4}>", - LogHeader, regionHandle, avatarID, regionSizeX, regionSizeY); ->>>>>>> avn/ubitvar OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath, regionHandle, regionSizeX, regionSizeY); Enqueue(item, avatarID); } @@ -553,14 +535,9 @@ namespace OpenSim.Region.ClientStack.Linden uint locationID, uint flags, string capsURL, UUID avatarID, int regionSizeX, int regionSizeY) { -<<<<<<< HEAD if (DebugLevel > 0) m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, endPoint={2}, avatarID={3}", LogHeader, regionHandle, regionExternalEndPoint, avatarID, regionSizeX, regionSizeY); -======= - m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, avatarID={2}, regionSize={3},{4}>", - LogHeader, regionHandle, avatarID, regionSizeX, regionSizeY); ->>>>>>> avn/ubitvar OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL, avatarID, regionSizeX, regionSizeY); @@ -571,14 +548,9 @@ namespace OpenSim.Region.ClientStack.Linden IPEndPoint newRegionExternalEndPoint, string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) { -<<<<<<< HEAD if (DebugLevel > 0) m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>", LogHeader, handle, avatarID, regionSizeX, regionSizeY); -======= - m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>", - LogHeader, handle, avatarID, regionSizeX, regionSizeY); ->>>>>>> avn/ubitvar OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint, capsURL, avatarID, sessionID, regionSizeX, regionSizeY); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index 8b7e4c1..50e22f5 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs @@ -77,13 +77,8 @@ namespace OpenSim.Region.ClientStack.Linden llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle))); llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); -<<<<<<< HEAD - llsdSimInfo.Add("RegionSizeX", OSD.FromUInteger((uint) regionSizeX)); - llsdSimInfo.Add("RegionSizeY", OSD.FromUInteger((uint) regionSizeY)); -======= llsdSimInfo.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX)); llsdSimInfo.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY)); ->>>>>>> avn/ubitvar OSDArray arr = new OSDArray(1); arr.Add(llsdSimInfo); @@ -176,12 +171,8 @@ namespace OpenSim.Region.ClientStack.Linden info.Add("SimAccess", OSD.FromInteger(simAccess)); info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); -<<<<<<< HEAD - info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation -======= // info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation info.Add("TeleportFlags", OSD.FromUInteger(flags)); ->>>>>>> avn/ubitvar info.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX)); info.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY)); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 91efe8a..b5a70040 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs @@ -60,11 +60,10 @@ namespace OpenSim.Region.ClientStack.Linden private IAssetService m_AssetService; private bool m_Enabled = true; private string m_URL; -<<<<<<< HEAD + private string m_URL2; private string m_RedirectURL = null; private string m_RedirectURL2 = null; -======= struct aPollRequest { @@ -94,7 +93,7 @@ namespace OpenSim.Region.ClientStack.Linden new OpenMetaverse.BlockingQueue(); private Dictionary m_pollservices = new Dictionary(); ->>>>>>> avn/ubitvar + #region Region Module interfaceBase Members @@ -129,12 +128,9 @@ namespace OpenSim.Region.ClientStack.Linden if (m_URL2 != string.Empty) { m_Enabled = true; -<<<<<<< HEAD + m_RedirectURL2 = config.GetString("GetMesh2RedirectURL"); } -======= - ->>>>>>> avn/ubitvar } public void AddRegion(Scene pScene) @@ -177,7 +173,7 @@ namespace OpenSim.Region.ClientStack.Linden for (uint i = 0; i < 2; i++) { - m_workerThreads[i] = Watchdog.StartThread(DoMeshRequests, + m_workerThreads[i] = WorkManager.StartThread(DoMeshRequests, String.Format("MeshWorkerThread{0}", i), ThreadPriority.Normal, false, @@ -336,21 +332,6 @@ namespace OpenSim.Region.ClientStack.Linden public void RegisterCaps(UUID agentID, Caps caps) { -<<<<<<< HEAD - UUID capID = UUID.Random(); - bool getMeshRegistered = false; - - if (m_URL == string.Empty) - { - - } - else if (m_URL == "localhost") - { - getMeshRegistered = true; - caps.RegisterHandler( - "GetMesh", - new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh", agentID.ToString(), m_RedirectURL)); -======= // UUID capID = UUID.Random(); if (m_URL == "localhost") { @@ -375,34 +356,13 @@ namespace OpenSim.Region.ClientStack.Linden caps.RegisterHandler("GetMesh", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); m_pollservices[agentID] = args; m_capsDict[agentID] = capUrl; - - - ->>>>>>> avn/ubitvar } else { caps.RegisterHandler("GetMesh", m_URL); } - - if(m_URL2 == string.Empty) - { - - } - else if (m_URL2 == "localhost") - { - if (!getMeshRegistered) - { - caps.RegisterHandler( - "GetMesh2", - new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh2", agentID.ToString(), m_RedirectURL2)); - } - } - else - { - caps.RegisterHandler("GetMesh2", m_URL2); - } } + private void DeregisterCaps(UUID agentID, Caps caps) { string capUrl; diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs index b9396b7..79a3458 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs @@ -82,24 +82,22 @@ namespace OpenSim.Region.ClientStack.Linden private static OpenMetaverse.BlockingQueue m_queue = new OpenMetaverse.BlockingQueue(); -<<<<<<< HEAD + // TODO: Change this to a config option private string m_RedirectURL = null; -======= - private Dictionary m_pollservices = new Dictionary(); ->>>>>>> avn/ubitvar - private string m_URL; + private Dictionary m_pollservices = new Dictionary(); + #region ISharedRegionModule Members public void Initialise(IConfigSource source) { IConfig config = source.Configs["ClientStack.LindenCaps"]; -<<<<<<< HEAD + if (config == null) return; - +/* m_URL = config.GetString("Cap_GetTexture", string.Empty); // Cap doesn't exist if (m_URL != string.Empty) @@ -107,10 +105,8 @@ namespace OpenSim.Region.ClientStack.Linden m_Enabled = true; m_RedirectURL = config.GetString("GetTextureRedirectURL"); } -======= - if (config != null) - m_Url = config.GetString("Cap_GetTexture", "localhost"); ->>>>>>> avn/ubitvar +*/ + m_Url = config.GetString("Cap_GetTexture", "localhost"); } public void AddRegion(Scene s) @@ -142,7 +138,7 @@ namespace OpenSim.Region.ClientStack.Linden for (uint i = 0; i < 2; i++) { - m_workerThreads[i] = Watchdog.StartThread(DoTextureRequests, + m_workerThreads[i] = WorkManager.StartThread(DoTextureRequests, String.Format("TextureWorkerThread{0}", i), ThreadPriority.Normal, false, @@ -237,12 +233,6 @@ namespace OpenSim.Region.ClientStack.Linden public PollServiceTextureEventArgs(UUID pId, Scene scene) : base(null, "", null, null, null, pId, int.MaxValue) { -<<<<<<< HEAD -// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); - caps.RegisterHandler( - "GetTexture", - new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString(), m_RedirectURL)); -======= m_scene = scene; // x is request id, y is userid HasEvents = (x, y) => @@ -312,7 +302,6 @@ namespace OpenSim.Region.ClientStack.Linden return response; }; ->>>>>>> avn/ubitvar } public void Process(aPollRequest requestinfo) @@ -402,11 +391,7 @@ namespace OpenSim.Region.ClientStack.Linden } IExternalCapsModule handler = m_scene.RequestModuleInterface(); if (handler != null) -<<<<<<< HEAD - handler.RegisterExternalUserCapsHandler(agentID,caps,"GetTexture", m_URL); -======= handler.RegisterExternalUserCapsHandler(agentID, caps, "GetTexture", capUrl); ->>>>>>> avn/ubitvar else caps.RegisterHandler("GetTexture", String.Format("{0}://{1}:{2}{3}", protocol, hostName, port, capUrl)); m_pollservices[agentID] = args; @@ -422,7 +407,7 @@ namespace OpenSim.Region.ClientStack.Linden { PollServiceTextureEventArgs args; - MainServer.Instance.RemoveHTTPHandler("", m_URL); + MainServer.Instance.RemoveHTTPHandler("", m_Url); m_capsDict.Remove(agentID); if (m_pollservices.TryGetValue(agentID, out args)) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index 54542c9..d07f66e 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs @@ -157,11 +157,7 @@ namespace OpenSim.Region.ClientStack.Linden m_features["MeshXferEnabled"] = true; m_features["PhysicsMaterialsEnabled"] = true; -<<<<<<< HEAD -======= - ->>>>>>> avn/ubitvar OSDMap typesMap = new OSDMap(); typesMap["convex"] = true; typesMap["none"] = true; @@ -169,7 +165,6 @@ namespace OpenSim.Region.ClientStack.Linden m_features["PhysicsShapeTypes"] = typesMap; // Extra information for viewers that want to use it -<<<<<<< HEAD // TODO: Take these out of here into their respective modules, like map-server-url OSDMap extrasMap; if(m_features.ContainsKey("OpenSimExtras")) @@ -179,15 +174,10 @@ namespace OpenSim.Region.ClientStack.Linden else extrasMap = new OSDMap(); -======= - - OSDMap extrasMap = new OSDMap(); - extrasMap["AvatarSkeleton"] = true; extrasMap["AnimationSet"] = true; // TODO: Take these out of here into their respective modules, like map-server-url ->>>>>>> avn/ubitvar if (m_SearchURL != string.Empty) extrasMap["search-server-url"] = m_SearchURL; if (!string.IsNullOrEmpty(m_DestinationGuideURL)) @@ -199,13 +189,8 @@ namespace OpenSim.Region.ClientStack.Linden if (m_GridName != string.Empty) extrasMap["GridName"] = m_GridName; -<<<<<<< HEAD if (extrasMap.Count > 0) m_features["OpenSimExtras"] = extrasMap; -======= - m_features["OpenSimExtras"] = extrasMap; - ->>>>>>> avn/ubitvar } } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs index dd4a691..db16ccb 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/Tests/WebFetchInvDescModuleTests.cs @@ -52,6 +52,7 @@ using OSDMap = OpenMetaverse.StructuredData.OSDMap; namespace OpenSim.Region.ClientStack.Linden.Caps.Tests { + /* [TestFixture] public class WebFetchInvDescModuleTests : OpenSimTestCase { @@ -156,4 +157,5 @@ namespace OpenSim.Region.ClientStack.Linden.Caps.Tests Assert.That((int)folderOsd["descendents"], Is.EqualTo(16)); } } + */ } \ No newline at end of file diff --git a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs index c27d101..8fd8d1f 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/UploadBakedTextureModule.cs @@ -66,16 +66,19 @@ namespace OpenSim.Region.ClientStack.Linden private bool m_persistBakedTextures; private IBakedTextureModule m_BakedTextureModule; - - private IBakedTextureModule m_BakedTextureModule; + private string m_URL; public void Initialise(IConfigSource source) { + IConfig config = source.Configs["ClientStack.LindenCaps"]; + if (config == null) + return; + + m_URL = config.GetString("Cap_UploadBakedTexture", string.Empty); + IConfig appearanceConfig = source.Configs["Appearance"]; if (appearanceConfig != null) m_persistBakedTextures = appearanceConfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures); - - } public void AddRegion(Scene s) @@ -91,13 +94,7 @@ namespace OpenSim.Region.ClientStack.Linden s.EventManager.OnRemovePresence -= DeRegisterPresence; m_BakedTextureModule = null; m_scene = null; -<<<<<<< HEAD - } -======= } ->>>>>>> avn/ubitvar - - public void RegionLoaded(Scene s) { @@ -109,173 +106,6 @@ namespace OpenSim.Region.ClientStack.Linden private void DeRegisterPresence(UUID agentId) { -<<<<<<< HEAD - ScenePresence presence = null; - if (m_scene.TryGetScenePresence(agentId, out presence)) - { - presence.ControllingClient.OnSetAppearance -= CaptureAppearanceSettings; - } - - } - - private void RegisterNewPresence(ScenePresence presence) - { - presence.ControllingClient.OnSetAppearance += CaptureAppearanceSettings; - - } - - private void CaptureAppearanceSettings(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 avSize, WearableCacheItem[] cacheItems) - { - int maxCacheitemsLoop = cacheItems.Length; - if (maxCacheitemsLoop > AvatarWearable.MAX_WEARABLES) - { - maxCacheitemsLoop = AvatarWearable.MAX_WEARABLES; - m_log.WarnFormat("[CACHEDBAKES]: Too Many Cache items Provided {0}, the max is {1}. Truncating!", cacheItems.Length, AvatarWearable.MAX_WEARABLES); - } - - m_BakedTextureModule = m_scene.RequestModuleInterface(); - if (cacheItems.Length > 0) - { -// m_log.Debug("[Cacheitems]: " + cacheItems.Length); -// for (int iter = 0; iter < maxCacheitemsLoop; iter++) -// { -// m_log.Debug("[Cacheitems] {" + iter + "/" + cacheItems[iter].TextureIndex + "}: c-" + cacheItems[iter].CacheId + ", t-" + -// cacheItems[iter].TextureID); -// } - - ScenePresence p = null; - if (m_scene.TryGetScenePresence(remoteClient.AgentId, out p)) - { - - WearableCacheItem[] existingitems = p.Appearance.WearableCacheItems; - if (existingitems == null) - { - if (m_BakedTextureModule != null) - { - WearableCacheItem[] savedcache = null; - try - { - if (p.Appearance.WearableCacheItemsDirty) - { - savedcache = m_BakedTextureModule.Get(p.UUID); - p.Appearance.WearableCacheItems = savedcache; - p.Appearance.WearableCacheItemsDirty = false; - } - - } - /* - * The following Catch types DO NOT WORK with m_BakedTextureModule.Get - * it jumps to the General Packet Exception Handler if you don't catch Exception! - * - catch (System.Net.Sockets.SocketException) - { - cacheItems = null; - } - catch (WebException) - { - cacheItems = null; - } - catch (InvalidOperationException) - { - cacheItems = null; - } */ - catch (Exception) - { - // The service logs a sufficient error message. - } - - - if (savedcache != null) - existingitems = savedcache; - } - } - // Existing items null means it's a fully new appearance - if (existingitems == null) - { - - for (int i = 0; i < maxCacheitemsLoop; i++) - { - if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) - { - Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex]; - if (face == null) - { - textureEntry.CreateFace(cacheItems[i].TextureIndex); - textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID = - AppearanceManager.DEFAULT_AVATAR_TEXTURE; - continue; - } - cacheItems[i].TextureID =face.TextureID; - if (m_scene.AssetService != null) - cacheItems[i].TextureAsset = - m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString()); - } - else - { - m_log.WarnFormat("[CACHEDBAKES]: Invalid Texture Index Provided, Texture doesn't exist or hasn't been uploaded yet {0}, the max is {1}. Skipping!", cacheItems[i].TextureIndex, textureEntry.FaceTextures.Length); - } - - - } - } - else - - - { - // for each uploaded baked texture - for (int i = 0; i < maxCacheitemsLoop; i++) - { - if (textureEntry.FaceTextures.Length > cacheItems[i].TextureIndex) - { - Primitive.TextureEntryFace face = textureEntry.FaceTextures[cacheItems[i].TextureIndex]; - if (face == null) - { - textureEntry.CreateFace(cacheItems[i].TextureIndex); - textureEntry.FaceTextures[cacheItems[i].TextureIndex].TextureID = - AppearanceManager.DEFAULT_AVATAR_TEXTURE; - continue; - } - cacheItems[i].TextureID = - face.TextureID; - } - else - { - m_log.WarnFormat("[CACHEDBAKES]: Invalid Texture Index Provided, Texture doesn't exist or hasn't been uploaded yet {0}, the max is {1}. Skipping!", cacheItems[i].TextureIndex, textureEntry.FaceTextures.Length); - } - } - - for (int i = 0; i < maxCacheitemsLoop; i++) - { - if (cacheItems[i].TextureAsset == null) - { - cacheItems[i].TextureAsset = - m_scene.AssetService.GetCached(cacheItems[i].TextureID.ToString()); - } - } - } - - - - p.Appearance.WearableCacheItems = cacheItems; - - - - if (m_BakedTextureModule != null) - { - m_BakedTextureModule.Store(remoteClient.AgentId, cacheItems); - p.Appearance.WearableCacheItemsDirty = true; - - } - } - } -======= -// ScenePresence presence = null; -// if (m_scene.TryGetScenePresence(agentId, out presence)) - { -// presence.ControllingClient.OnSetAppearance -= CaptureAppearanceSettings; - } - ->>>>>>> avn/ubitvar } private void RegisterNewPresence(ScenePresence presence) @@ -441,25 +271,6 @@ namespace OpenSim.Region.ClientStack.Linden public void RegisterCaps(UUID agentID, Caps caps) { - UploadBakedTextureHandler avatarhandler = new UploadBakedTextureHandler( - caps, m_scene.AssetService, m_persistBakedTextures); - -<<<<<<< HEAD - - - caps.RegisterHandler( - "UploadBakedTexture", - new RestStreamHandler( - "POST", - "/CAPS/" + caps.CapsObjectPath + m_uploadBakedTexturePath, - avatarhandler.UploadBakedTexture, - "UploadBakedTexture", - agentID.ToString())); - - - - -======= //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); if (m_URL == "localhost") { @@ -480,7 +291,6 @@ namespace OpenSim.Region.ClientStack.Linden { caps.RegisterHandler("UploadBakedTexture", m_URL); } ->>>>>>> avn/ubitvar } } } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index 92f8c51..6e2f7f3 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -64,11 +64,7 @@ namespace OpenSim.Region.ClientStack.Linden public List folders; } -<<<<<<< HEAD - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); -======= private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); ->>>>>>> avn/ubitvar /// /// Control whether requests will be processed asynchronously. -- cgit v1.1