take code for old avination service that was never donated out of main path

This commit is contained in:
UbitUmarov
2025-02-15 20:40:41 +00:00
parent 6b73f2157e
commit 4516bee2aa

View File

@@ -411,37 +411,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (DebugLevel > 0)
m_log.Debug($"[ATTACHMENTS MODULE]: Rezzing any attachments for {sp.Name} from simulator-side");
XmlDocument doc = new();
Dictionary<UUID, string> itemData = new();
IAttachmentsService attServ = m_scene.RequestModuleInterface<IAttachmentsService>();
if (attServ is not null)
{
// old avination service that was never donated
m_log.Debug("[ATTACHMENT]: Loading attachment data from attachment service");
string stateData = attServ.Get(sp.UUID.ToString());
if (!string.IsNullOrEmpty(stateData))
{
try
{
XmlDocument doc = new();
doc.LoadXml(stateData);
XmlNodeList nodes = doc.GetElementsByTagName("Attachment");
if (nodes.Count > 0)
{
foreach (XmlNode n in nodes)
{
XmlElement elem = (XmlElement)n;
string itemID = elem.GetAttribute("ItemID");
string xml = elem.InnerXml;
itemData[new UUID(itemID)] = xml;
}
}
}
catch { }
}
}
Dictionary<UUID, string> itemData = new();
XmlNodeList nodes = doc.GetElementsByTagName("Attachment");
if (nodes.Count > 0)
{
foreach (XmlNode n in nodes)
{
XmlElement elem = (XmlElement)n;
string itemID = elem.GetAttribute("ItemID");
string xml = elem.InnerXml;
itemData[new UUID(itemID)] = xml;
}
}
List<AvatarAttachment> attachments = sp.Appearance.GetAttachments();
if(sp.IsNPC)