diff options
author | idb | 2008-12-21 13:28:51 +0000 |
---|---|---|
committer | idb | 2008-12-21 13:28:51 +0000 |
commit | d7a19adcac21e2c19d01755de803d5210d4821ea (patch) | |
tree | 59a3e35c38164ed5c0656b04ab775cc09fe1b6c3 /OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs | |
parent | Small null check in DeregisterHandlers. (diff) | |
download | opensim-SC-d7a19adcac21e2c19d01755de803d5210d4821ea.zip opensim-SC-d7a19adcac21e2c19d01755de803d5210d4821ea.tar.gz opensim-SC-d7a19adcac21e2c19d01755de803d5210d4821ea.tar.bz2 opensim-SC-d7a19adcac21e2c19d01755de803d5210d4821ea.tar.xz |
Persist script permission mask and granter
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs | 38 |
1 files changed, 38 insertions, 0 deletions
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 | |||
179 | 179 | ||
180 | rootElement.AppendChild(plugins); | 180 | rootElement.AppendChild(plugins); |
181 | 181 | ||
182 | if (instance.ScriptTask != null) | ||
183 | { | ||
184 | if (instance.ScriptTask.PermsMask != 0 && instance.ScriptTask.PermsGranter != UUID.Zero) | ||
185 | { | ||
186 | XmlNode permissions = xmldoc.CreateElement("", "Permissions", ""); | ||
187 | XmlAttribute granter = xmldoc.CreateAttribute("", "granter", ""); | ||
188 | granter.Value = instance.ScriptTask.PermsGranter.ToString(); | ||
189 | permissions.Attributes.Append(granter); | ||
190 | XmlAttribute mask = xmldoc.CreateAttribute("", "mask", ""); | ||
191 | mask.Value = instance.ScriptTask.PermsMask.ToString(); | ||
192 | permissions.Attributes.Append(mask); | ||
193 | rootElement.AppendChild(permissions); | ||
194 | } | ||
195 | } | ||
196 | |||
182 | return xmldoc.InnerXml; | 197 | return xmldoc.InnerXml; |
183 | } | 198 | } |
184 | 199 | ||
@@ -342,6 +357,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
342 | case "Plugins": | 357 | case "Plugins": |
343 | instance.PluginData = ReadList(part).Data; | 358 | instance.PluginData = ReadList(part).Data; |
344 | break; | 359 | break; |
360 | case "Permissions": | ||
361 | string tmpPerm; | ||
362 | int mask = 0; | ||
363 | tmpPerm = part.Attributes.GetNamedItem("mask").Value; | ||
364 | if (tmpPerm != null) | ||
365 | { | ||
366 | int.TryParse(tmpPerm, out mask); | ||
367 | if (mask != 0) | ||
368 | { | ||
369 | tmpPerm = part.Attributes.GetNamedItem("granter").Value; | ||
370 | if (tmpPerm != null) | ||
371 | { | ||
372 | UUID granter = new UUID(); | ||
373 | UUID.TryParse(tmpPerm, out granter); | ||
374 | if (granter != UUID.Zero) | ||
375 | { | ||
376 | instance.ScriptTask.PermsMask = mask; | ||
377 | instance.ScriptTask.PermsGranter = granter; | ||
378 | } | ||
379 | } | ||
380 | } | ||
381 | } | ||
382 | break; | ||
345 | } | 383 | } |
346 | } | 384 | } |
347 | } | 385 | } |