diff options
author | Melanie Thielker | 2010-08-07 05:45:52 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-08-07 05:45:52 +0200 |
commit | c554de75010a442753cce29ee06d2b60d7b4701a (patch) | |
tree | 10714d66217de4a3fd77373407586bf041f1869c | |
parent | Change the (hackish) constant to match the changed enum for attachs (diff) | |
download | opensim-SC-c554de75010a442753cce29ee06d2b60d7b4701a.zip opensim-SC-c554de75010a442753cce29ee06d2b60d7b4701a.tar.gz opensim-SC-c554de75010a442753cce29ee06d2b60d7b4701a.tar.bz2 opensim-SC-c554de75010a442753cce29ee06d2b60d7b4701a.tar.xz |
Correct display of landmark about info. Also correct region maturity rating
in LM info. Maturity is NOT the parcel's setting, that is only for the
image and text. Parcel maturity is governed by region maturity.
9 files changed, 36 insertions, 13 deletions
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/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/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 153c2a5..2386060 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs | |||
@@ -108,13 +108,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | |||
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/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/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/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 | } |