From d7a19adcac21e2c19d01755de803d5210d4821ea Mon Sep 17 00:00:00 2001 From: idb Date: Sun, 21 Dec 2008 13:28:51 +0000 Subject: Persist script permission mask and granter --- .../Shared/Instance/ScriptSerializer.cs | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs index 17a864d..0ec039b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs @@ -179,6 +179,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance rootElement.AppendChild(plugins); + if (instance.ScriptTask != null) + { + if (instance.ScriptTask.PermsMask != 0 && instance.ScriptTask.PermsGranter != UUID.Zero) + { + XmlNode permissions = xmldoc.CreateElement("", "Permissions", ""); + XmlAttribute granter = xmldoc.CreateAttribute("", "granter", ""); + granter.Value = instance.ScriptTask.PermsGranter.ToString(); + permissions.Attributes.Append(granter); + XmlAttribute mask = xmldoc.CreateAttribute("", "mask", ""); + mask.Value = instance.ScriptTask.PermsMask.ToString(); + permissions.Attributes.Append(mask); + rootElement.AppendChild(permissions); + } + } + return xmldoc.InnerXml; } @@ -342,6 +357,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance case "Plugins": instance.PluginData = ReadList(part).Data; break; + case "Permissions": + string tmpPerm; + int mask = 0; + tmpPerm = part.Attributes.GetNamedItem("mask").Value; + if (tmpPerm != null) + { + int.TryParse(tmpPerm, out mask); + if (mask != 0) + { + tmpPerm = part.Attributes.GetNamedItem("granter").Value; + if (tmpPerm != null) + { + UUID granter = new UUID(); + UUID.TryParse(tmpPerm, out granter); + if (granter != UUID.Zero) + { + instance.ScriptTask.PermsMask = mask; + instance.ScriptTask.PermsGranter = granter; + } + } + } + } + break; } } } -- cgit v1.1