aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authormeta72010-08-07 06:33:51 -0700
committermeta72010-08-07 06:33:51 -0700
commitbcb3b57f8dad06b2df1e84900da9a63253fa5a8e (patch)
treec081310d6b2c6ebf1636c52a91c6b02dd4b37acf /OpenSim
parentAdd a CHANGED_POSITION event so scripts don't have to run expensive loops to ... (diff)
parentand another one... (diff)
downloadopensim-SC-bcb3b57f8dad06b2df1e84900da9a63253fa5a8e.zip
opensim-SC-bcb3b57f8dad06b2df1e84900da9a63253fa5a8e.tar.gz
opensim-SC-bcb3b57f8dad06b2df1e84900da9a63253fa5a8e.tar.bz2
opensim-SC-bcb3b57f8dad06b2df1e84900da9a63253fa5a8e.tar.xz
Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs7
-rw-r--r--OpenSim/Framework/Statistics/SimExtraStatsCollector.cs65
-rw-r--r--OpenSim/Framework/Util.cs12
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs6
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs (renamed from OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs)77
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs147
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs33
-rw-r--r--OpenSim/Server/Handlers/Land/LandHandlers.cs4
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs50
-rw-r--r--OpenSim/Services/Connectors/Land/LandServiceConnector.cs5
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs6
-rw-r--r--OpenSim/Services/GridService/GridService.cs16
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs45
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs1
-rw-r--r--OpenSim/Services/Interfaces/ILandService.cs2
28 files changed, 284 insertions, 252 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index ffa30d5..016ab73 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -319,6 +319,13 @@ namespace OpenSim.Framework.Servers.HttpServer
319 OSHttpRequest req = new OSHttpRequest(context, request); 319 OSHttpRequest req = new OSHttpRequest(context, request);
320 OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); 320 OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
321 HandleRequest(req, resp); 321 HandleRequest(req, resp);
322
323 // !!!HACK ALERT!!!
324 // There seems to be a bug in the underlying http code that makes subsequent requests
325 // come up with trash in Accept headers. Until that gets fixed, we're cleaning them up here.
326 if (request.AcceptTypes != null)
327 for (int i = 0; i < request.AcceptTypes.Length; i++)
328 request.AcceptTypes[i] = string.Empty;
322 } 329 }
323 330
324 // public void ConvertIHttpClientContextToOSHttp(object stateinfo) 331 // public void ConvertIHttpClientContextToOSHttp(object stateinfo)
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index 3619606..5449757 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -390,36 +390,41 @@ Asset service request failures: {3}" + Environment.NewLine,
390 public override string XReport(string uptime, string version) 390 public override string XReport(string uptime, string version)
391 { 391 {
392 OSDMap args = new OSDMap(30); 392 OSDMap args = new OSDMap(30);
393 args["AssetsInCache"] = OSD.FromReal(AssetsInCache); 393 args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
394 args["TimeAfterCacheMiss"] = OSD.FromReal(assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0); 394 args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
395 args["BlockedMissingTextureRequests"] = OSD.FromReal(BlockedMissingTextureRequests); 395 assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0));
396 args["AssetServiceRequestFailures"] = OSD.FromReal(AssetServiceRequestFailures); 396 args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}",
397 args["abnormalClientThreadTerminations"] = OSD.FromReal(abnormalClientThreadTerminations); 397 BlockedMissingTextureRequests));
398 args["InventoryServiceRetrievalFailures"] = OSD.FromReal(InventoryServiceRetrievalFailures); 398 args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}",
399 args["Dilatn"] = OSD.FromReal(timeDilation); 399 AssetServiceRequestFailures));
400 args["SimFPS"] = OSD.FromReal(simFps); 400 args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}",
401 args["PhyFPS"] = OSD.FromReal(physicsFps); 401 abnormalClientThreadTerminations));
402 args["AgntUp"] = OSD.FromReal(agentUpdates); 402 args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}",
403 args["RootAg"] = OSD.FromReal(rootAgents); 403 InventoryServiceRetrievalFailures));
404 args["ChldAg"] = OSD.FromReal(childAgents); 404 args["Dilatn"] = OSD.FromString (String.Format ("{0:0.##}", timeDilation));
405 args["Prims"] = OSD.FromReal(totalPrims); 405 args["SimFPS"] = OSD.FromString (String.Format ("{0:0.##}", simFps));
406 args["AtvPrm"] = OSD.FromReal(activePrims); 406 args["PhyFPS"] = OSD.FromString (String.Format ("{0:0.##}", physicsFps));
407 args["AtvScr"] = OSD.FromReal(activeScripts); 407 args["AgntUp"] = OSD.FromString (String.Format ("{0:0.##}", agentUpdates));
408 args["ScrLPS"] = OSD.FromReal(scriptLinesPerSecond); 408 args["RootAg"] = OSD.FromString (String.Format ("{0:0.##}", rootAgents));
409 args["PktsIn"] = OSD.FromReal(inPacketsPerSecond); 409 args["ChldAg"] = OSD.FromString (String.Format ("{0:0.##}", childAgents));
410 args["PktOut"] = OSD.FromReal(outPacketsPerSecond); 410 args["Prims"] = OSD.FromString (String.Format ("{0:0.##}", totalPrims));
411 args["PendDl"] = OSD.FromReal(pendingDownloads); 411 args["AtvPrm"] = OSD.FromString (String.Format ("{0:0.##}", activePrims));
412 args["PendUl"] = OSD.FromReal(pendingUploads); 412 args["AtvScr"] = OSD.FromString (String.Format ("{0:0.##}", activeScripts));
413 args["UnackB"] = OSD.FromReal(unackedBytes); 413 args["ScrLPS"] = OSD.FromString (String.Format ("{0:0.##}", scriptLinesPerSecond));
414 args["TotlFt"] = OSD.FromReal(totalFrameTime); 414 args["PktsIn"] = OSD.FromString (String.Format ("{0:0.##}", inPacketsPerSecond));
415 args["NetFt"] = OSD.FromReal(netFrameTime); 415 args["PktOut"] = OSD.FromString (String.Format ("{0:0.##}", outPacketsPerSecond));
416 args["PhysFt"] = OSD.FromReal(physicsFrameTime); 416 args["PendDl"] = OSD.FromString (String.Format ("{0:0.##}", pendingDownloads));
417 args["OthrFt"] = OSD.FromReal(otherFrameTime); 417 args["PendUl"] = OSD.FromString (String.Format ("{0:0.##}", pendingUploads));
418 args["AgntFt"] = OSD.FromReal(agentFrameTime); 418 args["UnackB"] = OSD.FromString (String.Format ("{0:0.##}", unackedBytes));
419 args["ImgsFt"] = OSD.FromReal(imageFrameTime); 419 args["TotlFt"] = OSD.FromString (String.Format ("{0:0.##}", totalFrameTime));
420 args["Memory"] = OSD.FromString(base.XReport(uptime, version)); 420 args["NetFt"] = OSD.FromString (String.Format ("{0:0.##}", netFrameTime));
421 args["Uptime"] = OSD.FromString(uptime); 421 args["PhysFt"] = OSD.FromString (String.Format ("{0:0.##}", physicsFrameTime));
422 args["Version"] = OSD.FromString(version); 422 args["OthrFt"] = OSD.FromString (String.Format ("{0:0.##}", otherFrameTime));
423 args["AgntFt"] = OSD.FromString (String.Format ("{0:0.##}", agentFrameTime));
424 args["ImgsFt"] = OSD.FromString (String.Format ("{0:0.##}", imageFrameTime));
425 args["Memory"] = OSD.FromString (base.XReport (uptime, version));
426 args["Uptime"] = OSD.FromString (uptime);
427 args["Version"] = OSD.FromString (version);
423 428
424 string strBuffer = ""; 429 string strBuffer = "";
425 strBuffer = OSDParser.SerializeJsonString(args); 430 strBuffer = OSDParser.SerializeJsonString(args);
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index c39fb6f..af5a0ce 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1171,6 +1171,16 @@ namespace OpenSim.Framework
1171 1171
1172 } 1172 }
1173 1173
1174 public static uint ConvertAccessLevelToMaturity(byte maturity)
1175 {
1176 if (maturity <= 13)
1177 return 0;
1178 else if (maturity <= 21)
1179 return 1;
1180 else
1181 return 2;
1182 }
1183
1174 /// <summary> 1184 /// <summary>
1175 /// Produces an OSDMap from its string representation on a stream 1185 /// Produces an OSDMap from its string representation on a stream
1176 /// </summary> 1186 /// </summary>
@@ -1486,4 +1496,4 @@ namespace OpenSim.Framework
1486 } 1496 }
1487 1497
1488 } 1498 }
1489} \ No newline at end of file 1499}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index d2d1e8f..af2dd85 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2675,7 +2675,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2675 2675
2676 // Bit 0: Mature, bit 7: on sale, other bits: no idea 2676 // Bit 0: Mature, bit 7: on sale, other bits: no idea
2677 reply.Data.Flags = (byte)( 2677 reply.Data.Flags = (byte)(
2678 ((land.Flags & (uint)ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + 2678 (info.AccessLevel > 13 ? (1 << 0) : 0) +
2679 ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); 2679 ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
2680 2680
2681 Vector3 pos = land.UserLocation; 2681 Vector3 pos = land.UserLocation;
@@ -2683,8 +2683,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2683 { 2683 {
2684 pos = (land.AABBMax + land.AABBMin) * 0.5f; 2684 pos = (land.AABBMax + land.AABBMin) * 0.5f;
2685 } 2685 }
2686 reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; 2686 reply.Data.GlobalX = info.RegionLocX + x;
2687 reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; 2687 reply.Data.GlobalY = info.RegionLocY + y;
2688 reply.Data.GlobalZ = pos.Z; 2688 reply.Data.GlobalZ = pos.Z;
2689 reply.Data.SimName = Utils.StringToBytes(info.RegionName); 2689 reply.Data.SimName = Utils.StringToBytes(info.RegionName);
2690 reply.Data.SnapshotID = land.SnapshotID; 2690 reply.Data.SnapshotID = land.SnapshotID;
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index e557d2c..c802490 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -293,8 +293,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
293 } 293 }
294 294
295 // Fire after attach, so we don't get messy perms dialogs 295 // Fire after attach, so we don't get messy perms dialogs
296 // 3 == AttachedRez 296 // 4 == AttachedRez
297 objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3); 297 objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4);
298 objatt.ResumeScripts(); 298 objatt.ResumeScripts();
299 299
300 // Do this last so that event listeners have access to all the effects of the attachment 300 // Do this last so that event listeners have access to all the effects of the attachment
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
index cbea54c..1603c07 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
169 } 169 }
170 catch 170 catch
171 { 171 {
172 m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp."); 172 //m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
173 } 173 }
174 174
175 // And make it look local again to fool the unix time util 175 // And make it look local again to fool the unix time util
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index d025f0c..e1ee0b1 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
132 { 132 {
133 UUID toAgentID = new UUID(im.toAgentID); 133 UUID toAgentID = new UUID(im.toAgentID);
134 134
135 m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString()); 135 //m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
136 136
137 // Try root avatar only first 137 // Try root avatar only first
138 foreach (Scene scene in m_Scenes) 138 foreach (Scene scene in m_Scenes)
@@ -140,12 +140,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
140 if (scene.Entities.ContainsKey(toAgentID) && 140 if (scene.Entities.ContainsKey(toAgentID) &&
141 scene.Entities[toAgentID] is ScenePresence) 141 scene.Entities[toAgentID] is ScenePresence)
142 { 142 {
143 m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName); 143 // m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName);
144 // Local message 144 // Local message
145 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 145 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
146 if (!user.IsChildAgent) 146 if (!user.IsChildAgent)
147 { 147 {
148 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); 148 // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
149 user.ControllingClient.SendInstantMessage(im); 149 user.ControllingClient.SendInstantMessage(im);
150 150
151 // Message sent 151 // Message sent
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
167 // Local message 167 // Local message
168 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 168 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
169 169
170 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); 170 // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
171 user.ControllingClient.SendInstantMessage(im); 171 user.ControllingClient.SendInstantMessage(im);
172 172
173 // Message sent 173 // Message sent
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 2d80382..3fb2c8c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -741,7 +741,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
741 public void TestMergeIarPath() 741 public void TestMergeIarPath()
742 { 742 {
743 TestHelper.InMethod(); 743 TestHelper.InMethod();
744 log4net.Config.XmlConfigurator.Configure(); 744// log4net.Config.XmlConfigurator.Configure();
745 745
746 Scene scene = SceneSetupHelpers.SetupScene("inventory"); 746 Scene scene = SceneSetupHelpers.SetupScene("inventory");
747 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); 747 UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
index bce160a..23251c9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs
@@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
121 121
122 #region ILandService 122 #region ILandService
123 123
124 public LandData GetLandData(ulong regionHandle, uint x, uint y) 124 public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
125 { 125 {
126 m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}", 126 m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}",
127 regionHandle, m_Scenes.Count); 127 regionHandle, m_Scenes.Count);
@@ -130,10 +130,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
130 if (s.RegionInfo.RegionHandle == regionHandle) 130 if (s.RegionInfo.RegionHandle == regionHandle)
131 { 131 {
132 m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from"); 132 m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from");
133 regionAccess = s.RegionInfo.AccessLevel;
133 return s.GetLandData(x, y); 134 return s.GetLandData(x, y);
134 } 135 }
135 } 136 }
136 m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle); 137 m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle);
138 regionAccess = 42;
137 return null; 139 return null;
138 } 140 }
139 141
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index b2e3f4f..023a44c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -233,6 +233,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
233 return m_GridService.GetFallbackRegions(scopeID, x, y); 233 return m_GridService.GetFallbackRegions(scopeID, x, y);
234 } 234 }
235 235
236 public List<GridRegion> GetHyperlinks(UUID scopeID)
237 {
238 return m_GridService.GetHyperlinks(scopeID);
239 }
240
236 public int GetRegionFlags(UUID scopeID, UUID regionID) 241 public int GetRegionFlags(UUID scopeID, UUID regionID)
237 { 242 {
238 return m_GridService.GetRegionFlags(scopeID, regionID); 243 return m_GridService.GetRegionFlags(scopeID, regionID);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
index 95d8737..2726ae8 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
@@ -136,6 +136,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
136 900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize); 136 900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize);
137 Assert.IsNotNull(results, "Retrieved GetRegionRange list is null"); 137 Assert.IsNotNull(results, "Retrieved GetRegionRange list is null");
138 Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected"); 138 Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
139
140 results = m_LocalConnector.GetHyperlinks(UUID.Zero);
141 Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
142 Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
143
139 } 144 }
140 } 145 }
141} 146}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
index cb87f6f..e15f624 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs
@@ -116,8 +116,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
116 116
117 #region ILandService 117 #region ILandService
118 118
119 public LandData GetLandData(ulong regionHandle, uint x, uint y) 119 public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
120 { 120 {
121 regionAccess = 2;
121 m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}", 122 m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}",
122 regionHandle, x, y); 123 regionHandle, x, y);
123 124
@@ -126,6 +127,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
126 if (s.RegionInfo.RegionHandle == regionHandle) 127 if (s.RegionInfo.RegionHandle == regionHandle)
127 { 128 {
128 LandData land = s.GetLandData(x, y); 129 LandData land = s.GetLandData(x, y);
130 regionAccess = s.RegionInfo.AccessLevel;
129 return land; 131 return land;
130 } 132 }
131 } 133 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
index b0ace39..2386060 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs
@@ -90,7 +90,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
90 if (!m_Enabled) 90 if (!m_Enabled)
91 return; 91 return;
92 92
93 m_GridService = scene.GridService;
94 m_LocalService.AddRegion(scene); 93 m_LocalService.AddRegion(scene);
95 scene.RegisterModuleInterface<ILandService>(this); 94 scene.RegisterModuleInterface<ILandService>(this);
96 } 95 }
@@ -103,18 +102,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
103 102
104 public void RegionLoaded(Scene scene) 103 public void RegionLoaded(Scene scene)
105 { 104 {
105 m_GridService = scene.GridService;
106 } 106 }
107 107
108 108
109 #region ILandService 109 #region ILandService
110 110
111 public override LandData GetLandData(ulong regionHandle, uint x, uint y) 111 public override LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
112 { 112 {
113 LandData land = m_LocalService.GetLandData(regionHandle, x, y); 113 LandData land = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess);
114 if (land != null) 114 if (land != null)
115 return land; 115 return land;
116 116
117 return base.GetLandData(regionHandle, x, y); 117 return base.GetLandData(regionHandle, x, y, out regionAccess);
118 118
119 } 119 }
120 #endregion ILandService 120 #endregion ILandService
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index cfee1b0..7e29a56 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -51,6 +51,7 @@ namespace OpenSim.Region.CoreModules.World.Land
51 public LandData LandData; 51 public LandData LandData;
52 public ulong RegionHandle; 52 public ulong RegionHandle;
53 public uint X, Y; 53 public uint X, Y;
54 public byte RegionAccess;
54 } 55 }
55 56
56 public class LandManagementModule : INonSharedRegionModule 57 public class LandManagementModule : INonSharedRegionModule
@@ -1484,13 +1485,15 @@ namespace OpenSim.Region.CoreModules.World.Land
1484 if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) 1485 if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle)
1485 { 1486 {
1486 extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; 1487 extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData;
1488 extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel;
1487 } 1489 }
1488 else 1490 else
1489 { 1491 {
1490 ILandService landService = m_scene.RequestModuleInterface<ILandService>(); 1492 ILandService landService = m_scene.RequestModuleInterface<ILandService>();
1491 extLandData.LandData = landService.GetLandData(extLandData.RegionHandle, 1493 extLandData.LandData = landService.GetLandData(extLandData.RegionHandle,
1492 extLandData.X, 1494 extLandData.X,
1493 extLandData.Y); 1495 extLandData.Y,
1496 out extLandData.RegionAccess);
1494 if (extLandData.LandData == null) 1497 if (extLandData.LandData == null)
1495 { 1498 {
1496 // we didn't find the region/land => don't cache 1499 // we didn't find the region/land => don't cache
@@ -1522,6 +1525,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1522 r.RegionName = info.RegionName; 1525 r.RegionName = info.RegionName;
1523 r.RegionLocX = (uint)info.RegionLocX; 1526 r.RegionLocX = (uint)info.RegionLocX;
1524 r.RegionLocY = (uint)info.RegionLocY; 1527 r.RegionLocY = (uint)info.RegionLocY;
1528 r.RegionSettings.Maturity = (int)Util.ConvertAccessLevelToMaturity(data.RegionAccess);
1525 remoteClient.SendParcelInfo(r, data.LandData, parcelID, data.X, data.Y); 1529 remoteClient.SendParcelInfo(r, data.LandData, parcelID, data.X, data.Y);
1526 } 1530 }
1527 else 1531 else
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index c0ec5df..5acc227 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1824,6 +1824,8 @@ namespace OpenSim.Region.Framework.Scenes
1824 /// <param name="originalPrim"></param> 1824 /// <param name="originalPrim"></param>
1825 /// <param name="offset"></param> 1825 /// <param name="offset"></param>
1826 /// <param name="flags"></param> 1826 /// <param name="flags"></param>
1827 /// <param name="AgentID"></param>
1828 /// <param name="GroupID"></param>
1827 protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) 1829 protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID)
1828 { 1830 {
1829 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); 1831 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
@@ -1838,7 +1840,10 @@ namespace OpenSim.Region.Framework.Scenes
1838 /// <param name="originalPrim"></param> 1840 /// <param name="originalPrim"></param>
1839 /// <param name="offset"></param> 1841 /// <param name="offset"></param>
1840 /// <param name="flags"></param> 1842 /// <param name="flags"></param>
1841 protected internal SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) 1843 /// <param name="AgentID"></param>
1844 /// <param name="GroupID"></param>
1845 /// <param name="rot"></param>
1846 public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
1842 { 1847 {
1843 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); 1848 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID);
1844 SceneObjectGroup original = GetGroupByPrim(originalPrimID); 1849 SceneObjectGroup original = GetGroupByPrim(originalPrimID);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index d544619..b0ce450 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1184,6 +1184,10 @@ namespace OpenSim.Region.Framework.Scenes
1184 set { _nextOwnerMask = value; } 1184 set { _nextOwnerMask = value; }
1185 } 1185 }
1186 1186
1187 /// <summary>
1188 /// Property flags. See OpenMetaverse.PrimFlags
1189 /// </summary>
1190 /// Example properties are PrimFlags.Phantom and PrimFlags.DieAtEdge
1187 public PrimFlags Flags 1191 public PrimFlags Flags
1188 { 1192 {
1189 get { return _flags; } 1193 get { return _flags; }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
index 42587c1..8a103d7 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -26,61 +26,46 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Reflection;
29using NUnit.Framework; 30using NUnit.Framework;
31using NUnit.Framework.SyntaxHelpers;
30using OpenMetaverse; 32using OpenMetaverse;
31using OpenSim.Framework; 33using OpenSim.Framework;
32using GridRegion = OpenSim.Services.Interfaces.GridRegion; 34using OpenSim.Framework.Communications;
35using OpenSim.Region.Framework.Scenes;
36using OpenSim.Tests.Common;
37using OpenSim.Tests.Common.Mock;
38using OpenSim.Tests.Common.Setup;
33 39
34namespace OpenSim.Region.Framework.Scenes.Tests 40namespace OpenSim.Region.Framework.Scenes.Tests
35{ 41{
36 /// <summary>
37 /// Scene presence tests
38 /// </summary>
39 [TestFixture] 42 [TestFixture]
40 public class SceneBaseTests 43 public class SceneGraphTests
41 { 44 {
42 private class SceneBaseImpl : SceneBase 45 [Test]
46 public void TestDuplicateObject()
43 { 47 {
44 public override void Update() 48 TestHelper.InMethod();
45 { 49 Scene scene = SceneSetupHelpers.SetupScene();
46 throw new NotImplementedException();
47 }
48
49 public override void LoadWorldMap()
50 {
51 throw new NotImplementedException();
52 }
53
54 public override void AddNewClient(IClientAPI client)
55 {
56 throw new NotImplementedException();
57 }
58
59 public override void RemoveClient(UUID agentID)
60 {
61 throw new NotImplementedException();
62 }
63 50
64 public override void OtherRegionUp(GridRegion otherRegion) 51 UUID ownerUuid = new UUID("00000000-0000-0000-0000-000000000010");
65 { 52 string objName = "obj1";
66 throw new NotImplementedException(); 53 UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001");
67 }
68 54
69 public override bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence) 55 SceneObjectPart part
70 { 56 = new SceneObjectPart(ownerUuid, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
71 throw new NotImplementedException(); 57 { Name = objName, UUID = objUuid };
72 }
73 58
74 public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep) 59 scene.AddNewSceneObject(new SceneObjectGroup(part), false);
75 { 60
76 throw new NotImplementedException(); 61 SceneObjectGroup duplicatedSo
77 } 62 = scene.SceneGraph.DuplicateObject(
78 } 63 part.LocalId, new Vector3(10, 0, 0), 0, ownerUuid, UUID.Zero, Quaternion.Identity);
79 64
80 [Test] 65 Assert.That(duplicatedSo.Children.Count, Is.EqualTo(1));
81 public void TestConstructor() 66 Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part.LocalId));
82 { 67
83 new SceneBaseImpl(); 68 //SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid);
84 } 69 }
85 } 70 }
86} 71} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 4baa22c..d4f9f18 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -32,7 +32,6 @@ using NUnit.Framework.SyntaxHelpers;
32using OpenMetaverse; 32using OpenMetaverse;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Communications; 34using OpenSim.Framework.Communications;
35
36using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
37using OpenSim.Tests.Common; 36using OpenSim.Tests.Common;
38using OpenSim.Tests.Common.Mock; 37using OpenSim.Tests.Common.Mock;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
deleted file mode 100644
index 8b2d387..0000000
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs
+++ /dev/null
@@ -1,147 +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.Collections.Generic;
30using NUnit.Framework;
31using OpenMetaverse;
32using OpenSim.Framework;
33using OpenSim.Region.Framework.Interfaces;
34
35namespace OpenSim.Region.Framework.Scenes.Tests
36{
37 /// <summary>
38 /// Scene presence tests
39 /// </summary>
40 [TestFixture]
41 public class SceneTests
42 {
43 private class FakeStorageManager : StorageManager
44 {
45 private class FakeRegionDataStore : IRegionDataStore
46 {
47 public void Initialise(string filename)
48 {
49 }
50
51 public void Dispose()
52 {
53 }
54
55 public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
56 {
57 throw new NotImplementedException();
58 }
59
60 public void RemoveObject(UUID uuid, UUID regionUUID)
61 {
62 throw new NotImplementedException();
63 }
64
65 public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
66 {
67 throw new NotImplementedException();
68 }
69
70 public List<SceneObjectGroup> LoadObjects(UUID regionUUID)
71 {
72 throw new NotImplementedException();
73 }
74
75 public void StoreTerrain(double[,] terrain, UUID regionID)
76 {
77 throw new NotImplementedException();
78 }
79
80 public double[,] LoadTerrain(UUID regionID)
81 {
82 throw new NotImplementedException();
83 }
84
85 public void StoreLandObject(ILandObject Parcel)
86 {
87 throw new NotImplementedException();
88 }
89
90 public void RemoveLandObject(UUID globalID)
91 {
92 throw new NotImplementedException();
93 }
94
95 public List<LandData> LoadLandObjects(UUID regionUUID)
96 {
97 throw new NotImplementedException();
98 }
99
100 public void StoreRegionSettings(RegionSettings rs)
101 {
102 throw new NotImplementedException();
103 }
104 public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
105 {
106 //This connector doesn't support the windlight module yet
107 //Return default LL windlight settings
108 return new RegionLightShareData();
109 }
110 public void StoreRegionWindlightSettings(RegionLightShareData wl)
111 {
112 //This connector doesn't support the windlight module yet
113 }
114 public RegionSettings LoadRegionSettings(UUID regionUUID)
115 {
116 return null;
117 }
118
119 public void Shutdown()
120 {
121 throw new NotImplementedException();
122 }
123 }
124
125 public FakeStorageManager() : base(new FakeRegionDataStore())
126 {
127 }
128
129 public FakeStorageManager(IRegionDataStore storage) : this()
130 {
131 }
132
133 public FakeStorageManager(string dllName, string connectionstring, string estateconnectionstring) : this()
134 {
135 }
136 }
137
138 [Test]
139 public void TestConstructor()
140 {
141 RegionInfo regionInfo = new RegionInfo(0,0,null,null);
142 FakeStorageManager storageManager = new FakeStorageManager();
143
144 new Scene(regionInfo, null, null, storageManager, null, false, false, false, null, null);
145 }
146 }
147}
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index c90dd6f..913c6c9 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -109,6 +109,9 @@ namespace OpenSim.Server.Handlers.Grid
109 case "get_fallback_regions": 109 case "get_fallback_regions":
110 return GetFallbackRegions(request); 110 return GetFallbackRegions(request);
111 111
112 case "get_hyperlinks":
113 return GetHyperlinks(request);
114
112 case "get_region_flags": 115 case "get_region_flags":
113 return GetRegionFlags(request); 116 return GetRegionFlags(request);
114 } 117 }
@@ -483,6 +486,36 @@ namespace OpenSim.Server.Handlers.Grid
483 return encoding.GetBytes(xmlString); 486 return encoding.GetBytes(xmlString);
484 } 487 }
485 488
489 byte[] GetHyperlinks(Dictionary<string, object> request)
490 {
491 //m_log.DebugFormat("[GRID HANDLER]: GetHyperlinks");
492 UUID scopeID = UUID.Zero;
493 if (request.ContainsKey("SCOPEID"))
494 UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
495 else
496 m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get linked regions");
497
498 List<GridRegion> rinfos = m_GridService.GetHyperlinks(scopeID);
499
500 Dictionary<string, object> result = new Dictionary<string, object>();
501 if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
502 result["result"] = "null";
503 else
504 {
505 int i = 0;
506 foreach (GridRegion rinfo in rinfos)
507 {
508 Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
509 result["region" + i] = rinfoDict;
510 i++;
511 }
512 }
513 string xmlString = ServerUtils.BuildXmlResponse(result);
514 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
515 UTF8Encoding encoding = new UTF8Encoding();
516 return encoding.GetBytes(xmlString);
517 }
518
486 byte[] GetRegionFlags(Dictionary<string, object> request) 519 byte[] GetRegionFlags(Dictionary<string, object> request)
487 { 520 {
488 UUID scopeID = UUID.Zero; 521 UUID scopeID = UUID.Zero;
diff --git a/OpenSim/Server/Handlers/Land/LandHandlers.cs b/OpenSim/Server/Handlers/Land/LandHandlers.cs
index a21f9de..561f285 100644
--- a/OpenSim/Server/Handlers/Land/LandHandlers.cs
+++ b/OpenSim/Server/Handlers/Land/LandHandlers.cs
@@ -66,7 +66,8 @@ namespace OpenSim.Server.Handlers.Land
66 uint y = Convert.ToUInt32(requestData["y"]); 66 uint y = Convert.ToUInt32(requestData["y"]);
67 m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle); 67 m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle);
68 68
69 LandData landData = m_LocalService.GetLandData(regionHandle, x, y); 69 byte regionAccess;
70 LandData landData = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess);
70 Hashtable hash = new Hashtable(); 71 Hashtable hash = new Hashtable();
71 if (landData != null) 72 if (landData != null)
72 { 73 {
@@ -83,6 +84,7 @@ namespace OpenSim.Server.Handlers.Land
83 hash["SalePrice"] = landData.SalePrice.ToString(); 84 hash["SalePrice"] = landData.SalePrice.ToString();
84 hash["SnapshotID"] = landData.SnapshotID.ToString(); 85 hash["SnapshotID"] = landData.SnapshotID.ToString();
85 hash["UserLocation"] = landData.UserLocation.ToString(); 86 hash["UserLocation"] = landData.UserLocation.ToString();
87 hash["RegionAccess"] = regionAccess.ToString();
86 } 88 }
87 89
88 XmlRpcResponse response = new XmlRpcResponse(); 90 XmlRpcResponse response = new XmlRpcResponse();
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
index 1831533..80f0d2d 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -556,6 +556,56 @@ namespace OpenSim.Services.Connectors
556 return rinfos; 556 return rinfos;
557 } 557 }
558 558
559 public List<GridRegion> GetHyperlinks(UUID scopeID)
560 {
561 Dictionary<string, object> sendData = new Dictionary<string, object>();
562
563 sendData["SCOPEID"] = scopeID.ToString();
564
565 sendData["METHOD"] = "get_hyperlinks";
566
567 List<GridRegion> rinfos = new List<GridRegion>();
568 string reply = string.Empty;
569 try
570 {
571 reply = SynchronousRestFormsRequester.MakeRequest("POST",
572 m_ServerURI + "/grid",
573 ServerUtils.BuildQueryString(sendData));
574
575 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
576 }
577 catch (Exception e)
578 {
579 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
580 return rinfos;
581 }
582
583 if (reply != string.Empty)
584 {
585 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
586
587 if (replyData != null)
588 {
589 Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
590 foreach (object r in rinfosList)
591 {
592 if (r is Dictionary<string, object>)
593 {
594 GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
595 rinfos.Add(rinfo);
596 }
597 }
598 }
599 else
600 m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response",
601 scopeID);
602 }
603 else
604 m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply");
605
606 return rinfos;
607 }
608
559 public virtual int GetRegionFlags(UUID scopeID, UUID regionID) 609 public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
560 { 610 {
561 Dictionary<string, object> sendData = new Dictionary<string, object>(); 611 Dictionary<string, object> sendData = new Dictionary<string, object>();
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
index 0223a77..c439dc5 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Services.Connectors
64 m_GridService = gridServices; 64 m_GridService = gridServices;
65 } 65 }
66 66
67 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y) 67 public virtual LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
68 { 68 {
69 LandData landData = null; 69 LandData landData = null;
70 Hashtable hash = new Hashtable(); 70 Hashtable hash = new Hashtable();
@@ -74,6 +74,7 @@ namespace OpenSim.Services.Connectors
74 74
75 IList paramList = new ArrayList(); 75 IList paramList = new ArrayList();
76 paramList.Add(hash); 76 paramList.Add(hash);
77 regionAccess = 42; // Default to adult. Better safe...
77 78
78 try 79 try
79 { 80 {
@@ -109,6 +110,8 @@ namespace OpenSim.Services.Connectors
109 landData.SalePrice = Convert.ToInt32(hash["SalePrice"]); 110 landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
110 landData.SnapshotID = new UUID((string)hash["SnapshotID"]); 111 landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
111 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]); 112 landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
113 if (hash["RegionAccess"] != null)
114 regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]);
112 m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name); 115 m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name);
113 } 116 }
114 catch (Exception e) 117 catch (Exception e)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 496eb2c..1ddcc75 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -359,6 +359,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
359 return new List<GridRegion>(0); 359 return new List<GridRegion>(0);
360 } 360 }
361 361
362 public List<GridRegion> GetHyperlinks(UUID scopeID)
363 {
364 // Hypergrid/linked regions are not supported
365 return new List<GridRegion>();
366 }
367
362 public int GetRegionFlags(UUID scopeID, UUID regionID) 368 public int GetRegionFlags(UUID scopeID, UUID regionID)
363 { 369 {
364 const int REGION_ONLINE = 4; 370 const int REGION_ONLINE = 4;
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index ebaed42..ce6f64b 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -426,6 +426,22 @@ namespace OpenSim.Services.GridService
426 return ret; 426 return ret;
427 } 427 }
428 428
429 public List<GridRegion> GetHyperlinks(UUID scopeID)
430 {
431 List<GridRegion> ret = new List<GridRegion>();
432
433 List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
434
435 foreach (RegionData r in regions)
436 {
437 if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
438 ret.Add(RegionData2RegionInfo(r));
439 }
440
441 m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
442 return ret;
443 }
444
429 public int GetRegionFlags(UUID scopeID, UUID regionID) 445 public int GetRegionFlags(UUID scopeID, UUID regionID)
430 { 446 {
431 RegionData region = m_Database.Get(regionID, scopeID); 447 RegionData region = m_Database.Get(regionID, scopeID);
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 1f53007..b190f93 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -62,6 +62,7 @@ namespace OpenSim.Services.GridService
62 protected GatekeeperServiceConnector m_GatekeeperConnector; 62 protected GatekeeperServiceConnector m_GatekeeperConnector;
63 63
64 protected UUID m_ScopeID = UUID.Zero; 64 protected UUID m_ScopeID = UUID.Zero;
65 protected bool m_Check4096 = true;
65 66
66 // Hyperlink regions are hyperlinks on the map 67 // Hyperlink regions are hyperlinks on the map
67 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>(); 68 public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@@ -116,6 +117,8 @@ namespace OpenSim.Services.GridService
116 if (scope != string.Empty) 117 if (scope != string.Empty)
117 UUID.TryParse(scope, out m_ScopeID); 118 UUID.TryParse(scope, out m_ScopeID);
118 119
120 m_Check4096 = gridConfig.GetBoolean("Check4096", true);
121
119 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); 122 m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
120 123
121 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); 124 m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
@@ -277,7 +280,7 @@ namespace OpenSim.Services.GridService
277 } 280 }
278 281
279 uint x, y; 282 uint x, y;
280 if (!Check4096(handle, out x, out y)) 283 if (m_Check4096 && !Check4096(handle, out x, out y))
281 { 284 {
282 RemoveHyperlinkRegion(regInfo.RegionID); 285 RemoveHyperlinkRegion(regInfo.RegionID);
283 reason = "Region is too far (" + x + ", " + y + ")"; 286 reason = "Region is too far (" + x + ", " + y + ")";
@@ -332,18 +335,50 @@ namespace OpenSim.Services.GridService
332 /// <returns></returns> 335 /// <returns></returns>
333 public bool Check4096(ulong realHandle, out uint x, out uint y) 336 public bool Check4096(ulong realHandle, out uint x, out uint y)
334 { 337 {
335 GridRegion defRegion = DefaultRegion;
336
337 uint ux = 0, uy = 0; 338 uint ux = 0, uy = 0;
338 Utils.LongToUInts(realHandle, out ux, out uy); 339 Utils.LongToUInts(realHandle, out ux, out uy);
339 x = ux / Constants.RegionSize; 340 x = ux / Constants.RegionSize;
340 y = uy / Constants.RegionSize; 341 y = uy / Constants.RegionSize;
341 342
342 if ((Math.Abs((int)defRegion.RegionLocX - ux) >= 4096 * Constants.RegionSize) || 343 const uint limit = (4096 - 1) * Constants.RegionSize;
343 (Math.Abs((int)defRegion.RegionLocY - uy) >= 4096 * Constants.RegionSize)) 344 uint xmin = ux - limit;
345 uint xmax = ux + limit;
346 uint ymin = uy - limit;
347 uint ymax = uy + limit;
348 // World map boundary checks
349 if (xmin < 0 || xmin > ux)
350 xmin = 0;
351 if (xmax > int.MaxValue || xmax < ux)
352 xmax = int.MaxValue;
353 if (ymin < 0 || ymin > uy)
354 ymin = 0;
355 if (ymax > int.MaxValue || ymax < uy)
356 ymax = int.MaxValue;
357
358 // Check for any regions that are within the possible teleport range to the linked region
359 List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
360 if (regions.Count == 0)
344 { 361 {
345 return false; 362 return false;
346 } 363 }
364 else
365 {
366 // Check for regions which are not linked regions
367 List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
368 // would like to use .Except, but doesn't seem to exist
369 //IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
370 List<GridRegion> availableRegions = regions.FindAll(delegate(GridRegion region)
371 {
372 // Ewww! n^2
373 if (hyperlinks.Find(delegate(GridRegion r) { return r.RegionID == region.RegionID; }) == null) // not hyperlink. good.
374 return true;
375
376 return false;
377 });
378 if (availableRegions.Count == 0)
379 return false;
380 }
381
347 return true; 382 return true;
348 } 383 }
349 384
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 94cee57..ac234dc 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -92,6 +92,7 @@ namespace OpenSim.Services.Interfaces
92 92
93 List<GridRegion> GetDefaultRegions(UUID scopeID); 93 List<GridRegion> GetDefaultRegions(UUID scopeID);
94 List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y); 94 List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y);
95 List<GridRegion> GetHyperlinks(UUID scopeID);
95 96
96 int GetRegionFlags(UUID scopeID, UUID regionID); 97 int GetRegionFlags(UUID scopeID, UUID regionID);
97 } 98 }
diff --git a/OpenSim/Services/Interfaces/ILandService.cs b/OpenSim/Services/Interfaces/ILandService.cs
index e2f1d1d..7a12aff 100644
--- a/OpenSim/Services/Interfaces/ILandService.cs
+++ b/OpenSim/Services/Interfaces/ILandService.cs
@@ -33,6 +33,6 @@ namespace OpenSim.Services.Interfaces
33{ 33{
34 public interface ILandService 34 public interface ILandService
35 { 35 {
36 LandData GetLandData(ulong regionHandle, uint x, uint y); 36 LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess);
37 } 37 }
38} 38}