aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitignore18
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs38
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs67
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs2
-rwxr-xr-x[-rw-r--r--]bin/OpenSim.ini.example7
-rw-r--r--bin/OpenSimDefaults.ini7
6 files changed, 124 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 8d3f2b2..0fd1e58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,4 +70,20 @@ TAGS
70Makefile.local 70Makefile.local
71bin/.version 71bin/.version
72compile.bat 72compile.bat
73 73addon-modules
74OpenSim/Data/Tests/test-results/
75OpenSim/Framework/Serialization/Tests/test-results/
76OpenSim/Framework/Servers/Tests/test-results/
77OpenSim/Framework/Tests/test-results/
78OpenSim/Region/ClientStack/Linden/Caps/test-results/
79OpenSim/Region/ClientStack/Linden/UDP/Tests/test-results/
80OpenSim/Region/CoreModules/test-results/
81OpenSim/Region/Framework/test-results/
82OpenSim/Region/OptionalModules/test-results/
83OpenSim/Region/Physics/BulletDotNETPlugin/
84OpenSim/Region/Physics/Manager/test-results/
85OpenSim/Region/Physics/OdePlugin/Tests/test-results/
86OpenSim/Region/ScriptEngine/test-results/
87OpenSim/Tests/Common/test-results/
88OpenSim/Tests/test-results/
89test-results/
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b8e9878..82701ce 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3325,12 +3325,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3325 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) 3325 public void llTargetOmega(LSL_Vector axis, double spinrate, double gain)
3326 { 3326 {
3327 m_host.AddScriptLPS(1); 3327 m_host.AddScriptLPS(1);
3328 m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 3328 TargetOmega(m_host, axis, spinrate, gain);
3329 m_host.ScheduleTerseUpdate();
3330 m_host.SendTerseUpdateToAllClients();
3331 m_host.ParentGroup.HasGroupChanged = true;
3332 } 3329 }
3333 3330
3331 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
3332 {
3333 part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
3334 part.ScheduleTerseUpdate();
3335 part.SendTerseUpdateToAllClients();
3336 part.ParentGroup.HasGroupChanged = true;
3337 }
3338
3334 public LSL_Integer llGetStartParameter() 3339 public LSL_Integer llGetStartParameter()
3335 { 3340 {
3336 m_host.AddScriptLPS(1); 3341 m_host.AddScriptLPS(1);
@@ -7014,10 +7019,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7014 { 7019 {
7015 m_host.AddScriptLPS(1); 7020 m_host.AddScriptLPS(1);
7016 7021
7017 List<SceneObjectPart> parts = GetLinkParts(linknumber); 7022 setLinkPrimParams(linknumber, rules);
7018
7019 foreach (SceneObjectPart part in parts)
7020 SetPrimParams(part, rules);
7021 7023
7022 ScriptSleep(200); 7024 ScriptSleep(200);
7023 } 7025 }
@@ -7026,6 +7028,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7026 { 7028 {
7027 m_host.AddScriptLPS(1); 7029 m_host.AddScriptLPS(1);
7028 7030
7031 setLinkPrimParams(linknumber, rules);
7032 }
7033
7034 protected void setLinkPrimParams(int linknumber, LSL_List rules)
7035 {
7029 List<SceneObjectPart> parts = GetLinkParts(linknumber); 7036 List<SceneObjectPart> parts = GetLinkParts(linknumber);
7030 7037
7031 foreach (SceneObjectPart part in parts) 7038 foreach (SceneObjectPart part in parts)
@@ -7395,6 +7402,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7395 LSL_Rotation lr = rules.GetQuaternionItem(idx++); 7402 LSL_Rotation lr = rules.GetQuaternionItem(idx++);
7396 SetRot(part, Rot2Quaternion(lr)); 7403 SetRot(part, Rot2Quaternion(lr));
7397 break; 7404 break;
7405 case (int)ScriptBaseClass.PRIM_OMEGA:
7406 if (remain < 3)
7407 return;
7408 LSL_Vector axis = rules.GetVector3Item(idx++);
7409 LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
7410 LSL_Float gain = rules.GetLSLFloatItem(idx++);
7411 TargetOmega(part, axis, (double)spinrate, (double)gain);
7412 break;
7413 case (int)ScriptBaseClass.PRIM_LINK_TARGET:
7414 if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
7415 return;
7416 LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++);
7417 LSL_List new_rules = rules.GetSublist(idx, -1);
7418 setLinkPrimParams((int)new_linknumber, new_rules);
7419 return;
7398 } 7420 }
7399 } 7421 }
7400 } 7422 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 52d787d..3cfc3c9 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
@@ -245,6 +247,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
245 // Default behavior 247 // Default behavior
246 perms.AllowedOwners = null; 248 perms.AllowedOwners = null;
247 perms.AllowedCreators = null; 249 perms.AllowedCreators = null;
250 perms.AllowedOwnerClasses = null;
248 } 251 }
249 else 252 else
250 { 253 {
@@ -265,12 +268,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
265 foreach (string id in ids) 268 foreach (string id in ids)
266 { 269 {
267 string current = id.Trim(); 270 string current = id.Trim();
268 UUID uuid; 271 if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER")
269
270 if (UUID.TryParse(current, out uuid))
271 { 272 {
272 if (uuid != UUID.Zero) 273 if (!perms.AllowedOwnerClasses.Contains(current))
273 perms.AllowedOwners.Add(uuid); 274 perms.AllowedOwnerClasses.Add(current.ToUpper());
275 }
276 else
277 {
278 UUID uuid;
279
280 if (UUID.TryParse(current, out uuid))
281 {
282 if (uuid != UUID.Zero)
283 perms.AllowedOwners.Add(uuid);
284 }
274 } 285 }
275 } 286 }
276 287
@@ -326,11 +337,55 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
326 String.Format("{0} permission error. Can't find script in prim inventory.", 337 String.Format("{0} permission error. Can't find script in prim inventory.",
327 function)); 338 function));
328 } 339 }
340
341 UUID ownerID = ti.OwnerID;
342
343 //OSSL only may be used if objet is in the same group as the parcel
344 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER"))
345 {
346 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
347
348 if (land.LandData.GroupID == ti.GroupID && land.LandData.GroupID != UUID.Zero)
349 {
350 return;
351 }
352 }
353
354 //Only Parcelowners may use the function
355 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_OWNER"))
356 {
357 ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
358
359 if (land.LandData.OwnerID == ownerID)
360 {
361 return;
362 }
363 }
364
365 //Only Estate Managers may use the function
366 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_MANAGER"))
367 {
368 //Only Estate Managers may use the function
369 if (World.RegionInfo.EstateSettings.IsEstateManager(ownerID) && World.RegionInfo.EstateSettings.EstateOwner != ownerID)
370 {
371 return;
372 }
373 }
374
375 //Only regionowners may use the function
376 if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("ESTATE_OWNER"))
377 {
378 if (World.RegionInfo.EstateSettings.EstateOwner == ownerID)
379 {
380 return;
381 }
382 }
383
329 if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID)) 384 if (!m_FunctionPerms[function].AllowedCreators.Contains(ti.CreatorID))
330 OSSLError( 385 OSSLError(
331 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.", 386 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.",
332 function)); 387 function));
333 if (ti.CreatorID != ti.OwnerID) 388 if (ti.CreatorID != ownerID)
334 { 389 {
335 if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0) 390 if ((ti.CurrentPermissions & (uint)PermissionMask.Modify) != 0)
336 OSSLError( 391 OSSLError(
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 4b008a4..ce4661c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -321,6 +321,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
321 public const int PRIM_NAME = 27; 321 public const int PRIM_NAME = 27;
322 public const int PRIM_DESC = 28; 322 public const int PRIM_DESC = 28;
323 public const int PRIM_ROT_LOCAL = 29; 323 public const int PRIM_ROT_LOCAL = 29;
324 public const int PRIM_OMEGA = 32;
325 public const int PRIM_LINK_TARGET = 34;
324 public const int PRIM_TEXGEN_DEFAULT = 0; 326 public const int PRIM_TEXGEN_DEFAULT = 0;
325 public const int PRIM_TEXGEN_PLANAR = 1; 327 public const int PRIM_TEXGEN_PLANAR = 1;
326 328
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 44da31c..80f4c0e 100644..100755
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -617,6 +617,13 @@
617 617
618 ; Comma separated list of UUIDS allows the function for that list of UUIDS 618 ; Comma separated list of UUIDS allows the function for that list of UUIDS
619 ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb 619 ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb
620
621 ; Comma separated list of owner classes that allow the function for a particular class of owners. Choices are
622 ; - PARCEL_GROUP_MEMBER: allow if objectgroup is the same group as the parcel
623 ; - PARCEL_OWNER: allow if the objectowner is parcelowner
624 ; - ESTATE_MANAGER: allow if the object owner is a estate manager
625 ; - ESTATE_OWNER: allow if objectowner is estateowner
626 ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb, PARCEL_OWNER, ESTATE_OWNER>, ...
620 627
621 ; You can also use script creators as the uuid 628 ; You can also use script creators as the uuid
622 ; Creators_osSetRegionWaterHeight = <uuid>, ... 629 ; Creators_osSetRegionWaterHeight = <uuid>, ...
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 7df4357..16ce125 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -1196,6 +1196,13 @@
1196 1196
1197 ; Comma separated list of UUIDS allows the function for that list of UUIDS 1197 ; Comma separated list of UUIDS allows the function for that list of UUIDS
1198 ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb 1198 ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb
1199
1200 ; Comma separated list of owner classes that allow the function for a particular class of owners. Choices are
1201 ; - PARCEL_GROUP_MEMBER: allow if objectgroup is the same group as the parcel
1202 ; - PARCEL_OWNER: allow if the objectowner is parcelowner
1203 ; - ESTATE_MANAGER: allow if the object owner is a estate manager
1204 ; - ESTATE_OWNER: allow if objectowner is estateowner
1205 ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb, PARCEL_OWNER, ESTATE_OWNER>, ...
1199 1206
1200 ; You can also use script creators as the uuid 1207 ; You can also use script creators as the uuid
1201 ; Creators_osSetRegionWaterHeight = <uuid>, ... 1208 ; Creators_osSetRegionWaterHeight = <uuid>, ...