aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs27
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs67
2 files changed, 84 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0e0c2b7..e53fd5d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3648,12 +3648,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3648 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) 3648 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain)
3649 { 3649 {
3650 m_host.AddScriptLPS(1); 3650 m_host.AddScriptLPS(1);
3651 m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 3651 TargetOmega(m_host, axis, spinrate, gain);
3652 m_host.ScheduleTerseUpdate();
3653 m_host.SendTerseUpdateToAllClients();
3654 m_host.ParentGroup.HasGroupChanged = true;
3655 } 3652 }
3656 3653
3654 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
3655 {
3656 part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
3657 part.ScheduleTerseUpdate();
3658 part.SendTerseUpdateToAllClients();
3659 part.ParentGroup.HasGroupChanged = true;
3660 }
3661
3657 public LSL_Integer llGetStartParameter() 3662 public LSL_Integer llGetStartParameter()
3658 { 3663 {
3659 m_host.AddScriptLPS(1); 3664 m_host.AddScriptLPS(1);
@@ -7936,6 +7941,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7936 LSL_Rotation lr = rules.GetQuaternionItem(idx++); 7941 LSL_Rotation lr = rules.GetQuaternionItem(idx++);
7937 SetRot(part, Rot2Quaternion(lr)); 7942 SetRot(part, Rot2Quaternion(lr));
7938 break; 7943 break;
7944 case (int)ScriptBaseClass.PRIM_OMEGA:
7945 if (remain < 3)
7946 return;
7947 LSL_Vector axis = rules.GetVector3Item(idx++);
7948 LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
7949 LSL_Float gain = rules.GetLSLFloatItem(idx++);
7950 TargetOmega(part, axis, (double)spinrate, (double)gain);
7951 break;
7952 case (int)ScriptBaseClass.PRIM_LINK_TARGET:
7953 if (remain < 1)
7954 return;
7955 LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
7956 part = part.ParentGroup.GetLinkNumPart((int)new_linknumber);
7957 break;
7939 } 7958 }
7940 } 7959 }
7941 7960
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index ed2f221..ab0eec9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -113,11 +113,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
113 { 113 {
114 public List<UUID> AllowedCreators; 114 public List<UUID> AllowedCreators;
115 public List<UUID> AllowedOwners; 115 public List<UUID> AllowedOwners;
116 public List<string> AllowedOwnerClasses;
116 117
117 public FunctionPerms() 118 public FunctionPerms()
118 { 119 {
119 AllowedCreators = new List<UUID>(); 120 AllowedCreators = new List<UUID>();
120 AllowedOwners = new List<UUID>(); 121 AllowedOwners = new List<UUID>();
122 AllowedOwnerClasses = new List<string>();
121 } 123 }
122 } 124 }
123 125
@@ -254,6 +256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
254 // Default behavior 256 // Default behavior
255 perms.AllowedOwners = null; 257 perms.AllowedOwners = null;
256 perms.AllowedCreators = null; 258 perms.AllowedCreators = null;
259 perms.AllowedOwnerClasses = null;
257 } 260 }
258 else 261 else
259 { 262 {
@@ -274,12 +277,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
274 foreach (string id in ids) 277 foreach (string id in ids)
275 { 278 {
276 string current = id.Trim(); 279 string current = id.Trim();
277 UUID uuid; 280 if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER")
278
279 if (UUID.TryParse(current, out uuid))
280 { 281 {
281 if (uuid != UUID.Zero) 282 if (!perms.AllowedOwnerClasses.Contains(current))
282 perms.AllowedOwners.Add(uuid); 283 perms.AllowedOwnerClasses.Add(current.ToUpper());
284 }
285 else
286 {
287 UUID uuid;
288
289 if (UUID.TryParse(current, out uuid))
290 {
291 if (uuid != UUID.Zero)
292 perms.AllowedOwners.Add(uuid);
293 }
283 } 294 }
284 } 295 }
285 296
@@ -335,11 +346,55 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
335 String.Format("{0} permission error. Can't find script in prim inventory.", 346 String.Format("{0} permission error. Can't find script in prim inventory.",
336 function)); 347 function));
337 } 348 }
349
350 UUID ownerID = ti.OwnerID;
351
352 //OSSL only may be used if objet is in the same group as the parcel
353 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER"))
354 {
355 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
356
357 if (land.LandData.GroupID == ti.GroupID && land.LandData.GroupID != UUID.Zero)
358 {
359 return;
360 }
361 }
362
363 //Only Parcelowners may use the function
364 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_OWNER"))
365 {
366 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
367
368 if (land.LandData.OwnerID == ownerID)
369 {
370 return;
371 }
372 }
373
374 //Only Estate Managers may use the function
375 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_MANAGER"))
376 {
377 //Only Estate Managers may use the function
378 if (World.RegionInfo.EstateSettings.IsEstateManager(ownerID) && World.RegionInfo.EstateSettings.EstateOwner != ownerID)
379 {
380 return;
381 }
382 }
383
384 //Only regionowners may use the function
385 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_OWNER"))
386 {
387 if (World.RegionInfo.EstateSettings.EstateOwner == ownerID)
388 {
389 return;
390 }
391 }
392
338 if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID)) 393 if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID))
339 OSSLError( 394 OSSLError(
340 String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", 395 String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.",
341 function)); 396 function));
342 if (ti.CreatorID != ti.OwnerID) 397 if (ti.CreatorID != ownerID)
343 { 398 {
344 if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0) 399 if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0)
345 OSSLError( 400 OSSLError(