From 818ed2032aa4e6c0a9ede3598d64f0c7960135c4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 30 Oct 2010 00:41:36 +0100 Subject: READ CAREFULLY!!! This is a BROKEN commit. It is UNTESTED and INCOMPLETE. It contains a major interface version bump and will NOT work with earlier grid services. This is preliminary work that will lead to layers support. Rest appearance services are commented out completely, they will have to be adapted by someone who actually uses them. Remote admin is working, but has no layers support. There is no layers support in the database. Login likely won't work. You have been warned. --- .../SimianGrid/SimianAvatarServiceConnector.cs | 53 +++++---- OpenSim/Services/Interfaces/IAvatarService.cs | 132 ++++++++++++--------- 2 files changed, 105 insertions(+), 80 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index ea9b4b4..7a28c2b 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs @@ -265,32 +265,33 @@ namespace OpenSim.Services.Connectors.SimianGrid map["Height"] = OSD.FromReal(appearance.AvatarHeight); - map["ShapeItem"] = OSD.FromUUID(appearance.BodyItem); - map["ShapeAsset"] = OSD.FromUUID(appearance.BodyAsset); - map["SkinItem"] = OSD.FromUUID(appearance.SkinItem); - map["SkinAsset"] = OSD.FromUUID(appearance.SkinAsset); - map["HairItem"] = OSD.FromUUID(appearance.HairItem); - map["HairAsset"] = OSD.FromUUID(appearance.HairAsset); - map["EyesItem"] = OSD.FromUUID(appearance.EyesItem); - map["EyesAsset"] = OSD.FromUUID(appearance.EyesAsset); - map["ShirtItem"] = OSD.FromUUID(appearance.ShirtItem); - map["ShirtAsset"] = OSD.FromUUID(appearance.ShirtAsset); - map["PantsItem"] = OSD.FromUUID(appearance.PantsItem); - map["PantsAsset"] = OSD.FromUUID(appearance.PantsAsset); - map["ShoesItem"] = OSD.FromUUID(appearance.ShoesItem); - map["ShoesAsset"] = OSD.FromUUID(appearance.ShoesAsset); - map["SocksItem"] = OSD.FromUUID(appearance.SocksItem); - map["SocksAsset"] = OSD.FromUUID(appearance.SocksAsset); - map["JacketItem"] = OSD.FromUUID(appearance.JacketItem); - map["JacketAsset"] = OSD.FromUUID(appearance.JacketAsset); - map["GlovesItem"] = OSD.FromUUID(appearance.GlovesItem); - map["GlovesAsset"] = OSD.FromUUID(appearance.GlovesAsset); - map["UndershirtItem"] = OSD.FromUUID(appearance.UnderShirtItem); - map["UndershirtAsset"] = OSD.FromUUID(appearance.UnderShirtAsset); - map["UnderpantsItem"] = OSD.FromUUID(appearance.UnderPantsItem); - map["UnderpantsAsset"] = OSD.FromUUID(appearance.UnderPantsAsset); - map["SkirtItem"] = OSD.FromUUID(appearance.SkirtItem); - map["SkirtAsset"] = OSD.FromUUID(appearance.SkirtAsset); + map["BodyItem"] = appearance.Wearables[AvatarWearable.BODY][0].ItemID.ToString(); + map["EyesItem"] = appearance.Wearables[AvatarWearable.EYES][0].ItemID.ToString(); + map["GlovesItem"] = appearance.Wearables[AvatarWearable.GLOVES][0].ItemID.ToString(); + map["HairItem"] = appearance.Wearables[AvatarWearable.HAIR][0].ItemID.ToString(); + map["JacketItem"] = appearance.Wearables[AvatarWearable.JACKET][0].ItemID.ToString(); + map["PantsItem"] = appearance.Wearables[AvatarWearable.PANTS][0].ItemID.ToString(); + map["ShirtItem"] = appearance.Wearables[AvatarWearable.SHIRT][0].ItemID.ToString(); + map["ShoesItem"] = appearance.Wearables[AvatarWearable.SHOES][0].ItemID.ToString(); + map["SkinItem"] = appearance.Wearables[AvatarWearable.SKIN][0].ItemID.ToString(); + map["SkirtItem"] = appearance.Wearables[AvatarWearable.SKIRT][0].ItemID.ToString(); + map["SocksItem"] = appearance.Wearables[AvatarWearable.SOCKS][0].ItemID.ToString(); + map["UnderPantsItem"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].ItemID.ToString(); + map["UnderShirtItem"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].ItemID.ToString(); + map["BodyAsset"] = appearance.Wearables[AvatarWearable.BODY][0].AssetID.ToString(); + map["EyesAsset"] = appearance.Wearables[AvatarWearable.EYES][0].AssetID.ToString(); + map["GlovesAsset"] = appearance.Wearables[AvatarWearable.GLOVES][0].AssetID.ToString(); + map["HairAsset"] = appearance.Wearables[AvatarWearable.HAIR][0].AssetID.ToString(); + map["JacketAsset"] = appearance.Wearables[AvatarWearable.JACKET][0].AssetID.ToString(); + map["PantsAsset"] = appearance.Wearables[AvatarWearable.PANTS][0].AssetID.ToString(); + map["ShirtAsset"] = appearance.Wearables[AvatarWearable.SHIRT][0].AssetID.ToString(); + map["ShoesAsset"] = appearance.Wearables[AvatarWearable.SHOES][0].AssetID.ToString(); + map["SkinAsset"] = appearance.Wearables[AvatarWearable.SKIN][0].AssetID.ToString(); + map["SkirtAsset"] = appearance.Wearables[AvatarWearable.SKIRT][0].AssetID.ToString(); + map["SocksAsset"] = appearance.Wearables[AvatarWearable.SOCKS][0].AssetID.ToString(); + map["UnderPantsAsset"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].AssetID.ToString(); + map["UnderShirtAsset"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].AssetID.ToString(); + OSDMap items = new OSDMap(); foreach (KeyValuePair kvp in avatar.Data) diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index eaa6534..a029fbc 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -149,33 +149,33 @@ namespace OpenSim.Services.Interfaces Data["Serial"] = appearance.Serial.ToString(); // Wearables Data["AvatarHeight"] = appearance.AvatarHeight.ToString(); - Data["BodyItem"] = appearance.BodyItem.ToString(); - Data["EyesItem"] = appearance.EyesItem.ToString(); - Data["GlovesItem"] = appearance.GlovesItem.ToString(); - Data["HairItem"] = appearance.HairItem.ToString(); - Data["JacketItem"] = appearance.JacketItem.ToString(); - Data["PantsItem"] = appearance.PantsItem.ToString(); - Data["ShirtItem"] = appearance.ShirtItem.ToString(); - Data["ShoesItem"] = appearance.ShoesItem.ToString(); - Data["SkinItem"] = appearance.SkinItem.ToString(); - Data["SkirtItem"] = appearance.SkirtItem.ToString(); - Data["SocksItem"] = appearance.SocksItem.ToString(); - Data["UnderPantsItem"] = appearance.UnderPantsItem.ToString(); - Data["UnderShirtItem"] = appearance.UnderShirtItem.ToString(); - - Data["BodyAsset"] = appearance.BodyAsset.ToString(); - Data["EyesAsset"] = appearance.EyesAsset.ToString(); - Data["GlovesAsset"] = appearance.GlovesAsset.ToString(); - Data["HairAsset"] = appearance.HairAsset.ToString(); - Data["JacketAsset"] = appearance.JacketAsset.ToString(); - Data["PantsAsset"] = appearance.PantsAsset.ToString(); - Data["ShirtAsset"] = appearance.ShirtAsset.ToString(); - Data["ShoesAsset"] = appearance.ShoesAsset.ToString(); - Data["SkinAsset"] = appearance.SkinAsset.ToString(); - Data["SkirtAsset"] = appearance.SkirtAsset.ToString(); - Data["SocksAsset"] = appearance.SocksAsset.ToString(); - Data["UnderPantsAsset"] = appearance.UnderPantsAsset.ToString(); - Data["UnderShirtAsset"] = appearance.UnderShirtAsset.ToString(); + Data["BodyItem"] = appearance.Wearables[AvatarWearable.BODY][0].ItemID.ToString(); + Data["EyesItem"] = appearance.Wearables[AvatarWearable.EYES][0].ItemID.ToString(); + Data["GlovesItem"] = appearance.Wearables[AvatarWearable.GLOVES][0].ItemID.ToString(); + Data["HairItem"] = appearance.Wearables[AvatarWearable.HAIR][0].ItemID.ToString(); + Data["JacketItem"] = appearance.Wearables[AvatarWearable.JACKET][0].ItemID.ToString(); + Data["PantsItem"] = appearance.Wearables[AvatarWearable.PANTS][0].ItemID.ToString(); + Data["ShirtItem"] = appearance.Wearables[AvatarWearable.SHIRT][0].ItemID.ToString(); + Data["ShoesItem"] = appearance.Wearables[AvatarWearable.SHOES][0].ItemID.ToString(); + Data["SkinItem"] = appearance.Wearables[AvatarWearable.SKIN][0].ItemID.ToString(); + Data["SkirtItem"] = appearance.Wearables[AvatarWearable.SKIRT][0].ItemID.ToString(); + Data["SocksItem"] = appearance.Wearables[AvatarWearable.SOCKS][0].ItemID.ToString(); + Data["UnderPantsItem"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].ItemID.ToString(); + Data["UnderShirtItem"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].ItemID.ToString(); + + Data["BodyAsset"] = appearance.Wearables[AvatarWearable.BODY][0].AssetID.ToString(); + Data["EyesAsset"] = appearance.Wearables[AvatarWearable.EYES][0].AssetID.ToString(); + Data["GlovesAsset"] = appearance.Wearables[AvatarWearable.GLOVES][0].AssetID.ToString(); + Data["HairAsset"] = appearance.Wearables[AvatarWearable.HAIR][0].AssetID.ToString(); + Data["JacketAsset"] = appearance.Wearables[AvatarWearable.JACKET][0].AssetID.ToString(); + Data["PantsAsset"] = appearance.Wearables[AvatarWearable.PANTS][0].AssetID.ToString(); + Data["ShirtAsset"] = appearance.Wearables[AvatarWearable.SHIRT][0].AssetID.ToString(); + Data["ShoesAsset"] = appearance.Wearables[AvatarWearable.SHOES][0].AssetID.ToString(); + Data["SkinAsset"] = appearance.Wearables[AvatarWearable.SKIN][0].AssetID.ToString(); + Data["SkirtAsset"] = appearance.Wearables[AvatarWearable.SKIRT][0].AssetID.ToString(); + Data["SocksAsset"] = appearance.Wearables[AvatarWearable.SOCKS][0].AssetID.ToString(); + Data["UnderPantsAsset"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].AssetID.ToString(); + Data["UnderShirtAsset"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].AssetID.ToString(); // Attachments List attachments = appearance.GetAttachments(); @@ -193,33 +193,57 @@ namespace OpenSim.Services.Interfaces appearance.Serial = Int32.Parse(Data["Serial"]); // Wearables - appearance.BodyItem = UUID.Parse(Data["BodyItem"]); - appearance.EyesItem = UUID.Parse(Data["EyesItem"]); - appearance.GlovesItem = UUID.Parse(Data["GlovesItem"]); - appearance.HairItem = UUID.Parse(Data["HairItem"]); - appearance.JacketItem = UUID.Parse(Data["JacketItem"]); - appearance.PantsItem = UUID.Parse(Data["PantsItem"]); - appearance.ShirtItem = UUID.Parse(Data["ShirtItem"]); - appearance.ShoesItem = UUID.Parse(Data["ShoesItem"]); - appearance.SkinItem = UUID.Parse(Data["SkinItem"]); - appearance.SkirtItem = UUID.Parse(Data["SkirtItem"]); - appearance.SocksItem = UUID.Parse(Data["SocksItem"]); - appearance.UnderPantsItem = UUID.Parse(Data["UnderPantsItem"]); - appearance.UnderShirtItem = UUID.Parse(Data["UnderShirtItem"]); - - appearance.BodyAsset = UUID.Parse(Data["BodyAsset"]); - appearance.EyesAsset = UUID.Parse(Data["EyesAsset"]); - appearance.GlovesAsset = UUID.Parse(Data["GlovesAsset"]); - appearance.HairAsset = UUID.Parse(Data["HairAsset"]); - appearance.JacketAsset = UUID.Parse(Data["JacketAsset"]); - appearance.PantsAsset = UUID.Parse(Data["PantsAsset"]); - appearance.ShirtAsset = UUID.Parse(Data["ShirtAsset"]); - appearance.ShoesAsset = UUID.Parse(Data["ShoesAsset"]); - appearance.SkinAsset = UUID.Parse(Data["SkinAsset"]); - appearance.SkirtAsset = UUID.Parse(Data["SkirtAsset"]); - appearance.SocksAsset = UUID.Parse(Data["SocksAsset"]); - appearance.UnderPantsAsset = UUID.Parse(Data["UnderPantsAsset"]); - appearance.UnderShirtAsset = UUID.Parse(Data["UnderShirtAsset"]); + appearance.Wearables[AvatarWearable.BODY].Wear( + UUID.Parse(Data["BodyItem"]), + UUID.Parse(Data["BodyAsset"])); + + appearance.Wearables[AvatarWearable.SKIN].Wear( + UUID.Parse(Data["SkinItem"]), + UUID.Parse(Data["SkinAsset"])); + + appearance.Wearables[AvatarWearable.HAIR].Wear( + UUID.Parse(Data["HairItem"]), + UUID.Parse(Data["HairAsset"])); + + appearance.Wearables[AvatarWearable.EYES].Wear( + UUID.Parse(Data["EyesItem"]), + UUID.Parse(Data["EyesAsset"])); + + appearance.Wearables[AvatarWearable.SHIRT].Wear( + UUID.Parse(Data["ShirtItem"]), + UUID.Parse(Data["ShirtAsset"])); + + appearance.Wearables[AvatarWearable.PANTS].Wear( + UUID.Parse(Data["PantsItem"]), + UUID.Parse(Data["PantsAsset"])); + + appearance.Wearables[AvatarWearable.SHOES].Wear( + UUID.Parse(Data["ShoesItem"]), + UUID.Parse(Data["ShoesAsset"])); + + appearance.Wearables[AvatarWearable.SOCKS].Wear( + UUID.Parse(Data["SocksItem"]), + UUID.Parse(Data["SocksAsset"])); + + appearance.Wearables[AvatarWearable.JACKET].Wear( + UUID.Parse(Data["JacketItem"]), + UUID.Parse(Data["JacketAsset"])); + + appearance.Wearables[AvatarWearable.GLOVES].Wear( + UUID.Parse(Data["GlovesItem"]), + UUID.Parse(Data["GlovesAsset"])); + + appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear( + UUID.Parse(Data["UnderShirtItem"]), + UUID.Parse(Data["UnderShirtAsset"])); + + appearance.Wearables[AvatarWearable.UNDERPANTS].Wear( + UUID.Parse(Data["UnderPantsItem"]), + UUID.Parse(Data["UnderPantsAsset"])); + + appearance.Wearables[AvatarWearable.SKIRT].Wear( + UUID.Parse(Data["SkirtItem"]), + UUID.Parse(Data["SkirtAsset"])); // Attachments Dictionary attchs = new Dictionary(); -- cgit v1.1 From ade71c9ed7ce45b4acb1456df457fe94ad46bd23 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 30 Oct 2010 01:32:56 +0100 Subject: Change level of some logging messages, turning some info into arguably more appropriate debug to reduce console spam when log level is info --- .../Simulation/SimulationServiceConnector.cs | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index a5f748f..502fc82 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -117,7 +117,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); + m_log.Error("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); reason = e.Message; return false; } @@ -158,13 +158,13 @@ namespace OpenSim.Services.Connectors.Simulation AgentCreateRequest.ContentLength = buffer.Length; //Count bytes to send os = AgentCreateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}", + m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}", uri, destination.RegionName, destination.RegionLocX, destination.RegionLocY); } //catch (WebException ex) catch { - //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on ChildAgentUpdate {0}", ex.Message); + //m_log.ErrorFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on ChildAgentUpdate {0}", ex.Message); reason = "cannot contact remote region"; return false; } @@ -191,19 +191,19 @@ namespace OpenSim.Services.Connectors.Simulation webResponse = AgentCreateRequest.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on DoCreateChildAgentCall post"); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on DoCreateChildAgentCall post"); } else { sr = new StreamReader(webResponse.GetResponseStream()); response = sr.ReadToEnd().Trim(); - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response); + m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response); } } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); reason = "Destination did not reply"; return string.Empty; } @@ -231,7 +231,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (NullReferenceException e) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message); // check for old style response if (response.ToLower().StartsWith("true")) @@ -251,7 +251,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); return null; } // Add the input arguments @@ -284,7 +284,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message); return false; } //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri); @@ -303,7 +303,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: PackUpdateMessage failed with exception: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackUpdateMessage failed with exception: " + e.Message); } // Add the input arguments args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); @@ -332,12 +332,12 @@ namespace OpenSim.Services.Connectors.Simulation ChildUpdateRequest.ContentLength = buffer.Length; //Count bytes to send os = ChildUpdateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted AgentUpdate request to remote sim {0}", uri); + //m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Posted AgentUpdate request to remote sim {0}", uri); } catch (WebException ex) //catch { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message); return false; } @@ -348,7 +348,7 @@ namespace OpenSim.Services.Connectors.Simulation } // Let's wait for the response - //m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after ChildAgentUpdate"); + //m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after ChildAgentUpdate"); WebResponse webResponse = null; StreamReader sr = null; @@ -357,19 +357,19 @@ namespace OpenSim.Services.Connectors.Simulation webResponse = ChildUpdateRequest.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on ChilAgentUpdate post"); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on ChilAgentUpdate post"); } sr = new StreamReader(webResponse.GetResponseStream()); //reply = sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim(); sr.Close(); - //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was {0} ", reply); + //m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was {0} ", reply); } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate from {0}: {1}", uri, ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate from {0}: {1}", uri, ex.Message); // ignore, really } finally @@ -401,7 +401,7 @@ namespace OpenSim.Services.Connectors.Simulation webResponse = (HttpWebResponse)request.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on agent get "); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on agent get "); } sr = new StreamReader(webResponse.GetResponseStream()); @@ -412,7 +412,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent get {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent get {0}", ex.Message); // ignore, really return false; } @@ -453,7 +453,7 @@ namespace OpenSim.Services.Connectors.Simulation WebResponse webResponse = request.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on ReleaseAgent"); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on ReleaseAgent"); } sr = new StreamReader(webResponse.GetResponseStream()); @@ -465,7 +465,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ReleaseAgent {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ReleaseAgent {0}", ex.Message); return false; } finally @@ -486,7 +486,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message); return false; } @@ -502,7 +502,7 @@ namespace OpenSim.Services.Connectors.Simulation WebResponse webResponse = request.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on agent delete "); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on agent delete "); } sr = new StreamReader(webResponse.GetResponseStream()); @@ -514,7 +514,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message); return false; } finally @@ -579,11 +579,11 @@ namespace OpenSim.Services.Connectors.Simulation ObjectCreateRequest.ContentLength = buffer.Length; //Count bytes to send os = ObjectCreateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateObject request to remote sim {0}", uri); + m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateObject request to remote sim {0}", uri); } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on CreateObject {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on CreateObject {0}", ex.Message); return false; } finally @@ -601,7 +601,7 @@ namespace OpenSim.Services.Connectors.Simulation WebResponse webResponse = ObjectCreateRequest.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on CreateObject post"); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: Null reply on CreateObject post"); return false; } @@ -613,7 +613,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of CreateObject {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of CreateObject {0}", ex.Message); return false; } finally -- cgit v1.1 From ff7da2082d4d44b34c3ef312d5ec5e88c94931e1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 30 Oct 2010 02:25:25 +0100 Subject: This commit fixes all the appearance related null refs. Still can't log in, client displays a blank error box. --- OpenSim/Services/AvatarService/AvatarService.cs | 11 ++- OpenSim/Services/Interfaces/IAvatarService.cs | 117 +++++++++++++----------- 2 files changed, 72 insertions(+), 56 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs index a8ad413..53ca7c8 100644 --- a/OpenSim/Services/AvatarService/AvatarService.cs +++ b/OpenSim/Services/AvatarService/AvatarService.cs @@ -51,8 +51,6 @@ namespace OpenSim.Services.AvatarService m_log.Debug("[AVATAR SERVICE]: Starting avatar service"); } - // Get|SetAppearance should preserve existing semantics - // until AvatarData can be removed completely public AvatarAppearance GetAppearance(UUID principalID) { AvatarData avatar = GetAvatar(principalID); @@ -68,12 +66,15 @@ namespace OpenSim.Services.AvatarService public AvatarData GetAvatar(UUID principalID) { AvatarBaseData[] av = m_Database.Get("PrincipalID", principalID.ToString()); - if (av.Length == 0) - return null; - AvatarData ret = new AvatarData(); ret.Data = new Dictionary(); + if (av.Length == 0) + { + ret.AvatarType = 1; // SL avatar + return ret; + } + foreach (AvatarBaseData b in av) { if (b.Data["Name"] == "AvatarType") diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index a029fbc..186871a 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -190,60 +190,75 @@ namespace OpenSim.Services.Interfaces AvatarAppearance appearance = new AvatarAppearance(owner); try { - appearance.Serial = Int32.Parse(Data["Serial"]); + if (Data.ContainsKey("Serial")) + appearance.Serial = Int32.Parse(Data["Serial"]); // Wearables - appearance.Wearables[AvatarWearable.BODY].Wear( - UUID.Parse(Data["BodyItem"]), - UUID.Parse(Data["BodyAsset"])); + if (Data.ContainsKey("BodyItem")) + appearance.Wearables[AvatarWearable.BODY].Wear( + UUID.Parse(Data["BodyItem"]), + UUID.Parse(Data["BodyAsset"])); + + if (Data.ContainsKey("SkinItem")) + appearance.Wearables[AvatarWearable.SKIN].Wear( + UUID.Parse(Data["SkinItem"]), + UUID.Parse(Data["SkinAsset"])); + + if (Data.ContainsKey("HairItem")) + appearance.Wearables[AvatarWearable.HAIR].Wear( + UUID.Parse(Data["HairItem"]), + UUID.Parse(Data["HairAsset"])); + + if (Data.ContainsKey("EyesItem")) + appearance.Wearables[AvatarWearable.EYES].Wear( + UUID.Parse(Data["EyesItem"]), + UUID.Parse(Data["EyesAsset"])); + + if (Data.ContainsKey("ShirtItem")) + appearance.Wearables[AvatarWearable.SHIRT].Wear( + UUID.Parse(Data["ShirtItem"]), + UUID.Parse(Data["ShirtAsset"])); + + if (Data.ContainsKey("PantsItem")) + appearance.Wearables[AvatarWearable.PANTS].Wear( + UUID.Parse(Data["PantsItem"]), + UUID.Parse(Data["PantsAsset"])); + + if (Data.ContainsKey("ShoesItem")) + appearance.Wearables[AvatarWearable.SHOES].Wear( + UUID.Parse(Data["ShoesItem"]), + UUID.Parse(Data["ShoesAsset"])); + + if (Data.ContainsKey("SocksItem")) + appearance.Wearables[AvatarWearable.SOCKS].Wear( + UUID.Parse(Data["SocksItem"]), + UUID.Parse(Data["SocksAsset"])); + + if (Data.ContainsKey("JacketItem")) + appearance.Wearables[AvatarWearable.JACKET].Wear( + UUID.Parse(Data["JacketItem"]), + UUID.Parse(Data["JacketAsset"])); + + if (Data.ContainsKey("GlovesItem")) + appearance.Wearables[AvatarWearable.GLOVES].Wear( + UUID.Parse(Data["GlovesItem"]), + UUID.Parse(Data["GlovesAsset"])); + + if (Data.ContainsKey("UnderShirtItem")) + appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear( + UUID.Parse(Data["UnderShirtItem"]), + UUID.Parse(Data["UnderShirtAsset"])); + + if (Data.ContainsKey("UnderPantsItem")) + appearance.Wearables[AvatarWearable.UNDERPANTS].Wear( + UUID.Parse(Data["UnderPantsItem"]), + UUID.Parse(Data["UnderPantsAsset"])); + + if (Data.ContainsKey("SkirtItem")) + appearance.Wearables[AvatarWearable.SKIRT].Wear( + UUID.Parse(Data["SkirtItem"]), + UUID.Parse(Data["SkirtAsset"])); - appearance.Wearables[AvatarWearable.SKIN].Wear( - UUID.Parse(Data["SkinItem"]), - UUID.Parse(Data["SkinAsset"])); - - appearance.Wearables[AvatarWearable.HAIR].Wear( - UUID.Parse(Data["HairItem"]), - UUID.Parse(Data["HairAsset"])); - - appearance.Wearables[AvatarWearable.EYES].Wear( - UUID.Parse(Data["EyesItem"]), - UUID.Parse(Data["EyesAsset"])); - - appearance.Wearables[AvatarWearable.SHIRT].Wear( - UUID.Parse(Data["ShirtItem"]), - UUID.Parse(Data["ShirtAsset"])); - - appearance.Wearables[AvatarWearable.PANTS].Wear( - UUID.Parse(Data["PantsItem"]), - UUID.Parse(Data["PantsAsset"])); - - appearance.Wearables[AvatarWearable.SHOES].Wear( - UUID.Parse(Data["ShoesItem"]), - UUID.Parse(Data["ShoesAsset"])); - - appearance.Wearables[AvatarWearable.SOCKS].Wear( - UUID.Parse(Data["SocksItem"]), - UUID.Parse(Data["SocksAsset"])); - - appearance.Wearables[AvatarWearable.JACKET].Wear( - UUID.Parse(Data["JacketItem"]), - UUID.Parse(Data["JacketAsset"])); - - appearance.Wearables[AvatarWearable.GLOVES].Wear( - UUID.Parse(Data["GlovesItem"]), - UUID.Parse(Data["GlovesAsset"])); - - appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear( - UUID.Parse(Data["UnderShirtItem"]), - UUID.Parse(Data["UnderShirtAsset"])); - - appearance.Wearables[AvatarWearable.UNDERPANTS].Wear( - UUID.Parse(Data["UnderPantsItem"]), - UUID.Parse(Data["UnderPantsAsset"])); - - appearance.Wearables[AvatarWearable.SKIRT].Wear( - UUID.Parse(Data["SkirtItem"]), - UUID.Parse(Data["SkirtAsset"])); // Attachments Dictionary attchs = new Dictionary(); -- cgit v1.1