aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJohn Hurliman2009-09-30 15:28:23 -0700
committerJohn Hurliman2009-09-30 15:28:23 -0700
commitacfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009 (patch)
tree305349e1bd0a5849fd7f96483e24d5e07b24b8f4 /OpenSim/Region/Framework
parent* Adding Scale to EntityBase * Fixing the incorrect initialization of EntityB... (diff)
parentFormatting cleanup. (diff)
downloadopensim-SC-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.zip
opensim-SC-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.gz
opensim-SC-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.bz2
opensim-SC-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/ICommander.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IDialogModule.cs10
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityCreator.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IFriendsModule.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/IGodsModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/ILandChannel.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISoundModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IVegetationModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IVoiceModule.cs45
-rw-r--r--OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/AvatarAnimations.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityManager.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs50
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs232
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs37
-rw-r--r--OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Permissions.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs194
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs367
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs19
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs31
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs281
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/UuidGatherer.cs12
48 files changed, 702 insertions, 870 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
index c1ed1ac..0cc8fb6 100644
--- a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Interfaces
41 sbyte type, byte wearableType, uint nextOwnerMask); 41 sbyte type, byte wearableType, uint nextOwnerMask);
42 42
43 void HandleTaskItemUpdateFromTransaction( 43 void HandleTaskItemUpdateFromTransaction(
44 IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item); 44 IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item);
45 45
46 void RemoveAgentAssetTransactions(UUID userID); 46 void RemoveAgentAssetTransactions(UUID userID);
47 } 47 }
diff --git a/OpenSim/Region/Framework/Interfaces/ICommander.cs b/OpenSim/Region/Framework/Interfaces/ICommander.cs
index 9371bea..6b872c1 100644
--- a/OpenSim/Region/Framework/Interfaces/ICommander.cs
+++ b/OpenSim/Region/Framework/Interfaces/ICommander.cs
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Framework.Interfaces
33 { 33 {
34 /// <value> 34 /// <value>
35 /// The name of this commander 35 /// The name of this commander
36 /// </value> 36 /// </value>
37 string Name { get; } 37 string Name { get; }
38 38
39 /// <value> 39 /// <value>
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Interfaces
44 /// <summary> 44 /// <summary>
45 /// The commands available for this commander 45 /// The commands available for this commander
46 /// </summary> 46 /// </summary>
47 Dictionary<string, ICommand> Commands { get; } 47 Dictionary<string, ICommand> Commands { get; }
48 48
49 void ProcessConsoleCommand(string function, string[] args); 49 void ProcessConsoleCommand(string function, string[] args);
50 void RegisterCommand(string commandName, ICommand command); 50 void RegisterCommand(string commandName, ICommand command);
diff --git a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
index a6ca7f1..d1c37da 100644
--- a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
@@ -37,15 +37,15 @@ namespace OpenSim.Region.Framework.Interfaces
37 /// small interval. 37 /// small interval.
38 /// </summary> 38 /// </summary>
39 /// <param name="client"></param> 39 /// <param name="client"></param>
40 /// <param name="message"></param> 40 /// <param name="message"></param>
41 void SendAlertToUser(IClientAPI client, string message); 41 void SendAlertToUser(IClientAPI client, string message);
42 42
43 /// <summary> 43 /// <summary>
44 /// Send an alert message to a particular user. 44 /// Send an alert message to a particular user.
45 /// </summary> 45 /// </summary>
46 /// <param name="client"></param> 46 /// <param name="client"></param>
47 /// <param name="message"></param> 47 /// <param name="message"></param>
48 /// <param name="modal"></param> 48 /// <param name="modal"></param>
49 void SendAlertToUser(IClientAPI client, string message, bool modal); 49 void SendAlertToUser(IClientAPI client, string message, bool modal);
50 50
51 /// <summary> 51 /// <summary>
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Framework.Interfaces
104 /// <param name="message"></param> 104 /// <param name="message"></param>
105 /// <param name="url"></param> 105 /// <param name="url"></param>
106 void SendUrlToUser( 106 void SendUrlToUser(
107 UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url); 107 UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url);
108 108
109 /// <summary> 109 /// <summary>
110 /// Send a notification to all users in the scene. This notification should remain around until the 110 /// Send a notification to all users in the scene. This notification should remain around until the
@@ -116,7 +116,7 @@ namespace OpenSim.Region.Framework.Interfaces
116 /// 116 ///
117 /// <param name="fromAvatarID">The user sending the message</param> 117 /// <param name="fromAvatarID">The user sending the message</param>
118 /// <param name="fromAvatarName">The name of the user doing the sending</param> 118 /// <param name="fromAvatarName">The name of the user doing the sending</param>
119 /// <param name="message">The message being sent to the user</param> 119 /// <param name="message">The message being sent to the user</param>
120 void SendNotificationToUsersInRegion(UUID fromAvatarID, string fromAvatarName, string message); 120 void SendNotificationToUsersInRegion(UUID fromAvatarID, string fromAvatarName, string message);
121 121
122 /// <summary> 122 /// <summary>
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs b/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs
index f3a3747..c39627c 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityCreator.cs
@@ -29,13 +29,13 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenSim.Region.Framework.Scenes; 30using OpenSim.Region.Framework.Scenes;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 /// <summary> 34 /// <summary>
35 /// Interface to a class that is capable of creating entities 35 /// Interface to a class that is capable of creating entities
36 /// </summary> 36 /// </summary>
37 public interface IEntityCreator 37 public interface IEntityCreator
38 { 38 {
39 /// <summary> 39 /// <summary>
40 /// The entities that this class is capable of creating. These match the PCode format. 40 /// The entities that this class is capable of creating. These match the PCode format.
41 /// </summary> 41 /// </summary>
@@ -51,6 +51,6 @@ namespace OpenSim.Region.Framework.Interfaces
51 /// <param name="rot"></param> 51 /// <param name="rot"></param>
52 /// <param name="shape"></param> 52 /// <param name="shape"></param>
53 /// <returns>The entity created, or null if the creation failed</returns> 53 /// <returns>The entity created, or null if the creation failed</returns>
54 SceneObjectGroup CreateEntity(UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape); 54 SceneObjectGroup CreateEntity(UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape);
55 } 55 }
56} 56}
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 1ed92fb..2c906a2 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Framework.Interfaces
64 /// <summary> 64 /// <summary>
65 /// Change every item in this inventory to a new group. 65 /// Change every item in this inventory to a new group.
66 /// </summary> 66 /// </summary>
67 /// <param name="groupID"></param> 67 /// <param name="groupID"></param>
68 void ChangeInventoryGroup(UUID groupID); 68 void ChangeInventoryGroup(UUID groupID);
69 69
70 /// <summary> 70 /// <summary>
@@ -94,7 +94,7 @@ namespace OpenSim.Region.Framework.Interfaces
94 /// <param name="startParam"></param> 94 /// <param name="startParam"></param>
95 /// <param name="postOnRez"></param> 95 /// <param name="postOnRez"></param>
96 /// <param name="engine"></param> 96 /// <param name="engine"></param>
97 /// <param name="stateSource"></param> 97 /// <param name="stateSource"></param>
98 void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource); 98 void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
99 99
100 /// <summary> 100 /// <summary>
@@ -150,7 +150,7 @@ namespace OpenSim.Region.Framework.Interfaces
150 150
151 /// <summary> 151 /// <summary>
152 /// Return the name with which a client can request a xfer of this prim's inventory metadata 152 /// Return the name with which a client can request a xfer of this prim's inventory metadata
153 /// </summary> 153 /// </summary>
154 string GetInventoryFileName(); 154 string GetInventoryFileName();
155 155
156 bool GetInventoryFileName(IClientAPI client, uint localID); 156 bool GetInventoryFileName(IClientAPI client, uint localID);
diff --git a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
index af54c76..7a8aba2 100644
--- a/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IFriendsModule.cs
@@ -29,7 +29,7 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface IFriendsModule 33 public interface IFriendsModule
34 { 34 {
35 /// <summary> 35 /// <summary>
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces
43 /// FIXME: This is somewhat too tightly coupled - it should arguably be possible to offer friendships even if the 43 /// FIXME: This is somewhat too tightly coupled - it should arguably be possible to offer friendships even if the
44 /// receiving user is not currently online. 44 /// receiving user is not currently online.
45 /// </param> 45 /// </param>
46 /// <param name="offerMessage"></param> 46 /// <param name="offerMessage"></param>
47 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage); 47 void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage);
48 } 48 }
49} 49}
diff --git a/OpenSim/Region/Framework/Interfaces/IGodsModule.cs b/OpenSim/Region/Framework/Interfaces/IGodsModule.cs
index 02abb05..552ce01 100644
--- a/OpenSim/Region/Framework/Interfaces/IGodsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IGodsModule.cs
@@ -29,7 +29,7 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 /// <summary> 33 /// <summary>
34 /// This interface provides god related methods 34 /// This interface provides god related methods
35 /// </summary> 35 /// </summary>
@@ -53,6 +53,6 @@ namespace OpenSim.Region.Framework.Interfaces
53 /// <param name="agentID">the person that is being kicked</param> 53 /// <param name="agentID">the person that is being kicked</param>
54 /// <param name="kickflags">This isn't used apparently</param> 54 /// <param name="kickflags">This isn't used apparently</param>
55 /// <param name="reason">The message to send to the user after it's been turned into a field</param> 55 /// <param name="reason">The message to send to the user after it's been turned into a field</param>
56 void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason); 56 void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason);
57 } 57 }
58} 58}
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
index 1622564..2d038ce 100644
--- a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs
@@ -30,7 +30,7 @@ using System.IO;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
31 31
32namespace OpenSim.Region.Framework.Interfaces 32namespace OpenSim.Region.Framework.Interfaces
33{ 33{
34 /// <summary> 34 /// <summary>
35 /// Used for the OnInventoryArchiveSaved event. 35 /// Used for the OnInventoryArchiveSaved event.
36 /// </summary> 36 /// </summary>
@@ -43,11 +43,11 @@ namespace OpenSim.Region.Framework.Interfaces
43 public delegate void InventoryArchiveSaved( 43 public delegate void InventoryArchiveSaved(
44 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException); 44 Guid id, bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException);
45 45
46 public interface IInventoryArchiverModule 46 public interface IInventoryArchiverModule
47 { 47 {
48 /// <summary> 48 /// <summary>
49 /// Fired when an archive inventory save has been completed. 49 /// Fired when an archive inventory save has been completed.
50 /// </summary> 50 /// </summary>
51 event InventoryArchiveSaved OnInventoryArchiveSaved; 51 event InventoryArchiveSaved OnInventoryArchiveSaved;
52 52
53 /// <summary> 53 /// <summary>
@@ -69,6 +69,6 @@ namespace OpenSim.Region.Framework.Interfaces
69 /// <param name="invPath">The inventory path from which the inventory should be saved.</param> 69 /// <param name="invPath">The inventory path from which the inventory should be saved.</param>
70 /// <param name="saveStream">The stream to which the inventory archive will be saved</param> 70 /// <param name="saveStream">The stream to which the inventory archive will be saved</param>
71 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns> 71 /// <returns>true if the first stage of the operation succeeded, false otherwise</returns>
72 bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream); 72 bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream);
73 } 73 }
74} 74}
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
index 19b8574..74f404f 100644
--- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
+++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Interfaces
41 /// </summary> 41 /// </summary>
42 /// <param name="x">Value between 0 - 256 on the x axis of the point</param> 42 /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
43 /// <param name="y">Value between 0 - 256 on the y axis of the point</param> 43 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
44 /// <returns>Land object at the point supplied</returns> 44 /// <returns>Land object at the point supplied</returns>
45 ILandObject GetLandObject(int x, int y); 45 ILandObject GetLandObject(int x, int y);
46 46
47 ILandObject GetLandObject(int localID); 47 ILandObject GetLandObject(int localID);
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces
51 /// </summary> 51 /// </summary>
52 /// <param name="x">Value between 0 - 256 on the x axis of the point</param> 52 /// <param name="x">Value between 0 - 256 on the x axis of the point</param>
53 /// <param name="y">Value between 0 - 256 on the y axis of the point</param> 53 /// <param name="y">Value between 0 - 256 on the y axis of the point</param>
54 /// <returns>Land object at the point supplied</returns> 54 /// <returns>Land object at the point supplied</returns>
55 ILandObject GetLandObject(float x, float y); 55 ILandObject GetLandObject(float x, float y);
56 56
57 bool IsLandPrimCountTainted(); 57 bool IsLandPrimCountTainted();
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
index 78b5322..fa64333 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
@@ -54,7 +54,7 @@ namespace OpenSim.Region.Framework.Interfaces
54 /// 54 ///
55 /// <param name="savePath"></param> 55 /// <param name="savePath"></param>
56 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 56 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
57 void ArchiveRegion(string savePath, Guid requestId); 57 void ArchiveRegion(string savePath, Guid requestId);
58 58
59 /// <summary> 59 /// <summary>
60 /// Archive the region to a stream. 60 /// Archive the region to a stream.
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Interfaces
88 /// settings in the archive will be ignored. 88 /// settings in the archive will be ignored.
89 /// </param> 89 /// </param>
90 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 90 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
91 void DearchiveRegion(string loadPath, bool merge, Guid requestId); 91 void DearchiveRegion(string loadPath, bool merge, Guid requestId);
92 92
93 /// <summary> 93 /// <summary>
94 /// Dearchive a region from a stream. This replaces the existing scene. 94 /// Dearchive a region from a stream. This replaces the existing scene.
@@ -109,8 +109,8 @@ namespace OpenSim.Region.Framework.Interfaces
109 /// <param name="merge"> 109 /// <param name="merge">
110 /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region 110 /// If true, the loaded region merges with the existing one rather than replacing it. Any terrain or region
111 /// settings in the archive will be ignored. 111 /// settings in the archive will be ignored.
112 /// </param> 112 /// </param>
113 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 113 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
114 void DearchiveRegion(Stream loadStream, bool merge, Guid requestId); 114 void DearchiveRegion(Stream loadStream, bool merge, Guid requestId);
115 } 115 }
116} 116}
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs
index 41a1e51..78bd622 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs
@@ -71,21 +71,21 @@ namespace OpenSim.Region.Framework.Interfaces
71 /// Load persisted objects from region storage. 71 /// Load persisted objects from region storage.
72 /// </summary> 72 /// </summary>
73 /// <param name="regionUUID">the Region UUID</param> 73 /// <param name="regionUUID">the Region UUID</param>
74 /// <returns>List of loaded groups</returns> 74 /// <returns>List of loaded groups</returns>
75 List<SceneObjectGroup> LoadObjects(UUID regionUUID); 75 List<SceneObjectGroup> LoadObjects(UUID regionUUID);
76 76
77 /// <summary> 77 /// <summary>
78 /// Store a terrain revision in region storage 78 /// Store a terrain revision in region storage
79 /// </summary> 79 /// </summary>
80 /// <param name="ter">HeightField data</param> 80 /// <param name="ter">HeightField data</param>
81 /// <param name="regionID">region UUID</param> 81 /// <param name="regionID">region UUID</param>
82 void StoreTerrain(double[,] terrain, UUID regionID); 82 void StoreTerrain(double[,] terrain, UUID regionID);
83 83
84 /// <summary> 84 /// <summary>
85 /// Load the latest terrain revision from region storage 85 /// Load the latest terrain revision from region storage
86 /// </summary> 86 /// </summary>
87 /// <param name="regionID">the region UUID</param> 87 /// <param name="regionID">the region UUID</param>
88 /// <returns>Heightfield data</returns> 88 /// <returns>Heightfield data</returns>
89 double[,] LoadTerrain(UUID regionID); 89 double[,] LoadTerrain(UUID regionID);
90 90
91 void StoreLandObject(ILandObject Parcel); 91 void StoreLandObject(ILandObject Parcel);
@@ -96,7 +96,7 @@ namespace OpenSim.Region.Framework.Interfaces
96 /// <item>delete from landaccesslist where LandUUID=globalID</item> 96 /// <item>delete from landaccesslist where LandUUID=globalID</item>
97 /// </list> 97 /// </list>
98 /// </summary> 98 /// </summary>
99 /// <param name="globalID"></param> 99 /// <param name="globalID"></param>
100 void RemoveLandObject(UUID globalID); 100 void RemoveLandObject(UUID globalID);
101 101
102 List<LandData> LoadLandObjects(UUID regionUUID); 102 List<LandData> LoadLandObjects(UUID regionUUID);
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs
index bfd25d3..e7562a5 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs
@@ -117,6 +117,6 @@ namespace OpenSim.Region.Framework.Interfaces
117 /// </summary> 117 /// </summary>
118 /// <param name="grp"></param> 118 /// <param name="grp"></param>
119 /// <returns></returns> 119 /// <returns></returns>
120 string SerializeGroupToXml2(SceneObjectGroup grp); 120 string SerializeGroupToXml2(SceneObjectGroup grp);
121 } 121 }
122} 122}
diff --git a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
index 3d803ee..379fabd 100644
--- a/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISoundModule.cs
@@ -29,12 +29,12 @@ using System;
29using OpenMetaverse; 29using OpenMetaverse;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface ISoundModule 33 public interface ISoundModule
34 { 34 {
35 void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags); 35 void PlayAttachedSound(UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags);
36 36
37 void TriggerSound( 37 void TriggerSound(
38 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle); 38 UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle);
39 } 39 }
40} \ No newline at end of file 40} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs b/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs
index 344601f..403d542 100644
--- a/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IVegetationModule.cs
@@ -29,7 +29,7 @@ using OpenMetaverse;
29using OpenSim.Region.Framework.Scenes; 29using OpenSim.Region.Framework.Scenes;
30 30
31namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
32{ 32{
33 public interface IVegetationModule : IEntityCreator 33 public interface IVegetationModule : IEntityCreator
34 { 34 {
35 /// <summary> 35 /// <summary>
@@ -44,6 +44,6 @@ namespace OpenSim.Region.Framework.Interfaces
44 /// <param name="newTree"></param> 44 /// <param name="newTree"></param>
45 /// <returns></returns> 45 /// <returns></returns>
46 SceneObjectGroup AddTree( 46 SceneObjectGroup AddTree(
47 UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree); 47 UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree);
48 } 48 }
49} 49}
diff --git a/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs b/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs
new file mode 100644
index 0000000..2e555fa
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IVoiceModule.cs
@@ -0,0 +1,45 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28
29using System.IO;
30using OpenMetaverse;
31
32namespace OpenSim.Region.Framework.Interfaces
33{
34 public interface IVoiceModule
35 {
36
37 /// <summary>
38 /// Set the SIP url to be used by a parcel, this will allow manual setting of a SIP address
39 /// for a particular piece of land, allowing region owners to use preconfigured SIP conference channels.
40 /// This is used by osSetParcelSIPAddress
41 /// </summary>
42 void setLandSIPAddress(string SIPAddress,UUID GlobalID);
43
44 }
45}
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
index a0b0888..de1bcd4 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
@@ -26,9 +26,9 @@
26 */ 26 */
27 27
28namespace OpenSim.Region.Framework.Interfaces 28namespace OpenSim.Region.Framework.Interfaces
29{ 29{
30 public interface IWorldMapModule 30 public interface IWorldMapModule
31 { 31 {
32 void LazySaveGeneratedMaptile(byte[] data, bool temporary); 32 void LazySaveGeneratedMaptile(byte[] data, bool temporary);
33 } 33 }
34} 34}
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index 7ac1e7e..5b571c7 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -34,7 +34,7 @@ using OpenMetaverse;
34using OpenSim.Framework; 34using OpenSim.Framework;
35 35
36namespace OpenSim.Region.Framework.Scenes 36namespace OpenSim.Region.Framework.Scenes
37{ 37{
38 class DeleteToInventoryHolder 38 class DeleteToInventoryHolder
39 { 39 {
40 public DeRezAction action; 40 public DeRezAction action;
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Scenes
49 /// up the main client thread. 49 /// up the main client thread.
50 /// </summary> 50 /// </summary>
51 public class AsyncSceneObjectGroupDeleter 51 public class AsyncSceneObjectGroupDeleter
52 { 52 {
53 private static readonly ILog m_log 53 private static readonly ILog m_log
54 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 55
@@ -58,16 +58,16 @@ namespace OpenSim.Region.Framework.Scenes
58 /// </value> 58 /// </value>
59 public bool Enabled; 59 public bool Enabled;
60 60
61 private Timer m_inventoryTicker = new Timer(2000); 61 private Timer m_inventoryTicker = new Timer(2000);
62 private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>(); 62 private readonly Queue<DeleteToInventoryHolder> m_inventoryDeletes = new Queue<DeleteToInventoryHolder>();
63 private Scene m_scene; 63 private Scene m_scene;
64 64
65 public AsyncSceneObjectGroupDeleter(Scene scene) 65 public AsyncSceneObjectGroupDeleter(Scene scene)
66 { 66 {
67 m_scene = scene; 67 m_scene = scene;
68 68
69 m_inventoryTicker.AutoReset = false; 69 m_inventoryTicker.AutoReset = false;
70 m_inventoryTicker.Elapsed += InventoryRunDeleteTimer; 70 m_inventoryTicker.Elapsed += InventoryRunDeleteTimer;
71 } 71 }
72 72
73 /// <summary> 73 /// <summary>
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Scenes
113 { 113 {
114 //m_log.Debug("[SCENE]: Sent item successfully to inventory, continuing..."); 114 //m_log.Debug("[SCENE]: Sent item successfully to inventory, continuing...");
115 } 115 }
116 } 116 }
117 117
118 /// <summary> 118 /// <summary>
119 /// Move the next object in the queue to inventory. Then delete it properly from the scene. 119 /// Move the next object in the queue to inventory. Then delete it properly from the scene.
@@ -121,7 +121,7 @@ namespace OpenSim.Region.Framework.Scenes
121 /// <returns></returns> 121 /// <returns></returns>
122 public bool InventoryDeQueueAndDelete() 122 public bool InventoryDeQueueAndDelete()
123 { 123 {
124 DeleteToInventoryHolder x = null; 124 DeleteToInventoryHolder x = null;
125 125
126 try 126 try
127 { 127 {
@@ -142,9 +142,9 @@ namespace OpenSim.Region.Framework.Scenes
142 142
143 try 143 try
144 { 144 {
145 m_scene.DeleteToInventory(x.action, x.folderID, x.objectGroup, x.remoteClient); 145 m_scene.DeleteToInventory(x.action, x.folderID, x.objectGroup, x.remoteClient);
146 if (x.permissionToDelete) 146 if (x.permissionToDelete)
147 m_scene.DeleteSceneObject(x.objectGroup, false); 147 m_scene.DeleteSceneObject(x.objectGroup, false);
148 } 148 }
149 catch (Exception e) 149 catch (Exception e)
150 { 150 {
@@ -166,6 +166,6 @@ namespace OpenSim.Region.Framework.Scenes
166 166
167 m_log.Debug("[SCENE]: No objects left in inventory send queue."); 167 m_log.Debug("[SCENE]: No objects left in inventory send queue.");
168 return false; 168 return false;
169 } 169 }
170 } 170 }
171} 171}
diff --git a/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs
index 06b1d22..72d599a 100644
--- a/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs
+++ b/OpenSim/Region/Framework/Scenes/AvatarAnimations.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes
47 { 47 {
48 if (nod.Attributes["name"] != null) 48 if (nod.Attributes["name"] != null)
49 { 49 {
50 string name = (string)nod.Attributes["name"].Value; 50 string name = (string)nod.Attributes["name"].Value;
51 UUID id = (UUID)nod.InnerText; 51 UUID id = (UUID)nod.InnerText;
52 string animState = (string)nod.Attributes["state"].Value; 52 string animState = (string)nod.Attributes["state"].Value;
53 53
diff --git a/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs b/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs
index 1dd9613..5f2eb0d 100644
--- a/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs
+++ b/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs
@@ -234,7 +234,7 @@ namespace OpenSim.Region.Framework.Scenes
234 234
235 235
236 /// <summary> 236 /// <summary>
237 /// Variable length strings seem to be null terminated in the animation asset.. but.. 237 /// Variable length strings seem to be null terminated in the animation asset.. but..
238 /// use with caution, home grown. 238 /// use with caution, home grown.
239 /// advances the index. 239 /// advances the index.
240 /// </summary> 240 /// </summary>
@@ -273,7 +273,7 @@ namespace OpenSim.Region.Framework.Scenes
273 byte[] interm = new byte[endpos-i]; 273 byte[] interm = new byte[endpos-i];
274 for (; i<endpos; i++) 274 for (; i<endpos; i++)
275 { 275 {
276 interm[i-startpos] = data[i]; 276 interm[i-startpos] = data[i];
277 } 277 }
278 i++; // advance past the null character 278 i++; // advance past the null character
279 279
@@ -624,7 +624,7 @@ switch (jointname)
624 case "mWristLeft": 624 case "mWristLeft":
625 case "mWristRight": 625 case "mWristRight":
626 case "mShoulderLeft": 626 case "mShoulderLeft":
627 case "mShoulderRight": 627 case "mShoulderRight":
628 // ZYX->ZXY 628 // ZYX->ZXY
629 t = y; 629 t = y;
630 y = z; 630 y = z;
diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs
index 504b90a..0ceef39 100644
--- a/OpenSim/Region/Framework/Scenes/EntityManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes
144 { 144 {
145 m_log.ErrorFormat("Remove Entity failed for {0}", localID, e); 145 m_log.ErrorFormat("Remove Entity failed for {0}", localID, e);
146 return false; 146 return false;
147 } 147 }
148 } 148 }
149 } 149 }
150 150
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 287d8d9..753344d 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -32,6 +32,7 @@ using OpenSim.Framework;
32using OpenSim.Framework.Client; 32using OpenSim.Framework.Client;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34using Caps=OpenSim.Framework.Capabilities.Caps; 34using Caps=OpenSim.Framework.Capabilities.Caps;
35using GridRegion = OpenSim.Services.Interfaces.GridRegion;
35 36
36namespace OpenSim.Region.Framework.Scenes 37namespace OpenSim.Region.Framework.Scenes
37{ 38{
@@ -289,7 +290,7 @@ namespace OpenSim.Region.Framework.Scenes
289 /// Guid.Empty is returned. 290 /// Guid.Empty is returned.
290 /// </summary> 291 /// </summary>
291 public delegate void OarFileSaved(Guid guid, string message); 292 public delegate void OarFileSaved(Guid guid, string message);
292 public event OarFileSaved OnOarFileSaved; 293 public event OarFileSaved OnOarFileSaved;
293 294
294 /// <summary> 295 /// <summary>
295 /// Called when the script compile queue becomes empty 296 /// Called when the script compile queue becomes empty
@@ -305,6 +306,9 @@ namespace OpenSim.Region.Framework.Scenes
305 public delegate void Attach(uint localID, UUID itemID, UUID avatarID); 306 public delegate void Attach(uint localID, UUID itemID, UUID avatarID);
306 public event Attach OnAttach; 307 public event Attach OnAttach;
307 308
309 public delegate void RegionUp(GridRegion region);
310 public event RegionUp OnRegionUp;
311
308 public class MoneyTransferArgs : EventArgs 312 public class MoneyTransferArgs : EventArgs
309 { 313 {
310 public UUID sender; 314 public UUID sender;
@@ -446,6 +450,7 @@ namespace OpenSim.Region.Framework.Scenes
446 private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null; 450 private EmptyScriptCompileQueue handlerEmptyScriptCompileQueue = null;
447 451
448 private Attach handlerOnAttach = null; 452 private Attach handlerOnAttach = null;
453 private RegionUp handlerOnRegionUp = null;
449 454
450 public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID) 455 public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)
451 { 456 {
@@ -999,7 +1004,7 @@ namespace OpenSim.Region.Framework.Scenes
999 handlerOarFileSaved = OnOarFileSaved; 1004 handlerOarFileSaved = OnOarFileSaved;
1000 if (handlerOarFileSaved != null) 1005 if (handlerOarFileSaved != null)
1001 handlerOarFileSaved(requestId, message); 1006 handlerOarFileSaved(requestId, message);
1002 } 1007 }
1003 1008
1004 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message) 1009 public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
1005 { 1010 {
@@ -1035,5 +1040,13 @@ namespace OpenSim.Region.Framework.Scenes
1035 if (handlerSetRootAgentScene != null) 1040 if (handlerSetRootAgentScene != null)
1036 handlerSetRootAgentScene(agentID, scene); 1041 handlerSetRootAgentScene(agentID, scene);
1037 } 1042 }
1043
1044 public void TriggerOnRegionUp(GridRegion otherRegion)
1045 {
1046 handlerOnRegionUp = OnRegionUp;
1047 if (handlerOnRegionUp != null)
1048 handlerOnRegionUp(otherRegion);
1049 }
1050
1038 } 1051 }
1039} 1052}
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
index 5d65f98..b6fa41d 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework;
35using OpenSim.Framework.Communications.Cache; 35using OpenSim.Framework.Communications.Cache;
36using OpenSim.Framework.Communications.Clients; 36using OpenSim.Framework.Communications.Clients;
37using OpenSim.Region.Framework.Scenes.Serialization; 37using OpenSim.Region.Framework.Scenes.Serialization;
38using OpenSim.Services.Interfaces;
38 39
39//using HyperGrid.Framework; 40//using HyperGrid.Framework;
40//using OpenSim.Region.Communications.Hypergrid; 41//using OpenSim.Region.Communications.Hypergrid;
@@ -47,10 +48,21 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 49
49 // This maps between inventory server urls and inventory server clients 50 // This maps between inventory server urls and inventory server clients
50 private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>(); 51// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>();
51
52 52
53 private Scene m_scene; 53 private Scene m_scene;
54
55 private IHyperlinkService m_hyper;
56 IHyperlinkService HyperlinkService
57 {
58 get
59 {
60 if (m_hyper == null)
61 m_hyper = m_scene.RequestModuleInterface<IHyperlinkService>();
62 return m_hyper;
63 }
64 }
65
54 #endregion 66 #endregion
55 67
56 #region Constructor 68 #region Constructor
@@ -72,30 +84,14 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
72 return null; 84 return null;
73 } 85 }
74 86
75 private string UserInventoryURL(UUID userID) 87// private string UserInventoryURL(UUID userID)
76 { 88// {
77 CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); 89// CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
78 if (uinfo != null) 90// if (uinfo != null)
79 return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI; 91// return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI;
80 return null; 92// return null;
81 } 93// }
82 94
83 private bool IsLocalUser(UUID userID)
84 {
85 CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
86
87 if (uinfo != null)
88 {
89 if (HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile))
90 {
91 m_log.Debug("[HGScene]: Home user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
92 return true;
93 }
94 }
95
96 m_log.Debug("[HGScene]: Foreign user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
97 return false;
98 }
99 95
100 public AssetBase FetchAsset(string url, UUID assetID) 96 public AssetBase FetchAsset(string url, UUID assetID)
101 { 97 {
@@ -171,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
171 167
172 public void Get(UUID assetID, UUID ownerID) 168 public void Get(UUID assetID, UUID ownerID)
173 { 169 {
174 if (!IsLocalUser(ownerID)) 170 if (!HyperlinkService.IsLocalUser(ownerID))
175 { 171 {
176 // Get the item from the remote asset server onto the local AssetCache 172 // Get the item from the remote asset server onto the local AssetCache
177 // and place an entry in m_assetMap 173 // and place an entry in m_assetMap
@@ -229,7 +225,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
229 225
230 public void Post(UUID assetID, UUID ownerID) 226 public void Post(UUID assetID, UUID ownerID)
231 { 227 {
232 if (!IsLocalUser(ownerID)) 228 if (!HyperlinkService.IsLocalUser(ownerID))
233 { 229 {
234 // Post the item from the local AssetCache onto the remote asset server 230 // Post the item from the local AssetCache onto the remote asset server
235 // and place an entry in m_assetMap 231 // and place an entry in m_assetMap
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs
deleted file mode 100644
index a576feb..0000000
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGHyperlink.cs
+++ /dev/null
@@ -1,232 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Net;
30using System.Reflection;
31using log4net;
32using OpenMetaverse;
33using OpenSim.Framework;
34
35namespace OpenSim.Region.Framework.Scenes.Hypergrid
36{
37 public class HGHyperlink
38 {
39 private static readonly ILog m_log =
40 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 private static Random random = new Random();
42
43 public static RegionInfo TryLinkRegionToCoords(Scene m_scene, IClientAPI client, string mapName, uint xloc, uint yloc)
44 {
45 string host = "127.0.0.1";
46 string portstr;
47 string regionName = "";
48 uint port = 9000;
49 string[] parts = mapName.Split(new char[] { ':' });
50 if (parts.Length >= 1)
51 {
52 host = parts[0];
53 }
54 if (parts.Length >= 2)
55 {
56 portstr = parts[1];
57 if (!UInt32.TryParse(portstr, out port))
58 regionName = parts[1];
59 }
60 // always take the last one
61 if (parts.Length >= 3)
62 {
63 regionName = parts[2];
64 }
65
66 // Sanity check. Don't ever link to this sim.
67 IPAddress ipaddr = null;
68 try
69 {
70 ipaddr = Util.GetHostFromDNS(host);
71 }
72 catch { }
73
74 if ((ipaddr != null) &&
75 !((m_scene.RegionInfo.ExternalEndPoint.Address.Equals(ipaddr)) && (m_scene.RegionInfo.HttpPort == port)))
76 {
77 RegionInfo regInfo;
78 bool success = TryCreateLink(m_scene, client, xloc, yloc, regionName, port, host, out regInfo);
79 if (success)
80 {
81 regInfo.RegionName = mapName;
82 return regInfo;
83 }
84 }
85
86 return null;
87 }
88
89 public static RegionInfo TryLinkRegion(Scene m_scene, IClientAPI client, string mapName)
90 {
91 uint xloc = (uint)(random.Next(0, Int16.MaxValue));
92 return TryLinkRegionToCoords(m_scene, client, mapName, xloc, 0);
93 }
94
95 public static bool TryCreateLink(Scene m_scene, IClientAPI client, uint xloc, uint yloc,
96 string externalRegionName, uint externalPort, string externalHostName, out RegionInfo regInfo)
97 {
98 m_log.DebugFormat("[HGrid]: Link to {0}:{1}, in {2}-{3}", externalHostName, externalPort, xloc, yloc);
99
100 regInfo = new RegionInfo();
101 regInfo.RegionName = externalRegionName;
102 regInfo.HttpPort = externalPort;
103 regInfo.ExternalHostName = externalHostName;
104 regInfo.RegionLocX = xloc;
105 regInfo.RegionLocY = yloc;
106
107 try
108 {
109 regInfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)0);
110 }
111 catch (Exception e)
112 {
113 m_log.Warn("[HGrid]: Wrong format for link-region: " + e.Message);
114 return false;
115 }
116 regInfo.RemotingAddress = regInfo.ExternalEndPoint.Address.ToString();
117
118 // Finally, link it
119 try
120 {
121 m_scene.CommsManager.GridService.RegisterRegion(regInfo);
122 }
123 catch (Exception e)
124 {
125 m_log.Warn("[HGrid]: Unable to link region: " + e.Message);
126 return false;
127 }
128
129 uint x, y;
130 if (!Check4096(m_scene, regInfo, out x, out y))
131 {
132 m_scene.CommsManager.GridService.DeregisterRegion(regInfo);
133 if (client != null)
134 client.SendAlertMessage("Region is too far (" + x + ", " + y + ")");
135 m_log.Info("[HGrid]: Unable to link, region is too far (" + x + ", " + y + ")");
136 return false;
137 }
138
139 if (!CheckCoords(m_scene.RegionInfo.RegionLocX, m_scene.RegionInfo.RegionLocY, x, y))
140 {
141 m_scene.CommsManager.GridService.DeregisterRegion(regInfo);
142 if (client != null)
143 client.SendAlertMessage("Region has incompatible coordinates (" + x + ", " + y + ")");
144 m_log.Info("[HGrid]: Unable to link, region has incompatible coordinates (" + x + ", " + y + ")");
145 return false;
146 }
147
148 m_log.Debug("[HGrid]: link region succeeded");
149 return true;
150 }
151
152 public static bool TryUnlinkRegion(Scene m_scene, string mapName)
153 {
154 RegionInfo regInfo = null;
155 if (mapName.Contains(":"))
156 {
157 string host = "127.0.0.1";
158 //string portstr;
159 //string regionName = "";
160 uint port = 9000;
161 string[] parts = mapName.Split(new char[] { ':' });
162 if (parts.Length >= 1)
163 {
164 host = parts[0];
165 }
166// if (parts.Length >= 2)
167// {
168// portstr = parts[1];
169// if (!UInt32.TryParse(portstr, out port))
170// regionName = parts[1];
171// }
172 // always take the last one
173// if (parts.Length >= 3)
174// {
175// regionName = parts[2];
176// }
177 regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(host, port);
178 }
179 else
180 {
181 regInfo = m_scene.CommsManager.GridService.RequestNeighbourInfo(mapName);
182 }
183 if (regInfo != null)
184 {
185 return m_scene.CommsManager.GridService.DeregisterRegion(regInfo);
186 }
187 else
188 {
189 m_log.InfoFormat("[HGrid]: Region {0} not found", mapName);
190 return false;
191 }
192 }
193
194 /// <summary>
195 /// Cope with this viewer limitation.
196 /// </summary>
197 /// <param name="regInfo"></param>
198 /// <returns></returns>
199 public static bool Check4096(Scene m_scene, RegionInfo regInfo, out uint x, out uint y)
200 {
201 ulong realHandle;
202 if (UInt64.TryParse(regInfo.regionSecret, out realHandle))
203 {
204 Utils.LongToUInts(realHandle, out x, out y);
205 x = x / Constants.RegionSize;
206 y = y / Constants.RegionSize;
207
208 if ((Math.Abs((int)m_scene.RegionInfo.RegionLocX - (int)x) >= 4096) ||
209 (Math.Abs((int)m_scene.RegionInfo.RegionLocY - (int)y) >= 4096))
210 {
211 return false;
212 }
213 return true;
214 }
215 else
216 {
217 m_scene.CommsManager.GridService.RegisterRegion(regInfo);
218 m_log.Debug("[HGrid]: Gnomes. Region deregistered.");
219 x = y = 0;
220 return false;
221 }
222 }
223
224 public static bool CheckCoords(uint thisx, uint thisy, uint x, uint y)
225 {
226 if ((thisx == x) && (thisy == y))
227 return false;
228 return true;
229 }
230
231 }
232}
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
index bf55df7..b1981b6 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.cs
@@ -29,6 +29,7 @@ using OpenMetaverse;
29using OpenSim.Framework; 29using OpenSim.Framework;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Framework.Communications.Cache;
31using TPFlags = OpenSim.Framework.Constants.TeleportFlags; 31using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
32using GridRegion = OpenSim.Services.Interfaces.GridRegion;
32 33
33namespace OpenSim.Region.Framework.Scenes.Hypergrid 34namespace OpenSim.Region.Framework.Scenes.Hypergrid
34{ 35{
@@ -50,7 +51,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
50 51
51 if (UserProfile != null) 52 if (UserProfile != null)
52 { 53 {
53 RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); 54 GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID);
54 //if (regionInfo != null) 55 //if (regionInfo != null)
55 //{ 56 //{
56 // UserProfile.HomeRegionID = regionInfo.RegionID; 57 // UserProfile.HomeRegionID = regionInfo.RegionID;
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
index 5c99d73..d7e62a8 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs
@@ -38,6 +38,8 @@ using OpenSim.Framework.Communications;
38using OpenSim.Framework.Communications.Cache; 38using OpenSim.Framework.Communications.Cache;
39using OpenSim.Framework.Capabilities; 39using OpenSim.Framework.Capabilities;
40using OpenSim.Region.Framework.Interfaces; 40using OpenSim.Region.Framework.Interfaces;
41using OpenSim.Services.Interfaces;
42using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 43
42namespace OpenSim.Region.Framework.Scenes.Hypergrid 44namespace OpenSim.Region.Framework.Scenes.Hypergrid
43{ 45{
@@ -45,11 +47,19 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
45 { 47 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 49
48 public readonly IHyperlink m_hg; 50 private IHyperlinkService m_hg;
51 IHyperlinkService HyperlinkService
52 {
53 get
54 {
55 if (m_hg == null)
56 m_hg = m_scene.RequestModuleInterface<IHyperlinkService>();
57 return m_hg;
58 }
59 }
49 60
50 public HGSceneCommunicationService(CommunicationsManager commsMan, IHyperlink hg) : base(commsMan) 61 public HGSceneCommunicationService(CommunicationsManager commsMan) : base(commsMan)
51 { 62 {
52 m_hg = hg;
53 } 63 }
54 64
55 65
@@ -77,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
77 if (regionHandle == m_regionInfo.RegionHandle) 87 if (regionHandle == m_regionInfo.RegionHandle)
78 { 88 {
79 // Teleport within the same region 89 // Teleport within the same region
80 if (position.X < 0 || position.X > Constants.RegionSize || position.Y < 0 || position.Y > Constants.RegionSize || position.Z < 0) 90 if (IsOutsideRegion(avatar.Scene, position) || position.Z < 0)
81 { 91 {
82 Vector3 emergencyPos = new Vector3(128, 128, 128); 92 Vector3 emergencyPos = new Vector3(128, 128, 128);
83 93
@@ -89,7 +99,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
89 // TODO: Get proper AVG Height 99 // TODO: Get proper AVG Height
90 float localAVHeight = 1.56f; 100 float localAVHeight = 1.56f;
91 101
92 float posZLimit = (float)avatar.Scene.Heightmap[(int)position.X, (int)position.Y]; 102 float posZLimit = 22;
103
104 if (position.X > 0 && position.X <= (int)Constants.RegionSize && position.Y > 0 && position.Y <= (int)Constants.RegionSize)
105 {
106 posZLimit = (float) avatar.Scene.Heightmap[(int) position.X, (int) position.Y];
107 }
108
93 float newPosZ = posZLimit + localAVHeight; 109 float newPosZ = posZLimit + localAVHeight;
94 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 110 if (posZLimit >= (position.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
95 { 111 {
@@ -106,7 +122,10 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
106 } 122 }
107 else 123 else
108 { 124 {
109 RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); 125 uint x = 0, y = 0;
126 Utils.LongToUInts(regionHandle, out x, out y);
127 GridRegion reg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
128
110 if (reg != null) 129 if (reg != null)
111 { 130 {
112 131
@@ -119,13 +138,13 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
119 /// Hypergrid mod start 138 /// Hypergrid mod start
120 /// 139 ///
121 /// 140 ///
122 bool isHyperLink = m_hg.IsHyperlinkRegion(reg.RegionHandle); 141 bool isHyperLink = (HyperlinkService.GetHyperlinkRegion(reg.RegionHandle) != null);
123 bool isHomeUser = true; 142 bool isHomeUser = true;
124 ulong realHandle = regionHandle; 143 ulong realHandle = regionHandle;
125 CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID); 144 CachedUserInfo uinfo = m_commsProvider.UserProfileCacheService.GetUserDetails(avatar.UUID);
126 if (uinfo != null) 145 if (uinfo != null)
127 { 146 {
128 isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile); 147 isHomeUser = HyperlinkService.IsLocalUser(uinfo.UserProfile.ID);
129 realHandle = m_hg.FindRegionHandle(regionHandle); 148 realHandle = m_hg.FindRegionHandle(regionHandle);
130 m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); 149 m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString());
131 } 150 }
@@ -338,7 +357,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
338 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID); 357 m_commsProvider.UserProfileCacheService.RemoveUser(avatar.UUID);
339 m_log.DebugFormat( 358 m_log.DebugFormat(
340 "[HGSceneCommService]: User {0} is going to another region, profile cache removed", 359 "[HGSceneCommService]: User {0} is going to another region, profile cache removed",
341 avatar.UUID); 360 avatar.UUID);
342 } 361 }
343 } 362 }
344 else 363 else
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
index 7c02f9a..73f918e 100644
--- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
+++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Scenes
53 53
54 54
55 public class RegionStatsHandler : IStreamedRequestHandler 55 public class RegionStatsHandler : IStreamedRequestHandler
56 { 56 {
57 private string osRXStatsURI = String.Empty; 57 private string osRXStatsURI = String.Empty;
58 private string osXStatsURI = String.Empty; 58 private string osXStatsURI = String.Empty;
59 //private string osSecret = String.Empty; 59 //private string osSecret = String.Empty;
@@ -87,13 +87,13 @@ namespace OpenSim.Region.Framework.Scenes
87 } 87 }
88 88
89 public string Path 89 public string Path
90 { 90 {
91 // This is for the region and is the regionSecret hashed 91 // This is for the region and is the regionSecret hashed
92 get { return "/" + osRXStatsURI + "/"; } 92 get { return "/" + osRXStatsURI + "/"; }
93 } 93 }
94 94
95 private string Report() 95 private string Report()
96 { 96 {
97 OSDMap args = new OSDMap(30); 97 OSDMap args = new OSDMap(30);
98 //int time = Util.ToUnixTime(DateTime.Now); 98 //int time = Util.ToUnixTime(DateTime.Now);
99 args["OSStatsURI"] = OSD.FromString("http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/" + osXStatsURI + "/"); 99 args["OSStatsURI"] = OSD.FromString("http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/" + osXStatsURI + "/");
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index eb397f6..a4460e4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1015,7 +1015,7 @@ namespace OpenSim.Region.Framework.Scenes
1015 return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId); 1015 return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId);
1016 } 1016 }
1017 else 1017 else
1018 { 1018 {
1019 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId); 1019 InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(avatarId, part, itemId);
1020 1020
1021 if (agentItem == null) 1021 if (agentItem == null)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index fddba86..6c9856d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes
413 remoteClient.SendInventoryItemDetails(ownerID, item); 413 remoteClient.SendInventoryItemDetails(ownerID, item);
414 } 414 }
415 // else shouldn't we send an alert message? 415 // else shouldn't we send an alert message?
416 } 416 }
417 417
418 /// <summary> 418 /// <summary>
419 /// Tell the client about the various child items and folders contained in the requested folder. 419 /// Tell the client about the various child items and folders contained in the requested folder.
@@ -485,7 +485,7 @@ namespace OpenSim.Region.Framework.Scenes
485 485
486 // TODO: This code for looking in the folder for the library should be folded back into the 486 // TODO: This code for looking in the folder for the library should be folded back into the
487 // CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc. 487 // CachedUserInfo so that this class doesn't have to know the details (and so that multiple libraries, etc.
488 // can be handled transparently). 488 // can be handled transparently).
489 InventoryFolderImpl fold; 489 InventoryFolderImpl fold;
490 if ((fold = CommsManager.UserProfileCacheService.LibraryRoot.FindFolder(folderID)) != null) 490 if ((fold = CommsManager.UserProfileCacheService.LibraryRoot.FindFolder(folderID)) != null)
491 { 491 {
@@ -515,7 +515,7 @@ namespace OpenSim.Region.Framework.Scenes
515 515
516 return contents; 516 return contents;
517 517
518 } 518 }
519 519
520 /// <summary> 520 /// <summary>
521 /// Handle an inventory folder creation request from the client. 521 /// Handle an inventory folder creation request from the client.
@@ -535,7 +535,7 @@ namespace OpenSim.Region.Framework.Scenes
535 "[AGENT INVENTORY]: Failed to move create folder for user {0} {1}", 535 "[AGENT INVENTORY]: Failed to move create folder for user {0} {1}",
536 remoteClient.Name, remoteClient.AgentId); 536 remoteClient.Name, remoteClient.AgentId);
537 } 537 }
538 } 538 }
539 539
540 /// <summary> 540 /// <summary>
541 /// Handle a client request to update the inventory folder 541 /// Handle a client request to update the inventory folder
@@ -570,7 +570,7 @@ namespace OpenSim.Region.Framework.Scenes
570 remoteClient.Name, remoteClient.AgentId); 570 remoteClient.Name, remoteClient.AgentId);
571 } 571 }
572 } 572 }
573 } 573 }
574 574
575 public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) 575 public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID)
576 { 576 {
@@ -588,7 +588,7 @@ namespace OpenSim.Region.Framework.Scenes
588 { 588 {
589 m_log.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID); 589 m_log.WarnFormat("[AGENT INVENTORY]: request to move folder {0} but folder not found", folderID);
590 } 590 }
591 } 591 }
592 592
593 /// <summary> 593 /// <summary>
594 /// This should delete all the items and folders in the given directory. 594 /// This should delete all the items and folders in the given directory.
@@ -609,7 +609,7 @@ namespace OpenSim.Region.Framework.Scenes
609 { 609 {
610 m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message); 610 m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message);
611 } 611 }
612 } 612 }
613 613
614 614
615 private void PurgeFolderAsync(UUID userID, UUID folderID) 615 private void PurgeFolderAsync(UUID userID, UUID folderID)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
index 226ec15..d01cef7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs
@@ -805,7 +805,7 @@ namespace OpenSim.Region.Framework.Scenes
805 /// <param name="invType"></param> 805 /// <param name="invType"></param>
806 /// <param name="objectID"></param> 806 /// <param name="objectID"></param>
807 /// <param name="userID"></param> 807 /// <param name="userID"></param>
808 /// <returns></returns> 808 /// <returns></returns>
809 public bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID) 809 public bool CanCreateObjectInventory(int invType, UUID objectID, UUID userID)
810 { 810 {
811 CreateObjectInventoryHandler handler = OnCreateObjectInventory; 811 CreateObjectInventoryHandler handler = OnCreateObjectInventory;
@@ -856,7 +856,7 @@ namespace OpenSim.Region.Framework.Scenes
856 /// </summary> 856 /// </summary>
857 /// <param name="invType"></param> 857 /// <param name="invType"></param>
858 /// <param name="userID"></param> 858 /// <param name="userID"></param>
859 /// <returns></returns> 859 /// <returns></returns>
860 public bool CanCreateUserInventory(int invType, UUID userID) 860 public bool CanCreateUserInventory(int invType, UUID userID)
861 { 861 {
862 CreateUserInventoryHandler handler = OnCreateUserInventory; 862 CreateUserInventoryHandler handler = OnCreateUserInventory;
@@ -877,7 +877,7 @@ namespace OpenSim.Region.Framework.Scenes
877 /// </summary> 877 /// </summary>
878 /// <param name="itemID"></param> 878 /// <param name="itemID"></param>
879 /// <param name="userID"></param> 879 /// <param name="userID"></param>
880 /// <returns></returns> 880 /// <returns></returns>
881 public bool CanEditUserInventory(UUID itemID, UUID userID) 881 public bool CanEditUserInventory(UUID itemID, UUID userID)
882 { 882 {
883 EditUserInventoryHandler handler = OnEditUserInventory; 883 EditUserInventoryHandler handler = OnEditUserInventory;
@@ -891,14 +891,14 @@ namespace OpenSim.Region.Framework.Scenes
891 } 891 }
892 } 892 }
893 return true; 893 return true;
894 } 894 }
895 895
896 /// <summary> 896 /// <summary>
897 /// Check whether the specified user is allowed to copy the given inventory item from their own inventory. 897 /// Check whether the specified user is allowed to copy the given inventory item from their own inventory.
898 /// </summary> 898 /// </summary>
899 /// <param name="itemID"></param> 899 /// <param name="itemID"></param>
900 /// <param name="userID"></param> 900 /// <param name="userID"></param>
901 /// <returns></returns> 901 /// <returns></returns>
902 public bool CanCopyUserInventory(UUID itemID, UUID userID) 902 public bool CanCopyUserInventory(UUID itemID, UUID userID)
903 { 903 {
904 CopyUserInventoryHandler handler = OnCopyUserInventory; 904 CopyUserInventoryHandler handler = OnCopyUserInventory;
@@ -912,14 +912,14 @@ namespace OpenSim.Region.Framework.Scenes
912 } 912 }
913 } 913 }
914 return true; 914 return true;
915 } 915 }
916 916
917 /// <summary> 917 /// <summary>
918 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. 918 /// Check whether the specified user is allowed to edit the given inventory item within their own inventory.
919 /// </summary> 919 /// </summary>
920 /// <param name="itemID"></param> 920 /// <param name="itemID"></param>
921 /// <param name="userID"></param> 921 /// <param name="userID"></param>
922 /// <returns></returns> 922 /// <returns></returns>
923 public bool CanDeleteUserInventory(UUID itemID, UUID userID) 923 public bool CanDeleteUserInventory(UUID itemID, UUID userID)
924 { 924 {
925 DeleteUserInventoryHandler handler = OnDeleteUserInventory; 925 DeleteUserInventoryHandler handler = OnDeleteUserInventory;
@@ -933,7 +933,7 @@ namespace OpenSim.Region.Framework.Scenes
933 } 933 }
934 } 934 }
935 return true; 935 return true;
936 } 936 }
937 937
938 public bool CanTeleport(UUID userID) 938 public bool CanTeleport(UUID userID)
939 { 939 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5b3062b..0d1cb81 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -49,6 +49,7 @@ using OpenSim.Region.Framework.Scenes.Serialization;
49using OpenSim.Region.Physics.Manager; 49using OpenSim.Region.Physics.Manager;
50using Timer=System.Timers.Timer; 50using Timer=System.Timers.Timer;
51using TPFlags = OpenSim.Framework.Constants.TeleportFlags; 51using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
52using GridRegion = OpenSim.Services.Interfaces.GridRegion;
52 53
53namespace OpenSim.Region.Framework.Scenes 54namespace OpenSim.Region.Framework.Scenes
54{ 55{
@@ -193,6 +194,26 @@ namespace OpenSim.Region.Framework.Scenes
193 } 194 }
194 } 195 }
195 196
197 protected IGridService m_GridService = null;
198
199 public IGridService GridService
200 {
201 get
202 {
203 if (m_GridService == null)
204 {
205 m_GridService = RequestModuleInterface<IGridService>();
206
207 if (m_GridService == null)
208 {
209 throw new Exception("No IGridService available. This could happen if the config_include folder doesn't exist or if the OpenSim.ini [Architecture] section isn't set. Please also check that you have the correct version of your inventory service dll. Sometimes old versions of this dll will still exist. Do a clean checkout and re-create the opensim.ini from the opensim.ini.example.");
210 }
211 }
212
213 return m_GridService;
214 }
215 }
216
196 protected IXMLRPC m_xmlrpcModule; 217 protected IXMLRPC m_xmlrpcModule;
197 protected IWorldComm m_worldCommModule; 218 protected IWorldComm m_worldCommModule;
198 protected IAvatarFactory m_AvatarFactory; 219 protected IAvatarFactory m_AvatarFactory;
@@ -566,10 +587,7 @@ namespace OpenSim.Region.Framework.Scenes
566 } 587 }
567 588
568 /// <summary> 589 /// <summary>
569 /// Another region is up. Gets called from Grid Comms: 590 /// Another region is up.
570 /// (OGS1 -> LocalBackEnd -> RegionListened -> SceneCommunicationService)
571 /// We have to tell all our ScenePresences about it, and add it to the
572 /// neighbor list.
573 /// 591 ///
574 /// We only add it to the neighbor list if it's within 1 region from here. 592 /// We only add it to the neighbor list if it's within 1 region from here.
575 /// Agents may have draw distance values that cross two regions though, so 593 /// Agents may have draw distance values that cross two regions though, so
@@ -578,47 +596,30 @@ namespace OpenSim.Region.Framework.Scenes
578 /// </summary> 596 /// </summary>
579 /// <param name="otherRegion">RegionInfo handle for the new region.</param> 597 /// <param name="otherRegion">RegionInfo handle for the new region.</param>
580 /// <returns>True after all operations complete, throws exceptions otherwise.</returns> 598 /// <returns>True after all operations complete, throws exceptions otherwise.</returns>
581 public override bool OtherRegionUp(RegionInfo otherRegion) 599 public override void OtherRegionUp(GridRegion otherRegion)
582 { 600 {
583 m_log.InfoFormat("[SCENE]: Region {0} up in coords {1}-{2}", otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY); 601 uint xcell = (uint)((int)otherRegion.RegionLocX / (int)Constants.RegionSize);
602 uint ycell = (uint)((int)otherRegion.RegionLocY / (int)Constants.RegionSize);
603 m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}",
604 RegionInfo.RegionName, otherRegion.RegionName, xcell, ycell);
584 605
585 if (RegionInfo.RegionHandle != otherRegion.RegionHandle) 606 if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
586 { 607 {
587 for (int i = 0; i < m_neighbours.Count; i++)
588 {
589 // The purpose of this loop is to re-update the known neighbors
590 // when another region comes up on top of another one.
591 // The latest region in that location ends up in the
592 // 'known neighbors list'
593 // Additionally, the commFailTF property gets reset to false.
594 if (m_neighbours[i].RegionHandle == otherRegion.RegionHandle)
595 {
596 lock (m_neighbours)
597 {
598 m_neighbours[i] = otherRegion;
599
600 }
601 }
602 }
603
604 // If the value isn't in the neighbours, add it.
605 // If the RegionInfo isn't exact but is for the same XY World location,
606 // then the above loop will fix that.
607
608 if (!(CheckNeighborRegion(otherRegion)))
609 {
610 lock (m_neighbours)
611 {
612 m_neighbours.Add(otherRegion);
613 //m_log.Info("[UP]: " + otherRegion.RegionHandle.ToString());
614 }
615 }
616 608
617 // If these are cast to INT because long + negative values + abs returns invalid data 609 // If these are cast to INT because long + negative values + abs returns invalid data
618 int resultX = Math.Abs((int)otherRegion.RegionLocX - (int)RegionInfo.RegionLocX); 610 int resultX = Math.Abs((int)xcell - (int)RegionInfo.RegionLocX);
619 int resultY = Math.Abs((int)otherRegion.RegionLocY - (int)RegionInfo.RegionLocY); 611 int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY);
620 if (resultX <= 1 && resultY <= 1) 612 if (resultX <= 1 && resultY <= 1)
621 { 613 {
614 // Let the grid service module know, so this can be cached
615 m_eventManager.TriggerOnRegionUp(otherRegion);
616
617 RegionInfo regInfo = new RegionInfo(xcell, ycell, otherRegion.InternalEndPoint, otherRegion.ExternalHostName);
618 regInfo.RegionID = otherRegion.RegionID;
619 regInfo.RegionName = otherRegion.RegionName;
620 regInfo.ScopeID = otherRegion.ScopeID;
621 regInfo.ExternalHostName = otherRegion.ExternalHostName;
622
622 try 623 try
623 { 624 {
624 ForEachScenePresence(delegate(ScenePresence agent) 625 ForEachScenePresence(delegate(ScenePresence agent)
@@ -632,7 +633,7 @@ namespace OpenSim.Region.Framework.Scenes
632 List<ulong> old = new List<ulong>(); 633 List<ulong> old = new List<ulong>();
633 old.Add(otherRegion.RegionHandle); 634 old.Add(otherRegion.RegionHandle);
634 agent.DropOldNeighbours(old); 635 agent.DropOldNeighbours(old);
635 InformClientOfNeighbor(agent, otherRegion); 636 InformClientOfNeighbor(agent, regInfo);
636 } 637 }
637 } 638 }
638 ); 639 );
@@ -643,6 +644,7 @@ namespace OpenSim.Region.Framework.Scenes
643 // This shouldn't happen too often anymore. 644 // This shouldn't happen too often anymore.
644 m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception"); 645 m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception");
645 } 646 }
647
646 } 648 }
647 else 649 else
648 { 650 {
@@ -651,7 +653,6 @@ namespace OpenSim.Region.Framework.Scenes
651 otherRegion.RegionLocY.ToString() + ")"); 653 otherRegion.RegionLocY.ToString() + ")");
652 } 654 }
653 } 655 }
654 return true;
655 } 656 }
656 657
657 public void AddNeighborRegion(RegionInfo region) 658 public void AddNeighborRegion(RegionInfo region)
@@ -683,9 +684,10 @@ namespace OpenSim.Region.Framework.Scenes
683 } 684 }
684 685
685 // Alias IncomingHelloNeighbour OtherRegionUp, for now 686 // Alias IncomingHelloNeighbour OtherRegionUp, for now
686 public bool IncomingHelloNeighbour(RegionInfo neighbour) 687 public GridRegion IncomingHelloNeighbour(RegionInfo neighbour)
687 { 688 {
688 return OtherRegionUp(neighbour); 689 OtherRegionUp(new GridRegion(neighbour));
690 return new GridRegion(RegionInfo);
689 } 691 }
690 692
691 /// <summary> 693 /// <summary>
@@ -994,7 +996,7 @@ namespace OpenSim.Region.Framework.Scenes
994 996
995 // Loop it 997 // Loop it
996 if (m_frame == Int32.MaxValue) 998 if (m_frame == Int32.MaxValue)
997 m_frame = 0; 999 m_frame = 0;
998 1000
999 otherMS = Environment.TickCount; 1001 otherMS = Environment.TickCount;
1000 // run through all entities looking for updates (slow) 1002 // run through all entities looking for updates (slow)
@@ -1336,24 +1338,31 @@ namespace OpenSim.Region.Framework.Scenes
1336 RegisterCommsEvents(); 1338 RegisterCommsEvents();
1337 1339
1338 // These two 'commands' *must be* next to each other or sim rebooting fails. 1340 // These two 'commands' *must be* next to each other or sim rebooting fails.
1339 m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); 1341 //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo);
1342
1343 GridRegion region = new GridRegion(RegionInfo);
1344 bool success = GridService.RegisterRegion(RegionInfo.ScopeID, region);
1345 if (!success)
1346 throw new Exception("Can't register with grid");
1347
1348 m_sceneGridService.SetScene(this);
1340 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); 1349 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
1341 1350
1342 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); 1351 //Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings();
1343 1352
1344 if (dGridSettings.ContainsKey("allow_forceful_banlines")) 1353 //if (dGridSettings.ContainsKey("allow_forceful_banlines"))
1345 { 1354 //{
1346 if (dGridSettings["allow_forceful_banlines"] != "TRUE") 1355 // if (dGridSettings["allow_forceful_banlines"] != "TRUE")
1347 { 1356 // {
1348 m_log.Info("[GRID]: Grid is disabling forceful parcel banlists"); 1357 // m_log.Info("[GRID]: Grid is disabling forceful parcel banlists");
1349 EventManager.TriggerSetAllowForcefulBan(false); 1358 // EventManager.TriggerSetAllowForcefulBan(false);
1350 } 1359 // }
1351 else 1360 // else
1352 { 1361 // {
1353 m_log.Info("[GRID]: Grid is allowing forceful parcel banlists"); 1362 // m_log.Info("[GRID]: Grid is allowing forceful parcel banlists");
1354 EventManager.TriggerSetAllowForcefulBan(true); 1363 // EventManager.TriggerSetAllowForcefulBan(true);
1355 } 1364 // }
1356 } 1365 //}
1357 } 1366 }
1358 1367
1359 /// <summary> 1368 /// <summary>
@@ -2014,12 +2023,12 @@ namespace OpenSim.Region.Framework.Scenes
2014 return true; 2023 return true;
2015 } 2024 }
2016 break; 2025 break;
2017 case Cardinals.W: 2026 case Cardinals.W:
2018 foreach (Border b in WestBorders) 2027 foreach (Border b in WestBorders)
2019 { 2028 {
2020 if (b.TestCross(position)) 2029 if (b.TestCross(position))
2021 return true; 2030 return true;
2022 } 2031 }
2023 break; 2032 break;
2024 } 2033 }
2025 } 2034 }
@@ -2717,10 +2726,12 @@ namespace OpenSim.Region.Framework.Scenes
2717 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); 2726 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId);
2718 if (UserProfile != null) 2727 if (UserProfile != null)
2719 { 2728 {
2720 RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegionID); 2729 GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID);
2721 if (regionInfo == null) 2730 if (regionInfo == null)
2722 { 2731 {
2723 regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); 2732 uint x = 0, y = 0;
2733 Utils.LongToUInts(UserProfile.HomeRegion, out x, out y);
2734 regionInfo = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
2724 if (regionInfo != null) // home region can be away temporarily, too 2735 if (regionInfo != null) // home region can be away temporarily, too
2725 { 2736 {
2726 UserProfile.HomeRegionID = regionInfo.RegionID; 2737 UserProfile.HomeRegionID = regionInfo.RegionID;
@@ -3074,7 +3085,7 @@ namespace OpenSim.Region.Framework.Scenes
3074 m_sceneGridService.OnExpectUser += HandleNewUserConnection; 3085 m_sceneGridService.OnExpectUser += HandleNewUserConnection;
3075 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing; 3086 m_sceneGridService.OnAvatarCrossingIntoRegion += AgentCrossing;
3076 m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent; 3087 m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
3077 m_sceneGridService.OnRegionUp += OtherRegionUp; 3088 //m_eventManager.OnRegionUp += OtherRegionUp;
3078 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; 3089 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
3079 m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup; 3090 m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup;
3080 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; 3091 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
@@ -3102,7 +3113,7 @@ namespace OpenSim.Region.Framework.Scenes
3102 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; 3113 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
3103 m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup; 3114 m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup;
3104 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; 3115 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
3105 m_sceneGridService.OnRegionUp -= OtherRegionUp; 3116 //m_eventManager.OnRegionUp -= OtherRegionUp;
3106 m_sceneGridService.OnExpectUser -= HandleNewUserConnection; 3117 m_sceneGridService.OnExpectUser -= HandleNewUserConnection;
3107 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; 3118 m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing;
3108 m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent; 3119 m_sceneGridService.OnCloseAgentConnection -= IncomingCloseAgent;
@@ -3111,7 +3122,11 @@ namespace OpenSim.Region.Framework.Scenes
3111 if (m_interregionCommsIn != null) 3122 if (m_interregionCommsIn != null)
3112 m_interregionCommsIn.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; 3123 m_interregionCommsIn.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
3113 3124
3125 // this does nothing; should be removed
3114 m_sceneGridService.Close(); 3126 m_sceneGridService.Close();
3127
3128 if (!GridService.DeregisterRegion(m_regInfo.RegionID))
3129 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
3115 } 3130 }
3116 3131
3117 /// <summary> 3132 /// <summary>
@@ -3255,7 +3270,7 @@ namespace OpenSim.Region.Framework.Scenes
3255 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region", 3270 m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region",
3256 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); 3271 agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
3257 //reason = String.Format("You are not currently on the access list for {0}",RegionInfo.RegionName); 3272 //reason = String.Format("You are not currently on the access list for {0}",RegionInfo.RegionName);
3258 return false; 3273 return false;
3259 } 3274 }
3260 } 3275 }
3261 3276
@@ -3557,30 +3572,6 @@ namespace OpenSim.Region.Framework.Scenes
3557 } 3572 }
3558 3573
3559 /// <summary> 3574 /// <summary>
3560 /// Requests information about this region from gridcomms
3561 /// </summary>
3562 /// <param name="regionHandle"></param>
3563 /// <returns></returns>
3564 public RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle)
3565 {
3566 return m_sceneGridService.RequestNeighbouringRegionInfo(regionHandle);
3567 }
3568
3569 /// <summary>
3570 /// Requests textures for map from minimum region to maximum region in world cordinates
3571 /// </summary>
3572 /// <param name="remoteClient"></param>
3573 /// <param name="minX"></param>
3574 /// <param name="minY"></param>
3575 /// <param name="maxX"></param>
3576 /// <param name="maxY"></param>
3577 public void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY)
3578 {
3579 m_log.DebugFormat("[MAPBLOCK]: {0}-{1}, {2}-{3}", minX, minY, maxX, maxY);
3580 m_sceneGridService.RequestMapBlocks(remoteClient, minX, minY, maxX, maxY);
3581 }
3582
3583 /// <summary>
3584 /// Tries to teleport agent to other region. 3575 /// Tries to teleport agent to other region.
3585 /// </summary> 3576 /// </summary>
3586 /// <param name="remoteClient"></param> 3577 /// <param name="remoteClient"></param>
@@ -3591,7 +3582,7 @@ namespace OpenSim.Region.Framework.Scenes
3591 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position, 3582 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
3592 Vector3 lookat, uint teleportFlags) 3583 Vector3 lookat, uint teleportFlags)
3593 { 3584 {
3594 RegionInfo regionInfo = m_sceneGridService.RequestClosestRegion(regionName); 3585 GridRegion regionInfo = GridService.GetRegionByName(UUID.Zero, regionName);
3595 if (regionInfo == null) 3586 if (regionInfo == null)
3596 { 3587 {
3597 // can't find the region: Tell viewer and abort 3588 // can't find the region: Tell viewer and abort
@@ -3680,7 +3671,7 @@ namespace OpenSim.Region.Framework.Scenes
3680 /// <param name="position"></param> 3671 /// <param name="position"></param>
3681 public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position) 3672 public void RequestTeleportLandmark(IClientAPI remoteClient, UUID regionID, Vector3 position)
3682 { 3673 {
3683 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID); 3674 GridRegion info = GridService.GetRegionByUUID(UUID.Zero, regionID);
3684 3675
3685 if (info == null) 3676 if (info == null)
3686 { 3677 {
@@ -3864,10 +3855,6 @@ namespace OpenSim.Region.Framework.Scenes
3864 return LandChannel.GetLandObject((int)x, (int)y).landData; 3855 return LandChannel.GetLandObject((int)x, (int)y).landData;
3865 } 3856 }
3866 3857
3867 public RegionInfo RequestClosestRegion(string name)
3868 {
3869 return m_sceneGridService.RequestClosestRegion(name);
3870 }
3871 3858
3872 #endregion 3859 #endregion
3873 3860
@@ -4154,6 +4141,11 @@ namespace OpenSim.Region.Framework.Scenes
4154 m_sceneGraph.ForEachClient(action); 4141 m_sceneGraph.ForEachClient(action);
4155 } 4142 }
4156 4143
4144 public void ForEachSOG(Action<SceneObjectGroup> action)
4145 {
4146 m_sceneGraph.ForEachSOG(action);
4147 }
4148
4157 /// <summary> 4149 /// <summary>
4158 /// Returns a list of the entities in the scene. This is a new list so operations perform on the list itself 4150 /// Returns a list of the entities in the scene. This is a new list so operations perform on the list itself
4159 /// will not affect the original list of objects in the scene. 4151 /// will not affect the original list of objects in the scene.
@@ -4178,14 +4170,18 @@ namespace OpenSim.Region.Framework.Scenes
4178 4170
4179 public void RegionHandleRequest(IClientAPI client, UUID regionID) 4171 public void RegionHandleRequest(IClientAPI client, UUID regionID)
4180 { 4172 {
4181 RegionInfo info; 4173 ulong handle = 0;
4182 if (regionID == RegionInfo.RegionID) 4174 if (regionID == RegionInfo.RegionID)
4183 info = RegionInfo; 4175 handle = RegionInfo.RegionHandle;
4184 else 4176 else
4185 info = CommsManager.GridService.RequestNeighbourInfo(regionID); 4177 {
4178 GridRegion r = GridService.GetRegionByUUID(UUID.Zero, regionID);
4179 if (r != null)
4180 handle = r.RegionHandle;
4181 }
4186 4182
4187 if (info != null) 4183 if (handle != 0)
4188 client.SendRegionHandle(regionID, info.RegionHandle); 4184 client.SendRegionHandle(regionID, handle);
4189 } 4185 }
4190 4186
4191 public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) 4187 public void TerrainUnAcked(IClientAPI client, int patchX, int patchY)
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 2a82237..0ac4ed4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -36,6 +36,7 @@ using OpenSim.Framework;
36using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Communications.Cache; 37using OpenSim.Framework.Communications.Cache;
38using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39 40
40namespace OpenSim.Region.Framework.Scenes 41namespace OpenSim.Region.Framework.Scenes
41{ 42{
@@ -91,7 +92,7 @@ namespace OpenSim.Region.Framework.Scenes
91 /// <value> 92 /// <value>
92 /// Registered classes that are capable of creating entities. 93 /// Registered classes that are capable of creating entities.
93 /// </value> 94 /// </value>
94 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); 95 protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>();
95 96
96 /// <summary> 97 /// <summary>
97 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is 98 /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is
@@ -227,7 +228,7 @@ namespace OpenSim.Region.Framework.Scenes
227 return false; 228 return false;
228 } 229 }
229 230
230 public abstract bool OtherRegionUp(RegionInfo thisRegion); 231 public abstract void OtherRegionUp(GridRegion otherRegion);
231 232
232 public virtual string GetSimulatorVersion() 233 public virtual string GetSimulatorVersion()
233 { 234 {
@@ -278,7 +279,7 @@ namespace OpenSim.Region.Framework.Scenes
278 _primAllocateMutex.ReleaseMutex(); 279 _primAllocateMutex.ReleaseMutex();
279 280
280 return myID; 281 return myID;
281 } 282 }
282 283
283 #region Module Methods 284 #region Module Methods
284 285
@@ -472,7 +473,7 @@ namespace OpenSim.Region.Framework.Scenes
472 /// <summary> 473 /// <summary>
473 /// Shows various details about the sim based on the parameters supplied by the console command in openSimMain. 474 /// Shows various details about the sim based on the parameters supplied by the console command in openSimMain.
474 /// </summary> 475 /// </summary>
475 /// <param name="showParams">What to show</param> 476 /// <param name="showParams">What to show</param>
476 public virtual void Show(string[] showParams) 477 public virtual void Show(string[] showParams)
477 { 478 {
478 switch (showParams[0]) 479 switch (showParams[0])
@@ -488,7 +489,7 @@ namespace OpenSim.Region.Framework.Scenes
488 } 489 }
489 break; 490 break;
490 } 491 }
491 } 492 }
492 493
493 public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) 494 public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
494 { 495 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 204c319..4a2db5e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -41,6 +41,7 @@ using OpenSim.Framework.Capabilities;
41using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Services.Interfaces; 42using OpenSim.Services.Interfaces;
43using OSD = OpenMetaverse.StructuredData.OSD; 43using OSD = OpenMetaverse.StructuredData.OSD;
44using GridRegion = OpenSim.Services.Interfaces.GridRegion;
44 45
45namespace OpenSim.Region.Framework.Scenes 46namespace OpenSim.Region.Framework.Scenes
46{ 47{
@@ -58,11 +59,19 @@ namespace OpenSim.Region.Framework.Scenes
58 protected CommunicationsManager m_commsProvider; 59 protected CommunicationsManager m_commsProvider;
59 protected IInterregionCommsOut m_interregionCommsOut; 60 protected IInterregionCommsOut m_interregionCommsOut;
60 protected RegionInfo m_regionInfo; 61 protected RegionInfo m_regionInfo;
62 protected Scene m_scene;
61 63
62 protected RegionCommsListener regionCommsHost; 64 protected RegionCommsListener regionCommsHost;
63 65
64 protected List<UUID> m_agentsInTransit; 66 protected List<UUID> m_agentsInTransit;
65 67
68 public bool RegionLoginsEnabled
69 {
70 get { return m_regionLoginsEnabled; }
71 set { m_regionLoginsEnabled = value; }
72 }
73 private bool m_regionLoginsEnabled = false;
74
66 /// <summary> 75 /// <summary>
67 /// An agent is crossing into this region 76 /// An agent is crossing into this region
68 /// </summary> 77 /// </summary>
@@ -84,10 +93,10 @@ namespace OpenSim.Region.Framework.Scenes
84 /// </summary> 93 /// </summary>
85 public event PrimCrossing OnPrimCrossingIntoRegion; 94 public event PrimCrossing OnPrimCrossingIntoRegion;
86 95
87 /// <summary> 96 ///// <summary>
88 /// A New Region is up and available 97 ///// A New Region is up and available
89 /// </summary> 98 ///// </summary>
90 public event RegionUp OnRegionUp; 99 //public event RegionUp OnRegionUp;
91 100
92 /// <summary> 101 /// <summary>
93 /// We have a child agent for this avatar and we're getting a status update about it 102 /// We have a child agent for this avatar and we're getting a status update about it
@@ -110,7 +119,7 @@ namespace OpenSim.Region.Framework.Scenes
110 private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; 119 private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim;
111 private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection; 120 private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
112 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; 121 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
113 private RegionUp handlerRegionUp = null; // OnRegionUp; 122 //private RegionUp handlerRegionUp = null; // OnRegionUp;
114 private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; 123 private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate;
115 //private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; 124 //private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar;
116 private LogOffUser handlerLogOffUser = null; 125 private LogOffUser handlerLogOffUser = null;
@@ -124,6 +133,13 @@ namespace OpenSim.Region.Framework.Scenes
124 m_agentsInTransit = new List<UUID>(); 133 m_agentsInTransit = new List<UUID>();
125 } 134 }
126 135
136 public void SetScene(Scene s)
137 {
138 m_scene = s;
139 m_regionInfo = s.RegionInfo;
140 m_interregionCommsOut = m_scene.RequestModuleInterface<IInterregionCommsOut>();
141 }
142
127 /// <summary> 143 /// <summary>
128 /// Register a region with the grid 144 /// Register a region with the grid
129 /// </summary> 145 /// </summary>
@@ -131,40 +147,30 @@ namespace OpenSim.Region.Framework.Scenes
131 /// <exception cref="System.Exception">Thrown if region registration fails.</exception> 147 /// <exception cref="System.Exception">Thrown if region registration fails.</exception>
132 public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos) 148 public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos)
133 { 149 {
134 m_interregionCommsOut = comms_out; 150 //m_interregionCommsOut = comms_out;
135 151
136 m_regionInfo = regionInfos; 152 //m_regionInfo = regionInfos;
137 m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName; 153 //m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName;
138 regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo); 154 //regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo);
139 155
140 if (regionCommsHost != null) 156 //if (regionCommsHost != null)
141 { 157 //{
142 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString()); 158 // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
143 159
144 regionCommsHost.debugRegionName = regionInfos.RegionName; 160 // regionCommsHost.debugRegionName = regionInfos.RegionName;
145 regionCommsHost.OnExpectPrim += IncomingPrimCrossing; 161 // regionCommsHost.OnExpectPrim += IncomingPrimCrossing;
146 regionCommsHost.OnExpectUser += NewUserConnection; 162 // regionCommsHost.OnExpectUser += NewUserConnection;
147 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; 163 // regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
148 regionCommsHost.OnCloseAgentConnection += CloseConnection; 164 // regionCommsHost.OnCloseAgentConnection += CloseConnection;
149 regionCommsHost.OnRegionUp += newRegionUp; 165 // regionCommsHost.OnRegionUp += newRegionUp;
150 regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; 166 // regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
151 regionCommsHost.OnLogOffUser += GridLogOffUser; 167 // regionCommsHost.OnLogOffUser += GridLogOffUser;
152 regionCommsHost.OnGetLandData += FetchLandData; 168 // regionCommsHost.OnGetLandData += FetchLandData;
153 } 169 //}
154 else 170 //else
155 { 171 //{
156 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null"); 172 // //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null");
157 } 173 //}
158 }
159
160 /// <summary>
161 /// Returns a region with the name closest to string provided
162 /// </summary>
163 /// <param name="name">Partial Region Name for matching</param>
164 /// <returns>Region Information for the region</returns>
165 public RegionInfo RequestClosestRegion(string name)
166 {
167 return m_commsProvider.GridService.RequestClosestRegion(name);
168 } 174 }
169 175
170 /// <summary> 176 /// <summary>
@@ -173,30 +179,31 @@ namespace OpenSim.Region.Framework.Scenes
173 /// </summary> 179 /// </summary>
174 public void Close() 180 public void Close()
175 { 181 {
176 if (regionCommsHost != null) 182
177 { 183 //if (regionCommsHost != null)
178 regionCommsHost.OnLogOffUser -= GridLogOffUser; 184 //{
179 regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate; 185 // regionCommsHost.OnLogOffUser -= GridLogOffUser;
180 regionCommsHost.OnRegionUp -= newRegionUp; 186 // regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate;
181 regionCommsHost.OnExpectUser -= NewUserConnection; 187 // regionCommsHost.OnRegionUp -= newRegionUp;
182 regionCommsHost.OnExpectPrim -= IncomingPrimCrossing; 188 // regionCommsHost.OnExpectUser -= NewUserConnection;
183 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; 189 // regionCommsHost.OnExpectPrim -= IncomingPrimCrossing;
184 regionCommsHost.OnCloseAgentConnection -= CloseConnection; 190 // regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
185 regionCommsHost.OnGetLandData -= FetchLandData; 191 // regionCommsHost.OnCloseAgentConnection -= CloseConnection;
192 // regionCommsHost.OnGetLandData -= FetchLandData;
186 193
187 try 194 // try
188 { 195 // {
189 m_commsProvider.GridService.DeregisterRegion(m_regionInfo); 196 // m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
190 } 197 // }
191 catch (Exception e) 198 // catch (Exception e)
192 { 199 // {
193 m_log.ErrorFormat( 200 // m_log.ErrorFormat(
194 "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing", 201 // "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing",
195 m_regionInfo.RegionName, e); 202 // m_regionInfo.RegionName, e);
196 } 203 // }
197 204
198 regionCommsHost = null; 205 // regionCommsHost = null;
199 } 206 //}
200 } 207 }
201 208
202 #region CommsManager Event handlers 209 #region CommsManager Event handlers
@@ -232,22 +239,6 @@ namespace OpenSim.Region.Framework.Scenes
232 } 239 }
233 240
234 /// <summary> 241 /// <summary>
235 /// A New Region is now available. Inform the scene that there is a new region available.
236 /// </summary>
237 /// <param name="region">Information about the new region that is available</param>
238 /// <returns>True if the event was handled</returns>
239 protected bool newRegionUp(RegionInfo region)
240 {
241 handlerRegionUp = OnRegionUp;
242 if (handlerRegionUp != null)
243 {
244 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: newRegionUp Fired for User:" + region.RegionName);
245 handlerRegionUp(region);
246 }
247 return true;
248 }
249
250 /// <summary>
251 /// Inform the scene that we've got an update about a child agent that we have 242 /// Inform the scene that we've got an update about a child agent that we have
252 /// </summary> 243 /// </summary>
253 /// <param name="cAgentData"></param> 244 /// <param name="cAgentData"></param>
@@ -330,7 +321,7 @@ namespace OpenSim.Region.Framework.Scenes
330 #region Inform Client of Neighbours 321 #region Inform Client of Neighbours
331 322
332 private delegate void InformClientOfNeighbourDelegate( 323 private delegate void InformClientOfNeighbourDelegate(
333 ScenePresence avatar, AgentCircuitData a, SimpleRegionInfo reg, IPEndPoint endPoint, bool newAgent); 324 ScenePresence avatar, AgentCircuitData a, GridRegion reg, IPEndPoint endPoint, bool newAgent);
334 325
335 private void InformClientOfNeighbourCompleted(IAsyncResult iar) 326 private void InformClientOfNeighbourCompleted(IAsyncResult iar)
336 { 327 {
@@ -348,7 +339,7 @@ namespace OpenSim.Region.Framework.Scenes
348 /// <param name="a"></param> 339 /// <param name="a"></param>
349 /// <param name="regionHandle"></param> 340 /// <param name="regionHandle"></param>
350 /// <param name="endPoint"></param> 341 /// <param name="endPoint"></param>
351 private void InformClientOfNeighbourAsync(ScenePresence avatar, AgentCircuitData a, SimpleRegionInfo reg, 342 private void InformClientOfNeighbourAsync(ScenePresence avatar, AgentCircuitData a, GridRegion reg,
352 IPEndPoint endPoint, bool newAgent) 343 IPEndPoint endPoint, bool newAgent)
353 { 344 {
354 // Let's wait just a little to give time to originating regions to catch up with closing child agents 345 // Let's wait just a little to give time to originating regions to catch up with closing child agents
@@ -366,8 +357,7 @@ namespace OpenSim.Region.Framework.Scenes
366 357
367 string reason = String.Empty; 358 string reason = String.Empty;
368 359
369 //bool regionAccepted = m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, a); 360
370
371 bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason); 361 bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason);
372 362
373 if (regionAccepted && newAgent) 363 if (regionAccepted && newAgent)
@@ -400,17 +390,7 @@ namespace OpenSim.Region.Framework.Scenes
400 390
401 } 391 }
402 392
403 public void RequestNeighbors(RegionInfo region) 393 public List<GridRegion> RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY)
404 {
405 // List<SimpleRegionInfo> neighbours =
406 m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
407 //IPEndPoint blah = new IPEndPoint();
408
409 //blah.Address = region.RemotingAddress;
410 //blah.Port = region.RemotingPort;
411 }
412
413 public List<SimpleRegionInfo> RequestNeighbors(Scene pScene, uint pRegionLocX, uint pRegionLocY)
414 { 394 {
415 Border[] northBorders = pScene.NorthBorders.ToArray(); 395 Border[] northBorders = pScene.NorthBorders.ToArray();
416 Border[] southBorders = pScene.SouthBorders.ToArray(); 396 Border[] southBorders = pScene.SouthBorders.ToArray();
@@ -420,50 +400,34 @@ namespace OpenSim.Region.Framework.Scenes
420 // Legacy one region. Provided for simplicity while testing the all inclusive method in the else statement. 400 // Legacy one region. Provided for simplicity while testing the all inclusive method in the else statement.
421 if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1) 401 if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1)
422 { 402 {
423 return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); 403 return m_scene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID);
424 } 404 }
425 else 405 else
426 { 406 {
427 Vector2 extent = Vector2.Zero; 407 Vector2 extent = Vector2.Zero;
428 for (int i=0;i<eastBorders.Length;i++) 408 for (int i = 0; i < eastBorders.Length; i++)
429 { 409 {
430 extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X; 410 extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X;
431 } 411 }
432 for (int i=0;i<northBorders.Length;i++) 412 for (int i = 0; i < northBorders.Length; i++)
433 { 413 {
434 extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y; 414 extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y;
435 } 415 }
436 416
437 List<SimpleRegionInfo> neighbourList = new List<SimpleRegionInfo>();
438
439 // Loss of fraction on purpose 417 // Loss of fraction on purpose
440 extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1; 418 extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1;
441 extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1; 419 extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1;
442 420
443 int startX = (int) pRegionLocX - 1; 421 int startX = (int)(pRegionLocX - 1) * (int)Constants.RegionSize;
444 int startY = (int) pRegionLocY - 1; 422 int startY = (int)(pRegionLocY - 1) * (int)Constants.RegionSize;
445 423
446 int endX = (int) pRegionLocX + (int)extent.X; 424 int endX = ((int)pRegionLocX + (int)extent.X) * (int)Constants.RegionSize;
447 int endY = (int) pRegionLocY + (int)extent.Y; 425 int endY = ((int)pRegionLocY + (int)extent.Y) * (int)Constants.RegionSize;
448 426
449 for (int i=startX;i<endX;i++) 427 List<GridRegion> neighbours = m_scene.GridService.GetRegionRange(m_regionInfo.ScopeID, startX, endX, startY, endY);
450 { 428 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; });
451 for (int j=startY;j<endY;j++) 429
452 { 430 return neighbours;
453 // Skip CurrentRegion
454 if (i == (int)pRegionLocX && j == (int)pRegionLocY)
455 continue;
456
457 ulong regionHandle = Util.UIntsToLong((uint)(i * Constants.RegionSize),
458 (uint)(j * Constants.RegionSize));
459 RegionInfo neighborreg = m_commsProvider.GridService.RequestNeighbourInfo(regionHandle);
460 if (neighborreg != null)
461 {
462 neighbourList.Add(neighborreg);
463 }
464 }
465 }
466 return neighbourList;
467 //SimpleRegionInfo regionData = m_commsProvider.GridService.RequestNeighbourInfo() 431 //SimpleRegionInfo regionData = m_commsProvider.GridService.RequestNeighbourInfo()
468 //return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); 432 //return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY);
469 } 433 }
@@ -475,29 +439,28 @@ namespace OpenSim.Region.Framework.Scenes
475 /// </summary> 439 /// </summary>
476 public void EnableNeighbourChildAgents(ScenePresence avatar, List<RegionInfo> lstneighbours) 440 public void EnableNeighbourChildAgents(ScenePresence avatar, List<RegionInfo> lstneighbours)
477 { 441 {
478 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>(); 442 //List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
443 List<GridRegion> neighbours = new List<GridRegion>();
479 444
480 //m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); 445 ////m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
481 for (int i = 0; i < lstneighbours.Count; i++) 446 //for (int i = 0; i < lstneighbours.Count; i++)
482 { 447 //{
483 // We don't want to keep sending to regions that consistently fail on comms. 448 // // We don't want to keep sending to regions that consistently fail on comms.
484 if (!(lstneighbours[i].commFailTF)) 449 // if (!(lstneighbours[i].commFailTF))
485 { 450 // {
486 neighbours.Add(new SimpleRegionInfo(lstneighbours[i])); 451 // neighbours.Add(new SimpleRegionInfo(lstneighbours[i]));
487 } 452 // }
488 } 453 //}
489 // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be 454 // we're going to be using the above code once neighbour cache is correct. Currently it doesn't appear to be
490 // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/ 455 // So we're temporarily going back to the old method of grabbing it from the Grid Server Every time :/
491 if (m_regionInfo != null) 456 if (m_regionInfo != null)
492 { 457 {
493 neighbours = 458 neighbours = RequestNeighbours(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
494 RequestNeighbors(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
495 } 459 }
496 else 460 else
497 { 461 {
498 m_log.Debug("[ENABLENEIGHBOURCHILDAGENTS]: m_regionInfo was null in EnableNeighbourChildAgents, is this a NPC?"); 462 m_log.Debug("[ENABLENEIGHBOURCHILDAGENTS]: m_regionInfo was null in EnableNeighbourChildAgents, is this a NPC?");
499 } 463 }
500
501 464
502 /// We need to find the difference between the new regions where there are no child agents 465 /// We need to find the difference between the new regions where there are no child agents
503 /// and the regions where there are already child agents. We only send notification to the former. 466 /// and the regions where there are already child agents. We only send notification to the former.
@@ -540,8 +503,9 @@ namespace OpenSim.Region.Framework.Scenes
540 503
541 /// Create the necessary child agents 504 /// Create the necessary child agents
542 List<AgentCircuitData> cagents = new List<AgentCircuitData>(); 505 List<AgentCircuitData> cagents = new List<AgentCircuitData>();
543 foreach (SimpleRegionInfo neighbour in neighbours) 506 //foreach (SimpleRegionInfo neighbour in neighbours)
544 { 507 foreach (GridRegion neighbour in neighbours)
508 {
545 if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle) 509 if (neighbour.RegionHandle != avatar.Scene.RegionInfo.RegionHandle)
546 { 510 {
547 511
@@ -581,7 +545,7 @@ namespace OpenSim.Region.Framework.Scenes
581 545
582 bool newAgent = false; 546 bool newAgent = false;
583 int count = 0; 547 int count = 0;
584 foreach (SimpleRegionInfo neighbour in neighbours) 548 foreach (GridRegion neighbour in neighbours)
585 { 549 {
586 // Don't do it if there's already an agent in that region 550 // Don't do it if there's already an agent in that region
587 if (newRegions.Contains(neighbour.RegionHandle)) 551 if (newRegions.Contains(neighbour.RegionHandle))
@@ -634,7 +598,7 @@ namespace OpenSim.Region.Framework.Scenes
634 /// This informs a single neighboring region about agent "avatar". 598 /// This informs a single neighboring region about agent "avatar".
635 /// Calls an asynchronous method to do so.. so it doesn't lag the sim. 599 /// Calls an asynchronous method to do so.. so it doesn't lag the sim.
636 /// </summary> 600 /// </summary>
637 public void InformNeighborChildAgent(ScenePresence avatar, SimpleRegionInfo region) 601 public void InformNeighborChildAgent(ScenePresence avatar, GridRegion region)
638 { 602 {
639 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); 603 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
640 agent.BaseFolder = UUID.Zero; 604 agent.BaseFolder = UUID.Zero;
@@ -665,61 +629,63 @@ namespace OpenSim.Region.Framework.Scenes
665 /// <param name="regionhandle"></param> 629 /// <param name="regionhandle"></param>
666 private void InformNeighboursThatRegionIsUpAsync(INeighbourService neighbourService, RegionInfo region, ulong regionhandle) 630 private void InformNeighboursThatRegionIsUpAsync(INeighbourService neighbourService, RegionInfo region, ulong regionhandle)
667 { 631 {
668 m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here"); 632 uint x = 0, y = 0;
669 //RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port); 633 Utils.LongToUInts(regionhandle, out x, out y);
670 634
671 //bool regionAccepted = 635 GridRegion neighbour = null;
672 // m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region), regionhandle);
673
674 //bool regionAccepted = m_interregionCommsOut.SendHelloNeighbour(regionhandle, region);
675 bool regionAccepted = false;
676 if (neighbourService != null) 636 if (neighbourService != null)
677 regionAccepted = neighbourService.HelloNeighbour(regionhandle, region); 637 neighbour = neighbourService.HelloNeighbour(regionhandle, region);
678 else 638 else
679 m_log.DebugFormat("[SCS]: No neighbour service provided for informing neigbhours of this region"); 639 m_log.DebugFormat("[SCS]: No neighbour service provided for informing neigbhours of this region");
680 640
681 if (regionAccepted) 641 if (neighbour != null)
682 { 642 {
683 m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here"); 643 m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
684 handlerRegionUp = OnRegionUp; 644 m_scene.EventManager.TriggerOnRegionUp(neighbour);
685
686 // yes, we're notifying ourselves.
687 if (handlerRegionUp != null)
688 handlerRegionUp(region);
689 } 645 }
690 else 646 else
691 { 647 {
692 m_log.Warn("[INTERGRID]: Failed to inform neighbors that I'm here."); 648 m_log.WarnFormat("[INTERGRID]: Failed to inform neighbour {0}-{1} that I'm here.", x / Constants.RegionSize, y / Constants.RegionSize);
693 } 649 }
694 } 650 }
695 651
696 /// <summary> 652
697 /// Called by scene when region is initialized (not always when it's listening for agents)
698 /// This is an inter-region message that informs the surrounding neighbors that the sim is up.
699 /// </summary>
700 public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region) 653 public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region)
701 { 654 {
702 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); 655 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
703 656
704 657 for (int x = (int)region.RegionLocX - 1; x <= region.RegionLocX + 1; x++)
705 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>(); 658 for (int y = (int)region.RegionLocY - 1; y <= region.RegionLocY + 1; y++)
706 // This stays uncached because we don't already know about our neighbors at this point. 659 if (!((x == region.RegionLocX) && (y == region.RegionLocY))) // skip this region
707 neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); 660 {
708 if (neighbours != null) 661 ulong handle = Utils.UIntsToLong((uint)x * Constants.RegionSize, (uint)y * Constants.RegionSize);
709 { 662 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
710 for (int i = 0; i < neighbours.Count; i++)
711 {
712 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
713 663
714 d.BeginInvoke(neighbourService, region, neighbours[i].RegionHandle, 664 d.BeginInvoke(neighbourService, region, handle,
715 InformNeighborsThatRegionisUpCompleted, 665 InformNeighborsThatRegionisUpCompleted,
716 d); 666 d);
717 } 667 }
718 } 668
669 //List<GridRegion> neighbours = new List<GridRegion>();
670 //// This stays uncached because we don't already know about our neighbors at this point.
671
672 //neighbours = m_scene.GridService.GetNeighbours(m_regionInfo.ScopeID, m_regionInfo.RegionID);
673 //if (neighbours != null)
674 //{
675 // for (int i = 0; i < neighbours.Count; i++)
676 // {
677 // InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
678
679 // d.BeginInvoke(neighbourService, region, neighbours[i].RegionHandle,
680 // InformNeighborsThatRegionisUpCompleted,
681 // d);
682 // }
683 //}
719 684
720 //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region)); 685 //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region));
721 } 686 }
722 687
688
723 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle); 689 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle);
724 690
725 /// <summary> 691 /// <summary>
@@ -815,41 +781,6 @@ namespace OpenSim.Region.Framework.Scenes
815 } 781 }
816 } 782 }
817 783
818 /// <summary>
819 /// Helper function to request neighbors from grid-comms
820 /// </summary>
821 /// <param name="regionHandle"></param>
822 /// <returns></returns>
823 public virtual RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle)
824 {
825 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionHandle.ToString());
826 return m_commsProvider.GridService.RequestNeighbourInfo(regionHandle);
827 }
828
829 /// <summary>
830 /// Helper function to request neighbors from grid-comms
831 /// </summary>
832 /// <param name="regionID"></param>
833 /// <returns></returns>
834 public virtual RegionInfo RequestNeighbouringRegionInfo(UUID regionID)
835 {
836 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionID);
837 return m_commsProvider.GridService.RequestNeighbourInfo(regionID);
838 }
839
840 /// <summary>
841 /// Requests map blocks in area of minX, maxX, minY, MaxY in world cordinates
842 /// </summary>
843 /// <param name="minX"></param>
844 /// <param name="minY"></param>
845 /// <param name="maxX"></param>
846 /// <param name="maxY"></param>
847 public virtual void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY)
848 {
849 List<MapBlockData> mapBlocks;
850 mapBlocks = m_commsProvider.GridService.RequestNeighbourMapBlocks(minX - 4, minY - 4, minX + 4, minY + 4);
851 remoteClient.SendMapBlock(mapBlocks, 0);
852 }
853 784
854 /// <summary> 785 /// <summary>
855 /// Try to teleport an agent to a new region. 786 /// Try to teleport an agent to a new region.
@@ -914,7 +845,10 @@ namespace OpenSim.Region.Framework.Scenes
914 } 845 }
915 else 846 else
916 { 847 {
917 RegionInfo reg = RequestNeighbouringRegionInfo(regionHandle); 848 uint x = 0, y = 0;
849 Utils.LongToUInts(regionHandle, out x, out y);
850 GridRegion reg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
851
918 if (reg != null) 852 if (reg != null)
919 { 853 {
920 m_log.DebugFormat( 854 m_log.DebugFormat(
@@ -1163,7 +1097,7 @@ namespace OpenSim.Region.Framework.Scenes
1163 } 1097 }
1164 } 1098 }
1165 1099
1166 private bool IsOutsideRegion(Scene s, Vector3 pos) 1100 protected bool IsOutsideRegion(Scene s, Vector3 pos)
1167 { 1101 {
1168 1102
1169 if (s.TestBorderCross(pos,Cardinals.N)) 1103 if (s.TestBorderCross(pos,Cardinals.N))
@@ -1221,10 +1155,10 @@ namespace OpenSim.Region.Framework.Scenes
1221 return false; 1155 return false;
1222 } 1156 }
1223 1157
1224 private List<ulong> NeighbourHandles(List<SimpleRegionInfo> neighbours) 1158 private List<ulong> NeighbourHandles(List<GridRegion> neighbours)
1225 { 1159 {
1226 List<ulong> handles = new List<ulong>(); 1160 List<ulong> handles = new List<ulong>();
1227 foreach (SimpleRegionInfo reg in neighbours) 1161 foreach (GridRegion reg in neighbours)
1228 { 1162 {
1229 handles.Add(reg.RegionHandle); 1163 handles.Add(reg.RegionHandle);
1230 } 1164 }
@@ -1475,7 +1409,10 @@ namespace OpenSim.Region.Framework.Scenes
1475 m_log.DebugFormat("[SCENE COMM]: Crossing agent {0} {1} to {2}-{3}", agent.Firstname, agent.Lastname, neighbourx, neighboury); 1409 m_log.DebugFormat("[SCENE COMM]: Crossing agent {0} {1} to {2}-{3}", agent.Firstname, agent.Lastname, neighbourx, neighboury);
1476 1410
1477 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 1411 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
1478 SimpleRegionInfo neighbourRegion = RequestNeighbouringRegionInfo(neighbourHandle); 1412
1413 int x = (int)(neighbourx * Constants.RegionSize), y = (int)(neighboury * Constants.RegionSize);
1414 GridRegion neighbourRegion = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
1415
1479 if (neighbourRegion != null && agent.ValidateAttachments()) 1416 if (neighbourRegion != null && agent.ValidateAttachments())
1480 { 1417 {
1481 pos = pos + (agent.Velocity); 1418 pos = pos + (agent.Velocity);
@@ -1602,11 +1539,6 @@ namespace OpenSim.Region.Framework.Scenes
1602 } 1539 }
1603 1540
1604 1541
1605 public Dictionary<string, string> GetGridSettings()
1606 {
1607 return m_commsProvider.GridService.GetGridSettings();
1608 }
1609
1610 public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat) 1542 public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat)
1611 { 1543 {
1612 m_commsProvider.LogOffUser(userid, regionid, regionhandle, position, lookat); 1544 m_commsProvider.LogOffUser(userid, regionid, regionhandle, position, lookat);
@@ -1643,19 +1575,14 @@ namespace OpenSim.Region.Framework.Scenes
1643 return m_commsProvider.GetUserFriendList(friendlistowner); 1575 return m_commsProvider.GetUserFriendList(friendlistowner);
1644 } 1576 }
1645 1577
1646 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
1647 {
1648 return m_commsProvider.GridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
1649 }
1650
1651 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query) 1578 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query)
1652 { 1579 {
1653 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query); 1580 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query);
1654 } 1581 }
1655 1582
1656 public List<RegionInfo> RequestNamedRegions(string name, int maxNumber) 1583 public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
1657 { 1584 {
1658 return m_commsProvider.GridService.RequestNamedRegions(name, maxNumber); 1585 return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);
1659 } 1586 }
1660 1587
1661 //private void Dump(string msg, List<ulong> handles) 1588 //private void Dump(string msg, List<ulong> handles)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 48dea07..54ac792 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -845,7 +845,7 @@ namespace OpenSim.Region.Framework.Scenes
845 ScenePresence sp; 845 ScenePresence sp;
846 846
847 lock (ScenePresences) 847 lock (ScenePresences)
848 { 848 {
849 ScenePresences.TryGetValue(agentID, out sp); 849 ScenePresences.TryGetValue(agentID, out sp);
850 } 850 }
851 851
@@ -1134,6 +1134,23 @@ namespace OpenSim.Region.Framework.Scenes
1134 } 1134 }
1135 } 1135 }
1136 1136
1137 protected internal void ForEachSOG(Action<SceneObjectGroup> action)
1138 {
1139 List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);
1140 foreach (SceneObjectGroup obj in objlist)
1141 {
1142 try
1143 {
1144 action(obj);
1145 }
1146 catch (Exception e)
1147 {
1148 // Catch it and move on. This includes situations where splist has inconsistent info
1149 m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.Message);
1150 }
1151 }
1152 }
1153
1137 #endregion 1154 #endregion
1138 1155
1139 #region Client Event handlers 1156 #region Client Event handlers
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index 0019b23..1d4efd0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
192 public void SaveCurrentSceneToXml(string filename) 192 public void SaveCurrentSceneToXml(string filename)
193 { 193 {
194 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 194 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
195 if (serialiser != null) 195 if (serialiser != null)
196 serialiser.SavePrimsToXml(CurrentOrFirstScene, filename); 196 serialiser.SavePrimsToXml(CurrentOrFirstScene, filename);
197 } 197 }
198 198
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Framework.Scenes
205 public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, Vector3 loadOffset) 205 public void LoadCurrentSceneFromXml(string filename, bool generateNewIDs, Vector3 loadOffset)
206 { 206 {
207 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 207 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
208 if (serialiser != null) 208 if (serialiser != null)
209 serialiser.LoadPrimsFromXml(CurrentOrFirstScene, filename, generateNewIDs, loadOffset); 209 serialiser.LoadPrimsFromXml(CurrentOrFirstScene, filename, generateNewIDs, loadOffset);
210 } 210 }
211 211
@@ -216,14 +216,14 @@ namespace OpenSim.Region.Framework.Scenes
216 public void SaveCurrentSceneToXml2(string filename) 216 public void SaveCurrentSceneToXml2(string filename)
217 { 217 {
218 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 218 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
219 if (serialiser != null) 219 if (serialiser != null)
220 serialiser.SavePrimsToXml2(CurrentOrFirstScene, filename); 220 serialiser.SavePrimsToXml2(CurrentOrFirstScene, filename);
221 } 221 }
222 222
223 public void SaveNamedPrimsToXml2(string primName, string filename) 223 public void SaveNamedPrimsToXml2(string primName, string filename)
224 { 224 {
225 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 225 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
226 if (serialiser != null) 226 if (serialiser != null)
227 serialiser.SaveNamedPrimsToXml2(CurrentOrFirstScene, primName, filename); 227 serialiser.SaveNamedPrimsToXml2(CurrentOrFirstScene, primName, filename);
228 } 228 }
229 229
@@ -233,7 +233,7 @@ namespace OpenSim.Region.Framework.Scenes
233 public void LoadCurrentSceneFromXml2(string filename) 233 public void LoadCurrentSceneFromXml2(string filename)
234 { 234 {
235 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>(); 235 IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
236 if (serialiser != null) 236 if (serialiser != null)
237 serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename); 237 serialiser.LoadPrimsFromXml2(CurrentOrFirstScene, filename);
238 } 238 }
239 239
@@ -257,7 +257,7 @@ namespace OpenSim.Region.Framework.Scenes
257 public void LoadArchiveToCurrentScene(string filename) 257 public void LoadArchiveToCurrentScene(string filename)
258 { 258 {
259 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>(); 259 IRegionArchiverModule archiver = CurrentOrFirstScene.RequestModuleInterface<IRegionArchiverModule>();
260 if (archiver != null) 260 if (archiver != null)
261 archiver.DearchiveRegion(filename); 261 archiver.DearchiveRegion(filename);
262 } 262 }
263 263
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 0cf08b5..57b7e70 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -258,6 +258,11 @@ namespace OpenSim.Region.Framework.Scenes
258 } 258 }
259 } 259 }
260 260
261 private bool IsAttachmentCheckFull()
262 {
263 return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0));
264 }
265
261 /// <summary> 266 /// <summary>
262 /// The absolute position of this scene object in the scene 267 /// The absolute position of this scene object in the scene
263 /// </summary> 268 /// </summary>
@@ -270,8 +275,8 @@ namespace OpenSim.Region.Framework.Scenes
270 275
271 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) 276 if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
272 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) 277 || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
273 && !IsAttachment) 278 && !IsAttachmentCheckFull())
274 { 279 {
275 m_scene.CrossPrimGroupIntoNewRegion(val, this, true); 280 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
276 } 281 }
277 282
@@ -462,7 +467,7 @@ namespace OpenSim.Region.Framework.Scenes
462 /// <param name="scene"></param> 467 /// <param name="scene"></param>
463 public void AttachToScene(Scene scene) 468 public void AttachToScene(Scene scene)
464 { 469 {
465 m_scene = scene; 470 m_scene = scene;
466 RegionHandle = m_scene.RegionInfo.RegionHandle; 471 RegionHandle = m_scene.RegionInfo.RegionHandle;
467 472
468 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0) 473 if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
@@ -487,9 +492,9 @@ namespace OpenSim.Region.Framework.Scenes
487 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); 492 //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
488 } 493 }
489 494
490 ApplyPhysics(m_scene.m_physicalPrim); 495 ApplyPhysics(m_scene.m_physicalPrim);
491 496
492 ScheduleGroupForFullUpdate(); 497 ScheduleGroupForFullUpdate();
493 } 498 }
494 499
495 public Vector3 GroupScale() 500 public Vector3 GroupScale()
@@ -1045,12 +1050,12 @@ namespace OpenSim.Region.Framework.Scenes
1045 m_rootPart = part; 1050 m_rootPart = part;
1046 if (!IsAttachment) 1051 if (!IsAttachment)
1047 part.ParentID = 0; 1052 part.ParentID = 0;
1048 part.LinkNum = 0; 1053 part.LinkNum = 0;
1049 1054
1050 // No locking required since the SOG should not be in the scene yet - one can't change root parts after 1055 // No locking required since the SOG should not be in the scene yet - one can't change root parts after
1051 // the scene object has been attached to the scene 1056 // the scene object has been attached to the scene
1052 m_parts.Add(m_rootPart.UUID, m_rootPart); 1057 m_parts.Add(m_rootPart.UUID, m_rootPart);
1053 } 1058 }
1054 1059
1055 /// <summary> 1060 /// <summary>
1056 /// Add a new part to this scene object. The part must already be correctly configured. 1061 /// Add a new part to this scene object. The part must already be correctly configured.
@@ -1168,7 +1173,7 @@ namespace OpenSim.Region.Framework.Scenes
1168 1173
1169 /// <summary> 1174 /// <summary>
1170 /// Delete this group from its scene and tell all the scene presences about that deletion. 1175 /// Delete this group from its scene and tell all the scene presences about that deletion.
1171 /// </summary> 1176 /// </summary>
1172 /// <param name="silent">Broadcast deletions to all clients.</param> 1177 /// <param name="silent">Broadcast deletions to all clients.</param>
1173 public void DeleteGroup(bool silent) 1178 public void DeleteGroup(bool silent)
1174 { 1179 {
@@ -1275,11 +1280,11 @@ namespace OpenSim.Region.Framework.Scenes
1275 if (part.LocalId != m_rootPart.LocalId) 1280 if (part.LocalId != m_rootPart.LocalId)
1276 { 1281 {
1277 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim); 1282 part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim);
1278 } 1283 }
1279 } 1284 }
1280 1285
1281 // Hack to get the physics scene geometries in the right spot 1286 // Hack to get the physics scene geometries in the right spot
1282 ResetChildPrimPhysicsPositions(); 1287 ResetChildPrimPhysicsPositions();
1283 } 1288 }
1284 else 1289 else
1285 { 1290 {
@@ -1502,7 +1507,7 @@ namespace OpenSim.Region.Framework.Scenes
1502 List<SceneObjectPart> partList; 1507 List<SceneObjectPart> partList;
1503 1508
1504 lock (m_parts) 1509 lock (m_parts)
1505 { 1510 {
1506 partList = new List<SceneObjectPart>(m_parts.Values); 1511 partList = new List<SceneObjectPart>(m_parts.Values);
1507 } 1512 }
1508 1513
@@ -1752,7 +1757,7 @@ namespace OpenSim.Region.Framework.Scenes
1752 rootpart.PhysActor.PIDHoverActive = false; 1757 rootpart.PhysActor.PIDHoverActive = false;
1753 } 1758 }
1754 } 1759 }
1755 } 1760 }
1756 } 1761 }
1757 1762
1758 /// <summary> 1763 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b0d279c..c915e9f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -42,7 +42,7 @@ using OpenSim.Region.Framework.Scenes.Scripting;
42using OpenSim.Region.Physics.Manager; 42using OpenSim.Region.Physics.Manager;
43 43
44namespace OpenSim.Region.Framework.Scenes 44namespace OpenSim.Region.Framework.Scenes
45{ 45{
46 #region Enumerations 46 #region Enumerations
47 47
48 [Flags] 48 [Flags]
@@ -187,7 +187,7 @@ namespace OpenSim.Region.Framework.Scenes
187 public IEntityInventory Inventory 187 public IEntityInventory Inventory
188 { 188 {
189 get { return m_inventory; } 189 get { return m_inventory; }
190 } 190 }
191 protected SceneObjectPartInventory m_inventory; 191 protected SceneObjectPartInventory m_inventory;
192 192
193 [XmlIgnore] 193 [XmlIgnore]
@@ -309,9 +309,9 @@ namespace OpenSim.Region.Framework.Scenes
309 RotationOffset = rotationOffset; 309 RotationOffset = rotationOffset;
310 Velocity = new Vector3(0, 0, 0); 310 Velocity = new Vector3(0, 0, 0);
311 AngularVelocity = new Vector3(0, 0, 0); 311 AngularVelocity = new Vector3(0, 0, 0);
312 Acceleration = new Vector3(0, 0, 0); 312 Acceleration = new Vector3(0, 0, 0);
313 m_TextureAnimation = new byte[0]; 313 m_TextureAnimation = new byte[0];
314 m_particleSystem = new byte[0]; 314 m_particleSystem = new byte[0];
315 315
316 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, 316 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
317 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from 317 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
@@ -384,7 +384,7 @@ namespace OpenSim.Region.Framework.Scenes
384 384
385 /// <value> 385 /// <value>
386 /// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes 386 /// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes
387 /// </value> 387 /// </value>
388 public TaskInventoryDictionary TaskInventory 388 public TaskInventoryDictionary TaskInventory
389 { 389 {
390 get { return m_inventory.Items; } 390 get { return m_inventory.Items; }
@@ -415,9 +415,10 @@ namespace OpenSim.Region.Framework.Scenes
415 set 415 set
416 { 416 {
417 m_name = value; 417 m_name = value;
418 if (PhysActor != null) 418 PhysicsActor pa = PhysActor;
419 if (pa != null)
419 { 420 {
420 PhysActor.SOPName = value; 421 pa.SOPName = value;
421 } 422 }
422 } 423 }
423 } 424 }
@@ -427,10 +428,11 @@ namespace OpenSim.Region.Framework.Scenes
427 get { return (byte) m_material; } 428 get { return (byte) m_material; }
428 set 429 set
429 { 430 {
431 PhysicsActor pa = PhysActor;
430 m_material = (Material)value; 432 m_material = (Material)value;
431 if (PhysActor != null) 433 if (pa != null)
432 { 434 {
433 PhysActor.SetMaterial((int)value); 435 pa.SetMaterial((int)value);
434 } 436 }
435 } 437 }
436 } 438 }
@@ -501,11 +503,12 @@ namespace OpenSim.Region.Framework.Scenes
501 get 503 get
502 { 504 {
503 // If this is a linkset, we don't want the physics engine mucking up our group position here. 505 // If this is a linkset, we don't want the physics engine mucking up our group position here.
504 if (PhysActor != null && _parentID == 0) 506 PhysicsActor pa = PhysActor;
507 if (pa != null && _parentID == 0)
505 { 508 {
506 m_groupPosition.X = PhysActor.Position.X; 509 m_groupPosition.X = pa.Position.X;
507 m_groupPosition.Y = PhysActor.Position.Y; 510 m_groupPosition.Y = pa.Position.Y;
508 m_groupPosition.Z = PhysActor.Position.Z; 511 m_groupPosition.Z = pa.Position.Z;
509 } 512 }
510 513
511 if (IsAttachment) 514 if (IsAttachment)
@@ -525,26 +528,27 @@ namespace OpenSim.Region.Framework.Scenes
525 528
526 m_groupPosition = value; 529 m_groupPosition = value;
527 530
528 if (PhysActor != null) 531 PhysicsActor pa = PhysActor;
532 if (pa != null)
529 { 533 {
530 try 534 try
531 { 535 {
532 // Root prim actually goes at Position 536 // Root prim actually goes at Position
533 if (_parentID == 0) 537 if (_parentID == 0)
534 { 538 {
535 PhysActor.Position = new PhysicsVector(value.X, value.Y, value.Z); 539 pa.Position = new PhysicsVector(value.X, value.Y, value.Z);
536 } 540 }
537 else 541 else
538 { 542 {
539 // To move the child prim in respect to the group position and rotation we have to calculate 543 // To move the child prim in respect to the group position and rotation we have to calculate
540 Vector3 resultingposition = GetWorldPosition(); 544 Vector3 resultingposition = GetWorldPosition();
541 PhysActor.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z); 545 pa.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z);
542 Quaternion resultingrot = GetWorldRotation(); 546 Quaternion resultingrot = GetWorldRotation();
543 PhysActor.Orientation = resultingrot; 547 pa.Orientation = resultingrot;
544 } 548 }
545 549
546 // Tell the physics engines that this prim changed. 550 // Tell the physics engines that this prim changed.
547 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 551 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
548 } 552 }
549 catch (Exception e) 553 catch (Exception e)
550 { 554 {
@@ -577,15 +581,16 @@ namespace OpenSim.Region.Framework.Scenes
577 581
578 if (ParentGroup != null && !ParentGroup.IsDeleted) 582 if (ParentGroup != null && !ParentGroup.IsDeleted)
579 { 583 {
580 if (_parentID != 0 && PhysActor != null) 584 PhysicsActor pa = PhysActor;
585 if (_parentID != 0 && pa != null)
581 { 586 {
582 Vector3 resultingposition = GetWorldPosition(); 587 Vector3 resultingposition = GetWorldPosition();
583 PhysActor.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z); 588 pa.Position = new PhysicsVector(resultingposition.X, resultingposition.Y, resultingposition.Z);
584 Quaternion resultingrot = GetWorldRotation(); 589 Quaternion resultingrot = GetWorldRotation();
585 PhysActor.Orientation = resultingrot; 590 pa.Orientation = resultingrot;
586 591
587 // Tell the physics engines that this prim changed. 592 // Tell the physics engines that this prim changed.
588 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 593 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
589 } 594 }
590 } 595 }
591 } 596 }
@@ -595,13 +600,14 @@ namespace OpenSim.Region.Framework.Scenes
595 { 600 {
596 get 601 get
597 { 602 {
603 PhysicsActor pa = PhysActor;
598 // We don't want the physics engine mucking up the rotations in a linkset 604 // We don't want the physics engine mucking up the rotations in a linkset
599 if ((_parentID == 0) && (Shape.PCode != 9 || Shape.State == 0) && (PhysActor != null)) 605 if ((_parentID == 0) && (Shape.PCode != 9 || Shape.State == 0) && (pa != null))
600 { 606 {
601 if (PhysActor.Orientation.X != 0 || PhysActor.Orientation.Y != 0 607 if (pa.Orientation.X != 0 || pa.Orientation.Y != 0
602 || PhysActor.Orientation.Z != 0 || PhysActor.Orientation.W != 0) 608 || pa.Orientation.Z != 0 || pa.Orientation.W != 0)
603 { 609 {
604 m_rotationOffset = PhysActor.Orientation; 610 m_rotationOffset = pa.Orientation;
605 } 611 }
606 } 612 }
607 613
@@ -610,27 +616,28 @@ namespace OpenSim.Region.Framework.Scenes
610 616
611 set 617 set
612 { 618 {
619 PhysicsActor pa = PhysActor;
613 StoreUndoState(); 620 StoreUndoState();
614 m_rotationOffset = value; 621 m_rotationOffset = value;
615 622
616 if (PhysActor != null) 623 if (pa != null)
617 { 624 {
618 try 625 try
619 { 626 {
620 // Root prim gets value directly 627 // Root prim gets value directly
621 if (_parentID == 0) 628 if (_parentID == 0)
622 { 629 {
623 PhysActor.Orientation = value; 630 pa.Orientation = value;
624 //m_log.Info("[PART]: RO1:" + PhysActor.Orientation.ToString()); 631 //m_log.Info("[PART]: RO1:" + PhysActor.Orientation.ToString());
625 } 632 }
626 else 633 else
627 { 634 {
628 // Child prim we have to calculate it's world rotationwel 635 // Child prim we have to calculate it's world rotationwel
629 Quaternion resultingrotation = GetWorldRotation(); 636 Quaternion resultingrotation = GetWorldRotation();
630 PhysActor.Orientation = resultingrotation; 637 pa.Orientation = resultingrotation;
631 //m_log.Info("[PART]: RO2:" + PhysActor.Orientation.ToString()); 638 //m_log.Info("[PART]: RO2:" + PhysActor.Orientation.ToString());
632 } 639 }
633 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 640 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
634 //} 641 //}
635 } 642 }
636 catch (Exception ex) 643 catch (Exception ex)
@@ -650,13 +657,14 @@ namespace OpenSim.Region.Framework.Scenes
650 //if (PhysActor.Velocity.X != 0 || PhysActor.Velocity.Y != 0 657 //if (PhysActor.Velocity.X != 0 || PhysActor.Velocity.Y != 0
651 //|| PhysActor.Velocity.Z != 0) 658 //|| PhysActor.Velocity.Z != 0)
652 //{ 659 //{
653 if (PhysActor != null) 660 PhysicsActor pa = PhysActor;
661 if (pa != null)
654 { 662 {
655 if (PhysActor.IsPhysical) 663 if (pa.IsPhysical)
656 { 664 {
657 m_velocity.X = PhysActor.Velocity.X; 665 m_velocity.X = pa.Velocity.X;
658 m_velocity.Y = PhysActor.Velocity.Y; 666 m_velocity.Y = pa.Velocity.Y;
659 m_velocity.Z = PhysActor.Velocity.Z; 667 m_velocity.Z = pa.Velocity.Z;
660 } 668 }
661 } 669 }
662 670
@@ -666,12 +674,13 @@ namespace OpenSim.Region.Framework.Scenes
666 set 674 set
667 { 675 {
668 m_velocity = value; 676 m_velocity = value;
669 if (PhysActor != null) 677 PhysicsActor pa = PhysActor;
678 if (pa != null)
670 { 679 {
671 if (PhysActor.IsPhysical) 680 if (pa.IsPhysical)
672 { 681 {
673 PhysActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z); 682 pa.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
674 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 683 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
675 } 684 }
676 } 685 }
677 } 686 }
@@ -688,9 +697,10 @@ namespace OpenSim.Region.Framework.Scenes
688 { 697 {
689 get 698 get
690 { 699 {
691 if ((PhysActor != null) && PhysActor.IsPhysical) 700 PhysicsActor pa = PhysActor;
701 if ((pa != null) && pa.IsPhysical)
692 { 702 {
693 m_angularVelocity.FromBytes(PhysActor.RotationalVelocity.GetBytes(), 0); 703 m_angularVelocity.FromBytes(pa.RotationalVelocity.GetBytes(), 0);
694 } 704 }
695 return m_angularVelocity; 705 return m_angularVelocity;
696 } 706 }
@@ -709,10 +719,11 @@ namespace OpenSim.Region.Framework.Scenes
709 get { return m_description; } 719 get { return m_description; }
710 set 720 set
711 { 721 {
722 PhysicsActor pa = PhysActor;
712 m_description = value; 723 m_description = value;
713 if (PhysActor != null) 724 if (pa != null)
714 { 725 {
715 PhysActor.SOPDescription = value; 726 pa.SOPDescription = value;
716 } 727 }
717 } 728 }
718 } 729 }
@@ -806,14 +817,15 @@ namespace OpenSim.Region.Framework.Scenes
806if (m_shape != null) { 817if (m_shape != null) {
807 m_shape.Scale = value; 818 m_shape.Scale = value;
808 819
809 if (PhysActor != null && m_parentGroup != null) 820 PhysicsActor pa = PhysActor;
821 if (pa != null && m_parentGroup != null)
810 { 822 {
811 if (m_parentGroup.Scene != null) 823 if (m_parentGroup.Scene != null)
812 { 824 {
813 if (m_parentGroup.Scene.PhysicsScene != null) 825 if (m_parentGroup.Scene.PhysicsScene != null)
814 { 826 {
815 PhysActor.Size = new PhysicsVector(m_shape.Scale.X, m_shape.Scale.Y, m_shape.Scale.Z); 827 pa.Size = new PhysicsVector(m_shape.Scale.X, m_shape.Scale.Y, m_shape.Scale.Z);
816 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 828 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
817 } 829 }
818 } 830 }
819 } 831 }
@@ -1343,13 +1355,14 @@ if (m_shape != null) {
1343 RigidBody); 1355 RigidBody);
1344 1356
1345 // Basic Physics returns null.. joy joy joy. 1357 // Basic Physics returns null.. joy joy joy.
1346 if (PhysActor != null) 1358 PhysicsActor pa = PhysActor;
1359 if (pa != null)
1347 { 1360 {
1348 PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info 1361 pa.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info
1349 PhysActor.SOPDescription = this.Description; 1362 pa.SOPDescription = this.Description;
1350 PhysActor.LocalID = LocalId; 1363 pa.LocalID = LocalId;
1351 DoPhysicsPropertyUpdate(RigidBody, true); 1364 DoPhysicsPropertyUpdate(RigidBody, true);
1352 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0); 1365 pa.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
1353 } 1366 }
1354 } 1367 }
1355 } 1368 }
@@ -1563,23 +1576,24 @@ if (m_shape != null) {
1563 } 1576 }
1564 else 1577 else
1565 { 1578 {
1566 if (PhysActor != null) 1579 PhysicsActor pa = PhysActor;
1580 if (pa != null)
1567 { 1581 {
1568 if (UsePhysics != PhysActor.IsPhysical || isNew) 1582 if (UsePhysics != pa.IsPhysical || isNew)
1569 { 1583 {
1570 if (PhysActor.IsPhysical) // implies UsePhysics==false for this block 1584 if (pa.IsPhysical) // implies UsePhysics==false for this block
1571 { 1585 {
1572 if (!isNew) 1586 if (!isNew)
1573 ParentGroup.Scene.RemovePhysicalPrim(1); 1587 ParentGroup.Scene.RemovePhysicalPrim(1);
1574 1588
1575 PhysActor.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate; 1589 pa.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate;
1576 PhysActor.OnOutOfBounds -= PhysicsOutOfBounds; 1590 pa.OnOutOfBounds -= PhysicsOutOfBounds;
1577 PhysActor.delink(); 1591 pa.delink();
1578 1592
1579 if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints && (!isNew)) 1593 if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints && (!isNew))
1580 { 1594 {
1581 // destroy all joints connected to this now deactivated body 1595 // destroy all joints connected to this now deactivated body
1582 m_parentGroup.Scene.PhysicsScene.RemoveAllJointsConnectedToActorThreadLocked(PhysActor); 1596 m_parentGroup.Scene.PhysicsScene.RemoveAllJointsConnectedToActorThreadLocked(pa);
1583 } 1597 }
1584 1598
1585 // stop client-side interpolation of all joint proxy objects that have just been deleted 1599 // stop client-side interpolation of all joint proxy objects that have just been deleted
@@ -1598,7 +1612,7 @@ if (m_shape != null) {
1598 //RotationalVelocity = new Vector3(0, 0, 0); 1612 //RotationalVelocity = new Vector3(0, 0, 0);
1599 } 1613 }
1600 1614
1601 PhysActor.IsPhysical = UsePhysics; 1615 pa.IsPhysical = UsePhysics;
1602 1616
1603 1617
1604 // If we're not what we're supposed to be in the physics scene, recreate ourselves. 1618 // If we're not what we're supposed to be in the physics scene, recreate ourselves.
@@ -1612,19 +1626,19 @@ if (m_shape != null) {
1612 { 1626 {
1613 ParentGroup.Scene.AddPhysicalPrim(1); 1627 ParentGroup.Scene.AddPhysicalPrim(1);
1614 1628
1615 PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; 1629 pa.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate;
1616 PhysActor.OnOutOfBounds += PhysicsOutOfBounds; 1630 pa.OnOutOfBounds += PhysicsOutOfBounds;
1617 if (_parentID != 0 && _parentID != LocalId) 1631 if (_parentID != 0 && _parentID != LocalId)
1618 { 1632 {
1619 if (ParentGroup.RootPart.PhysActor != null) 1633 if (ParentGroup.RootPart.PhysActor != null)
1620 { 1634 {
1621 PhysActor.link(ParentGroup.RootPart.PhysActor); 1635 pa.link(ParentGroup.RootPart.PhysActor);
1622 } 1636 }
1623 } 1637 }
1624 } 1638 }
1625 } 1639 }
1626 } 1640 }
1627 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 1641 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
1628 } 1642 }
1629 } 1643 }
1630 } 1644 }
@@ -1690,9 +1704,10 @@ if (m_shape != null) {
1690 1704
1691 public Vector3 GetGeometricCenter() 1705 public Vector3 GetGeometricCenter()
1692 { 1706 {
1693 if (PhysActor != null) 1707 PhysicsActor pa = PhysActor;
1708 if (pa != null)
1694 { 1709 {
1695 return new Vector3(PhysActor.CenterOfMass.X, PhysActor.CenterOfMass.Y, PhysActor.CenterOfMass.Z); 1710 return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z);
1696 } 1711 }
1697 else 1712 else
1698 { 1713 {
@@ -1702,9 +1717,10 @@ if (m_shape != null) {
1702 1717
1703 public float GetMass() 1718 public float GetMass()
1704 { 1719 {
1705 if (PhysActor != null) 1720 PhysicsActor pa = PhysActor;
1721 if (pa != null)
1706 { 1722 {
1707 return PhysActor.Mass; 1723 return pa.Mass;
1708 } 1724 }
1709 else 1725 else
1710 { 1726 {
@@ -1714,8 +1730,9 @@ if (m_shape != null) {
1714 1730
1715 public PhysicsVector GetForce() 1731 public PhysicsVector GetForce()
1716 { 1732 {
1717 if (PhysActor != null) 1733 PhysicsActor pa = PhysActor;
1718 return PhysActor.Force; 1734 if (pa != null)
1735 return pa.Force;
1719 else 1736 else
1720 return new PhysicsVector(); 1737 return new PhysicsVector();
1721 } 1738 }
@@ -2094,11 +2111,15 @@ if (m_shape != null) {
2094 2111
2095 public void PhysicsRequestingTerseUpdate() 2112 public void PhysicsRequestingTerseUpdate()
2096 { 2113 {
2097 if (PhysActor != null) 2114 PhysicsActor pa = PhysActor;
2115 if (pa != null)
2098 { 2116 {
2099 Vector3 newpos = new Vector3(PhysActor.Position.GetBytes(), 0); 2117 Vector3 newpos = new Vector3(pa.Position.GetBytes(), 0);
2100 2118
2101 if (m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.N) | m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.S) | m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.E) | m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.W)) 2119 if (m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.N) |
2120 m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.S) |
2121 m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.E) |
2122 m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.W))
2102 { 2123 {
2103 m_parentGroup.AbsolutePosition = newpos; 2124 m_parentGroup.AbsolutePosition = newpos;
2104 return; 2125 return;
@@ -2294,14 +2315,15 @@ if (m_shape != null) {
2294 if (texture != null) 2315 if (texture != null)
2295 m_shape.SculptData = texture.Data; 2316 m_shape.SculptData = texture.Data;
2296 2317
2297 if (PhysActor != null) 2318 PhysicsActor pa = PhysActor;
2319 if (pa != null)
2298 { 2320 {
2299 // Tricks physics engine into thinking we've changed the part shape. 2321 // Tricks physics engine into thinking we've changed the part shape.
2300 PrimitiveBaseShape m_newshape = m_shape.Copy(); 2322 PrimitiveBaseShape m_newshape = m_shape.Copy();
2301 PhysActor.Shape = m_newshape; 2323 pa.Shape = m_newshape;
2302 m_shape = m_newshape; 2324 m_shape = m_newshape;
2303 2325
2304 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 2326 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
2305 } 2327 }
2306 } 2328 }
2307 } 2329 }
@@ -2520,9 +2542,10 @@ if (m_shape != null) {
2520 2542
2521 public void SetBuoyancy(float fvalue) 2543 public void SetBuoyancy(float fvalue)
2522 { 2544 {
2523 if (PhysActor != null) 2545 PhysicsActor pa = PhysActor;
2546 if (pa != null)
2524 { 2547 {
2525 PhysActor.Buoyancy = fvalue; 2548 pa.Buoyancy = fvalue;
2526 } 2549 }
2527 } 2550 }
2528 2551
@@ -2538,56 +2561,62 @@ if (m_shape != null) {
2538 2561
2539 public void SetFloatOnWater(int floatYN) 2562 public void SetFloatOnWater(int floatYN)
2540 { 2563 {
2541 if (PhysActor != null) 2564 PhysicsActor pa = PhysActor;
2565 if (pa != null)
2542 { 2566 {
2543 if (floatYN == 1) 2567 if (floatYN == 1)
2544 { 2568 {
2545 PhysActor.FloatOnWater = true; 2569 pa.FloatOnWater = true;
2546 } 2570 }
2547 else 2571 else
2548 { 2572 {
2549 PhysActor.FloatOnWater = false; 2573 pa.FloatOnWater = false;
2550 } 2574 }
2551 } 2575 }
2552 } 2576 }
2553 2577
2554 public void SetForce(PhysicsVector force) 2578 public void SetForce(PhysicsVector force)
2555 { 2579 {
2556 if (PhysActor != null) 2580 PhysicsActor pa = PhysActor;
2581 if (pa != null)
2557 { 2582 {
2558 PhysActor.Force = force; 2583 pa.Force = force;
2559 } 2584 }
2560 } 2585 }
2561 2586
2562 public void SetVehicleType(int type) 2587 public void SetVehicleType(int type)
2563 { 2588 {
2564 if (PhysActor != null) 2589 PhysicsActor pa = PhysActor;
2590 if (pa != null)
2565 { 2591 {
2566 PhysActor.VehicleType = type; 2592 pa.VehicleType = type;
2567 } 2593 }
2568 } 2594 }
2569 2595
2570 public void SetVehicleFloatParam(int param, float value) 2596 public void SetVehicleFloatParam(int param, float value)
2571 { 2597 {
2572 if (PhysActor != null) 2598 PhysicsActor pa = PhysActor;
2599 if (pa != null)
2573 { 2600 {
2574 PhysActor.VehicleFloatParam(param, value); 2601 pa.VehicleFloatParam(param, value);
2575 } 2602 }
2576 } 2603 }
2577 2604
2578 public void SetVehicleVectorParam(int param, PhysicsVector value) 2605 public void SetVehicleVectorParam(int param, PhysicsVector value)
2579 { 2606 {
2580 if (PhysActor != null) 2607 PhysicsActor pa = PhysActor;
2608 if (pa != null)
2581 { 2609 {
2582 PhysActor.VehicleVectorParam(param, value); 2610 pa.VehicleVectorParam(param, value);
2583 } 2611 }
2584 } 2612 }
2585 2613
2586 public void SetVehicleRotationParam(int param, Quaternion rotation) 2614 public void SetVehicleRotationParam(int param, Quaternion rotation)
2587 { 2615 {
2588 if (PhysActor != null) 2616 PhysicsActor pa = PhysActor;
2617 if (pa != null)
2589 { 2618 {
2590 PhysActor.VehicleRotationParam(param, rotation); 2619 pa.VehicleRotationParam(param, rotation);
2591 } 2620 }
2592 } 2621 }
2593 2622
@@ -2615,10 +2644,11 @@ if (m_shape != null) {
2615 2644
2616 public void SetPhysicsAxisRotation() 2645 public void SetPhysicsAxisRotation()
2617 { 2646 {
2618 if (PhysActor != null) 2647 PhysicsActor pa = PhysActor;
2648 if (pa != null)
2619 { 2649 {
2620 PhysActor.LockAngularMotion(RotationAxis); 2650 pa.LockAngularMotion(RotationAxis);
2621 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 2651 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
2622 } 2652 }
2623 } 2653 }
2624 2654
@@ -3350,8 +3380,9 @@ if (m_shape != null) {
3350 { 3380 {
3351 IsVD = false; // Switch it of for the course of this routine 3381 IsVD = false; // Switch it of for the course of this routine
3352 VolumeDetectActive = false; // and also permanently 3382 VolumeDetectActive = false; // and also permanently
3353 if (PhysActor != null) 3383 PhysicsActor pa = PhysActor;
3354 PhysActor.SetVolumeDetect(0); // Let physics know about it too 3384 if (pa != null)
3385 pa.SetVolumeDetect(0); // Let physics know about it too
3355 } 3386 }
3356 else 3387 else
3357 { 3388 {
@@ -3399,18 +3430,21 @@ if (m_shape != null) {
3399 if (IsPhantom || IsAttachment) // note: this may have been changed above in the case of joints 3430 if (IsPhantom || IsAttachment) // note: this may have been changed above in the case of joints
3400 { 3431 {
3401 AddFlag(PrimFlags.Phantom); 3432 AddFlag(PrimFlags.Phantom);
3402 if (PhysActor != null) 3433 PhysicsActor pa = PhysActor;
3434 if (pa != null)
3403 { 3435 {
3404 m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); 3436 m_parentGroup.Scene.PhysicsScene.RemovePrim(pa);
3405 /// that's not wholesome. Had to make Scene public 3437 /// that's not wholesome. Had to make Scene public
3406 PhysActor = null; 3438 pa = null;
3407 } 3439 }
3408 } 3440 }
3409 else // Not phantom 3441 else // Not phantom
3410 { 3442 {
3411 RemFlag(PrimFlags.Phantom); 3443 RemFlag(PrimFlags.Phantom);
3412 3444
3413 if (PhysActor == null) 3445 // This is NOT safe!!
3446 PhysicsActor pa = PhysActor;
3447 if (pa == null)
3414 { 3448 {
3415 // It's not phantom anymore. So make sure the physics engine get's knowledge of it 3449 // It's not phantom anymore. So make sure the physics engine get's knowledge of it
3416 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( 3450 PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
@@ -3421,9 +3455,10 @@ if (m_shape != null) {
3421 RotationOffset, 3455 RotationOffset,
3422 UsePhysics); 3456 UsePhysics);
3423 3457
3424 if (PhysActor != null) 3458 pa = PhysActor;
3459 if (pa != null)
3425 { 3460 {
3426 PhysActor.LocalID = LocalId; 3461 pa.LocalID = LocalId;
3427 DoPhysicsPropertyUpdate(UsePhysics, true); 3462 DoPhysicsPropertyUpdate(UsePhysics, true);
3428 if (m_parentGroup != null) 3463 if (m_parentGroup != null)
3429 { 3464 {
@@ -3442,14 +3477,14 @@ if (m_shape != null) {
3442 (CollisionSound != UUID.Zero) 3477 (CollisionSound != UUID.Zero)
3443 ) 3478 )
3444 { 3479 {
3445 PhysActor.OnCollisionUpdate += PhysicsCollision; 3480 pa.OnCollisionUpdate += PhysicsCollision;
3446 PhysActor.SubscribeEvents(1000); 3481 pa.SubscribeEvents(1000);
3447 } 3482 }
3448 } 3483 }
3449 } 3484 }
3450 else // it already has a physical representation 3485 else // it already has a physical representation
3451 { 3486 {
3452 PhysActor.IsPhysical = UsePhysics; 3487 pa.IsPhysical = UsePhysics;
3453 3488
3454 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim 3489 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim
3455 if (m_parentGroup != null) 3490 if (m_parentGroup != null)
@@ -3472,20 +3507,21 @@ if (m_shape != null) {
3472 // Defensive programming calls for a check here. 3507 // Defensive programming calls for a check here.
3473 // Better would be throwing an exception that could be catched by a unit test as the internal 3508 // Better would be throwing an exception that could be catched by a unit test as the internal
3474 // logic should make sure, this Physactor is always here. 3509 // logic should make sure, this Physactor is always here.
3475 if (this.PhysActor != null) 3510 PhysicsActor pa = this.PhysActor;
3511 if (pa != null)
3476 { 3512 {
3477 PhysActor.SetVolumeDetect(1); 3513 pa.SetVolumeDetect(1);
3478 AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active 3514 AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active
3479 this.VolumeDetectActive = true; 3515 this.VolumeDetectActive = true;
3480 } 3516 }
3481
3482 } 3517 }
3483 else 3518 else
3484 { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like 3519 { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like
3485 // (mumbles, well, at least if you have infinte CPU powers :-)) 3520 // (mumbles, well, at least if you have infinte CPU powers :-))
3486 if (this.PhysActor != null) 3521 PhysicsActor pa = this.PhysActor;
3522 if (pa != null)
3487 { 3523 {
3488 PhysActor.SetVolumeDetect(0); 3524 pa.SetVolumeDetect(0);
3489 } 3525 }
3490 this.VolumeDetectActive = false; 3526 this.VolumeDetectActive = false;
3491 } 3527 }
@@ -3543,10 +3579,11 @@ if (m_shape != null) {
3543 m_shape.PathTaperY = shapeBlock.PathTaperY; 3579 m_shape.PathTaperY = shapeBlock.PathTaperY;
3544 m_shape.PathTwist = shapeBlock.PathTwist; 3580 m_shape.PathTwist = shapeBlock.PathTwist;
3545 m_shape.PathTwistBegin = shapeBlock.PathTwistBegin; 3581 m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
3546 if (PhysActor != null) 3582 PhysicsActor pa = PhysActor;
3583 if (pa != null)
3547 { 3584 {
3548 PhysActor.Shape = m_shape; 3585 pa.Shape = m_shape;
3549 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 3586 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(pa);
3550 } 3587 }
3551 3588
3552 // This is what makes vehicle trailers work 3589 // This is what makes vehicle trailers work
@@ -3647,19 +3684,21 @@ if (m_shape != null) {
3647 ) 3684 )
3648 { 3685 {
3649 // subscribe to physics updates. 3686 // subscribe to physics updates.
3650 if (PhysActor != null) 3687 PhysicsActor pa = PhysActor;
3688 if (pa != null)
3651 { 3689 {
3652 PhysActor.OnCollisionUpdate += PhysicsCollision; 3690 pa.OnCollisionUpdate += PhysicsCollision;
3653 PhysActor.SubscribeEvents(1000); 3691 pa.SubscribeEvents(1000);
3654 3692
3655 } 3693 }
3656 } 3694 }
3657 else 3695 else
3658 { 3696 {
3659 if (PhysActor != null) 3697 PhysicsActor pa = PhysActor;
3698 if (pa != null)
3660 { 3699 {
3661 PhysActor.UnSubscribeEvents(); 3700 pa.UnSubscribeEvents();
3662 PhysActor.OnCollisionUpdate -= PhysicsCollision; 3701 pa.OnCollisionUpdate -= PhysicsCollision;
3663 } 3702 }
3664 } 3703 }
3665 3704
@@ -3736,7 +3775,7 @@ if (m_shape != null) {
3736 public override string ToString() 3775 public override string ToString()
3737 { 3776 {
3738 return String.Format("{0} {1} (parent {2}))", Name, UUID, ParentGroup); 3777 return String.Format("{0} {1} (parent {2}))", Name, UUID, ParentGroup);
3739 } 3778 }
3740 3779
3741 #endregion Public Methods 3780 #endregion Public Methods
3742 3781
@@ -3784,11 +3823,11 @@ if (m_shape != null) {
3784 _everyoneMask &= _nextOwnerMask; 3823 _everyoneMask &= _nextOwnerMask;
3785 3824
3786 Inventory.ApplyNextOwnerPermissions(); 3825 Inventory.ApplyNextOwnerPermissions();
3787 } 3826 }
3788 3827
3789 public bool CanBeDeleted() 3828 public bool CanBeDeleted()
3790 { 3829 {
3791 return Inventory.CanBeDeleted(); 3830 return Inventory.CanBeDeleted();
3792 } 3831 }
3793 } 3832 }
3794} 3833}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 76bcd7e..098e010 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes
105 public void ForceInventoryPersistence() 105 public void ForceInventoryPersistence()
106 { 106 {
107 HasInventoryChanged = true; 107 HasInventoryChanged = true;
108 } 108 }
109 109
110 /// <summary> 110 /// <summary>
111 /// Reset UUIDs for all the items in the prim's inventory. This involves either generating 111 /// Reset UUIDs for all the items in the prim's inventory. This involves either generating
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes
164 /// <summary> 164 /// <summary>
165 /// Change every item in this inventory to a new group. 165 /// Change every item in this inventory to a new group.
166 /// </summary> 166 /// </summary>
167 /// <param name="groupID"></param> 167 /// <param name="groupID"></param>
168 public void ChangeInventoryGroup(UUID groupID) 168 public void ChangeInventoryGroup(UUID groupID)
169 { 169 {
170 lock (Items) 170 lock (Items)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 23fe2d3..0e1b8d9 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -36,6 +36,7 @@ using OpenSim.Framework.Communications.Cache;
36using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes.Types; 37using OpenSim.Region.Framework.Scenes.Types;
38using OpenSim.Region.Physics.Manager; 38using OpenSim.Region.Physics.Manager;
39using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39 40
40namespace OpenSim.Region.Framework.Scenes 41namespace OpenSim.Region.Framework.Scenes
41{ 42{
@@ -775,7 +776,7 @@ namespace OpenSim.Region.Framework.Scenes
775 // Moved this from SendInitialData to ensure that m_appearance is initialized 776 // Moved this from SendInitialData to ensure that m_appearance is initialized
776 // before the inventory is processed in MakeRootAgent. This fixes a race condition 777 // before the inventory is processed in MakeRootAgent. This fixes a race condition
777 // related to the handling of attachments 778 // related to the handling of attachments
778 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); 779 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
779 if (m_scene.TestBorderCross(pos, Cardinals.E)) 780 if (m_scene.TestBorderCross(pos, Cardinals.E))
780 { 781 {
781 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E); 782 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E);
@@ -1234,7 +1235,7 @@ namespace OpenSim.Region.Framework.Scenes
1234 if ((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) 1235 if ((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
1235 { 1236 {
1236 StandUp(); 1237 StandUp();
1237 } 1238 }
1238 1239
1239 // Check if Client has camera in 'follow cam' or 'build' mode. 1240 // Check if Client has camera in 'follow cam' or 'build' mode.
1240 Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation); 1241 Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation);
@@ -1488,7 +1489,7 @@ namespace OpenSim.Region.Framework.Scenes
1488 { 1489 {
1489// m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); 1490// m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed));
1490// m_log.DebugFormat( 1491// m_log.DebugFormat(
1491// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); 1492// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
1492 1493
1493 AddNewMovement(agent_control_v3, q); 1494 AddNewMovement(agent_control_v3, q);
1494 1495
@@ -2269,7 +2270,7 @@ namespace OpenSim.Region.Framework.Scenes
2269 { 2270 {
2270 //Record the time we enter this state so we know whether to "land" or not 2271 //Record the time we enter this state so we know whether to "land" or not
2271 m_animPersistUntil = DateTime.Now.Ticks; 2272 m_animPersistUntil = DateTime.Now.Ticks;
2272 return "FALLDOWN"; 2273 return "FALLDOWN"; // this falling animation is invoked too frequently when capsule tilt correction is used - why?
2273 } 2274 }
2274 } 2275 }
2275 } 2276 }
@@ -2305,7 +2306,7 @@ namespace OpenSim.Region.Framework.Scenes
2305 /// Rotate the avatar to the given rotation and apply a movement in the given relative vector 2306 /// Rotate the avatar to the given rotation and apply a movement in the given relative vector
2306 /// </summary> 2307 /// </summary>
2307 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param> 2308 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param>
2308 /// <param name="rotation">The direction in which this avatar should now face. 2309 /// <param name="rotation">The direction in which this avatar should now face.
2309 public void AddNewMovement(Vector3 vec, Quaternion rotation) 2310 public void AddNewMovement(Vector3 vec, Quaternion rotation)
2310 { 2311 {
2311 if (m_isChildAgent) 2312 if (m_isChildAgent)
@@ -2648,7 +2649,7 @@ namespace OpenSim.Region.Framework.Scenes
2648 /// Tell the client for this scene presence what items it should be wearing now 2649 /// Tell the client for this scene presence what items it should be wearing now
2649 /// </summary> 2650 /// </summary>
2650 public void SendWearables() 2651 public void SendWearables()
2651 { 2652 {
2652 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); 2653 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
2653 } 2654 }
2654 2655
@@ -2934,8 +2935,9 @@ namespace OpenSim.Region.Framework.Scenes
2934 else if (dir > 3 && dir < 7) // Heading Sout 2935 else if (dir > 3 && dir < 7) // Heading Sout
2935 neighboury--; 2936 neighboury--;
2936 2937
2937 ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize)); 2938 int x = (int)(neighbourx * Constants.RegionSize);
2938 SimpleRegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); 2939 int y = (int)(neighboury * Constants.RegionSize);
2940 GridRegion neighbourRegion = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, x, y);
2939 2941
2940 if (neighbourRegion == null) 2942 if (neighbourRegion == null)
2941 { 2943 {
@@ -3173,7 +3175,7 @@ namespace OpenSim.Region.Framework.Scenes
3173 else 3175 else
3174 { 3176 {
3175 wears[i++] = UUID.Zero; 3177 wears[i++] = UUID.Zero;
3176 wears[i++] = UUID.Zero; 3178 wears[i++] = UUID.Zero;
3177 } 3179 }
3178 } 3180 }
3179 cAgent.Wearables = wears; 3181 cAgent.Wearables = wears;
@@ -3485,7 +3487,7 @@ namespace OpenSim.Region.Framework.Scenes
3485 3487
3486 public bool HasAttachments() 3488 public bool HasAttachments()
3487 { 3489 {
3488 return m_attachments.Count > 0; 3490 return m_attachments.Count > 0;
3489 } 3491 }
3490 3492
3491 public bool HasScriptedAttachments() 3493 public bool HasScriptedAttachments()
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index fe74158..f7544ac 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -122,13 +122,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
122 "[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData); 122 "[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData);
123 return null; 123 return null;
124 } 124 }
125 } 125 }
126 126
127 /// <summary> 127 /// <summary>
128 /// Serialize a scene object to the original xml format 128 /// Serialize a scene object to the original xml format
129 /// </summary> 129 /// </summary>
130 /// <param name="sceneObject"></param> 130 /// <param name="sceneObject"></param>
131 /// <returns></returns> 131 /// <returns></returns>
132 public static string ToOriginalXmlFormat(SceneObjectGroup sceneObject) 132 public static string ToOriginalXmlFormat(SceneObjectGroup sceneObject)
133 { 133 {
134 using (StringWriter sw = new StringWriter()) 134 using (StringWriter sw = new StringWriter())
@@ -140,13 +140,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
140 140
141 return sw.ToString(); 141 return sw.ToString();
142 } 142 }
143 } 143 }
144 144
145 /// <summary> 145 /// <summary>
146 /// Serialize a scene object to the original xml format 146 /// Serialize a scene object to the original xml format
147 /// </summary> 147 /// </summary>
148 /// <param name="sceneObject"></param> 148 /// <param name="sceneObject"></param>
149 /// <returns></returns> 149 /// <returns></returns>
150 public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer) 150 public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer)
151 { 151 {
152 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name); 152 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name);
@@ -238,13 +238,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
238 m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData); 238 m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData);
239 return null; 239 return null;
240 } 240 }
241 } 241 }
242 242
243 /// <summary> 243 /// <summary>
244 /// Serialize a scene object to the 'xml2' format. 244 /// Serialize a scene object to the 'xml2' format.
245 /// </summary> 245 /// </summary>
246 /// <param name="sceneObject"></param> 246 /// <param name="sceneObject"></param>
247 /// <returns></returns> 247 /// <returns></returns>
248 public static string ToXml2Format(SceneObjectGroup sceneObject) 248 public static string ToXml2Format(SceneObjectGroup sceneObject)
249 { 249 {
250 using (StringWriter sw = new StringWriter()) 250 using (StringWriter sw = new StringWriter())
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
262 /// Serialize a scene object to the 'xml2' format. 262 /// Serialize a scene object to the 'xml2' format.
263 /// </summary> 263 /// </summary>
264 /// <param name="sceneObject"></param> 264 /// <param name="sceneObject"></param>
265 /// <returns></returns> 265 /// <returns></returns>
266 public static void ToXml2Format(SceneObjectGroup sceneObject, XmlTextWriter writer) 266 public static void ToXml2Format(SceneObjectGroup sceneObject, XmlTextWriter writer)
267 { 267 {
268 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of SOG {0} to XML2", Name); 268 //m_log.DebugFormat("[SERIALIZER]: Starting serialization of SOG {0} to XML2", Name);
@@ -288,6 +288,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
288 writer.WriteEndElement(); // End of SceneObjectGroup 288 writer.WriteEndElement(); // End of SceneObjectGroup
289 289
290 //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0} to XML2, {1}ms", Name, System.Environment.TickCount - time); 290 //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0} to XML2, {1}ms", Name, System.Environment.TickCount - time);
291 } 291 }
292 } 292 }
293} 293}
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
index 7fa1b8c..cf0f345 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs
@@ -236,7 +236,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
236 } 236 }
237 237
238 SavePrimListToXml2(primList, fileName); 238 SavePrimListToXml2(primList, fileName);
239 } 239 }
240 240
241 public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName) 241 public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName)
242 { 242 {
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 7f44bf1..ee288b3 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -450,7 +450,7 @@ namespace OpenSim.Region.Framework.Scenes
450 { 450 {
451 addFrameMS(ms); 451 addFrameMS(ms);
452 addAgentMS(ms); 452 addAgentMS(ms);
453 } 453 }
454 454
455 #endregion 455 #endregion
456 } 456 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
index 3b0e77f..fc66c85 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44{ 44{
45 [TestFixture, LongRunning] 45 [TestFixture, LongRunning]
46 public class EntityManagerTests 46 public class EntityManagerTests
47 { 47 {
48 static public Random random; 48 static public Random random;
49 SceneObjectGroup found; 49 SceneObjectGroup found;
50 Scene scene = SceneSetupHelpers.SetupScene(); 50 Scene scene = SceneSetupHelpers.SetupScene();
@@ -81,13 +81,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
81 81
82 Assert.That(entman.ContainsKey(obj1), Is.False); 82 Assert.That(entman.ContainsKey(obj1), Is.False);
83 Assert.That(entman.ContainsKey(li1), Is.False); 83 Assert.That(entman.ContainsKey(li1), Is.False);
84 Assert.That(entman.ContainsKey(obj2), Is.False); 84 Assert.That(entman.ContainsKey(obj2), Is.False);
85 Assert.That(entman.ContainsKey(li2), Is.False); 85 Assert.That(entman.ContainsKey(li2), Is.False);
86 } 86 }
87 87
88 [Test] 88 [Test]
89 public void T011_ThreadAddRemoveTest() 89 public void T011_ThreadAddRemoveTest()
90 { 90 {
91 TestHelper.InMethod(); 91 TestHelper.InMethod();
92 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); 92 // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod());
93 93
@@ -148,12 +148,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests
148 int size = random.Next(40,80); 148 int size = random.Next(40,80);
149 char ch ; 149 char ch ;
150 for (int i=0; i<size; i++) 150 for (int i=0; i<size; i++)
151 { 151 {
152 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ; 152 ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))) ;
153 name.Append(ch); 153 name.Append(ch);
154 } 154 }
155 return name.ToString(); 155 return name.ToString();
156 } 156 }
157 } 157 }
158 158
159 public class NewTestThreads 159 public class NewTestThreads
@@ -179,4 +179,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests
179 entman.Remove(sog.UUID); 179 entman.Remove(sog.UUID);
180 } 180 }
181 } 181 }
182} \ No newline at end of file 182} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
index f6737a5..5c9e66f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
@@ -29,6 +29,7 @@ using System;
29using NUnit.Framework; 29using NUnit.Framework;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using GridRegion = OpenSim.Services.Interfaces.GridRegion;
32 33
33namespace OpenSim.Region.Framework.Scenes.Tests 34namespace OpenSim.Region.Framework.Scenes.Tests
34{ 35{
@@ -65,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
65 throw new NotImplementedException(); 66 throw new NotImplementedException();
66 } 67 }
67 68
68 public override bool OtherRegionUp(RegionInfo thisRegion) 69 public override void OtherRegionUp(GridRegion otherRegion)
69 { 70 {
70 throw new NotImplementedException(); 71 throw new NotImplementedException();
71 } 72 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 105446d..288fb36 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -46,13 +46,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
46 /// </summary> 46 /// </summary>
47 [TestFixture] 47 [TestFixture]
48 public class SceneObjectBasicTests 48 public class SceneObjectBasicTests
49 { 49 {
50 /// <summary> 50 /// <summary>
51 /// Test adding an object to a scene. 51 /// Test adding an object to a scene.
52 /// </summary> 52 /// </summary>
53 [Test, LongRunning] 53 [Test, LongRunning]
54 public void TestAddSceneObject() 54 public void TestAddSceneObject()
55 { 55 {
56 TestHelper.InMethod(); 56 TestHelper.InMethod();
57 57
58 Scene scene = SceneSetupHelpers.SetupScene(); 58 Scene scene = SceneSetupHelpers.SetupScene();
@@ -61,7 +61,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
61 61
62 //m_log.Debug("retrievedPart : {0}", retrievedPart); 62 //m_log.Debug("retrievedPart : {0}", retrievedPart);
63 // If the parts have the same UUID then we will consider them as one and the same 63 // If the parts have the same UUID then we will consider them as one and the same
64 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); 64 Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID));
65 } 65 }
66 66
67 /// <summary> 67 /// <summary>
@@ -72,11 +72,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
72 { 72 {
73 TestHelper.InMethod(); 73 TestHelper.InMethod();
74 74
75 TestScene scene = SceneSetupHelpers.SetupScene(); 75 TestScene scene = SceneSetupHelpers.SetupScene();
76 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); 76 SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene);
77 scene.DeleteSceneObject(part.ParentGroup, false); 77 scene.DeleteSceneObject(part.ParentGroup, false);
78 78
79 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 79 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
80 Assert.That(retrievedPart, Is.Null); 80 Assert.That(retrievedPart, Is.Null);
81 } 81 }
82 82
@@ -115,13 +115,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
115 //[Test] 115 //[Test]
116 //public void TestDeleteSceneObjectAsyncToUserInventory() 116 //public void TestDeleteSceneObjectAsyncToUserInventory()
117 //{ 117 //{
118 // TestHelper.InMethod(); 118 // TestHelper.InMethod();
119 // //log4net.Config.XmlConfigurator.Configure(); 119 // //log4net.Config.XmlConfigurator.Configure();
120 120
121 // UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); 121 // UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
122 // string myObjectName = "Fred"; 122 // string myObjectName = "Fred";
123 123
124 // TestScene scene = SceneSetupHelpers.SetupScene(); 124 // TestScene scene = SceneSetupHelpers.SetupScene();
125 // SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName); 125 // SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene, myObjectName);
126 126
127 // Assert.That( 127 // Assert.That(
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index bf13607..e15dc84 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -45,7 +45,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
45 /// <summary> 45 /// <summary>
46 /// Linking tests 46 /// Linking tests
47 /// </summary> 47 /// </summary>
48 [TestFixture] 48 [TestFixture]
49 public class SceneObjectLinkingTests 49 public class SceneObjectLinkingTests
50 { 50 {
51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -174,13 +174,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
174 // Link grp4 to grp3. 174 // Link grp4 to grp3.
175 grp3.LinkToGroup(grp4); 175 grp3.LinkToGroup(grp4);
176 176
177 // At this point we should have 4 parts total in two groups. 177 // At this point we should have 4 parts total in two groups.
178 Assert.That(grp1.Children.Count == 2); 178 Assert.That(grp1.Children.Count == 2);
179 Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); 179 Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link.");
180 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); 180 Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink.");
181 Assert.That(grp3.Children.Count == 2); 181 Assert.That(grp3.Children.Count == 2);
182 Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); 182 Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link.");
183 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); 183 Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink.");
184 184
185 if (debugtest) 185 if (debugtest)
186 { 186 {
@@ -194,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
194 m_log.Debug("Group3: Pos:"+grp3.AbsolutePosition+", Rot:"+grp3.Rotation); 194 m_log.Debug("Group3: Pos:"+grp3.AbsolutePosition+", Rot:"+grp3.Rotation);
195 m_log.Debug("Group3: Prim1: OffsetPosition:"+part3.OffsetPosition+", OffsetRotation:"+part3.RotationOffset); 195 m_log.Debug("Group3: Prim1: OffsetPosition:"+part3.OffsetPosition+", OffsetRotation:"+part3.RotationOffset);
196 m_log.Debug("Group3: Prim2: OffsetPosition:"+part4.OffsetPosition+", OffsetRotation:"+part4.RotationOffset); 196 m_log.Debug("Group3: Prim2: OffsetPosition:"+part4.OffsetPosition+", OffsetRotation:"+part4.RotationOffset);
197 } 197 }
198 198
199 // Required for linking 199 // Required for linking
200 grp1.RootPart.UpdateFlag = 0; 200 grp1.RootPart.UpdateFlag = 0;
@@ -253,6 +253,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
253 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) 253 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003)
254 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) 254 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003)
255 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); 255 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003));
256 } 256 }
257 } 257 }
258} 258}
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
index 1c9bce4..8a27b7b 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
@@ -41,11 +41,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
41 public class SceneTests 41 public class SceneTests
42 { 42 {
43 private class FakeStorageManager : StorageManager 43 private class FakeStorageManager : StorageManager
44 { 44 {
45 private class FakeRegionDataStore : IRegionDataStore 45 private class FakeRegionDataStore : IRegionDataStore
46 { 46 {
47 public void Initialise(string filename) 47 public void Initialise(string filename)
48 { 48 {
49 } 49 }
50 50
51 public void Dispose() 51 public void Dispose()
diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
index 1d460dd..b46eb8e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44{ 44{
45 /// <summary> 45 /// <summary>
46 /// Teleport tests in a standalone OpenSim 46 /// Teleport tests in a standalone OpenSim
47 /// </summary> 47 /// </summary>
48 [TestFixture] 48 [TestFixture]
49 public class StandaloneTeleportTests 49 public class StandaloneTeleportTests
50 { 50 {
@@ -52,7 +52,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
52 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common. 52 /// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
53 /// </summary> 53 /// </summary>
54 /// Does not yet do what is says on the tin. 54 /// Does not yet do what is says on the tin.
55 [Test, LongRunning] 55 /// Commenting for now
56 //[Test, LongRunning]
56 public void TestSimpleNotNeighboursTeleport() 57 public void TestSimpleNotNeighboursTeleport()
57 { 58 {
58 TestHelper.InMethod(); 59 TestHelper.InMethod();
@@ -117,14 +118,15 @@ namespace OpenSim.Region.Framework.Scenes.Tests
117 // shared module 118 // shared module
118 ISharedRegionModule interregionComms = new RESTInterregionComms(); 119 ISharedRegionModule interregionComms = new RESTInterregionComms();
119 120
120 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
121 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
122 sceneA.RegisterRegionWithGrid();
123 121
124 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm); 122 Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm, "grid");
125 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms); 123 SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
126 sceneB.RegisterRegionWithGrid(); 124 sceneB.RegisterRegionWithGrid();
127 125
126 Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm, "grid");
127 SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
128 sceneA.RegisterRegionWithGrid();
129
128 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041"); 130 UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000041");
129 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId); 131 TestClient client = SceneSetupHelpers.AddRootAgent(sceneA, agentId);
130 132
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index f449e18..525a93a 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.Framework.Scenes
41{ 41{
42 /// <summary> 42 /// <summary>
43 /// Gather uuids for a given entity. 43 /// Gather uuids for a given entity.
44 /// </summary> 44 /// </summary>
45 /// 45 ///
46 /// This does a deep inspection of the entity to retrieve all the assets it uses (whether as textures, as scripts 46 /// This does a deep inspection of the entity to retrieve all the assets it uses (whether as textures, as scripts
47 /// contained in inventory, as scripts contained in objects contained in another object's inventory, etc. Assets 47 /// contained in inventory, as scripts contained in objects contained in another object's inventory, etc. Assets
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Framework.Scenes
82 /// 82 ///
83 /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param> 83 /// <param name="assetUuid">The uuid of the asset for which to gather referenced assets</param>
84 /// <param name="assetType">The type of the asset for the uuid given</param> 84 /// <param name="assetType">The type of the asset for the uuid given</param>
85 /// <param name="assetUuids">The assets gathered</param> 85 /// <param name="assetUuids">The assets gathered</param>
86 public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, int> assetUuids) 86 public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, int> assetUuids)
87 { 87 {
88 assetUuids[assetUuid] = 1; 88 assetUuids[assetUuid] = 1;
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes
142 142
143 // If the prim is a sculpt then preserve this information too 143 // If the prim is a sculpt then preserve this information too
144 if (part.Shape.SculptTexture != UUID.Zero) 144 if (part.Shape.SculptTexture != UUID.Zero)
145 assetUuids[part.Shape.SculptTexture] = 1; 145 assetUuids[part.Shape.SculptTexture] = 1;
146 146
147 TaskInventoryDictionary taskDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone(); 147 TaskInventoryDictionary taskDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone();
148 148
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes
167 167
168 /// <summary> 168 /// <summary>
169 /// The callback made when we request the asset for an object from the asset service. 169 /// The callback made when we request the asset for an object from the asset service.
170 /// </summary> 170 /// </summary>
171 protected void AssetReceived(string id, Object sender, AssetBase asset) 171 protected void AssetReceived(string id, Object sender, AssetBase asset)
172 { 172 {
173 lock (this) 173 lock (this)
@@ -242,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes
242 AssetBase assetBase = GetAsset(wearableAssetUuid); 242 AssetBase assetBase = GetAsset(wearableAssetUuid);
243 243
244 if (null != assetBase) 244 if (null != assetBase)
245 { 245 {
246 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data)); 246 //m_log.Debug(new System.Text.ASCIIEncoding().GetString(bodypartAsset.Data));
247 AssetWearable wearableAsset = new AssetBodypart(wearableAssetUuid, assetBase.Data); 247 AssetWearable wearableAsset = new AssetBodypart(wearableAssetUuid, assetBase.Data);
248 wearableAsset.Decode(); 248 wearableAsset.Decode();
@@ -275,6 +275,6 @@ namespace OpenSim.Region.Framework.Scenes
275 SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml); 275 SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml);
276 GatherAssetUuids(sog, assetUuids); 276 GatherAssetUuids(sog, assetUuids);
277 } 277 }
278 } 278 }
279 } 279 }
280} \ No newline at end of file 280} \ No newline at end of file