aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs1571
1 files changed, 804 insertions, 767 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index 0b2cc9e..a0e0a37 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -45,534 +45,553 @@ namespace OpenSim.Region.Environment.Scenes
45 45
46 #region Object Permission Checks 46 #region Object Permission Checks
47 47
48 public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID); 48 public delegate uint GenerateClientFlags(LLUUID userID, LLUUID objectIDID);
49 private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>(); 49 private List<GenerateClientFlags> GenerateClientFlagsCheckFunctions = new List<GenerateClientFlags>();
50 50
51 public void addGenerateClientFlags(GenerateClientFlags delegateFunc) 51 public void addGenerateClientFlags(GenerateClientFlags delegateFunc)
52 { 52 {
53 if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc)) 53 if (!GenerateClientFlagsCheckFunctions.Contains(delegateFunc))
54 GenerateClientFlagsCheckFunctions.Add(delegateFunc); 54 GenerateClientFlagsCheckFunctions.Add(delegateFunc);
55 } 55 }
56 public void removeGenerateClientFlags(GenerateClientFlags delegateFunc)
57 {
58 if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc))
59 GenerateClientFlagsCheckFunctions.Remove(delegateFunc);
60 }
61 56
62 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID) 57 public void removeGenerateClientFlags(GenerateClientFlags delegateFunc)
63 { 58 {
64 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID); 59 if (GenerateClientFlagsCheckFunctions.Contains(delegateFunc))
65 60 GenerateClientFlagsCheckFunctions.Remove(delegateFunc);
66 if (part == null) 61 }
67 return 0;
68
69 uint perms=part.GetEffectiveObjectFlags() |
70 (uint)LLObject.ObjectFlags.ObjectModify |
71 (uint)LLObject.ObjectFlags.ObjectCopy |
72 (uint)LLObject.ObjectFlags.ObjectMove |
73 (uint)LLObject.ObjectFlags.ObjectTransfer |
74 (uint)LLObject.ObjectFlags.ObjectYouOwner |
75 (uint)LLObject.ObjectFlags.ObjectAnyOwner |
76 (uint)LLObject.ObjectFlags.ObjectOwnerModify |
77 (uint)LLObject.ObjectFlags.ObjectYouOfficer;
78
79 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
80 {
81 perms &= check(userID, objectID);
82 }
83 return perms;
84 }
85 62
86 public delegate void SetBypassPermissions(bool value); 63 public uint ExternalChecksGenerateClientFlags(LLUUID userID, LLUUID objectID)
87 private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>(); 64 {
65 SceneObjectPart part=m_scene.GetSceneObjectPart(objectID);
88 66
89 public void addSetBypassPermissions(SetBypassPermissions delegateFunc) 67 if (part == null)
90 { 68 return 0;
91 if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc))
92 SetBypassPermissionsCheckFunctions.Add(delegateFunc);
93 }
94 public void removeSetBypassPermissions(SetBypassPermissions delegateFunc)
95 {
96 if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc))
97 SetBypassPermissionsCheckFunctions.Remove(delegateFunc);
98 }
99 69
100 public void ExternalChecksSetBypassPermissions(bool value) 70 uint perms=part.GetEffectiveObjectFlags() |
71 (uint)LLObject.ObjectFlags.ObjectModify |
72 (uint)LLObject.ObjectFlags.ObjectCopy |
73 (uint)LLObject.ObjectFlags.ObjectMove |
74 (uint)LLObject.ObjectFlags.ObjectTransfer |
75 (uint)LLObject.ObjectFlags.ObjectYouOwner |
76 (uint)LLObject.ObjectFlags.ObjectAnyOwner |
77 (uint)LLObject.ObjectFlags.ObjectOwnerModify |
78 (uint)LLObject.ObjectFlags.ObjectYouOfficer;
79
80 foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
101 { 81 {
102 foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions) 82 perms &= check(userID, objectID);
103 {
104 check(value);
105 }
106 } 83 }
84 return perms;
85 }
107 86
108 public delegate bool BypassPermissions(); 87 public delegate void SetBypassPermissions(bool value);
109 private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>(); 88 private List<SetBypassPermissions> SetBypassPermissionsCheckFunctions = new List<SetBypassPermissions>();
110 89
111 public void addBypassPermissions(BypassPermissions delegateFunc) 90 public void addSetBypassPermissions(SetBypassPermissions delegateFunc)
112 { 91 {
113 if (!BypassPermissionsCheckFunctions.Contains(delegateFunc)) 92 if (!SetBypassPermissionsCheckFunctions.Contains(delegateFunc))
114 BypassPermissionsCheckFunctions.Add(delegateFunc); 93 SetBypassPermissionsCheckFunctions.Add(delegateFunc);
115 } 94 }
116 public void removeBypassPermissions(BypassPermissions delegateFunc) 95
96 public void removeSetBypassPermissions(SetBypassPermissions delegateFunc)
97 {
98 if (SetBypassPermissionsCheckFunctions.Contains(delegateFunc))
99 SetBypassPermissionsCheckFunctions.Remove(delegateFunc);
100 }
101
102 public void ExternalChecksSetBypassPermissions(bool value)
103 {
104 foreach (SetBypassPermissions check in SetBypassPermissionsCheckFunctions)
117 { 105 {
118 if (BypassPermissionsCheckFunctions.Contains(delegateFunc)) 106 check(value);
119 BypassPermissionsCheckFunctions.Remove(delegateFunc);
120 } 107 }
108 }
121 109
122 public bool ExternalChecksBypassPermissions() 110 public delegate bool BypassPermissions();
111 private List<BypassPermissions> BypassPermissionsCheckFunctions = new List<BypassPermissions>();
112
113 public void addBypassPermissions(BypassPermissions delegateFunc)
114 {
115 if (!BypassPermissionsCheckFunctions.Contains(delegateFunc))
116 BypassPermissionsCheckFunctions.Add(delegateFunc);
117 }
118
119 public void removeBypassPermissions(BypassPermissions delegateFunc)
120 {
121 if (BypassPermissionsCheckFunctions.Contains(delegateFunc))
122 BypassPermissionsCheckFunctions.Remove(delegateFunc);
123 }
124
125 public bool ExternalChecksBypassPermissions()
126 {
127 foreach (BypassPermissions check in BypassPermissionsCheckFunctions)
123 { 128 {
124 foreach (BypassPermissions check in BypassPermissionsCheckFunctions) 129 if (check() == false)
125 { 130 {
126 if (check() == false) 131 return false;
127 {
128 return false;
129 }
130 } 132 }
131 return true;
132 } 133 }
134 return true;
135 }
133 136
134 public delegate bool PropagatePermissions(); 137 public delegate bool PropagatePermissions();
135 private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>(); 138 private List<PropagatePermissions> PropagatePermissionsCheckFunctions = new List<PropagatePermissions>();
136 139
137 public void addPropagatePermissions(PropagatePermissions delegateFunc) 140 public void addPropagatePermissions(PropagatePermissions delegateFunc)
138 { 141 {
139 if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc)) 142 if (!PropagatePermissionsCheckFunctions.Contains(delegateFunc))
140 PropagatePermissionsCheckFunctions.Add(delegateFunc); 143 PropagatePermissionsCheckFunctions.Add(delegateFunc);
141 } 144 }
142 public void removePropagatePermissions(PropagatePermissions delegateFunc)
143 {
144 if (PropagatePermissionsCheckFunctions.Contains(delegateFunc))
145 PropagatePermissionsCheckFunctions.Remove(delegateFunc);
146 }
147 145
148 public bool ExternalChecksPropagatePermissions() 146 public void removePropagatePermissions(PropagatePermissions delegateFunc)
147 {
148 if (PropagatePermissionsCheckFunctions.Contains(delegateFunc))
149 PropagatePermissionsCheckFunctions.Remove(delegateFunc);
150 }
151
152 public bool ExternalChecksPropagatePermissions()
153 {
154 foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions)
149 { 155 {
150 foreach (PropagatePermissions check in PropagatePermissionsCheckFunctions) 156 if (check() == false)
151 { 157 {
152 if (check() == false) 158 return false;
153 {
154 return false;
155 }
156 } 159 }
157 return true;
158 } 160 }
161 return true;
162 }
159 163
160 #region REZ OBJECT 164 #region REZ OBJECT
161 public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene); 165 public delegate bool CanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition, Scene scene);
162 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>(); 166 private List<CanRezObject> CanRezObjectCheckFunctions = new List<CanRezObject>();
163 167
164 public void addCheckRezObject(CanRezObject delegateFunc) 168 public void addCheckRezObject(CanRezObject delegateFunc)
165 { 169 {
166 if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) 170 if (!CanRezObjectCheckFunctions.Contains(delegateFunc))
167 CanRezObjectCheckFunctions.Add(delegateFunc); 171 CanRezObjectCheckFunctions.Add(delegateFunc);
168 } 172 }
169 public void removeCheckRezObject(CanRezObject delegateFunc)
170 {
171 if (CanRezObjectCheckFunctions.Contains(delegateFunc))
172 CanRezObjectCheckFunctions.Remove(delegateFunc);
173 }
174 173
175 public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition) 174 public void removeCheckRezObject(CanRezObject delegateFunc)
175 {
176 if (CanRezObjectCheckFunctions.Contains(delegateFunc))
177 CanRezObjectCheckFunctions.Remove(delegateFunc);
178 }
179
180 public bool ExternalChecksCanRezObject(int objectCount, LLUUID owner, LLVector3 objectPosition)
181 {
182 foreach (CanRezObject check in CanRezObjectCheckFunctions)
176 { 183 {
177 foreach (CanRezObject check in CanRezObjectCheckFunctions) 184 if (check(objectCount, owner,objectPosition, m_scene) == false)
178 { 185 {
179 if (check(objectCount, owner,objectPosition, m_scene) == false) 186 return false;
180 {
181 return false;
182 }
183 } 187 }
184 return true;
185 } 188 }
189 return true;
190 }
186 191
187 #endregion 192 #endregion
188 193
189 #region DELETE OBJECT 194 #region DELETE OBJECT
190 public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene); 195 public delegate bool CanDeleteObject(LLUUID objectID, LLUUID deleter, Scene scene);
191 private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>(); 196 private List<CanDeleteObject> CanDeleteObjectCheckFunctions = new List<CanDeleteObject>();
192 197
193 public void addCheckDeleteObject(CanDeleteObject delegateFunc) 198 public void addCheckDeleteObject(CanDeleteObject delegateFunc)
194 { 199 {
195 if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc)) 200 if (!CanDeleteObjectCheckFunctions.Contains(delegateFunc))
196 CanDeleteObjectCheckFunctions.Add(delegateFunc); 201 CanDeleteObjectCheckFunctions.Add(delegateFunc);
197 } 202 }
198 public void removeCheckDeleteObject(CanDeleteObject delegateFunc)
199 {
200 if (CanDeleteObjectCheckFunctions.Contains(delegateFunc))
201 CanDeleteObjectCheckFunctions.Remove(delegateFunc);
202 }
203 203
204 public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter) 204 public void removeCheckDeleteObject(CanDeleteObject delegateFunc)
205 {
206 if (CanDeleteObjectCheckFunctions.Contains(delegateFunc))
207 CanDeleteObjectCheckFunctions.Remove(delegateFunc);
208 }
209
210 public bool ExternalChecksCanDeleteObject(LLUUID objectID, LLUUID deleter)
211 {
212 foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions)
205 { 213 {
206 foreach (CanDeleteObject check in CanDeleteObjectCheckFunctions) 214 if (check(objectID,deleter,m_scene) == false)
207 { 215 {
208 if (check(objectID,deleter,m_scene) == false) 216 return false;
209 {
210 return false;
211 }
212 } 217 }
213 return true;
214 } 218 }
219 return true;
220 }
215 221
216 #endregion 222 #endregion
217 223
218 #region TAKE OBJECT 224 #region TAKE OBJECT
219 public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene); 225 public delegate bool CanTakeObject(LLUUID objectID, LLUUID stealer, Scene scene);
220 private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>(); 226 private List<CanTakeObject> CanTakeObjectCheckFunctions = new List<CanTakeObject>();
221 227
222 public void addCheckTakeObject(CanTakeObject delegateFunc) 228 public void addCheckTakeObject(CanTakeObject delegateFunc)
223 { 229 {
224 if (!CanTakeObjectCheckFunctions.Contains(delegateFunc)) 230 if (!CanTakeObjectCheckFunctions.Contains(delegateFunc))
225 CanTakeObjectCheckFunctions.Add(delegateFunc); 231 CanTakeObjectCheckFunctions.Add(delegateFunc);
226 } 232 }
227 public void removeCheckTakeObject(CanTakeObject delegateFunc)
228 {
229 if (CanTakeObjectCheckFunctions.Contains(delegateFunc))
230 CanTakeObjectCheckFunctions.Remove(delegateFunc);
231 }
232 233
233 public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID) 234 public void removeCheckTakeObject(CanTakeObject delegateFunc)
235 {
236 if (CanTakeObjectCheckFunctions.Contains(delegateFunc))
237 CanTakeObjectCheckFunctions.Remove(delegateFunc);
238 }
239
240 public bool ExternalChecksCanTakeObject(LLUUID objectID, LLUUID AvatarTakingUUID)
241 {
242 foreach (CanTakeObject check in CanTakeObjectCheckFunctions)
234 { 243 {
235 foreach (CanTakeObject check in CanTakeObjectCheckFunctions) 244 if (check(objectID, AvatarTakingUUID, m_scene) == false)
236 { 245 {
237 if (check(objectID, AvatarTakingUUID, m_scene) == false) 246 return false;
238 {
239 return false;
240 }
241 } 247 }
242 return true;
243 } 248 }
249 return true;
250 }
244 251
245 #endregion 252 #endregion
246 253
247 #region TAKE COPY OBJECT 254 #region TAKE COPY OBJECT
248 public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene); 255 public delegate bool CanTakeCopyObject(LLUUID objectID, LLUUID userID, Scene inScene);
249 private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>(); 256 private List<CanTakeCopyObject> CanTakeCopyObjectCheckFunctions = new List<CanTakeCopyObject>();
250 257
251 public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc) 258 public void addCheckTakeCopyObject(CanTakeCopyObject delegateFunc)
252 { 259 {
253 if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc)) 260 if (!CanTakeCopyObjectCheckFunctions.Contains(delegateFunc))
254 CanTakeCopyObjectCheckFunctions.Add(delegateFunc); 261 CanTakeCopyObjectCheckFunctions.Add(delegateFunc);
255 } 262 }
256 public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc)
257 {
258 if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc))
259 CanTakeCopyObjectCheckFunctions.Remove(delegateFunc);
260 }
261 263
262 public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID) 264 public void removeCheckTakeCopyObject(CanTakeCopyObject delegateFunc)
265 {
266 if (CanTakeCopyObjectCheckFunctions.Contains(delegateFunc))
267 CanTakeCopyObjectCheckFunctions.Remove(delegateFunc);
268 }
269
270 public bool ExternalChecksCanTakeCopyObject(LLUUID objectID, LLUUID userID)
271 {
272 foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions)
263 { 273 {
264 foreach (CanTakeCopyObject check in CanTakeCopyObjectCheckFunctions) 274 if (check(objectID,userID,m_scene) == false)
265 { 275 {
266 if (check(objectID,userID,m_scene) == false) 276 return false;
267 {
268 return false;
269 }
270 } 277 }
271 return true;
272 } 278 }
279 return true;
280 }
273 281
274 #endregion 282 #endregion
275 283
276 #region DUPLICATE OBJECT 284 #region DUPLICATE OBJECT
277 public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition); 285 public delegate bool CanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, Scene scene, LLVector3 objectPosition);
278 private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>(); 286 private List<CanDuplicateObject> CanDuplicateObjectCheckFunctions = new List<CanDuplicateObject>();
279 287
280 public void addCheckDuplicateObject(CanDuplicateObject delegateFunc) 288 public void addCheckDuplicateObject(CanDuplicateObject delegateFunc)
281 { 289 {
282 if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc)) 290 if (!CanDuplicateObjectCheckFunctions.Contains(delegateFunc))
283 CanDuplicateObjectCheckFunctions.Add(delegateFunc); 291 CanDuplicateObjectCheckFunctions.Add(delegateFunc);
284 } 292 }
285 public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc)
286 {
287 if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc))
288 CanDuplicateObjectCheckFunctions.Remove(delegateFunc);
289 }
290 293
291 public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition) 294 public void removeCheckDuplicateObject(CanDuplicateObject delegateFunc)
295 {
296 if (CanDuplicateObjectCheckFunctions.Contains(delegateFunc))
297 CanDuplicateObjectCheckFunctions.Remove(delegateFunc);
298 }
299
300 public bool ExternalChecksCanDuplicateObject(int objectCount, LLUUID objectID, LLUUID owner, LLVector3 objectPosition)
301 {
302 foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions)
292 { 303 {
293 foreach (CanDuplicateObject check in CanDuplicateObjectCheckFunctions) 304 if (check(objectCount, objectID, owner, m_scene, objectPosition) == false)
294 { 305 {
295 if (check(objectCount, objectID, owner, m_scene, objectPosition) == false) 306 return false;
296 {
297 return false;
298 }
299 } 307 }
300 return true;
301 } 308 }
309 return true;
310 }
302 311
303 #endregion 312 #endregion
304 313
305 #region EDIT OBJECT 314 #region EDIT OBJECT
306 public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene); 315 public delegate bool CanEditObject(LLUUID objectID, LLUUID editorID, Scene scene);
307 private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>(); 316 private List<CanEditObject> CanEditObjectCheckFunctions = new List<CanEditObject>();
308 317
309 public void addCheckEditObject(CanEditObject delegateFunc) 318 public void addCheckEditObject(CanEditObject delegateFunc)
310 { 319 {
311 if (!CanEditObjectCheckFunctions.Contains(delegateFunc)) 320 if (!CanEditObjectCheckFunctions.Contains(delegateFunc))
312 CanEditObjectCheckFunctions.Add(delegateFunc); 321 CanEditObjectCheckFunctions.Add(delegateFunc);
313 } 322 }
314 public void removeCheckEditObject(CanEditObject delegateFunc)
315 {
316 if (CanEditObjectCheckFunctions.Contains(delegateFunc))
317 CanEditObjectCheckFunctions.Remove(delegateFunc);
318 }
319 323
320 public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID) 324 public void removeCheckEditObject(CanEditObject delegateFunc)
325 {
326 if (CanEditObjectCheckFunctions.Contains(delegateFunc))
327 CanEditObjectCheckFunctions.Remove(delegateFunc);
328 }
329
330 public bool ExternalChecksCanEditObject(LLUUID objectID, LLUUID editorID)
331 {
332 foreach (CanEditObject check in CanEditObjectCheckFunctions)
321 { 333 {
322 foreach (CanEditObject check in CanEditObjectCheckFunctions) 334 if (check(objectID, editorID, m_scene) == false)
323 { 335 {
324 if (check(objectID, editorID, m_scene) == false) 336 return false;
325 {
326 return false;
327 }
328 } 337 }
329 return true;
330 } 338 }
339 return true;
340 }
331 341
332 #endregion 342 #endregion
333 343
334 #region MOVE OBJECT 344 #region MOVE OBJECT
335 public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene); 345 public delegate bool CanMoveObject(LLUUID objectID, LLUUID moverID, Scene scene);
336 private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>(); 346 private List<CanMoveObject> CanMoveObjectCheckFunctions = new List<CanMoveObject>();
337 347
338 public void addCheckMoveObject(CanMoveObject delegateFunc) 348 public void addCheckMoveObject(CanMoveObject delegateFunc)
339 { 349 {
340 if (!CanMoveObjectCheckFunctions.Contains(delegateFunc)) 350 if (!CanMoveObjectCheckFunctions.Contains(delegateFunc))
341 CanMoveObjectCheckFunctions.Add(delegateFunc); 351 CanMoveObjectCheckFunctions.Add(delegateFunc);
342 } 352 }
343 public void removeCheckMoveObject(CanMoveObject delegateFunc)
344 {
345 if (CanMoveObjectCheckFunctions.Contains(delegateFunc))
346 CanMoveObjectCheckFunctions.Remove(delegateFunc);
347 }
348 353
349 public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID) 354 public void removeCheckMoveObject(CanMoveObject delegateFunc)
355 {
356 if (CanMoveObjectCheckFunctions.Contains(delegateFunc))
357 CanMoveObjectCheckFunctions.Remove(delegateFunc);
358 }
359
360 public bool ExternalChecksCanMoveObject(LLUUID objectID, LLUUID moverID)
361 {
362 foreach (CanMoveObject check in CanMoveObjectCheckFunctions)
350 { 363 {
351 foreach (CanMoveObject check in CanMoveObjectCheckFunctions) 364 if (check(objectID,moverID,m_scene) == false)
352 { 365 {
353 if (check(objectID,moverID,m_scene) == false) 366 return false;
354 {
355 return false;
356 }
357 } 367 }
358 return true;
359 } 368 }
369 return true;
370 }
360 371
361 #endregion 372 #endregion
362 373
363 #region OBJECT ENTRY 374 #region OBJECT ENTRY
364 public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene); 375 public delegate bool CanObjectEntry(LLUUID objectID, LLVector3 newPoint, Scene scene);
365 private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>(); 376 private List<CanObjectEntry> CanObjectEntryCheckFunctions = new List<CanObjectEntry>();
366 377
367 public void addCheckObjectEntry(CanObjectEntry delegateFunc) 378 public void addCheckObjectEntry(CanObjectEntry delegateFunc)
368 { 379 {
369 if (!CanObjectEntryCheckFunctions.Contains(delegateFunc)) 380 if (!CanObjectEntryCheckFunctions.Contains(delegateFunc))
370 CanObjectEntryCheckFunctions.Add(delegateFunc); 381 CanObjectEntryCheckFunctions.Add(delegateFunc);
371 } 382 }
372 public void removeCheckObjectEntry(CanObjectEntry delegateFunc)
373 {
374 if (CanObjectEntryCheckFunctions.Contains(delegateFunc))
375 CanObjectEntryCheckFunctions.Remove(delegateFunc);
376 }
377 383
378 public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint) 384 public void removeCheckObjectEntry(CanObjectEntry delegateFunc)
385 {
386 if (CanObjectEntryCheckFunctions.Contains(delegateFunc))
387 CanObjectEntryCheckFunctions.Remove(delegateFunc);
388 }
389
390 public bool ExternalChecksCanObjectEntry(LLUUID objectID, LLVector3 newPoint)
391 {
392 foreach (CanObjectEntry check in CanObjectEntryCheckFunctions)
379 { 393 {
380 foreach (CanObjectEntry check in CanObjectEntryCheckFunctions) 394 if (check(objectID, newPoint, m_scene) == false)
381 { 395 {
382 if (check(objectID, newPoint, m_scene) == false) 396 return false;
383 {
384 return false;
385 }
386 } 397 }
387 return true;
388 } 398 }
399 return true;
400 }
389 401
390 #endregion 402 #endregion
391 403
392 #region RETURN OBJECT 404 #region RETURN OBJECT
393 public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene); 405 public delegate bool CanReturnObject(LLUUID objectID, LLUUID returnerID, Scene scene);
394 private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>(); 406 private List<CanReturnObject> CanReturnObjectCheckFunctions = new List<CanReturnObject>();
395 407
396 public void addCheckReturnObject(CanReturnObject delegateFunc) 408 public void addCheckReturnObject(CanReturnObject delegateFunc)
397 { 409 {
398 if (!CanReturnObjectCheckFunctions.Contains(delegateFunc)) 410 if (!CanReturnObjectCheckFunctions.Contains(delegateFunc))
399 CanReturnObjectCheckFunctions.Add(delegateFunc); 411 CanReturnObjectCheckFunctions.Add(delegateFunc);
400 } 412 }
401 public void removeCheckReturnObject(CanReturnObject delegateFunc)
402 {
403 if (CanReturnObjectCheckFunctions.Contains(delegateFunc))
404 CanReturnObjectCheckFunctions.Remove(delegateFunc);
405 }
406 413
407 public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID) 414 public void removeCheckReturnObject(CanReturnObject delegateFunc)
415 {
416 if (CanReturnObjectCheckFunctions.Contains(delegateFunc))
417 CanReturnObjectCheckFunctions.Remove(delegateFunc);
418 }
419
420 public bool ExternalChecksCanReturnObject(LLUUID objectID, LLUUID returnerID)
421 {
422 foreach (CanReturnObject check in CanReturnObjectCheckFunctions)
408 { 423 {
409 foreach (CanReturnObject check in CanReturnObjectCheckFunctions) 424 if (check(objectID,returnerID,m_scene) == false)
410 { 425 {
411 if (check(objectID,returnerID,m_scene) == false) 426 return false;
412 {
413 return false;
414 }
415 } 427 }
416 return true;
417 } 428 }
429 return true;
430 }
418 431
419 #endregion 432 #endregion
420 433
421 #region INSTANT MESSAGE 434 #region INSTANT MESSAGE
422 public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene); 435 public delegate bool CanInstantMessage(LLUUID user, LLUUID target, Scene startScene);
423 private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>(); 436 private List<CanInstantMessage> CanInstantMessageCheckFunctions = new List<CanInstantMessage>();
424 437
425 public void addCheckInstantMessage(CanInstantMessage delegateFunc) 438 public void addCheckInstantMessage(CanInstantMessage delegateFunc)
426 { 439 {
427 if (!CanInstantMessageCheckFunctions.Contains(delegateFunc)) 440 if (!CanInstantMessageCheckFunctions.Contains(delegateFunc))
428 CanInstantMessageCheckFunctions.Add(delegateFunc); 441 CanInstantMessageCheckFunctions.Add(delegateFunc);
429 } 442 }
430 public void removeCheckInstantMessage(CanInstantMessage delegateFunc) 443
431 { 444 public void removeCheckInstantMessage(CanInstantMessage delegateFunc)
432 if (CanInstantMessageCheckFunctions.Contains(delegateFunc)) 445 {
433 CanInstantMessageCheckFunctions.Remove(delegateFunc); 446 if (CanInstantMessageCheckFunctions.Contains(delegateFunc))
434 } 447 CanInstantMessageCheckFunctions.Remove(delegateFunc);
448 }
435 449
436 public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target) 450 public bool ExternalChecksCanInstantMessage(LLUUID user, LLUUID target)
451 {
452 foreach (CanInstantMessage check in CanInstantMessageCheckFunctions)
437 { 453 {
438 foreach (CanInstantMessage check in CanInstantMessageCheckFunctions) 454 if (check(user, target, m_scene) == false)
439 { 455 {
440 if (check(user, target, m_scene) == false) 456 return false;
441 {
442 return false;
443 }
444 } 457 }
445 return true;
446 } 458 }
459 return true;
460 }
447 461
448 #endregion 462 #endregion
449 463
450 #region INVENTORY TRANSFER 464 #region INVENTORY TRANSFER
451 public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene); 465 public delegate bool CanInventoryTransfer(LLUUID user, LLUUID target, Scene startScene);
452 private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>(); 466 private List<CanInventoryTransfer> CanInventoryTransferCheckFunctions = new List<CanInventoryTransfer>();
453 467
454 public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc) 468 public void addCheckInventoryTransfer(CanInventoryTransfer delegateFunc)
455 { 469 {
456 if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc)) 470 if (!CanInventoryTransferCheckFunctions.Contains(delegateFunc))
457 CanInventoryTransferCheckFunctions.Add(delegateFunc); 471 CanInventoryTransferCheckFunctions.Add(delegateFunc);
458 } 472 }
459 public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc) 473
474 public void removeCheckInventoryTransfer(CanInventoryTransfer delegateFunc)
460 { 475 {
461 if (CanInventoryTransferCheckFunctions.Contains(delegateFunc)) 476 if (CanInventoryTransferCheckFunctions.Contains(delegateFunc))
462 CanInventoryTransferCheckFunctions.Remove(delegateFunc); 477 CanInventoryTransferCheckFunctions.Remove(delegateFunc);
463 } 478 }
464 479
465 public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target) 480 public bool ExternalChecksCanInventoryTransfer(LLUUID user, LLUUID target)
481 {
482 foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions)
466 { 483 {
467 foreach (CanInventoryTransfer check in CanInventoryTransferCheckFunctions) 484 if (check(user, target, m_scene) == false)
468 { 485 {
469 if (check(user, target, m_scene) == false) 486 return false;
470 {
471 return false;
472 }
473 } 487 }
474 return true;
475 } 488 }
489 return true;
490 }
476 491
477 #endregion 492 #endregion
478 493
479 #region VIEW SCRIPT 494 #region VIEW SCRIPT
480 public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 495 public delegate bool CanViewScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
481 private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>(); 496 private List<CanViewScript> CanViewScriptCheckFunctions = new List<CanViewScript>();
482 497
483 public void addCheckViewScript(CanViewScript delegateFunc) 498 public void addCheckViewScript(CanViewScript delegateFunc)
484 { 499 {
485 if (!CanViewScriptCheckFunctions.Contains(delegateFunc)) 500 if (!CanViewScriptCheckFunctions.Contains(delegateFunc))
486 CanViewScriptCheckFunctions.Add(delegateFunc); 501 CanViewScriptCheckFunctions.Add(delegateFunc);
487 } 502 }
488 public void removeCheckViewScript(CanViewScript delegateFunc)
489 {
490 if (CanViewScriptCheckFunctions.Contains(delegateFunc))
491 CanViewScriptCheckFunctions.Remove(delegateFunc);
492 }
493 503
494 public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user) 504 public void removeCheckViewScript(CanViewScript delegateFunc)
505 {
506 if (CanViewScriptCheckFunctions.Contains(delegateFunc))
507 CanViewScriptCheckFunctions.Remove(delegateFunc);
508 }
509
510 public bool ExternalChecksCanViewScript(LLUUID script, LLUUID objectID, LLUUID user)
511 {
512 foreach (CanViewScript check in CanViewScriptCheckFunctions)
495 { 513 {
496 foreach (CanViewScript check in CanViewScriptCheckFunctions) 514 if (check(script, objectID, user, m_scene) == false)
497 { 515 {
498 if (check(script, objectID, user, m_scene) == false) 516 return false;
499 {
500 return false;
501 }
502 } 517 }
503 return true;
504 } 518 }
519 return true;
520 }
505 521
506 public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 522 public delegate bool CanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
507 private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>(); 523 private List<CanViewNotecard> CanViewNotecardCheckFunctions = new List<CanViewNotecard>();
508 524
509 public void addCheckViewNotecard(CanViewNotecard delegateFunc) 525 public void addCheckViewNotecard(CanViewNotecard delegateFunc)
510 { 526 {
511 if (!CanViewNotecardCheckFunctions.Contains(delegateFunc)) 527 if (!CanViewNotecardCheckFunctions.Contains(delegateFunc))
512 CanViewNotecardCheckFunctions.Add(delegateFunc); 528 CanViewNotecardCheckFunctions.Add(delegateFunc);
513 } 529 }
514 public void removeCheckViewNotecard(CanViewNotecard delegateFunc) 530
515 { 531 public void removeCheckViewNotecard(CanViewNotecard delegateFunc)
516 if (CanViewNotecardCheckFunctions.Contains(delegateFunc)) 532 {
517 CanViewNotecardCheckFunctions.Remove(delegateFunc); 533 if (CanViewNotecardCheckFunctions.Contains(delegateFunc))
518 } 534 CanViewNotecardCheckFunctions.Remove(delegateFunc);
535 }
519 536
520 public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user) 537 public bool ExternalChecksCanViewNotecard(LLUUID script, LLUUID objectID, LLUUID user)
538 {
539 foreach (CanViewNotecard check in CanViewNotecardCheckFunctions)
521 { 540 {
522 foreach (CanViewNotecard check in CanViewNotecardCheckFunctions) 541 if (check(script, objectID, user, m_scene) == false)
523 { 542 {
524 if (check(script, objectID, user, m_scene) == false) 543 return false;
525 {
526 return false;
527 }
528 } 544 }
529 return true;
530 } 545 }
546 return true;
547 }
548
549 #endregion
531 550
532 #endregion 551 #region EDIT SCRIPT
552 public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
553 private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>();
533 554
534 #region EDIT SCRIPT 555 public void addCheckEditScript(CanEditScript delegateFunc)
535 public delegate bool CanEditScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 556 {
536 private List<CanEditScript> CanEditScriptCheckFunctions = new List<CanEditScript>(); 557 if (!CanEditScriptCheckFunctions.Contains(delegateFunc))
558 CanEditScriptCheckFunctions.Add(delegateFunc);
559 }
537 560
538 public void addCheckEditScript(CanEditScript delegateFunc) 561 public void removeCheckEditScript(CanEditScript delegateFunc)
539 { 562 {
540 if (!CanEditScriptCheckFunctions.Contains(delegateFunc)) 563 if (CanEditScriptCheckFunctions.Contains(delegateFunc))
541 CanEditScriptCheckFunctions.Add(delegateFunc); 564 CanEditScriptCheckFunctions.Remove(delegateFunc);
542 } 565 }
543 public void removeCheckEditScript(CanEditScript delegateFunc)
544 {
545 if (CanEditScriptCheckFunctions.Contains(delegateFunc))
546 CanEditScriptCheckFunctions.Remove(delegateFunc);
547 }
548 566
549 public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user) 567 public bool ExternalChecksCanEditScript(LLUUID script, LLUUID objectID, LLUUID user)
568 {
569 foreach (CanEditScript check in CanEditScriptCheckFunctions)
550 { 570 {
551 foreach (CanEditScript check in CanEditScriptCheckFunctions) 571 if (check(script, objectID, user, m_scene) == false)
552 { 572 {
553 if (check(script, objectID, user, m_scene) == false) 573 return false;
554 {
555 return false;
556 }
557 } 574 }
558 return true;
559 } 575 }
576 return true;
577 }
560 578
561 public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene); 579 public delegate bool CanEditNotecard(LLUUID notecard, LLUUID objectID, LLUUID user, Scene scene);
562 private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>(); 580 private List<CanEditNotecard> CanEditNotecardCheckFunctions = new List<CanEditNotecard>();
563 581
564 public void addCheckEditNotecard(CanEditNotecard delegateFunc) 582 public void addCheckEditNotecard(CanEditNotecard delegateFunc)
565 { 583 {
566 if (!CanEditNotecardCheckFunctions.Contains(delegateFunc)) 584 if (!CanEditNotecardCheckFunctions.Contains(delegateFunc))
567 CanEditNotecardCheckFunctions.Add(delegateFunc); 585 CanEditNotecardCheckFunctions.Add(delegateFunc);
568 } 586 }
569 public void removeCheckEditNotecard(CanEditNotecard delegateFunc)
570 {
571 if (CanEditNotecardCheckFunctions.Contains(delegateFunc))
572 CanEditNotecardCheckFunctions.Remove(delegateFunc);
573 }
574 587
575 public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user) 588 public void removeCheckEditNotecard(CanEditNotecard delegateFunc)
589 {
590 if (CanEditNotecardCheckFunctions.Contains(delegateFunc))
591 CanEditNotecardCheckFunctions.Remove(delegateFunc);
592 }
593
594 public bool ExternalChecksCanEditNotecard(LLUUID script, LLUUID objectID, LLUUID user)
576 { 595 {
577 foreach (CanEditNotecard check in CanEditNotecardCheckFunctions) 596 foreach (CanEditNotecard check in CanEditNotecardCheckFunctions)
578 { 597 {
@@ -584,388 +603,402 @@ namespace OpenSim.Region.Environment.Scenes
584 return true; 603 return true;
585 } 604 }
586 605
587 #endregion 606 #endregion
588 607
589 #region RUN SCRIPT (When Script Placed in Object) 608 #region RUN SCRIPT (When Script Placed in Object)
590 public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene); 609 public delegate bool CanRunScript(LLUUID script, LLUUID objectID, LLUUID user, Scene scene);
591 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>(); 610 private List<CanRunScript> CanRunScriptCheckFunctions = new List<CanRunScript>();
592 611
593 public void addCheckRunScript(CanRunScript delegateFunc) 612 public void addCheckRunScript(CanRunScript delegateFunc)
594 { 613 {
595 if (!CanRunScriptCheckFunctions.Contains(delegateFunc)) 614 if (!CanRunScriptCheckFunctions.Contains(delegateFunc))
596 CanRunScriptCheckFunctions.Add(delegateFunc); 615 CanRunScriptCheckFunctions.Add(delegateFunc);
597 } 616 }
598 public void removeCheckRunScript(CanRunScript delegateFunc)
599 {
600 if (CanRunScriptCheckFunctions.Contains(delegateFunc))
601 CanRunScriptCheckFunctions.Remove(delegateFunc);
602 }
603 617
604 public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user) 618 public void removeCheckRunScript(CanRunScript delegateFunc)
619 {
620 if (CanRunScriptCheckFunctions.Contains(delegateFunc))
621 CanRunScriptCheckFunctions.Remove(delegateFunc);
622 }
623
624 public bool ExternalChecksCanRunScript(LLUUID script, LLUUID objectID, LLUUID user)
625 {
626 foreach (CanRunScript check in CanRunScriptCheckFunctions)
605 { 627 {
606 foreach (CanRunScript check in CanRunScriptCheckFunctions) 628 if (check(script, objectID, user, m_scene) == false)
607 { 629 {
608 if (check(script, objectID, user, m_scene) == false) 630 return false;
609 {
610 return false;
611 }
612 } 631 }
613 return true;
614 } 632 }
633 return true;
634 }
615 635
616 #endregion 636 #endregion
617 637
618 #region START SCRIPT (When Script run box is Checked after placed in object) 638 #region START SCRIPT (When Script run box is Checked after placed in object)
619 public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene); 639 public delegate bool CanStartScript(LLUUID script, LLUUID user, Scene scene);
620 private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>(); 640 private List<CanStartScript> CanStartScriptCheckFunctions = new List<CanStartScript>();
621 641
622 public void addCheckStartScript(CanStartScript delegateFunc) 642 public void addCheckStartScript(CanStartScript delegateFunc)
623 { 643 {
624 if (!CanStartScriptCheckFunctions.Contains(delegateFunc)) 644 if (!CanStartScriptCheckFunctions.Contains(delegateFunc))
625 CanStartScriptCheckFunctions.Add(delegateFunc); 645 CanStartScriptCheckFunctions.Add(delegateFunc);
626 } 646 }
627 public void removeCheckStartScript(CanStartScript delegateFunc)
628 {
629 if (CanStartScriptCheckFunctions.Contains(delegateFunc))
630 CanStartScriptCheckFunctions.Remove(delegateFunc);
631 }
632 647
633 public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user) 648 public void removeCheckStartScript(CanStartScript delegateFunc)
649 {
650 if (CanStartScriptCheckFunctions.Contains(delegateFunc))
651 CanStartScriptCheckFunctions.Remove(delegateFunc);
652 }
653
654 public bool ExternalChecksCanStartScript(LLUUID script, LLUUID user)
655 {
656 foreach (CanStartScript check in CanStartScriptCheckFunctions)
634 { 657 {
635 foreach (CanStartScript check in CanStartScriptCheckFunctions) 658 if (check(script, user, m_scene) == false)
636 { 659 {
637 if (check(script, user, m_scene) == false) 660 return false;
638 {
639 return false;
640 }
641 } 661 }
642 return true;
643 } 662 }
663 return true;
664 }
644 665
645 #endregion 666 #endregion
646 667
647 #region STOP SCRIPT (When Script run box is unchecked after placed in object) 668 #region STOP SCRIPT (When Script run box is unchecked after placed in object)
648 public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene); 669 public delegate bool CanStopScript(LLUUID script, LLUUID user, Scene scene);
649 private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>(); 670 private List<CanStopScript> CanStopScriptCheckFunctions = new List<CanStopScript>();
650 671
651 public void addCheckStopScript(CanStopScript delegateFunc) 672 public void addCheckStopScript(CanStopScript delegateFunc)
652 { 673 {
653 if (!CanStopScriptCheckFunctions.Contains(delegateFunc)) 674 if (!CanStopScriptCheckFunctions.Contains(delegateFunc))
654 CanStopScriptCheckFunctions.Add(delegateFunc); 675 CanStopScriptCheckFunctions.Add(delegateFunc);
655 } 676 }
656 public void removeCheckStopScript(CanStopScript delegateFunc)
657 {
658 if (CanStopScriptCheckFunctions.Contains(delegateFunc))
659 CanStopScriptCheckFunctions.Remove(delegateFunc);
660 }
661 677
662 public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user) 678 public void removeCheckStopScript(CanStopScript delegateFunc)
679 {
680 if (CanStopScriptCheckFunctions.Contains(delegateFunc))
681 CanStopScriptCheckFunctions.Remove(delegateFunc);
682 }
683
684 public bool ExternalChecksCanStopScript(LLUUID script, LLUUID user)
685 {
686 foreach (CanStopScript check in CanStopScriptCheckFunctions)
663 { 687 {
664 foreach (CanStopScript check in CanStopScriptCheckFunctions) 688 if (check(script, user, m_scene) == false)
665 { 689 {
666 if (check(script, user, m_scene) == false) 690 return false;
667 {
668 return false;
669 }
670 } 691 }
671 return true;
672 } 692 }
693 return true;
694 }
673 695
674 #endregion 696 #endregion
675 697
676 #region RESET SCRIPT 698 #region RESET SCRIPT
677 public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene); 699 public delegate bool CanResetScript(LLUUID script, LLUUID user, Scene scene);
678 private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>(); 700 private List<CanResetScript> CanResetScriptCheckFunctions = new List<CanResetScript>();
679 701
680 public void addCheckResetScript(CanResetScript delegateFunc) 702 public void addCheckResetScript(CanResetScript delegateFunc)
681 { 703 {
682 if (!CanResetScriptCheckFunctions.Contains(delegateFunc)) 704 if (!CanResetScriptCheckFunctions.Contains(delegateFunc))
683 CanResetScriptCheckFunctions.Add(delegateFunc); 705 CanResetScriptCheckFunctions.Add(delegateFunc);
684 } 706 }
685 public void removeCheckResetScript(CanResetScript delegateFunc) 707
686 { 708 public void removeCheckResetScript(CanResetScript delegateFunc)
687 if (CanResetScriptCheckFunctions.Contains(delegateFunc)) 709 {
688 CanResetScriptCheckFunctions.Remove(delegateFunc); 710 if (CanResetScriptCheckFunctions.Contains(delegateFunc))
689 } 711 CanResetScriptCheckFunctions.Remove(delegateFunc);
712 }
690 713
691 public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user) 714 public bool ExternalChecksCanResetScript(LLUUID script, LLUUID user)
715 {
716 foreach (CanResetScript check in CanResetScriptCheckFunctions)
692 { 717 {
693 foreach (CanResetScript check in CanResetScriptCheckFunctions) 718 if (check(script, user, m_scene) == false)
694 { 719 {
695 if (check(script, user, m_scene) == false) 720 return false;
696 {
697 return false;
698 }
699 } 721 }
700 return true;
701 } 722 }
723 return true;
724 }
702 725
703 #endregion 726 #endregion
704 727
705 #region TERRAFORM LAND 728 #region TERRAFORM LAND
706 public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene); 729 public delegate bool CanTerraformLand(LLUUID user, LLVector3 position, Scene requestFromScene);
707 private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>(); 730 private List<CanTerraformLand> CanTerraformLandCheckFunctions = new List<CanTerraformLand>();
708 731
709 public void addCheckTerraformLand(CanTerraformLand delegateFunc) 732 public void addCheckTerraformLand(CanTerraformLand delegateFunc)
710 { 733 {
711 if (!CanTerraformLandCheckFunctions.Contains(delegateFunc)) 734 if (!CanTerraformLandCheckFunctions.Contains(delegateFunc))
712 CanTerraformLandCheckFunctions.Add(delegateFunc); 735 CanTerraformLandCheckFunctions.Add(delegateFunc);
713 } 736 }
714 public void removeCheckTerraformLand(CanTerraformLand delegateFunc)
715 {
716 if (CanTerraformLandCheckFunctions.Contains(delegateFunc))
717 CanTerraformLandCheckFunctions.Remove(delegateFunc);
718 }
719 737
720 public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos) 738 public void removeCheckTerraformLand(CanTerraformLand delegateFunc)
739 {
740 if (CanTerraformLandCheckFunctions.Contains(delegateFunc))
741 CanTerraformLandCheckFunctions.Remove(delegateFunc);
742 }
743
744 public bool ExternalChecksCanTerraformLand(LLUUID user, LLVector3 pos)
745 {
746 foreach (CanTerraformLand check in CanTerraformLandCheckFunctions)
721 { 747 {
722 foreach (CanTerraformLand check in CanTerraformLandCheckFunctions) 748 if (check(user, pos, m_scene) == false)
723 { 749 {
724 if (check(user, pos, m_scene) == false) 750 return false;
725 {
726 return false;
727 }
728 } 751 }
729 return true;
730 } 752 }
753 return true;
754 }
731 755
732 #endregion 756 #endregion
733 757
734 #region RUN CONSOLE COMMAND 758 #region RUN CONSOLE COMMAND
735 public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene); 759 public delegate bool CanRunConsoleCommand(LLUUID user, Scene requestFromScene);
736 private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>(); 760 private List<CanRunConsoleCommand> CanRunConsoleCommandCheckFunctions = new List<CanRunConsoleCommand>();
737 761
738 public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc) 762 public void addCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc)
739 { 763 {
740 if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc)) 764 if (!CanRunConsoleCommandCheckFunctions.Contains(delegateFunc))
741 CanRunConsoleCommandCheckFunctions.Add(delegateFunc); 765 CanRunConsoleCommandCheckFunctions.Add(delegateFunc);
742 } 766 }
743 public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc)
744 {
745 if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc))
746 CanRunConsoleCommandCheckFunctions.Remove(delegateFunc);
747 }
748 767
749 public bool ExternalChecksCanRunConsoleCommand(LLUUID user) 768 public void removeCheckRunConsoleCommand(CanRunConsoleCommand delegateFunc)
769 {
770 if (CanRunConsoleCommandCheckFunctions.Contains(delegateFunc))
771 CanRunConsoleCommandCheckFunctions.Remove(delegateFunc);
772 }
773
774 public bool ExternalChecksCanRunConsoleCommand(LLUUID user)
775 {
776 foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions)
750 { 777 {
751 foreach (CanRunConsoleCommand check in CanRunConsoleCommandCheckFunctions) 778 if (check(user, m_scene) == false)
752 { 779 {
753 if (check(user, m_scene) == false) 780 return false;
754 {
755 return false;
756 }
757 } 781 }
758 return true;
759 } 782 }
783 return true;
784 }
760 785
761 #endregion 786 #endregion
762 787
763 #region CAN ISSUE ESTATE COMMAND 788 #region CAN ISSUE ESTATE COMMAND
764 public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand); 789 public delegate bool CanIssueEstateCommand(LLUUID user, Scene requestFromScene, bool ownerCommand);
765 private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>(); 790 private List<CanIssueEstateCommand> CanIssueEstateCommandCheckFunctions = new List<CanIssueEstateCommand>();
766 791
767 public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc) 792 public void addCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc)
768 { 793 {
769 if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc)) 794 if (!CanIssueEstateCommandCheckFunctions.Contains(delegateFunc))
770 CanIssueEstateCommandCheckFunctions.Add(delegateFunc); 795 CanIssueEstateCommandCheckFunctions.Add(delegateFunc);
771 } 796 }
772 public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc)
773 {
774 if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc))
775 CanIssueEstateCommandCheckFunctions.Remove(delegateFunc);
776 }
777 797
778 public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand) 798 public void removeCheckIssueEstateCommand(CanIssueEstateCommand delegateFunc)
799 {
800 if (CanIssueEstateCommandCheckFunctions.Contains(delegateFunc))
801 CanIssueEstateCommandCheckFunctions.Remove(delegateFunc);
802 }
803
804 public bool ExternalChecksCanIssueEstateCommand(LLUUID user, bool ownerCommand)
805 {
806 foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions)
779 { 807 {
780 foreach (CanIssueEstateCommand check in CanIssueEstateCommandCheckFunctions) 808 if (check(user, m_scene, ownerCommand) == false)
781 { 809 {
782 if (check(user, m_scene, ownerCommand) == false) 810 return false;
783 {
784 return false;
785 }
786 } 811 }
787 return true;
788 } 812 }
789 #endregion 813 return true;
814 }
815 #endregion
790 816
791 #region CAN BE GODLIKE 817 #region CAN BE GODLIKE
792 public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene); 818 public delegate bool CanBeGodLike(LLUUID user, Scene requestFromScene);
793 private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>(); 819 private List<CanBeGodLike> CanBeGodLikeCheckFunctions = new List<CanBeGodLike>();
794 820
795 public void addCheckBeGodLike(CanBeGodLike delegateFunc) 821 public void addCheckBeGodLike(CanBeGodLike delegateFunc)
796 { 822 {
797 if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc)) 823 if (!CanBeGodLikeCheckFunctions.Contains(delegateFunc))
798 CanBeGodLikeCheckFunctions.Add(delegateFunc); 824 CanBeGodLikeCheckFunctions.Add(delegateFunc);
799 } 825 }
800 public void removeCheckBeGodLike(CanBeGodLike delegateFunc) 826
801 { 827 public void removeCheckBeGodLike(CanBeGodLike delegateFunc)
802 if (CanBeGodLikeCheckFunctions.Contains(delegateFunc)) 828 {
803 CanBeGodLikeCheckFunctions.Remove(delegateFunc); 829 if (CanBeGodLikeCheckFunctions.Contains(delegateFunc))
804 } 830 CanBeGodLikeCheckFunctions.Remove(delegateFunc);
831 }
805 832
806 public bool ExternalChecksCanBeGodLike(LLUUID user) 833 public bool ExternalChecksCanBeGodLike(LLUUID user)
834 {
835 foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions)
807 { 836 {
808 foreach (CanBeGodLike check in CanBeGodLikeCheckFunctions) 837 if (check(user, m_scene) == false)
809 { 838 {
810 if (check(user, m_scene) == false) 839 return false;
811 {
812 return false;
813 }
814 } 840 }
815 return true;
816 } 841 }
817 #endregion 842 return true;
843 }
844 #endregion
818 845
819 #region EDIT PARCEL 846 #region EDIT PARCEL
820 public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene); 847 public delegate bool CanEditParcel(LLUUID user, ILandObject parcel, Scene scene);
821 private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>(); 848 private List<CanEditParcel> CanEditParcelCheckFunctions = new List<CanEditParcel>();
822 849
823 public void addCheckEditParcel(CanEditParcel delegateFunc) 850 public void addCheckEditParcel(CanEditParcel delegateFunc)
824 { 851 {
825 if (!CanEditParcelCheckFunctions.Contains(delegateFunc)) 852 if (!CanEditParcelCheckFunctions.Contains(delegateFunc))
826 CanEditParcelCheckFunctions.Add(delegateFunc); 853 CanEditParcelCheckFunctions.Add(delegateFunc);
827 } 854 }
828 public void removeCheckEditParcel(CanEditParcel delegateFunc) 855
829 { 856 public void removeCheckEditParcel(CanEditParcel delegateFunc)
830 if (CanEditParcelCheckFunctions.Contains(delegateFunc)) 857 {
831 CanEditParcelCheckFunctions.Remove(delegateFunc); 858 if (CanEditParcelCheckFunctions.Contains(delegateFunc))
832 } 859 CanEditParcelCheckFunctions.Remove(delegateFunc);
860 }
833 861
834 public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel) 862 public bool ExternalChecksCanEditParcel(LLUUID user, ILandObject parcel)
863 {
864 foreach (CanEditParcel check in CanEditParcelCheckFunctions)
835 { 865 {
836 foreach (CanEditParcel check in CanEditParcelCheckFunctions) 866 if (check(user, parcel, m_scene) == false)
837 { 867 {
838 if (check(user, parcel, m_scene) == false) 868 return false;
839 {
840 return false;
841 }
842 } 869 }
843 return true;
844 } 870 }
845 #endregion 871 return true;
872 }
873 #endregion
846 874
847 #region SELL PARCEL 875 #region SELL PARCEL
848 public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene); 876 public delegate bool CanSellParcel(LLUUID user, ILandObject parcel, Scene scene);
849 private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>(); 877 private List<CanSellParcel> CanSellParcelCheckFunctions = new List<CanSellParcel>();
850 878
851 public void addCheckSellParcel(CanSellParcel delegateFunc) 879 public void addCheckSellParcel(CanSellParcel delegateFunc)
852 { 880 {
853 if (!CanSellParcelCheckFunctions.Contains(delegateFunc)) 881 if (!CanSellParcelCheckFunctions.Contains(delegateFunc))
854 CanSellParcelCheckFunctions.Add(delegateFunc); 882 CanSellParcelCheckFunctions.Add(delegateFunc);
855 } 883 }
856 public void removeCheckSellParcel(CanSellParcel delegateFunc) 884
857 { 885 public void removeCheckSellParcel(CanSellParcel delegateFunc)
858 if (CanSellParcelCheckFunctions.Contains(delegateFunc)) 886 {
859 CanSellParcelCheckFunctions.Remove(delegateFunc); 887 if (CanSellParcelCheckFunctions.Contains(delegateFunc))
860 } 888 CanSellParcelCheckFunctions.Remove(delegateFunc);
889 }
861 890
862 public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel) 891 public bool ExternalChecksCanSellParcel(LLUUID user, ILandObject parcel)
892 {
893 foreach (CanSellParcel check in CanSellParcelCheckFunctions)
863 { 894 {
864 foreach (CanSellParcel check in CanSellParcelCheckFunctions) 895 if (check(user, parcel, m_scene) == false)
865 { 896 {
866 if (check(user, parcel, m_scene) == false) 897 return false;
867 {
868 return false;
869 }
870 } 898 }
871 return true;
872 } 899 }
873 #endregion 900 return true;
901 }
902 #endregion
874 903
875 #region ABANDON PARCEL 904 #region ABANDON PARCEL
876 public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene); 905 public delegate bool CanAbandonParcel(LLUUID user, ILandObject parcel, Scene scene);
877 private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>(); 906 private List<CanAbandonParcel> CanAbandonParcelCheckFunctions = new List<CanAbandonParcel>();
878 907
879 public void addCheckAbandonParcel(CanAbandonParcel delegateFunc) 908 public void addCheckAbandonParcel(CanAbandonParcel delegateFunc)
880 { 909 {
881 if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc)) 910 if (!CanAbandonParcelCheckFunctions.Contains(delegateFunc))
882 CanAbandonParcelCheckFunctions.Add(delegateFunc); 911 CanAbandonParcelCheckFunctions.Add(delegateFunc);
883 } 912 }
884 public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc)
885 {
886 if (CanAbandonParcelCheckFunctions.Contains(delegateFunc))
887 CanAbandonParcelCheckFunctions.Remove(delegateFunc);
888 }
889 913
890 public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel) 914 public void removeCheckAbandonParcel(CanAbandonParcel delegateFunc)
915 {
916 if (CanAbandonParcelCheckFunctions.Contains(delegateFunc))
917 CanAbandonParcelCheckFunctions.Remove(delegateFunc);
918 }
919
920 public bool ExternalChecksCanAbandonParcel(LLUUID user, ILandObject parcel)
921 {
922 foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions)
891 { 923 {
892 foreach (CanAbandonParcel check in CanAbandonParcelCheckFunctions) 924 if (check(user, parcel, m_scene) == false)
893 { 925 {
894 if (check(user, parcel, m_scene) == false) 926 return false;
895 {
896 return false;
897 }
898 } 927 }
899 return true;
900 } 928 }
901 #endregion 929 return true;
930 }
931 #endregion
902 932
903 public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene); 933 public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene);
904 private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>(); 934 private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>();
905 935
906 public void addCheckReclaimParcel(CanReclaimParcel delegateFunc) 936 public void addCheckReclaimParcel(CanReclaimParcel delegateFunc)
907 { 937 {
908 if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc)) 938 if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc))
909 CanReclaimParcelCheckFunctions.Add(delegateFunc); 939 CanReclaimParcelCheckFunctions.Add(delegateFunc);
910 } 940 }
911 public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc)
912 {
913 if (CanReclaimParcelCheckFunctions.Contains(delegateFunc))
914 CanReclaimParcelCheckFunctions.Remove(delegateFunc);
915 }
916 941
917 public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel) 942 public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc)
943 {
944 if (CanReclaimParcelCheckFunctions.Contains(delegateFunc))
945 CanReclaimParcelCheckFunctions.Remove(delegateFunc);
946 }
947
948 public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel)
949 {
950 foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions)
918 { 951 {
919 foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions) 952 if (check(user, parcel, m_scene) == false)
920 { 953 {
921 if (check(user, parcel, m_scene) == false) 954 return false;
922 {
923 return false;
924 }
925 } 955 }
926 return true;
927 } 956 }
928 public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); 957 return true;
929 private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); 958 }
959 public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene);
960 private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>();
930 961
931 public void addCheckCanBuyLand(CanBuyLand delegateFunc) 962 public void addCheckCanBuyLand(CanBuyLand delegateFunc)
932 { 963 {
933 if (!CanBuyLandCheckFunctions.Contains(delegateFunc)) 964 if (!CanBuyLandCheckFunctions.Contains(delegateFunc))
934 CanBuyLandCheckFunctions.Add(delegateFunc); 965 CanBuyLandCheckFunctions.Add(delegateFunc);
935 } 966 }
936 public void removeCheckCanBuyLand(CanBuyLand delegateFunc)
937 {
938 if (CanBuyLandCheckFunctions.Contains(delegateFunc))
939 CanBuyLandCheckFunctions.Remove(delegateFunc);
940 }
941 967
942 public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel) 968 public void removeCheckCanBuyLand(CanBuyLand delegateFunc)
969 {
970 if (CanBuyLandCheckFunctions.Contains(delegateFunc))
971 CanBuyLandCheckFunctions.Remove(delegateFunc);
972 }
973
974 public bool ExternalChecksCanBuyLand(LLUUID user, ILandObject parcel)
975 {
976 foreach (CanBuyLand check in CanBuyLandCheckFunctions)
943 { 977 {
944 foreach (CanBuyLand check in CanBuyLandCheckFunctions) 978 if (check(user, parcel, m_scene) == false)
945 { 979 {
946 if (check(user, parcel, m_scene) == false) 980 return false;
947 {
948 return false;
949 }
950 } 981 }
951 return true;
952 } 982 }
983 return true;
984 }
953 985
954 public delegate bool CanLinkObject(LLUUID user, LLUUID objectID); 986 public delegate bool CanLinkObject(LLUUID user, LLUUID objectID);
955 private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>(); 987 private List<CanLinkObject> CanLinkObjectCheckFunctions = new List<CanLinkObject>();
956 988
957 public void addCheckCanLinkObject(CanLinkObject delegateFunc) 989 public void addCheckCanLinkObject(CanLinkObject delegateFunc)
958 { 990 {
959 if (!CanLinkObjectCheckFunctions.Contains(delegateFunc)) 991 if (!CanLinkObjectCheckFunctions.Contains(delegateFunc))
960 CanLinkObjectCheckFunctions.Add(delegateFunc); 992 CanLinkObjectCheckFunctions.Add(delegateFunc);
961 } 993 }
962 public void removeCheckCanLinkObject(CanLinkObject delegateFunc) 994
963 { 995 public void removeCheckCanLinkObject(CanLinkObject delegateFunc)
964 if (CanLinkObjectCheckFunctions.Contains(delegateFunc)) 996 {
965 CanLinkObjectCheckFunctions.Remove(delegateFunc); 997 if (CanLinkObjectCheckFunctions.Contains(delegateFunc))
966 } 998 CanLinkObjectCheckFunctions.Remove(delegateFunc);
999 }
967 1000
968 public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID) 1001 public bool ExternalChecksCanLinkObject(LLUUID user, LLUUID objectID)
969 { 1002 {
970 foreach (CanLinkObject check in CanLinkObjectCheckFunctions) 1003 foreach (CanLinkObject check in CanLinkObjectCheckFunctions)
971 { 1004 {
@@ -977,137 +1010,141 @@ namespace OpenSim.Region.Environment.Scenes
977 return true; 1010 return true;
978 } 1011 }
979 1012
980 public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID); 1013 public delegate bool CanDelinkObject(LLUUID user, LLUUID objectID);
981 private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>(); 1014 private List<CanDelinkObject> CanDelinkObjectCheckFunctions = new List<CanDelinkObject>();
982 1015
983 public void addCheckCanDelinkObject(CanDelinkObject delegateFunc) 1016 public void addCheckCanDelinkObject(CanDelinkObject delegateFunc)
984 { 1017 {
985 if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc)) 1018 if (!CanDelinkObjectCheckFunctions.Contains(delegateFunc))
986 CanDelinkObjectCheckFunctions.Add(delegateFunc); 1019 CanDelinkObjectCheckFunctions.Add(delegateFunc);
987 } 1020 }
988 public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc) 1021
989 { 1022 public void removeCheckCanDelinkObject(CanDelinkObject delegateFunc)
990 if (CanDelinkObjectCheckFunctions.Contains(delegateFunc)) 1023 {
991 CanDelinkObjectCheckFunctions.Remove(delegateFunc); 1024 if (CanDelinkObjectCheckFunctions.Contains(delegateFunc))
992 } 1025 CanDelinkObjectCheckFunctions.Remove(delegateFunc);
1026 }
993 1027
994 public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID) 1028 public bool ExternalChecksCanDelinkObject(LLUUID user, LLUUID objectID)
1029 {
1030 foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions)
995 { 1031 {
996 foreach (CanDelinkObject check in CanDelinkObjectCheckFunctions) 1032 if (check(user, objectID) == false)
997 { 1033 {
998 if (check(user, objectID) == false) 1034 return false;
999 {
1000 return false;
1001 }
1002 } 1035 }
1003 return true;
1004 } 1036 }
1037 return true;
1038 }
1005 1039
1006 #endregion 1040 #endregion
1007 1041
1008 public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID); 1042 public delegate bool CanCreateInventory(uint invType, LLUUID objectID, LLUUID userID);
1009 private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>(); 1043 private List<CanCreateInventory> CanCreateInventoryCheckFunctions = new List<CanCreateInventory>();
1010 1044
1011 public void addCheckCanCreateInventory(CanCreateInventory delegateFunc) 1045 public void addCheckCanCreateInventory(CanCreateInventory delegateFunc)
1012 { 1046 {
1013 if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc)) 1047 if (!CanCreateInventoryCheckFunctions.Contains(delegateFunc))
1014 CanCreateInventoryCheckFunctions.Add(delegateFunc); 1048 CanCreateInventoryCheckFunctions.Add(delegateFunc);
1015 } 1049 }
1016 public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc)
1017 {
1018 if (CanCreateInventoryCheckFunctions.Contains(delegateFunc))
1019 CanCreateInventoryCheckFunctions.Remove(delegateFunc);
1020 }
1021 1050
1022 public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID) 1051 public void removeCheckCanCreateInventory(CanCreateInventory delegateFunc)
1052 {
1053 if (CanCreateInventoryCheckFunctions.Contains(delegateFunc))
1054 CanCreateInventoryCheckFunctions.Remove(delegateFunc);
1055 }
1056
1057 public bool ExternalChecksCanCreateInventory(uint invType, LLUUID objectID, LLUUID userID)
1058 {
1059 foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions)
1023 { 1060 {
1024 foreach (CanCreateInventory check in CanCreateInventoryCheckFunctions) 1061 if (check(invType, objectID, userID) == false)
1025 { 1062 {
1026 if (check(invType, objectID, userID) == false) 1063 return false;
1027 {
1028 return false;
1029 }
1030 } 1064 }
1031 return true;
1032 } 1065 }
1066 return true;
1067 }
1033 1068
1034 public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); 1069 public delegate bool CanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID);
1035 private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>(); 1070 private List<CanCopyInventory> CanCopyInventoryCheckFunctions = new List<CanCopyInventory>();
1036 1071
1037 public void addCheckCanCopyInventory(CanCopyInventory delegateFunc) 1072 public void addCheckCanCopyInventory(CanCopyInventory delegateFunc)
1038 { 1073 {
1039 if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc)) 1074 if (!CanCopyInventoryCheckFunctions.Contains(delegateFunc))
1040 CanCopyInventoryCheckFunctions.Add(delegateFunc); 1075 CanCopyInventoryCheckFunctions.Add(delegateFunc);
1041 } 1076 }
1042 public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc) 1077
1043 { 1078 public void removeCheckCanCopyInventory(CanCopyInventory delegateFunc)
1044 if (CanCopyInventoryCheckFunctions.Contains(delegateFunc)) 1079 {
1045 CanCopyInventoryCheckFunctions.Remove(delegateFunc); 1080 if (CanCopyInventoryCheckFunctions.Contains(delegateFunc))
1046 } 1081 CanCopyInventoryCheckFunctions.Remove(delegateFunc);
1082 }
1047 1083
1048 public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 1084 public bool ExternalChecksCanCopyInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
1085 {
1086 foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions)
1049 { 1087 {
1050 foreach (CanCopyInventory check in CanCopyInventoryCheckFunctions) 1088 if (check(itemID, objectID, userID) == false)
1051 { 1089 {
1052 if (check(itemID, objectID, userID) == false) 1090 return false;
1053 {
1054 return false;
1055 }
1056 } 1091 }
1057 return true;
1058 } 1092 }
1093 return true;
1094 }
1059 1095
1060 public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID); 1096 public delegate bool CanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID);
1061 private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>(); 1097 private List<CanDeleteInventory> CanDeleteInventoryCheckFunctions = new List<CanDeleteInventory>();
1062 1098
1063 public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc) 1099 public void addCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
1064 { 1100 {
1065 if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc)) 1101 if (!CanDeleteInventoryCheckFunctions.Contains(delegateFunc))
1066 CanDeleteInventoryCheckFunctions.Add(delegateFunc); 1102 CanDeleteInventoryCheckFunctions.Add(delegateFunc);
1067 } 1103 }
1068 public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
1069 {
1070 if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc))
1071 CanDeleteInventoryCheckFunctions.Remove(delegateFunc);
1072 }
1073 1104
1074 public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID) 1105 public void removeCheckCanDeleteInventory(CanDeleteInventory delegateFunc)
1106 {
1107 if (CanDeleteInventoryCheckFunctions.Contains(delegateFunc))
1108 CanDeleteInventoryCheckFunctions.Remove(delegateFunc);
1109 }
1110
1111 public bool ExternalChecksCanDeleteInventory(LLUUID itemID, LLUUID objectID, LLUUID userID)
1112 {
1113 foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions)
1075 { 1114 {
1076 foreach (CanDeleteInventory check in CanDeleteInventoryCheckFunctions) 1115 if (check(itemID, objectID, userID) == false)
1077 { 1116 {
1078 if (check(itemID, objectID, userID) == false) 1117 return false;
1079 {
1080 return false;
1081 }
1082 } 1118 }
1083 return true;
1084 } 1119 }
1120 return true;
1121 }
1085 1122
1086 public delegate bool CanTeleport(LLUUID userID); 1123 public delegate bool CanTeleport(LLUUID userID);
1087 private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>(); 1124 private List<CanTeleport> CanTeleportCheckFunctions = new List<CanTeleport>();
1088 1125
1089 public void addCheckCanTeleport(CanTeleport delegateFunc) 1126 public void addCheckCanTeleport(CanTeleport delegateFunc)
1090 { 1127 {
1091 if (!CanTeleportCheckFunctions.Contains(delegateFunc)) 1128 if (!CanTeleportCheckFunctions.Contains(delegateFunc))
1092 CanTeleportCheckFunctions.Add(delegateFunc); 1129 CanTeleportCheckFunctions.Add(delegateFunc);
1093 } 1130 }
1094 public void removeCheckCanTeleport(CanTeleport delegateFunc)
1095 {
1096 if (CanTeleportCheckFunctions.Contains(delegateFunc))
1097 CanTeleportCheckFunctions.Remove(delegateFunc);
1098 }
1099 1131
1100 public bool ExternalChecksCanTeleport(LLUUID userID) 1132 public void removeCheckCanTeleport(CanTeleport delegateFunc)
1133 {
1134 if (CanTeleportCheckFunctions.Contains(delegateFunc))
1135 CanTeleportCheckFunctions.Remove(delegateFunc);
1136 }
1137
1138 public bool ExternalChecksCanTeleport(LLUUID userID)
1139 {
1140 foreach (CanTeleport check in CanTeleportCheckFunctions)
1101 { 1141 {
1102 foreach (CanTeleport check in CanTeleportCheckFunctions) 1142 if (check(userID) == false)
1103 { 1143 {
1104 if (check(userID) == false) 1144 return false;
1105 {
1106 return false;
1107 }
1108 } 1145 }
1109 return true;
1110 } 1146 }
1147 return true;
1148 }
1111 } 1149 }
1112} 1150}
1113