aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2011-10-26 17:48:51 +0100
committerMelanie2011-10-26 17:48:51 +0100
commit6a96c9546d4fd89f6e9319246cc2270836cf19f7 (patch)
treee6492419b9a03cb78435e911b345b4a31f749162 /OpenSim/Region
parentMerge branch 'master' into bigmerge (diff)
parentMerge branch 'master' of /home/opensim/var/repo/opensim (diff)
downloadopensim-SC-6a96c9546d4fd89f6e9319246cc2270836cf19f7.zip
opensim-SC-6a96c9546d4fd89f6e9319246cc2270836cf19f7.tar.gz
opensim-SC-6a96c9546d4fd89f6e9319246cc2270836cf19f7.tar.bz2
opensim-SC-6a96c9546d4fd89f6e9319246cc2270836cf19f7.tar.xz
Merge branch 'master' into bigmerge
Conflicts: OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs2
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs27
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs67
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs2
6 files changed, 89 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 8c7ce24..b2f5279 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1203,7 +1203,7 @@ namespace OpenSim.Region.Framework.Scenes
1203 { 1203 {
1204 m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName); 1204 m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName);
1205 HeartbeatThread.Abort(); 1205 HeartbeatThread.Abort();
1206 Watchdog.RemoveThread(HeartbeatThread.ManagedThreadId); 1206 Watchdog.AbortThread(HeartbeatThread.ManagedThreadId);
1207 HeartbeatThread = null; 1207 HeartbeatThread = null;
1208 } 1208 }
1209 m_lastUpdate = Util.EnvironmentTickCount(); 1209 m_lastUpdate = Util.EnvironmentTickCount();
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
index 1bce760..58e2e4c 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
@@ -1299,7 +1299,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1299 { 1299 {
1300 if (m_eventsubscription > 0) 1300 if (m_eventsubscription > 0)
1301 { 1301 {
1302 CollisionEventsThisFrame.addCollider(CollidedWith, contact); 1302 CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
1303 } 1303 }
1304 } 1304 }
1305 1305
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
index 82f1b94..5f802d0 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
@@ -2438,7 +2438,7 @@ Console.WriteLine("ODEPrim JointCreateFixed !!!");
2438 { 2438 {
2439 if (CollisionEventsThisFrame == null) 2439 if (CollisionEventsThisFrame == null)
2440 CollisionEventsThisFrame = new CollisionEventUpdate(); 2440 CollisionEventsThisFrame = new CollisionEventUpdate();
2441 CollisionEventsThisFrame.addCollider(CollidedWith, contact); 2441 CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
2442 } 2442 }
2443 2443
2444 public void SendCollisions() 2444 public void SendCollisions()
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(
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 3af9911..a1cf3df 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -322,6 +322,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
322 public const int PRIM_NAME = 27; 322 public const int PRIM_NAME = 27;
323 public const int PRIM_DESC = 28; 323 public const int PRIM_DESC = 28;
324 public const int PRIM_ROT_LOCAL = 29; 324 public const int PRIM_ROT_LOCAL = 29;
325 public const int PRIM_OMEGA = 32;
326 public const int PRIM_LINK_TARGET = 34;
325 public const int PRIM_TEXGEN_DEFAULT = 0; 327 public const int PRIM_TEXGEN_DEFAULT = 0;
326 public const int PRIM_TEXGEN_PLANAR = 1; 328 public const int PRIM_TEXGEN_PLANAR = 1;
327 329