aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs22
1 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
index 4638ad0..6ba5ccf 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs
@@ -40,10 +40,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
40 { 40 {
41 private readonly Scene m_scene; 41 private readonly Scene m_scene;
42 private readonly IEnumerator<EntityBase> m_sogEnum; 42 private readonly IEnumerator<EntityBase> m_sogEnum;
43 private readonly ISecurityCredential m_security;
43 44
44 public IObjEnum(Scene scene) 45 public IObjEnum(Scene scene, ISecurityCredential security)
45 { 46 {
46 m_scene = scene; 47 m_scene = scene;
48 m_security = security;
47 m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator(); 49 m_sogEnum = m_scene.Entities.GetAllByType<SceneObjectGroup>().GetEnumerator();
48 } 50 }
49 51
@@ -66,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
66 { 68 {
67 get 69 get
68 { 70 {
69 return new SOPObject(m_scene, m_sogEnum.Current.LocalId); 71 return new SOPObject(m_scene, m_sogEnum.Current.LocalId, m_security);
70 } 72 }
71 } 73 }
72 74
@@ -79,17 +81,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
79 public class ObjectAccessor : System.MarshalByRefObject, IObjectAccessor 81 public class ObjectAccessor : System.MarshalByRefObject, IObjectAccessor
80 { 82 {
81 private readonly Scene m_scene; 83 private readonly Scene m_scene;
84 private readonly ISecurityCredential m_security;
82 85
83 public ObjectAccessor(Scene scene) 86 public ObjectAccessor(Scene scene, ISecurityCredential security)
84 { 87 {
85 m_scene = scene; 88 m_scene = scene;
89 m_security = security;
86 } 90 }
87 91
88 public IObject this[int index] 92 public IObject this[int index]
89 { 93 {
90 get 94 get
91 { 95 {
92 return new SOPObject(m_scene, m_scene.Entities[(uint)index].LocalId); 96 return new SOPObject(m_scene, m_scene.Entities[(uint)index].LocalId, m_security);
93 } 97 }
94 } 98 }
95 99
@@ -97,7 +101,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
97 { 101 {
98 get 102 get
99 { 103 {
100 return new SOPObject(m_scene, m_scene.Entities[index].LocalId); 104 return new SOPObject(m_scene, m_scene.Entities[index].LocalId, m_security);
101 } 105 }
102 } 106 }
103 107
@@ -105,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
105 { 109 {
106 get 110 get
107 { 111 {
108 return new SOPObject(m_scene, m_scene.Entities[index].LocalId); 112 return new SOPObject(m_scene, m_scene.Entities[index].LocalId, m_security);
109 } 113 }
110 } 114 }
111 115
@@ -117,20 +121,20 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
117 public IObject Create(Vector3 position, Quaternion rotation) 121 public IObject Create(Vector3 position, Quaternion rotation)
118 { 122 {
119 123
120 SceneObjectGroup sog = m_scene.AddNewPrim(m_scene.RegionInfo.MasterAvatarAssignedUUID, 124 SceneObjectGroup sog = m_scene.AddNewPrim(m_security.owner.GlobalID,
121 UUID.Zero, 125 UUID.Zero,
122 position, 126 position,
123 rotation, 127 rotation,
124 PrimitiveBaseShape.CreateBox()); 128 PrimitiveBaseShape.CreateBox());
125 129
126 IObject ret = new SOPObject(m_scene, sog.LocalId); 130 IObject ret = new SOPObject(m_scene, sog.LocalId, m_security);
127 131
128 return ret; 132 return ret;
129 } 133 }
130 134
131 public IEnumerator<IObject> GetEnumerator() 135 public IEnumerator<IObject> GetEnumerator()
132 { 136 {
133 return new IObjEnum(m_scene); 137 return new IObjEnum(m_scene, m_security);
134 } 138 }
135 139
136 IEnumerator IEnumerable.GetEnumerator() 140 IEnumerator IEnumerable.GetEnumerator()