diff options
author | Charles Krinke | 2008-08-16 19:20:14 +0000 |
---|---|---|
committer | Charles Krinke | 2008-08-16 19:20:14 +0000 |
commit | d9cc908471922a1239bb8a757e07084072852982 (patch) | |
tree | 3390870e039a51194efa9c2e1e20142c9266dddd /OpenSim | |
parent | * Fix a rare maptile shading error, terrain difference mod 1 = 0 + abs = oops. (diff) | |
download | opensim-SC_OLD-d9cc908471922a1239bb8a757e07084072852982.zip opensim-SC_OLD-d9cc908471922a1239bb8a757e07084072852982.tar.gz opensim-SC_OLD-d9cc908471922a1239bb8a757e07084072852982.tar.bz2 opensim-SC_OLD-d9cc908471922a1239bb8a757e07084072852982.tar.xz |
Mantis#1965. Thank you kindly, HomerHorwitz for a patch that:
Places touched:
- Added two events for in-packets to LLCLientView: RegionHandleRequest and
ParcelInfoRequest
- Added sending of two out-packets to LLCLientView: RegionIDAndHandleReply and
ParcelInfoReply.
- Scene handles the RegionHandleRequest, LandManagementModule the
ParcelInfoRequest
- Added inter-region request for LandData by RegionHandle and local position.
This was implemented as XML-RPC request. The returned LandData isn't
complete, it only contains the data necessary for answering the
ParcelInfoRequest
- Added new CAPS (0009) for RemoteParcelRequest and some methods for LandData
handling to LandManagementModule
- Added methods for fake parcelID creation and parsing to Util
- Fixed missing implementation of interface methods.
- Added new file:
OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs
NOTE: This is part of the patch, too.
Due to the many places touched, I would consider this patch as experimental.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/Caps.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs | 42 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/IGridServices.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 9 | ||||
-rw-r--r-- | OpenSim/Framework/IRegionCommsListener.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/RegionCommsListener.cs | 15 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 65 | ||||
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalBackEndServices.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 101 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | 120 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 11 |
15 files changed, 448 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 7350d4d..1aa8eb0 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -86,11 +86,13 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
86 | private static readonly string m_notecardTaskUpdatePath = "0005/"; | 86 | private static readonly string m_notecardTaskUpdatePath = "0005/"; |
87 | // private static readonly string m_fetchInventoryPath = "0006/"; | 87 | // private static readonly string m_fetchInventoryPath = "0006/"; |
88 | 88 | ||
89 | // The following two entries are in a module, however, there also here so that we don't re-assign | 89 | // The following entries are in a module, however, they are also here so that we don't re-assign |
90 | // the path to another cap by mistake. | 90 | // the path to another cap by mistake. |
91 | // private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module. | 91 | // private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module. |
92 | // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. | 92 | // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. |
93 | 93 | ||
94 | // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. | ||
95 | |||
94 | //private string eventQueue = "0100/"; | 96 | //private string eventQueue = "0100/"; |
95 | private BaseHttpServer m_httpListener; | 97 | private BaseHttpServer m_httpListener; |
96 | private LLUUID m_agentID; | 98 | private LLUUID m_agentID; |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs new file mode 100644 index 0000000..27adea0 --- /dev/null +++ b/OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs | |||
@@ -0,0 +1,42 @@ | |||
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 OpenSim 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 | |||
29 | using libsecondlife; | ||
30 | |||
31 | namespace OpenSim.Framework.Communications.Capabilities | ||
32 | { | ||
33 | [LLSDType("MAP")] | ||
34 | public class LLSDRemoteParcelResponse | ||
35 | { | ||
36 | public LLUUID parcel_id; | ||
37 | |||
38 | public LLSDRemoteParcelResponse() | ||
39 | { | ||
40 | } | ||
41 | } | ||
42 | } | ||
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs index 3ecda68..509f408 100644 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ b/OpenSim/Framework/Communications/IGridServices.cs | |||
@@ -57,5 +57,7 @@ namespace OpenSim.Framework.Communications | |||
57 | RegionInfo RequestClosestRegion(string regionName); | 57 | RegionInfo RequestClosestRegion(string regionName); |
58 | Dictionary<string, string> GetGridSettings(); | 58 | Dictionary<string, string> GetGridSettings(); |
59 | List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); | 59 | List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); |
60 | // not complete yet, only contains the fields needed for ParcelInfoReqeust | ||
61 | LandData RequestLandData(ulong regionHandle, uint x, uint y); | ||
60 | } | 62 | } |
61 | } | 63 | } |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 36842cc..536050c 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -293,6 +293,9 @@ namespace OpenSim.Framework | |||
293 | public delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message); | 293 | public delegate void EstateBlueBoxMessageRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID sessionID, string senderName, string message); |
294 | public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics); | 294 | public delegate void EstateDebugRegionRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, bool scripted, bool collisionEvents, bool physics); |
295 | public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); | 295 | public delegate void EstateTeleportOneUserHomeRequest(IClientAPI remoteClient, LLUUID invoice, LLUUID senderID, LLUUID prey); |
296 | public delegate void RegionHandleRequest(IClientAPI remoteClient, LLUUID regionID); | ||
297 | public delegate void ParcelInfoRequest(IClientAPI remoteClient, LLUUID parcelID); | ||
298 | |||
296 | public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); | 299 | public delegate void ScriptReset(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); |
297 | public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); | 300 | public delegate void GetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID); |
298 | public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running); | 301 | public delegate void SetScriptRunning(IClientAPI remoteClient, LLUUID objectID, LLUUID itemID, bool running); |
@@ -498,6 +501,9 @@ namespace OpenSim.Framework | |||
498 | event EstateDebugRegionRequest OnEstateDebugRegionRequest; | 501 | event EstateDebugRegionRequest OnEstateDebugRegionRequest; |
499 | event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; | 502 | event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; |
500 | event UUIDNameRequest OnUUIDGroupNameRequest; | 503 | event UUIDNameRequest OnUUIDGroupNameRequest; |
504 | |||
505 | event RegionHandleRequest OnRegionHandleRequest; | ||
506 | event ParcelInfoRequest OnParcelInfoRequest; | ||
501 | 507 | ||
502 | event RequestObjectPropertiesFamily OnObjectGroupRequest; | 508 | event RequestObjectPropertiesFamily OnObjectGroupRequest; |
503 | event ScriptReset OnScriptReset; | 509 | event ScriptReset OnScriptReset; |
@@ -721,5 +727,8 @@ namespace OpenSim.Framework | |||
721 | 727 | ||
722 | void SendSetFollowCamProperties(LLUUID objectID, SortedDictionary<int, float> parameters); | 728 | void SendSetFollowCamProperties(LLUUID objectID, SortedDictionary<int, float> parameters); |
723 | void SendClearFollowCamProperties(LLUUID objectID); | 729 | void SendClearFollowCamProperties(LLUUID objectID); |
730 | |||
731 | void SendRegionHandle(LLUUID regoinID, ulong handle); | ||
732 | void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y); | ||
724 | } | 733 | } |
725 | } | 734 | } |
diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs index ce84a40..1758508 100644 --- a/OpenSim/Framework/IRegionCommsListener.cs +++ b/OpenSim/Framework/IRegionCommsListener.cs | |||
@@ -52,6 +52,8 @@ namespace OpenSim.Framework | |||
52 | 52 | ||
53 | public delegate void LogOffUser(ulong regionHandle, LLUUID agentID, LLUUID regionSecret, string message); | 53 | public delegate void LogOffUser(ulong regionHandle, LLUUID agentID, LLUUID regionSecret, string message); |
54 | 54 | ||
55 | public delegate LandData GetLandData(uint x, uint y); | ||
56 | |||
55 | public interface IRegionCommsListener | 57 | public interface IRegionCommsListener |
56 | { | 58 | { |
57 | event ExpectUserDelegate OnExpectUser; | 59 | event ExpectUserDelegate OnExpectUser; |
@@ -66,5 +68,6 @@ namespace OpenSim.Framework | |||
66 | event RegionUp OnRegionUp; | 68 | event RegionUp OnRegionUp; |
67 | event ChildAgentUpdate OnChildAgentUpdate; | 69 | event ChildAgentUpdate OnChildAgentUpdate; |
68 | event LogOffUser OnLogOffUser; | 70 | event LogOffUser OnLogOffUser; |
71 | event GetLandData OnGetLandData; | ||
69 | } | 72 | } |
70 | } \ No newline at end of file | 73 | } |
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 4045b44..0b50a81 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs | |||
@@ -46,7 +46,8 @@ namespace OpenSim.Framework | |||
46 | private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; | 46 | private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; |
47 | private RegionUp handlerRegionUp = null; // OnRegionUp; | 47 | private RegionUp handlerRegionUp = null; // OnRegionUp; |
48 | private LogOffUser handlerLogOffUser = null; | 48 | private LogOffUser handlerLogOffUser = null; |
49 | 49 | private GetLandData handlerGetLandData = null; | |
50 | |||
50 | #region IRegionCommsListener Members | 51 | #region IRegionCommsListener Members |
51 | 52 | ||
52 | public event ExpectUserDelegate OnExpectUser; | 53 | public event ExpectUserDelegate OnExpectUser; |
@@ -61,6 +62,7 @@ namespace OpenSim.Framework | |||
61 | public event RegionUp OnRegionUp; | 62 | public event RegionUp OnRegionUp; |
62 | public event ChildAgentUpdate OnChildAgentUpdate; | 63 | public event ChildAgentUpdate OnChildAgentUpdate; |
63 | public event LogOffUser OnLogOffUser; | 64 | public event LogOffUser OnLogOffUser; |
65 | public event GetLandData OnGetLandData; | ||
64 | 66 | ||
65 | #endregion | 67 | #endregion |
66 | 68 | ||
@@ -226,5 +228,14 @@ namespace OpenSim.Framework | |||
226 | 228 | ||
227 | return false; | 229 | return false; |
228 | } | 230 | } |
231 | |||
232 | public LandData TriggerGetLandData(uint x, uint y) | ||
233 | { | ||
234 | handlerGetLandData = OnGetLandData; | ||
235 | if (handlerGetLandData != null) | ||
236 | return handlerGetLandData(x, y); | ||
237 | |||
238 | return null; | ||
239 | } | ||
229 | } | 240 | } |
230 | } \ No newline at end of file | 241 | } |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index d72e03e..bc35fa6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -716,5 +716,24 @@ namespace OpenSim.Framework | |||
716 | XmlRpcRequest client = new XmlRpcRequest(methodName, args); | 716 | XmlRpcRequest client = new XmlRpcRequest(methodName, args); |
717 | return client.Send(url, 6000); | 717 | return client.Send(url, 6000); |
718 | } | 718 | } |
719 | |||
720 | // used for RemoteParcelRequest (for "About Landmark") | ||
721 | public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { | ||
722 | byte[] bytes = { | ||
723 | (byte)(regionHandle >> 56), (byte)(regionHandle >> 48), (byte)(regionHandle >> 40), (byte)(regionHandle >> 32), | ||
724 | (byte)(regionHandle >> 24), (byte)(regionHandle >> 16), (byte)(regionHandle >> 8), (byte)regionHandle, | ||
725 | (byte)(x >> 24), (byte)(x >> 16), (byte)(x >> 8), (byte)x, | ||
726 | (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y }; | ||
727 | return new LLUUID(bytes, 0); | ||
728 | } | ||
729 | |||
730 | public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) { | ||
731 | byte[] bytes = parcelID.GetBytes(); | ||
732 | regionHandle = Helpers.BytesToUInt64(bytes); | ||
733 | x = Helpers.BytesToUInt(bytes, 8); | ||
734 | // grrr. I'd like to use that code in the next line, but libsl has an off-by-one bug here and returns 0. | ||
735 | //uint y = Helpers.BytesToUInt(bytes, 12); | ||
736 | y = (uint)((bytes[12] << 24) | (bytes[13] << 16) | (bytes[14] << 8) | bytes[15]); | ||
737 | } | ||
719 | } | 738 | } |
720 | } | 739 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 69c1dac..b616acb 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -229,6 +229,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
229 | // private RequestAsset handlerRequestAsset = null; // OnRequestAsset; | 229 | // private RequestAsset handlerRequestAsset = null; // OnRequestAsset; |
230 | private UUIDNameRequest handlerTeleportHomeRequest = null; | 230 | private UUIDNameRequest handlerTeleportHomeRequest = null; |
231 | 231 | ||
232 | private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest | ||
233 | private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest | ||
234 | |||
232 | private ScriptAnswer handlerScriptAnswer = null; | 235 | private ScriptAnswer handlerScriptAnswer = null; |
233 | private RequestPayPrice handlerRequestPayPrice = null; | 236 | private RequestPayPrice handlerRequestPayPrice = null; |
234 | private ObjectDeselect handlerObjectDetach = null; | 237 | private ObjectDeselect handlerObjectDetach = null; |
@@ -916,6 +919,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
916 | public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; | 919 | public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; |
917 | public event EstateDebugRegionRequest OnEstateDebugRegionRequest; | 920 | public event EstateDebugRegionRequest OnEstateDebugRegionRequest; |
918 | public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; | 921 | public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; |
922 | public event RegionHandleRequest OnRegionHandleRequest; | ||
923 | public event ParcelInfoRequest OnParcelInfoRequest; | ||
919 | public event ScriptReset OnScriptReset; | 924 | public event ScriptReset OnScriptReset; |
920 | public event GetScriptRunning OnGetScriptRunning; | 925 | public event GetScriptRunning OnGetScriptRunning; |
921 | public event SetScriptRunning OnSetScriptRunning; | 926 | public event SetScriptRunning OnSetScriptRunning; |
@@ -5296,6 +5301,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5296 | 5301 | ||
5297 | #region Parcel related packets | 5302 | #region Parcel related packets |
5298 | 5303 | ||
5304 | case PacketType.RegionHandleRequest: | ||
5305 | RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack; | ||
5306 | |||
5307 | handlerRegionHandleRequest = OnRegionHandleRequest; | ||
5308 | if (handlerRegionHandleRequest != null) | ||
5309 | { | ||
5310 | handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID); | ||
5311 | } | ||
5312 | break; | ||
5313 | |||
5314 | case PacketType.ParcelInfoRequest: | ||
5315 | ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack; | ||
5316 | |||
5317 | handlerParcelInfoRequest = OnParcelInfoRequest; | ||
5318 | if (handlerParcelInfoRequest != null) | ||
5319 | { | ||
5320 | handlerParcelInfoRequest(this, pirPack.Data.ParcelID); | ||
5321 | } | ||
5322 | break; | ||
5323 | |||
5299 | case PacketType.ParcelAccessListRequest: | 5324 | case PacketType.ParcelAccessListRequest: |
5300 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; | 5325 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; |
5301 | 5326 | ||
@@ -6294,5 +6319,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6294 | } | 6319 | } |
6295 | 6320 | ||
6296 | #endregion | 6321 | #endregion |
6322 | |||
6323 | public void SendRegionHandle(LLUUID regionID, ulong handle) { | ||
6324 | RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply); | ||
6325 | reply.ReplyBlock.RegionID = regionID; | ||
6326 | reply.ReplyBlock.RegionHandle = handle; | ||
6327 | OutPacket(reply, ThrottleOutPacketType.Land); | ||
6328 | } | ||
6329 | |||
6330 | public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) | ||
6331 | { | ||
6332 | ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); | ||
6333 | reply.AgentData.AgentID = m_agentId; | ||
6334 | reply.Data.ParcelID = parcelID; | ||
6335 | reply.Data.OwnerID = land.OwnerID; | ||
6336 | reply.Data.Name = Helpers.StringToField(land.Name); | ||
6337 | reply.Data.Desc = Helpers.StringToField(land.Description); | ||
6338 | reply.Data.ActualArea = land.Area; | ||
6339 | reply.Data.BillableArea = land.Area; // TODO: what is this? | ||
6340 | |||
6341 | // Bit 0: Mature, bit 7: on sale, other bits: no idea | ||
6342 | reply.Data.Flags = (byte)( | ||
6343 | ((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + | ||
6344 | ((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); | ||
6345 | |||
6346 | LLVector3 pos = land.UserLocation; | ||
6347 | if (pos.Equals(LLVector3.Zero)) | ||
6348 | { | ||
6349 | pos = (land.AABBMax + land.AABBMin) * 0.5f; | ||
6350 | } | ||
6351 | reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; | ||
6352 | reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; | ||
6353 | reply.Data.GlobalZ = pos.Z; | ||
6354 | reply.Data.SimName = Helpers.StringToField(info.RegionName); | ||
6355 | reply.Data.SnapshotID = land.SnapshotID; | ||
6356 | reply.Data.Dwell = 0; // TODO: not implemented yet | ||
6357 | reply.Data.SalePrice = land.SalePrice; | ||
6358 | reply.Data.AuctionID = (int)land.AuctionID; | ||
6359 | |||
6360 | OutPacket(reply, ThrottleOutPacketType.Land); | ||
6361 | } | ||
6297 | } | 6362 | } |
6298 | } | 6363 | } |
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 5cf62f3..8149bcc 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |||
@@ -491,5 +491,20 @@ namespace OpenSim.Region.Communications.Local | |||
491 | 491 | ||
492 | return false; | 492 | return false; |
493 | } | 493 | } |
494 | |||
495 | public LandData RequestLandData (ulong regionHandle, uint x, uint y) | ||
496 | { | ||
497 | m_log.DebugFormat("[INTERREGION STANDALONE] requests land data in {0}, at {1}, {2}", | ||
498 | regionHandle, x, y); | ||
499 | |||
500 | if (m_regionListeners.ContainsKey(regionHandle)) | ||
501 | { | ||
502 | LandData land = m_regionListeners[regionHandle].TriggerGetLandData(x, y); | ||
503 | return land; | ||
504 | } | ||
505 | |||
506 | m_log.Debug("[INTERREGION STANDALONE] didn't find land data locally."); | ||
507 | return null; | ||
508 | } | ||
494 | } | 509 | } |
495 | } | 510 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 65b8763..9a4c166 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | ||
31 | using System.Net; | 32 | using System.Net; |
32 | using System.Net.Sockets; | 33 | using System.Net.Sockets; |
33 | using System.Reflection; | 34 | using System.Reflection; |
@@ -92,6 +93,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
92 | httpServer.AddXmlRPCHandler("expect_user", ExpectUser); | 93 | httpServer.AddXmlRPCHandler("expect_user", ExpectUser); |
93 | httpServer.AddXmlRPCHandler("logoff_user", LogOffUser); | 94 | httpServer.AddXmlRPCHandler("logoff_user", LogOffUser); |
94 | httpServer.AddXmlRPCHandler("check", PingCheckReply); | 95 | httpServer.AddXmlRPCHandler("check", PingCheckReply); |
96 | httpServer.AddXmlRPCHandler("land_data", LandData); | ||
95 | 97 | ||
96 | StartRemoting(); | 98 | StartRemoting(); |
97 | } | 99 | } |
@@ -1624,5 +1626,104 @@ namespace OpenSim.Region.Communications.OGS1 | |||
1624 | } | 1626 | } |
1625 | } | 1627 | } |
1626 | } | 1628 | } |
1629 | |||
1630 | public LandData RequestLandData (ulong regionHandle, uint x, uint y) | ||
1631 | { | ||
1632 | m_log.DebugFormat("[OGS1 GRID SERVICES] requests land data in {0}, at {1}, {2}", | ||
1633 | regionHandle, x, y); | ||
1634 | LandData landData = m_localBackend.RequestLandData(regionHandle, x, y); | ||
1635 | if (landData == null) | ||
1636 | { | ||
1637 | Hashtable hash = new Hashtable(); | ||
1638 | hash["region_handle"] = regionHandle.ToString(); | ||
1639 | hash["x"] = x.ToString(); | ||
1640 | hash["y"] = y.ToString(); | ||
1641 | |||
1642 | IList paramList = new ArrayList(); | ||
1643 | paramList.Add(hash); | ||
1644 | |||
1645 | // this might be cached, as we probably requested it just a moment ago... | ||
1646 | RegionInfo info = RequestNeighbourInfo(regionHandle); | ||
1647 | |||
1648 | try | ||
1649 | { | ||
1650 | XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); | ||
1651 | string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; | ||
1652 | XmlRpcResponse response = request.Send(uri, 10000); | ||
1653 | if (response.IsFault) | ||
1654 | { | ||
1655 | m_log.ErrorFormat("[OGS1 GRID SERVICES] remote call returned an error: {0}", response.FaultString); | ||
1656 | } | ||
1657 | else | ||
1658 | { | ||
1659 | hash = (Hashtable)response.Value; | ||
1660 | try { | ||
1661 | landData = new LandData(); | ||
1662 | landData.AABBMax = LLVector3.Parse((string)hash["AABBMax"]); | ||
1663 | landData.AABBMin = LLVector3.Parse((string)hash["AABBMin"]); | ||
1664 | landData.Area = Convert.ToInt32(hash["Area"]); | ||
1665 | landData.AuctionID = Convert.ToUInt32(hash["AuctionID"]); | ||
1666 | landData.Description = (string)hash["Description"]; | ||
1667 | landData.Flags = Convert.ToUInt32(hash["Flags"]); | ||
1668 | landData.GlobalID = new LLUUID((string)hash["GlobalID"]); | ||
1669 | landData.Name = (string)hash["Name"]; | ||
1670 | landData.OwnerID = new LLUUID((string)hash["OwnerID"]); | ||
1671 | landData.SalePrice = Convert.ToInt32(hash["SalePrice"]); | ||
1672 | landData.SnapshotID = new LLUUID((string)hash["SnapshotID"]); | ||
1673 | landData.UserLocation = LLVector3.Parse((string)hash["UserLocation"]); | ||
1674 | m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name); | ||
1675 | } | ||
1676 | catch (Exception e) | ||
1677 | { | ||
1678 | m_log.Error("[OGS1 GRID SERVICES] Got exception while parsing land-data:", e); | ||
1679 | } | ||
1680 | } | ||
1681 | } | ||
1682 | catch (Exception e) | ||
1683 | { | ||
1684 | m_log.ErrorFormat("[OGS1 GRID SERVICES] Couldn't contact region {0}: {1}", regionHandle, e); | ||
1685 | } | ||
1686 | } | ||
1687 | return landData; | ||
1688 | } | ||
1689 | |||
1690 | // Grid Request Processing | ||
1691 | /// <summary> | ||
1692 | /// Someone asked us about parcel-information | ||
1693 | /// </summary> | ||
1694 | /// <param name="request"></param> | ||
1695 | /// <returns></returns> | ||
1696 | public XmlRpcResponse LandData(XmlRpcRequest request) | ||
1697 | { | ||
1698 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
1699 | ulong regionHandle = Convert.ToUInt64(requestData["region_handle"]); | ||
1700 | uint x = Convert.ToUInt32(requestData["x"]); | ||
1701 | uint y = Convert.ToUInt32(requestData["y"]); | ||
1702 | m_log.DebugFormat("[OGS1 GRID SERVICES]: Got XML reqeuest for land data at {0}, {1} in region {2}", x, y, regionHandle); | ||
1703 | |||
1704 | LandData landData = m_localBackend.RequestLandData(regionHandle, x, y); | ||
1705 | Hashtable hash = new Hashtable(); | ||
1706 | if (landData != null) | ||
1707 | { | ||
1708 | // for now, only push out the data we need for answering a ParcelInfoReqeust | ||
1709 | // FIXME: these Replace calls are necessary as LLVector3.Parse can't parse vectors with spaces in them. Can be removed as soon as we switch to a newer version | ||
1710 | hash["AABBMax"] = landData.AABBMax.ToString().Replace(" ", ""); | ||
1711 | hash["AABBMin"] = landData.AABBMin.ToString().Replace(" ", ""); | ||
1712 | hash["Area"] = landData.Area.ToString(); | ||
1713 | hash["AuctionID"] = landData.AuctionID.ToString(); | ||
1714 | hash["Description"] = landData.Description; | ||
1715 | hash["Flags"] = landData.Flags.ToString(); | ||
1716 | hash["GlobalID"] = landData.GlobalID.ToString(); | ||
1717 | hash["Name"] = landData.Name; | ||
1718 | hash["OwnerID"] = landData.OwnerID.ToString(); | ||
1719 | hash["SalePrice"] = landData.SalePrice.ToString(); | ||
1720 | hash["SnapshotID"] = landData.SnapshotID.ToString(); | ||
1721 | hash["UserLocation"] = landData.UserLocation.ToString().Replace(" ", ""); | ||
1722 | } | ||
1723 | |||
1724 | XmlRpcResponse response = new XmlRpcResponse(); | ||
1725 | response.Value = hash; | ||
1726 | return response; | ||
1727 | } | ||
1627 | } | 1728 | } |
1628 | } | 1729 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 92eda80..46f108e 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs | |||
@@ -26,19 +26,30 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | ||
30 | using libsecondlife; | 32 | using libsecondlife; |
33 | using log4net; | ||
31 | using Nini.Config; | 34 | using Nini.Config; |
32 | using OpenSim.Region.Environment.Interfaces; | 35 | using OpenSim.Region.Environment.Interfaces; |
33 | using OpenSim.Region.Environment.Scenes; | 36 | using OpenSim.Region.Environment.Scenes; |
34 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Servers; | ||
39 | using OpenSim.Framework.Communications.Capabilities; | ||
35 | using OpenSim.Region.Physics.Manager; | 40 | using OpenSim.Region.Physics.Manager; |
36 | using Axiom.Math; | 41 | using Axiom.Math; |
42 | using Caps = OpenSim.Framework.Communications.Capabilities.Caps; | ||
37 | 43 | ||
38 | namespace OpenSim.Region.Environment.Modules.World.Land | 44 | namespace OpenSim.Region.Environment.Modules.World.Land |
39 | { | 45 | { |
40 | public class LandManagementModule : IRegionModule | 46 | public class LandManagementModule : IRegionModule |
41 | { | 47 | { |
48 | private static readonly ILog m_log = | ||
49 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
50 | |||
51 | private static readonly string remoteParcelRequestPath = "0009/"; | ||
52 | |||
42 | private LandChannel landChannel; | 53 | private LandChannel landChannel; |
43 | private Scene m_scene; | 54 | private Scene m_scene; |
44 | 55 | ||
@@ -75,6 +86,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
75 | m_scene.EventManager.OnSetAllowForcefulBan += this.SetAllowedForcefulBans; | 86 | m_scene.EventManager.OnSetAllowForcefulBan += this.SetAllowedForcefulBans; |
76 | m_scene.EventManager.OnRequestParcelPrimCountUpdate += this.PerformParcelPrimCountUpdate; | 87 | m_scene.EventManager.OnRequestParcelPrimCountUpdate += this.PerformParcelPrimCountUpdate; |
77 | m_scene.EventManager.OnParcelPrimCountTainted += this.SetPrimsTainted; | 88 | m_scene.EventManager.OnParcelPrimCountTainted += this.SetPrimsTainted; |
89 | m_scene.EventManager.OnRegisterCaps += this.OnRegisterCaps; | ||
78 | 90 | ||
79 | lock (m_scene) | 91 | lock (m_scene) |
80 | { | 92 | { |
@@ -95,7 +107,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
95 | client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(handleParcelAccessUpdateRequest); | 107 | client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(handleParcelAccessUpdateRequest); |
96 | client.OnParcelAbandonRequest += new ParcelAbandonRequest(handleParcelAbandonRequest); | 108 | client.OnParcelAbandonRequest += new ParcelAbandonRequest(handleParcelAbandonRequest); |
97 | client.OnParcelReclaim += new ParcelReclaim(handleParcelReclaim); | 109 | client.OnParcelReclaim += new ParcelReclaim(handleParcelReclaim); |
98 | 110 | client.OnParcelInfoRequest += new ParcelInfoRequest(handleParcelInfo); | |
99 | if (m_scene.Entities.ContainsKey(client.AgentId)) | 111 | if (m_scene.Entities.ContainsKey(client.AgentId)) |
100 | { | 112 | { |
101 | SendLandUpdate((ScenePresence)m_scene.Entities[client.AgentId], true); | 113 | SendLandUpdate((ScenePresence)m_scene.Entities[client.AgentId], true); |
@@ -1084,6 +1096,112 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
1084 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | 1096 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) |
1085 | { | 1097 | { |
1086 | } | 1098 | } |
1099 | |||
1100 | #region CAPS handler | ||
1101 | private void OnRegisterCaps(LLUUID agentID, Caps caps) | ||
1102 | { | ||
1103 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | ||
1104 | caps.RegisterHandler("RemoteParcelRequest", | ||
1105 | new RestStreamHandler("POST", capsBase + remoteParcelRequestPath, | ||
1106 | delegate(string request, string path, string param, | ||
1107 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
1108 | { | ||
1109 | return RemoteParcelRequest(request, path, param, agentID, caps); | ||
1110 | })); | ||
1111 | } | ||
1112 | |||
1113 | // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the | ||
1114 | // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. | ||
1115 | // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x | ||
1116 | // and y coordinate (each 8 bit), encoded in a LLUUID (128 bit). | ||
1117 | // | ||
1118 | // Request format: | ||
1119 | // <llsd> | ||
1120 | // <map> | ||
1121 | // <key>location</key> | ||
1122 | // <array> | ||
1123 | // <real>1.23</real> | ||
1124 | // <real>45..6</real> | ||
1125 | // <real>78.9</real> | ||
1126 | // </array> | ||
1127 | // <key>region_id</key> | ||
1128 | // <uuid>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</uuid> | ||
1129 | // </map> | ||
1130 | // </llsd> | ||
1131 | private string RemoteParcelRequest(string request, string path, string param, LLUUID agentID, Caps caps) | ||
1132 | { | ||
1133 | LLUUID parcelID = LLUUID.Zero; | ||
1134 | try | ||
1135 | { | ||
1136 | Hashtable hash = new Hashtable(); | ||
1137 | hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); | ||
1138 | if(hash.ContainsKey("region_id") && hash.ContainsKey("location")) | ||
1139 | { | ||
1140 | LLUUID regionID = (LLUUID)hash["region_id"]; | ||
1141 | ArrayList list = (ArrayList)hash["location"]; | ||
1142 | uint x = (uint)(double)list[0]; | ||
1143 | uint y = (uint)(double)list[1]; | ||
1144 | if(hash.ContainsKey("region_handle")) | ||
1145 | { | ||
1146 | // if you do a "About Landmark" on a landmark a second time, the viewer sends the | ||
1147 | // region_handle it got earlier via RegionHandleRequest | ||
1148 | ulong regionHandle = Helpers.BytesToUInt64((byte[])hash["region_handle"]); | ||
1149 | parcelID = Util.BuildFakeParcelID(regionHandle, x, y); | ||
1150 | } | ||
1151 | else if(regionID == m_scene.RegionInfo.RegionID) | ||
1152 | { | ||
1153 | // a parcel request for a local parcel => no need to query the grid | ||
1154 | parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); | ||
1155 | } | ||
1156 | else | ||
1157 | { | ||
1158 | // a parcel request for a parcel in another region. Ask the grid about the region | ||
1159 | RegionInfo info = m_scene.CommsManager.GridService.RequestNeighbourInfo(regionID); | ||
1160 | if(info != null) parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); | ||
1161 | } | ||
1162 | } | ||
1163 | } | ||
1164 | catch (LLSD.LLSDParseException e) | ||
1165 | { | ||
1166 | m_log.ErrorFormat("[LAND] Fetch error: {0}", e.Message); | ||
1167 | m_log.ErrorFormat("[LAND] ... in request {0}", request); | ||
1168 | } | ||
1169 | catch(InvalidCastException) | ||
1170 | { | ||
1171 | m_log.ErrorFormat("[LAND] Wrong type in request {0}", request); | ||
1172 | } | ||
1173 | |||
1174 | LLSDRemoteParcelResponse response = new LLSDRemoteParcelResponse(); | ||
1175 | response.parcel_id = parcelID; | ||
1176 | m_log.DebugFormat("[LAND] got parcelID {0}", parcelID); | ||
1177 | |||
1178 | return LLSDHelpers.SerialiseLLSDReply(response); | ||
1179 | } | ||
1180 | |||
1181 | #endregion | ||
1182 | |||
1183 | private void handleParcelInfo(IClientAPI remoteClient, LLUUID parcelID) | ||
1184 | { | ||
1185 | if(parcelID == LLUUID.Zero) return; | ||
1186 | |||
1187 | // assume we've got the parcelID we just computed in RemoteParcelRequest | ||
1188 | ulong regionHandle; | ||
1189 | uint x, y; | ||
1190 | Util.ParseFakeParcelID(parcelID, out regionHandle, out x, out y); | ||
1191 | m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", regionHandle, x, y); | ||
1192 | |||
1193 | LandData landData; | ||
1194 | if(regionHandle == m_scene.RegionInfo.RegionHandle) landData = this.GetLandObject(x, y).landData; | ||
1195 | else landData = m_scene.CommsManager.GridService.RequestLandData(regionHandle, x, y); | ||
1196 | |||
1197 | if(landData != null) | ||
1198 | { | ||
1199 | // we need to transfer the fake parcelID, not the one in landData, so the viewer can match it to the landmark. | ||
1200 | m_log.Debug("[LAND] got parcelinfo; sending"); | ||
1201 | remoteClient.SendParcelInfo(m_scene.RegionInfo, landData, parcelID, x, y); | ||
1202 | } | ||
1203 | else m_log.Debug("[LAND] got no parcelinfo; not sending"); | ||
1204 | } | ||
1087 | } | 1205 | } |
1088 | 1206 | ||
1089 | } | 1207 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 5853b87..7b05027 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -302,6 +302,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
302 | public event UpdateVector OnAutoPilotGo; | 302 | public event UpdateVector OnAutoPilotGo; |
303 | 303 | ||
304 | public event TerrainUnacked OnUnackedTerrain; | 304 | public event TerrainUnacked OnUnackedTerrain; |
305 | |||
306 | public event RegionHandleRequest OnRegionHandleRequest; | ||
307 | public event ParcelInfoRequest OnParcelInfoRequest; | ||
308 | |||
305 | #pragma warning restore 67 | 309 | #pragma warning restore 67 |
306 | 310 | ||
307 | #endregion | 311 | #endregion |
@@ -832,5 +836,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
832 | public void SendClearFollowCamProperties (LLUUID objectID) | 836 | public void SendClearFollowCamProperties (LLUUID objectID) |
833 | { | 837 | { |
834 | } | 838 | } |
839 | |||
840 | public void SendRegionHandle (LLUUID regoinID, ulong handle) | ||
841 | { | ||
842 | } | ||
843 | |||
844 | public void SendParcelInfo (RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) | ||
845 | { | ||
846 | } | ||
835 | } | 847 | } |
836 | } | 848 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2e89e4b..9b0b53a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2170,6 +2170,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
2170 | client.OnScriptReset += ProcessScriptReset; | 2170 | client.OnScriptReset += ProcessScriptReset; |
2171 | client.OnGetScriptRunning += GetScriptRunning; | 2171 | client.OnGetScriptRunning += GetScriptRunning; |
2172 | client.OnSetScriptRunning += SetScriptRunning; | 2172 | client.OnSetScriptRunning += SetScriptRunning; |
2173 | |||
2174 | client.OnRegionHandleRequest += RegionHandleRequest; | ||
2173 | 2175 | ||
2174 | client.OnUnackedTerrain += TerrainUnAcked; | 2176 | client.OnUnackedTerrain += TerrainUnAcked; |
2175 | 2177 | ||
@@ -2502,6 +2504,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2502 | m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; | 2504 | m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; |
2503 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; | 2505 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; |
2504 | m_sceneGridService.KillObject += SendKillObject; | 2506 | m_sceneGridService.KillObject += SendKillObject; |
2507 | m_sceneGridService.OnGetLandData += GetLandData; | ||
2505 | } | 2508 | } |
2506 | 2509 | ||
2507 | /// <summary> | 2510 | /// <summary> |
@@ -2518,6 +2521,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2518 | m_sceneGridService.OnExpectUser -= NewUserConnection; | 2521 | m_sceneGridService.OnExpectUser -= NewUserConnection; |
2519 | m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; | 2522 | m_sceneGridService.OnAvatarCrossingIntoRegion -= AgentCrossing; |
2520 | m_sceneGridService.OnCloseAgentConnection -= CloseConnection; | 2523 | m_sceneGridService.OnCloseAgentConnection -= CloseConnection; |
2524 | m_sceneGridService.OnGetLandData -= GetLandData; | ||
2521 | 2525 | ||
2522 | m_sceneGridService.Close(); | 2526 | m_sceneGridService.Close(); |
2523 | } | 2527 | } |
@@ -3436,6 +3440,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
3436 | return LandChannel.GetLandObject(x, y).landData; | 3440 | return LandChannel.GetLandObject(x, y).landData; |
3437 | } | 3441 | } |
3438 | 3442 | ||
3443 | public LandData GetLandData(uint x, uint y) | ||
3444 | { | ||
3445 | m_log.DebugFormat("[SCENE] returning land for {0},{1}", x, y); | ||
3446 | return LandChannel.GetLandObject((int)x, (int)y).landData; | ||
3447 | } | ||
3448 | |||
3439 | public void SetLandMusicURL(float x, float y, string url) | 3449 | public void SetLandMusicURL(float x, float y, string url) |
3440 | { | 3450 | { |
3441 | ILandObject land = LandChannel.GetLandObject(x, y); | 3451 | ILandObject land = LandChannel.GetLandObject(x, y); |
@@ -3833,6 +3843,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
3833 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); | 3843 | // client.SendParcelMediaCommand((uint)(4), ParcelMediaCommandEnum.Play, 0); |
3834 | // }); | 3844 | // }); |
3835 | } | 3845 | } |
3846 | |||
3847 | public void RegionHandleRequest(IClientAPI client, LLUUID regionID) | ||
3848 | { | ||
3849 | RegionInfo info; | ||
3850 | if(regionID == RegionInfo.RegionID) info = RegionInfo; | ||
3851 | else info = CommsManager.GridService.RequestNeighbourInfo(regionID); | ||
3852 | if(info != null) client.SendRegionHandle(regionID, info.RegionHandle); | ||
3853 | } | ||
3836 | 3854 | ||
3837 | 3855 | ||
3838 | public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) | 3856 | public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 008d67a..35a7434 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -59,7 +59,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
59 | public event ChildAgentUpdate OnChildAgentUpdate; | 59 | public event ChildAgentUpdate OnChildAgentUpdate; |
60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; | 60 | public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; |
61 | public event LogOffUser OnLogOffUser; | 61 | public event LogOffUser OnLogOffUser; |
62 | 62 | public event GetLandData OnGetLandData; | |
63 | |||
63 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; | 64 | private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion; |
64 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; | 65 | private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser; |
65 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; | 66 | private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim; |
@@ -69,6 +70,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
69 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; | 70 | private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate; |
70 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; | 71 | private RemoveKnownRegionsFromAvatarList handlerRemoveKnownRegionFromAvatar = null; // OnRemoveKnownRegionFromAvatar; |
71 | private LogOffUser handlerLogOffUser = null; | 72 | private LogOffUser handlerLogOffUser = null; |
73 | private GetLandData handlerGetLandData = null; // OnGetLandData | ||
72 | 74 | ||
73 | public KillObjectDelegate KillObject; | 75 | public KillObjectDelegate KillObject; |
74 | public string _debugRegionName = String.Empty; | 76 | public string _debugRegionName = String.Empty; |
@@ -108,6 +110,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
108 | regionCommsHost.OnRegionUp += newRegionUp; | 110 | regionCommsHost.OnRegionUp += newRegionUp; |
109 | regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; | 111 | regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate; |
110 | regionCommsHost.OnLogOffUser += GridLogOffUser; | 112 | regionCommsHost.OnLogOffUser += GridLogOffUser; |
113 | regionCommsHost.OnGetLandData += FetchLandData; | ||
111 | } | 114 | } |
112 | else | 115 | else |
113 | { | 116 | { |
@@ -131,6 +134,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
131 | regionCommsHost.OnExpectPrim -= IncomingPrimCrossing; | 134 | regionCommsHost.OnExpectPrim -= IncomingPrimCrossing; |
132 | regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; | 135 | regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; |
133 | regionCommsHost.OnCloseAgentConnection -= CloseConnection; | 136 | regionCommsHost.OnCloseAgentConnection -= CloseConnection; |
137 | regionCommsHost.OnGetLandData -= FetchLandData; | ||
134 | m_commsProvider.GridService.DeregisterRegion(m_regionInfo); | 138 | m_commsProvider.GridService.DeregisterRegion(m_regionInfo); |
135 | regionCommsHost = null; | 139 | regionCommsHost = null; |
136 | } | 140 | } |
@@ -227,6 +231,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
227 | return false; | 231 | return false; |
228 | } | 232 | } |
229 | 233 | ||
234 | protected LandData FetchLandData(uint x, uint y) | ||
235 | { | ||
236 | handlerGetLandData = OnGetLandData; | ||
237 | if (handlerGetLandData != null) | ||
238 | { | ||
239 | return handlerGetLandData(x, y); | ||
240 | } | ||
241 | return null; | ||
242 | } | ||
243 | |||
230 | #endregion | 244 | #endregion |
231 | 245 | ||
232 | #region Inform Client of Neighbours | 246 | #region Inform Client of Neighbours |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index a7d2ef3..61ea966 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -204,6 +204,9 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
204 | 204 | ||
205 | public event TerrainUnacked OnUnackedTerrain; | 205 | public event TerrainUnacked OnUnackedTerrain; |
206 | 206 | ||
207 | public event RegionHandleRequest OnRegionHandleRequest; | ||
208 | public event ParcelInfoRequest OnParcelInfoRequest; | ||
209 | |||
207 | #pragma warning restore 67 | 210 | #pragma warning restore 67 |
208 | 211 | ||
209 | private LLUUID myID = LLUUID.Random(); | 212 | private LLUUID myID = LLUUID.Random(); |
@@ -832,5 +835,13 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
832 | public void SendClearFollowCamProperties (LLUUID objectID) | 835 | public void SendClearFollowCamProperties (LLUUID objectID) |
833 | { | 836 | { |
834 | } | 837 | } |
838 | |||
839 | public void SendRegionHandle (LLUUID regoinID, ulong handle) | ||
840 | { | ||
841 | } | ||
842 | |||
843 | public void SendParcelInfo (RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y) | ||
844 | { | ||
845 | } | ||
835 | } | 846 | } |
836 | } | 847 | } |