diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index dcd5cc7c01..ebb00d2b1d 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs @@ -374,8 +374,7 @@ namespace OpenSim.Framework OSDMap urls = (OSDMap)tmpOSD; foreach (KeyValuePair kvp in urls) { - tmpOSD = kvp.Value; - ServiceURLs[kvp.Key] = tmpOSD.AsString(); + ServiceURLs[kvp.Key] = kvp.Value; //System.Console.WriteLine("XXX " + kvp.Key + "=" + ServiceURLs[kvp.Key]); } } @@ -394,6 +393,5 @@ namespace OpenSim.Framework } } } - } } diff --git a/OpenSim/Framework/WearableCacheItem.cs b/OpenSim/Framework/WearableCacheItem.cs index 84b9ee98e6..e060f22bf6 100644 --- a/OpenSim/Framework/WearableCacheItem.cs +++ b/OpenSim/Framework/WearableCacheItem.cs @@ -161,20 +161,16 @@ namespace OpenSim.Framework public static WearableCacheItem[] BakedFromOSD(OSD pInput) { WearableCacheItem[] pcache = WearableCacheItem.GetDefaultCacheItem(); - OSD tmpOSD; if (pInput.Type == OSDType.Array) { OSDArray itemarray = (OSDArray)pInput; foreach (OSDMap item in itemarray) { - tmpOSD = item["textureindex"]; - int idx = tmpOSD.AsInteger(); + int idx = item["textureindex"].AsInteger(); if (idx < 0 || idx > pcache.Length) continue; - tmpOSD = item["cacheid"]; - pcache[idx].CacheId = tmpOSD.AsUUID(); - tmpOSD = item["textureid"]; - pcache[idx].TextureID = tmpOSD.AsUUID(); + pcache[idx].CacheId = item["cacheid"].AsUUID(); + pcache[idx].TextureID = item["textureid"].AsUUID(); /* if (item.ContainsKey("assetdata")) { @@ -220,6 +216,4 @@ namespace OpenSim.Framework return null; } } - - } diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index 4a92120203..331f1bdc9a 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs @@ -267,24 +267,24 @@ namespace OpenSim.Region.OptionalModules.Materials if (matsArr == null) return partchanged; - OSD tmpOSD; foreach (OSD elemOsd in matsArr) { if (elemOsd != null && elemOsd is OSDMap) { OSDMap matMap = elemOsd as OSDMap; - if (matMap.ContainsKey("ID") && matMap.ContainsKey("Material")) + OSD OSDID; + OSD OSDMaterial; + if (matMap.TryGetValue("ID", out OSDID) && matMap.TryGetValue("Material", out OSDMaterial) && OSDMaterial is OSDMap) { try { lock (materialslock) { - tmpOSD = matMap["ID"]; - UUID id = tmpOSD.AsUUID(); + UUID id = OSDID.AsUUID(); if(m_Materials.ContainsKey(id)) continue; - OSDMap theMatMap = (OSDMap)matMap["Material"]; + OSDMap theMatMap = (OSDMap)OSDMaterial; FaceMaterial fmat = new FaceMaterial(theMatMap); if(fmat == null || @@ -292,7 +292,7 @@ namespace OpenSim.Region.OptionalModules.Materials && fmat.NormalMapID == UUID.Zero && fmat.SpecularMapID == UUID.Zero)) continue; - + fmat.ID = id; m_Materials[id] = fmat; m_MaterialsRefCount[id] = 0; @@ -560,8 +560,7 @@ namespace OpenSim.Region.OptionalModules.Materials uint primLocalID = 0; try { - tmpOSD = matsMap["ID"]; - primLocalID = tmpOSD.AsUInteger(); + primLocalID = matsMap["ID"].AsUInteger(); } catch (Exception e) { diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index b7dbb79abd..f5e7771248 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -120,36 +120,26 @@ namespace OpenSim.Services.Connectors.Simulation PackData(args, source, aCircuit, destination, flags); OSDMap result = WebUtil.PostToServiceCompressed(uri, args, 30000); - tmpOSD = result["success"]; - bool success = tmpOSD.AsBoolean(); + bool success = result["success"].AsBoolean(); if (success && result.TryGetValue("_Result", out tmpOSD) && tmpOSD is OSDMap) { OSDMap data = (OSDMap)tmpOSD; - - tmpOSD = data["reason"]; - reason = tmpOSD.AsString(); - - tmpOSD = data["success"]; - success = tmpOSD.AsBoolean(); + reason = data["reason"].AsString(); + success = data["success"].AsBoolean(); return success; } // Try the old version, uncompressed result = WebUtil.PostToService(uri, args, 30000, false); - tmpOSD = result["success"]; - success = tmpOSD.AsBoolean(); + success = result["success"].AsBoolean(); if (success) { if (result.TryGetValue("_Result", out tmpOSD) && tmpOSD is OSDMap) { OSDMap data = (OSDMap)tmpOSD; - - tmpOSD = data["reason"]; - reason = tmpOSD.AsString(); - - tmpOSD = data["success"]; - success = tmpOSD.AsBoolean(); + reason = data["reason"].AsString(); + success = data["success"].AsBoolean(); m_log.WarnFormat( "[REMOTE SIMULATION CONNECTOR]: Remote simulator {0} did not accept compressed transfer, suggest updating it.", destination.RegionName); @@ -327,8 +317,7 @@ namespace OpenSim.Services.Connectors.Simulation { OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 30000, false, false, true); - tmpOSD = result["success"]; - bool success = tmpOSD.AsBoolean(); + bool success = result["success"].AsBoolean(); bool has_Result = false; if (result.TryGetValue("_Result", out tmpOSD)) @@ -339,18 +328,14 @@ namespace OpenSim.Services.Connectors.Simulation // FIXME: If there is a _Result map then it's the success key here that indicates the true success // or failure, not the sibling result node. //nte4.8 crap - tmpOSD = data["success"]; - success = tmpOSD.AsBoolean(); - - tmpOSD = data["reason"]; - reason = tmpOSD.AsString(); + success = data["success"].AsBoolean(); + reason = data["reason"].AsString(); // We will need to plumb this and start sing the outbound version as well // TODO: lay the pipe for version plumbing if (data.TryGetValue("negotiated_inbound_version", out tmpOSD) && tmpOSD != null) { ctx.InboundVersion = (float)tmpOSD.AsReal(); - tmpOSD = data["negotiated_outbound_version"]; - ctx.OutboundVersion = (float)tmpOSD.AsReal(); + ctx.OutboundVersion = (float)data["negotiated_outbound_version"].AsReal(); } else if (data.TryGetValue("version", out tmpOSD) && tmpOSD != null) { diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 22748cc1f7..b923761368 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -1051,7 +1051,7 @@ namespace OpenSim.Services.LLLoginService } aCircuit.ServiceURLs[keyName] = keyValue; - m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); +// m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); } if (!account.ServiceURLs.ContainsKey("GatekeeperURI") && !string.IsNullOrEmpty(m_GatekeeperURL))