aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
diff options
context:
space:
mode:
authorMelanie2012-08-15 18:22:52 +0200
committerMelanie2012-08-15 18:22:52 +0200
commit44dc138d8b7a957f9db39fd1a017c0267dfd0829 (patch)
tree1b4b893b0ecbc1ef97a9d42dfb9767f3b133f52a /OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
parentAdd support for the extra params to scene and the event manager (diff)
downloadopensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.zip
opensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.tar.gz
opensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.tar.bz2
opensim-SC-44dc138d8b7a957f9db39fd1a017c0267dfd0829.tar.xz
Let the temp attachment module add a command to allow attaching without permissions and add support for this (incomplete!) to LSL
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs41
1 files changed, 38 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
index 68a484a..417b620 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
@@ -43,15 +43,13 @@ using OpenSim.Region.Framework.Scenes;
43 43
44namespace OpenSim.Region.OptionalModules.Avatar.Attachments 44namespace OpenSim.Region.OptionalModules.Avatar.Attachments
45{ 45{
46 /// <summary>
47 /// A module that just holds commands for inspecting avatar appearance.
48 /// </summary>
49 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "TempAttachmentsModule")] 46 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "TempAttachmentsModule")]
50 public class TempAttachmentsModule : INonSharedRegionModule 47 public class TempAttachmentsModule : INonSharedRegionModule
51 { 48 {
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 50
54 private Scene m_scene; 51 private Scene m_scene;
52 private IRegionConsole m_console;
55 53
56 public void Initialise(IConfigSource configSource) 54 public void Initialise(IConfigSource configSource)
57 { 55 {
@@ -74,6 +72,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
74 { 72 {
75 comms.RegisterScriptInvocation( this, "llAttachToAvatarTemp"); 73 comms.RegisterScriptInvocation( this, "llAttachToAvatarTemp");
76 m_log.DebugFormat("[TEMP ATTACHS]: Registered script functions"); 74 m_log.DebugFormat("[TEMP ATTACHS]: Registered script functions");
75 m_console = scene.RequestModuleInterface<IRegionConsole>();
76
77 if (m_console != null)
78 {
79 m_console.AddCommand("TempATtachModule", false, "set auto_grant_attach_perms", "set auto_grant_attach_perms true|false", "Allow objects owned by the region owner os estate managers to obtain attach permissions without asking the user", SetAutoGrantAttachPerms);
80 }
77 } 81 }
78 else 82 else
79 { 83 {
@@ -95,6 +99,37 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
95 get { return "TempAttachmentsModule"; } 99 get { return "TempAttachmentsModule"; }
96 } 100 }
97 101
102 private void SendConsoleOutput(UUID agentID, string text)
103 {
104 if (m_console == null)
105 return;
106
107 m_console.SendConsoleOutput(agentID, text);
108 }
109
110 private void SetAutoGrantAttachPerms(string module, string[] parms)
111 {
112 UUID agentID = new UUID(parms[parms.Length - 1]);
113 Array.Resize(ref parms, parms.Length - 1);
114
115 if (parms.Length != 3)
116 {
117 SendConsoleOutput(agentID, "Command parameter error");
118 return;
119 }
120
121 string val = parms[2];
122 if (val != "true" && val != "false")
123 {
124 SendConsoleOutput(agentID, "Command parameter error");
125 return;
126 }
127
128 m_scene.StoreExtraSetting("auto_grant_attach_perms", val);
129
130 SendConsoleOutput(agentID, String.Format("auto_grant_attach_perms set to {0}", val));
131 }
132
98 private void llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint) 133 private void llAttachToAvatarTemp(UUID host, UUID script, int attachmentPoint)
99 { 134 {
100 SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host); 135 SceneObjectPart hostPart = m_scene.GetSceneObjectPart(host);