aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-05-05 10:32:04 +0100
committerMelanie2012-05-05 10:32:04 +0100
commit31ab8b2fe0683cbc9fa4503c616722d678b66e33 (patch)
tree34fefd4bf9db7eea797db49e75aaaac5080ea94b /OpenSim/Region/Framework/Scenes
parentMerge branch 'avination' (diff)
parentFire the scripting changed event with CHANGED_OWNER when an object that has c... (diff)
downloadopensim-SC-31ab8b2fe0683cbc9fa4503c616722d678b66e33.zip
opensim-SC-31ab8b2fe0683cbc9fa4503c616722d678b66e33.tar.gz
opensim-SC-31ab8b2fe0683cbc9fa4503c616722d678b66e33.tar.bz2
opensim-SC-31ab8b2fe0683cbc9fa4503c616722d678b66e33.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/WebUtil.cs OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs69
3 files changed, 70 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
index 6c5685c..1365831 100644
--- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
+++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
@@ -48,16 +48,19 @@ namespace OpenSim.Region.Framework.Scenes
48{ 48{
49 public class RegionStatsHandler : IStreamedRequestHandler 49 public class RegionStatsHandler : IStreamedRequestHandler
50 { 50 {
51 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52
51 private string osRXStatsURI = String.Empty; 53 private string osRXStatsURI = String.Empty;
52 private string osXStatsURI = String.Empty; 54 private string osXStatsURI = String.Empty;
53 //private string osSecret = String.Empty; 55 //private string osSecret = String.Empty;
54 private OpenSim.Framework.RegionInfo regionInfo; 56 private OpenSim.Framework.RegionInfo regionInfo;
55 public string localZone = TimeZone.CurrentTimeZone.StandardName; 57 public string localZone = TimeZone.CurrentTimeZone.StandardName;
56 public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); 58 public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
57
58 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59 59
60 public RegionStatsHandler(OpenSim.Framework.RegionInfo region_info) 60 public string Name { get { return "RegionStats"; } }
61 public string Description { get { return "Region Statistics"; } }
62
63 public RegionStatsHandler(RegionInfo region_info)
61 { 64 {
62 regionInfo = region_info; 65 regionInfo = region_info;
63 osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret); 66 osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index a190efe..141cf66 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -1417,13 +1417,19 @@ namespace OpenSim.Region.Framework.Scenes
1417 { 1417 {
1418 if (engine != null) 1418 if (engine != null)
1419 { 1419 {
1420// m_log.DebugFormat(
1421// "[PRIM INVENTORY]: Resuming script {0} {1} for {2}, OwnerChanged {3}",
1422// item.Name, item.ItemID, item.OwnerID, item.OwnerChanged);
1423
1424 engine.ResumeScript(item.ItemID);
1425
1420 if (item.OwnerChanged) 1426 if (item.OwnerChanged)
1421 engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER }); 1427 engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
1428
1422 item.OwnerChanged = false; 1429 item.OwnerChanged = false;
1423 engine.ResumeScript(item.ItemID);
1424 } 1430 }
1425 } 1431 }
1426 } 1432 }
1427 } 1433 }
1428 } 1434 }
1429} 1435} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 35c920b..5e275f6 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1250,9 +1250,19 @@ namespace OpenSim.Region.Framework.Scenes
1250 1250
1251 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); 1251 bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
1252 MakeRootAgent(AbsolutePosition, flying); 1252 MakeRootAgent(AbsolutePosition, flying);
1253 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1254
1255// m_log.DebugFormat("[SCENE PRESENCE] Completed movement");
1253 1256
1254 if ((m_callbackURI != null) && !m_callbackURI.Equals("")) 1257 if ((m_callbackURI != null) && !m_callbackURI.Equals(""))
1255 { 1258 {
1259 // We cannot sleep here since this would hold up the inbound packet processing thread, as
1260 // CompleteMovement() is executed synchronously. However, it might be better to delay the release
1261 // here until we know for sure that the agent is active in this region. Sending AgentMovementComplete
1262 // is not enough for Imprudence clients - there appears to be a small delay (<200ms, <500ms) until they regard this
1263 // region as the current region, meaning that a close sent before then will fail the teleport.
1264// System.Threading.Thread.Sleep(2000);
1265
1256 m_log.DebugFormat( 1266 m_log.DebugFormat(
1257 "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}", 1267 "[SCENE PRESENCE]: Releasing {0} {1} with callback to {2}",
1258 client.Name, client.AgentId, m_callbackURI); 1268 client.Name, client.AgentId, m_callbackURI);
@@ -1261,9 +1271,6 @@ namespace OpenSim.Region.Framework.Scenes
1261 m_callbackURI = null; 1271 m_callbackURI = null;
1262 } 1272 }
1263 1273
1264// m_log.DebugFormat("[SCENE PRESENCE] Completed movement");
1265
1266 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1267 ValidateAndSendAppearanceAndAgentData(); 1274 ValidateAndSendAppearanceAndAgentData();
1268 1275
1269 // Create child agents in neighbouring regions 1276 // Create child agents in neighbouring regions
@@ -1278,7 +1285,6 @@ namespace OpenSim.Region.Framework.Scenes
1278 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); 1285 friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
1279 } 1286 }
1280 1287
1281
1282// m_log.DebugFormat( 1288// m_log.DebugFormat(
1283// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", 1289// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
1284// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); 1290// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
@@ -3453,25 +3459,53 @@ namespace OpenSim.Region.Framework.Scenes
3453 } 3459 }
3454 } 3460 }
3455 3461
3456 RaiseCollisionScriptEvents(coldata); 3462 // Gods do not take damage and Invulnerable is set depending on parcel/region flags
3457 3463 if (Invulnerable || GodLevel > 0)
3458 if (Invulnerable)
3459 return; 3464 return;
3460 3465
3466 // The following may be better in the ICombatModule
3467 // probably tweaking of the values for ground and normal prim collisions will be needed
3461 float starthealth = Health; 3468 float starthealth = Health;
3462 uint killerObj = 0; 3469 uint killerObj = 0;
3470 SceneObjectPart part = null;
3463 foreach (uint localid in coldata.Keys) 3471 foreach (uint localid in coldata.Keys)
3464 { 3472 {
3465 SceneObjectPart part = Scene.GetSceneObjectPart(localid); 3473 if (localid == 0)
3466 3474 {
3467 if (part != null && part.ParentGroup.Damage != -1.0f) 3475 part = null;
3468 Health -= part.ParentGroup.Damage; 3476 }
3469 else 3477 else
3470 { 3478 {
3471 if (coldata[localid].PenetrationDepth >= 0.10f) 3479 part = Scene.GetSceneObjectPart(localid);
3480 }
3481 if (part != null)
3482 {
3483 // Ignore if it has been deleted or volume detect
3484 if (!part.ParentGroup.IsDeleted && !part.ParentGroup.IsVolumeDetect)
3485 {
3486 if (part.ParentGroup.Damage > 0.0f)
3487 {
3488 // Something with damage...
3489 Health -= part.ParentGroup.Damage;
3490 part.ParentGroup.Scene.DeleteSceneObject(part.ParentGroup, false);
3491 }
3492 else
3493 {
3494 // An ordinary prim
3495 if (coldata[localid].PenetrationDepth >= 0.10f)
3496 Health -= coldata[localid].PenetrationDepth * 5.0f;
3497 }
3498 }
3499 }
3500 else
3501 {
3502 // 0 is the ground
3503 // what about collisions with other avatars?
3504 if (localid == 0 && coldata[localid].PenetrationDepth >= 0.10f)
3472 Health -= coldata[localid].PenetrationDepth * 5.0f; 3505 Health -= coldata[localid].PenetrationDepth * 5.0f;
3473 } 3506 }
3474 3507
3508
3475 if (Health <= 0.0f) 3509 if (Health <= 0.0f)
3476 { 3510 {
3477 if (localid != 0) 3511 if (localid != 0)
@@ -3487,7 +3521,16 @@ namespace OpenSim.Region.Framework.Scenes
3487 ControllingClient.SendHealth(Health); 3521 ControllingClient.SendHealth(Health);
3488 } 3522 }
3489 if (Health <= 0) 3523 if (Health <= 0)
3524 {
3490 m_scene.EventManager.TriggerAvatarKill(killerObj, this); 3525 m_scene.EventManager.TriggerAvatarKill(killerObj, this);
3526 }
3527 if (starthealth == Health && Health < 100.0f)
3528 {
3529 Health += 0.03f;
3530 if (Health > 100.0f)
3531 Health = 100.0f;
3532 ControllingClient.SendHealth(Health);
3533 }
3491 } 3534 }
3492 } 3535 }
3493 3536