mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
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.
This commit is contained in:
@@ -229,6 +229,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// private RequestAsset handlerRequestAsset = null; // OnRequestAsset;
|
||||
private UUIDNameRequest handlerTeleportHomeRequest = null;
|
||||
|
||||
private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest
|
||||
private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest
|
||||
|
||||
private ScriptAnswer handlerScriptAnswer = null;
|
||||
private RequestPayPrice handlerRequestPayPrice = null;
|
||||
private ObjectDeselect handlerObjectDetach = null;
|
||||
@@ -916,6 +919,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest;
|
||||
public event EstateDebugRegionRequest OnEstateDebugRegionRequest;
|
||||
public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
|
||||
public event RegionHandleRequest OnRegionHandleRequest;
|
||||
public event ParcelInfoRequest OnParcelInfoRequest;
|
||||
public event ScriptReset OnScriptReset;
|
||||
public event GetScriptRunning OnGetScriptRunning;
|
||||
public event SetScriptRunning OnSetScriptRunning;
|
||||
@@ -5296,6 +5301,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
#region Parcel related packets
|
||||
|
||||
case PacketType.RegionHandleRequest:
|
||||
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
||||
|
||||
handlerRegionHandleRequest = OnRegionHandleRequest;
|
||||
if (handlerRegionHandleRequest != null)
|
||||
{
|
||||
handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
|
||||
}
|
||||
break;
|
||||
|
||||
case PacketType.ParcelInfoRequest:
|
||||
ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack;
|
||||
|
||||
handlerParcelInfoRequest = OnParcelInfoRequest;
|
||||
if (handlerParcelInfoRequest != null)
|
||||
{
|
||||
handlerParcelInfoRequest(this, pirPack.Data.ParcelID);
|
||||
}
|
||||
break;
|
||||
|
||||
case PacketType.ParcelAccessListRequest:
|
||||
ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack;
|
||||
|
||||
@@ -6294,5 +6319,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void SendRegionHandle(LLUUID regionID, ulong handle) {
|
||||
RegionIDAndHandleReplyPacket reply = (RegionIDAndHandleReplyPacket)PacketPool.Instance.GetPacket(PacketType.RegionIDAndHandleReply);
|
||||
reply.ReplyBlock.RegionID = regionID;
|
||||
reply.ReplyBlock.RegionHandle = handle;
|
||||
OutPacket(reply, ThrottleOutPacketType.Land);
|
||||
}
|
||||
|
||||
public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y)
|
||||
{
|
||||
ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply);
|
||||
reply.AgentData.AgentID = m_agentId;
|
||||
reply.Data.ParcelID = parcelID;
|
||||
reply.Data.OwnerID = land.OwnerID;
|
||||
reply.Data.Name = Helpers.StringToField(land.Name);
|
||||
reply.Data.Desc = Helpers.StringToField(land.Description);
|
||||
reply.Data.ActualArea = land.Area;
|
||||
reply.Data.BillableArea = land.Area; // TODO: what is this?
|
||||
|
||||
// Bit 0: Mature, bit 7: on sale, other bits: no idea
|
||||
reply.Data.Flags = (byte)(
|
||||
((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) +
|
||||
((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
|
||||
|
||||
LLVector3 pos = land.UserLocation;
|
||||
if (pos.Equals(LLVector3.Zero))
|
||||
{
|
||||
pos = (land.AABBMax + land.AABBMin) * 0.5f;
|
||||
}
|
||||
reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x;
|
||||
reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y;
|
||||
reply.Data.GlobalZ = pos.Z;
|
||||
reply.Data.SimName = Helpers.StringToField(info.RegionName);
|
||||
reply.Data.SnapshotID = land.SnapshotID;
|
||||
reply.Data.Dwell = 0; // TODO: not implemented yet
|
||||
reply.Data.SalePrice = land.SalePrice;
|
||||
reply.Data.AuctionID = (int)land.AuctionID;
|
||||
|
||||
OutPacket(reply, ThrottleOutPacketType.Land);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user