diff options
author | UbitUmarov | 2012-03-27 21:58:25 +0100 |
---|---|---|
committer | UbitUmarov | 2012-03-27 21:58:25 +0100 |
commit | de45fe75156283ccb4f378349ef77828aaf7330b (patch) | |
tree | 27a69017e9ee38e418f2b414ef1bb2bbfb487680 /OpenSim/Region | |
parent | Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-de45fe75156283ccb4f378349ef77828aaf7330b.zip opensim-SC_OLD-de45fe75156283ccb4f378349ef77828aaf7330b.tar.gz opensim-SC_OLD-de45fe75156283ccb4f378349ef77828aaf7330b.tar.bz2 opensim-SC_OLD-de45fe75156283ccb4f378349ef77828aaf7330b.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region')
7 files changed, 85 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index feab40e..a2d833b 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
448 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.", | 448 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.", |
449 | sp.Name, finalDestination.RegionName); | 449 | sp.Name, finalDestination.RegionName); |
450 | 450 | ||
451 | Fail(sp, finalDestination); | 451 | Fail(sp, finalDestination, logout); |
452 | return; | 452 | return; |
453 | } | 453 | } |
454 | 454 | ||
@@ -480,7 +480,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
480 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", | 480 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.", |
481 | sp.Name, finalDestination.RegionName); | 481 | sp.Name, finalDestination.RegionName); |
482 | 482 | ||
483 | Fail(sp, finalDestination); | 483 | Fail(sp, finalDestination, logout); |
484 | return; | 484 | return; |
485 | } | 485 | } |
486 | 486 | ||
@@ -531,7 +531,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
531 | } | 531 | } |
532 | } | 532 | } |
533 | 533 | ||
534 | private void Fail(ScenePresence sp, GridRegion finalDestination) | 534 | protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout) |
535 | { | 535 | { |
536 | // Client never contacted destination. Let's restore everything back | 536 | // Client never contacted destination. Let's restore everything back |
537 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); | 537 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 5c7ca22..4a563f9 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -50,6 +50,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
50 | 50 | ||
51 | private bool m_Initialized = false; | 51 | private bool m_Initialized = false; |
52 | 52 | ||
53 | private bool m_RestrictInventoryAccessAbroad = false; | ||
54 | |||
53 | private GatekeeperServiceConnector m_GatekeeperConnector; | 55 | private GatekeeperServiceConnector m_GatekeeperConnector; |
54 | 56 | ||
55 | #region ISharedRegionModule | 57 | #region ISharedRegionModule |
@@ -68,6 +70,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
68 | if (name == Name) | 70 | if (name == Name) |
69 | { | 71 | { |
70 | InitialiseCommon(source); | 72 | InitialiseCommon(source); |
73 | IConfig transferConfig = source.Configs["HGEntityTransfer"]; | ||
74 | if (transferConfig != null) | ||
75 | m_RestrictInventoryAccessAbroad = transferConfig.GetBoolean("RestrictInventoryAccessAbroad", false); | ||
76 | |||
71 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); | 77 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); |
72 | } | 78 | } |
73 | } | 79 | } |
@@ -170,6 +176,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
170 | bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); | 176 | bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); |
171 | logout = success; // flag for later logout from this grid; this is an HG TP | 177 | logout = success; // flag for later logout from this grid; this is an HG TP |
172 | 178 | ||
179 | if (success && m_RestrictInventoryAccessAbroad) | ||
180 | { | ||
181 | // TODO tell the viewer to remove the root folder | ||
182 | } | ||
183 | |||
173 | return success; | 184 | return success; |
174 | } | 185 | } |
175 | else | 186 | else |
@@ -288,6 +299,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
288 | 299 | ||
289 | } | 300 | } |
290 | 301 | ||
302 | protected override void Fail(ScenePresence sp, GridRegion finalDestination, bool logout) | ||
303 | { | ||
304 | base.Fail(sp, finalDestination, logout); | ||
305 | if (logout && m_RestrictInventoryAccessAbroad) | ||
306 | { | ||
307 | // Restore the user's inventory, because we removed it earlier on | ||
308 | InventoryFolderBase root = m_Scenes[0].InventoryService.GetRootFolder(sp.UUID); | ||
309 | if (root != null) | ||
310 | { | ||
311 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Restoring"); | ||
312 | sp.ControllingClient.SendBulkUpdateInventory(root); | ||
313 | } | ||
314 | } | ||
315 | } | ||
316 | |||
291 | #endregion | 317 | #endregion |
292 | 318 | ||
293 | #region IUserAgentVerificationModule | 319 | #region IUserAgentVerificationModule |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 9159f0c..14e428e 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -1199,8 +1199,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1199 | saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); | 1199 | saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); |
1200 | saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", | 1200 | saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", |
1201 | "Integer"); | 1201 | "Integer"); |
1202 | saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file", | ||
1203 | "Integer"); | ||
1204 | saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n" | 1202 | saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n" |
1205 | + "= Example =\n" | 1203 | + "= Example =\n" |
1206 | + "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n" | 1204 | + "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n" |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6ac7846..fc1034d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2800,6 +2800,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2800 | // Cache the user's name | 2800 | // Cache the user's name |
2801 | CacheUserName(sp, aCircuit); | 2801 | CacheUserName(sp, aCircuit); |
2802 | 2802 | ||
2803 | // Let's send the Suitcase folder for incoming HG agents | ||
2804 | if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) | ||
2805 | { | ||
2806 | m_log.DebugFormat("[SCENE]: Sending root folder to viewer..."); | ||
2807 | InventoryFolderBase suitcase = InventoryService.GetRootFolder(client.AgentId); | ||
2808 | client.SendBulkUpdateInventory(suitcase); | ||
2809 | } | ||
2810 | |||
2803 | EventManager.TriggerOnNewClient(client); | 2811 | EventManager.TriggerOnNewClient(client); |
2804 | if (vialogin) | 2812 | if (vialogin) |
2805 | { | 2813 | { |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 20708d9..b08d5db 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -426,6 +426,8 @@ public class BSCharacter : PhysicsActor | |||
426 | } | 426 | } |
427 | } | 427 | } |
428 | 428 | ||
429 | // Called by the scene when a collision with this object is reported | ||
430 | CollisionEventUpdate collisionCollection = null; | ||
429 | public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth) | 431 | public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth) |
430 | { | 432 | { |
431 | // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); | 433 | // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); |
@@ -443,10 +445,24 @@ public class BSCharacter : PhysicsActor | |||
443 | if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; | 445 | if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; |
444 | _lastCollisionTime = nowTime; | 446 | _lastCollisionTime = nowTime; |
445 | 447 | ||
446 | Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); | 448 | if (collisionCollection == null) |
447 | contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); | 449 | collisionCollection = new CollisionEventUpdate(); |
448 | CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); | 450 | collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); |
449 | base.SendCollisionUpdate(args); | 451 | } |
452 | |||
453 | public void SendCollisions() | ||
454 | { | ||
455 | // if (collisionCollection != null) | ||
456 | // { | ||
457 | // base.SendCollisionUpdate(collisionCollection); | ||
458 | // collisionCollection = null; | ||
459 | // } | ||
460 | // Kludge to make a collision call even if there are no collisions. | ||
461 | // This causes the avatar animation to get updated. | ||
462 | if (collisionCollection == null) | ||
463 | collisionCollection = new CollisionEventUpdate(); | ||
464 | base.SendCollisionUpdate(collisionCollection); | ||
465 | collisionCollection = null; | ||
450 | } | 466 | } |
451 | 467 | ||
452 | } | 468 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index f122df9..248d1f2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -1326,6 +1326,7 @@ public sealed class BSPrim : PhysicsActor | |||
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | // I've collided with something | 1328 | // I've collided with something |
1329 | CollisionEventUpdate collisionCollection = null; | ||
1329 | public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) | 1330 | public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) |
1330 | { | 1331 | { |
1331 | // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); | 1332 | // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); |
@@ -1343,11 +1344,18 @@ public sealed class BSPrim : PhysicsActor | |||
1343 | if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; | 1344 | if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; |
1344 | _lastCollisionTime = nowTime; | 1345 | _lastCollisionTime = nowTime; |
1345 | 1346 | ||
1346 | // create the event for the collision | 1347 | if (collisionCollection == null) |
1347 | Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); | 1348 | collisionCollection = new CollisionEventUpdate(); |
1348 | contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); | 1349 | collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); |
1349 | CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); | 1350 | } |
1350 | base.SendCollisionUpdate(args); | 1351 | |
1352 | public void SendCollisions() | ||
1353 | { | ||
1354 | if (collisionCollection != null) | ||
1355 | { | ||
1356 | base.SendCollisionUpdate(collisionCollection); | ||
1357 | collisionCollection = null; | ||
1358 | } | ||
1351 | } | 1359 | } |
1352 | } | 1360 | } |
1353 | } | 1361 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 581d540..94a0ccf 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -78,6 +78,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
78 | 78 | ||
79 | private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>(); | 79 | private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>(); |
80 | private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>(); | 80 | private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>(); |
81 | private HashSet<BSCharacter> m_avatarsWithCollisions = new HashSet<BSCharacter>(); | ||
82 | private HashSet<BSPrim> m_primsWithCollisions = new HashSet<BSPrim>(); | ||
81 | private List<BSPrim> m_vehicles = new List<BSPrim>(); | 83 | private List<BSPrim> m_vehicles = new List<BSPrim>(); |
82 | private float[] m_heightMap; | 84 | private float[] m_heightMap; |
83 | private float m_waterLevel; | 85 | private float m_waterLevel; |
@@ -435,6 +437,17 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
435 | } | 437 | } |
436 | } | 438 | } |
437 | 439 | ||
440 | // The SendCollision's batch up the collisions on the objects. Now push the collisions into the simulator. | ||
441 | foreach (BSPrim bsp in m_primsWithCollisions) | ||
442 | bsp.SendCollisions(); | ||
443 | m_primsWithCollisions.Clear(); | ||
444 | // foreach (BSCharacter bsc in m_avatarsWithCollisions) | ||
445 | // bsc.SendCollisions(); | ||
446 | // This is a kludge to get avatar movement updated. ODE sends collisions even if there isn't any | ||
447 | foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars) | ||
448 | kvp.Value.SendCollisions(); | ||
449 | m_avatarsWithCollisions.Clear(); | ||
450 | |||
438 | // If any of the objects had updated properties, tell the object it has been changed by the physics engine | 451 | // If any of the objects had updated properties, tell the object it has been changed by the physics engine |
439 | if (updatedEntityCount > 0) | 452 | if (updatedEntityCount > 0) |
440 | { | 453 | { |
@@ -485,11 +498,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
485 | BSPrim prim; | 498 | BSPrim prim; |
486 | if (m_prims.TryGetValue(localID, out prim)) { | 499 | if (m_prims.TryGetValue(localID, out prim)) { |
487 | prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration); | 500 | prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration); |
501 | m_primsWithCollisions.Add(prim); | ||
488 | return; | 502 | return; |
489 | } | 503 | } |
490 | BSCharacter actor; | 504 | BSCharacter actor; |
491 | if (m_avatars.TryGetValue(localID, out actor)) { | 505 | if (m_avatars.TryGetValue(localID, out actor)) { |
492 | actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration); | 506 | actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration); |
507 | m_avatarsWithCollisions.Add(actor); | ||
493 | return; | 508 | return; |
494 | } | 509 | } |
495 | return; | 510 | return; |