*Standardized the Land module by removing all references to libsecondlife.packets
parent
ce19234dc8
commit
c535f3947d
|
@ -235,6 +235,26 @@ namespace OpenSim.Framework
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LandUpdateArgs : EventArgs
|
||||||
|
{
|
||||||
|
public LLUUID AuthBuyerID;
|
||||||
|
public Parcel.ParcelCategory Category;
|
||||||
|
public string Desc;
|
||||||
|
public LLUUID GroupID;
|
||||||
|
public byte LandingType;
|
||||||
|
public byte MediaAutoScale;
|
||||||
|
public LLUUID MediaID;
|
||||||
|
public string MediaURL;
|
||||||
|
public string MusicURL;
|
||||||
|
public string Name;
|
||||||
|
public uint ParcelFlags;
|
||||||
|
public float PassHours;
|
||||||
|
public int PassPrice;
|
||||||
|
public int SalePrice;
|
||||||
|
public LLUUID SnapshotID;
|
||||||
|
public LLVector3 UserLocation;
|
||||||
|
public LLVector3 UserLookAt;
|
||||||
|
}
|
||||||
public delegate void TextureRequest(Object sender, TextureRequestArgs e);
|
public delegate void TextureRequest(Object sender, TextureRequestArgs e);
|
||||||
|
|
||||||
public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e);
|
public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e);
|
||||||
|
@ -355,7 +375,7 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
|
public delegate void ParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
|
||||||
|
|
||||||
public delegate void ParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client);
|
public delegate void ParcelPropertiesUpdateRequest(LandUpdateArgs args, int local_id, IClientAPI remote_client);
|
||||||
|
|
||||||
public delegate void ParcelSelectObjects(int land_local_id, int request_type, IClientAPI remote_client);
|
public delegate void ParcelSelectObjects(int land_local_id, int request_type, IClientAPI remote_client);
|
||||||
|
|
||||||
|
@ -778,6 +798,11 @@ namespace OpenSim.Framework
|
||||||
void sendEstateCovenantInformation();
|
void sendEstateCovenantInformation();
|
||||||
void sendDetailedEstateData(LLUUID invoice);
|
void sendDetailedEstateData(LLUUID invoice);
|
||||||
|
|
||||||
|
void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity);
|
||||||
|
void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID);
|
||||||
|
void sendForceClientSelectObjects(List<uint> objectIDs);
|
||||||
|
void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount);
|
||||||
|
|
||||||
byte[] GetThrottlesPacked(float multiplier);
|
byte[] GetThrottlesPacked(float multiplier);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2273,6 +2273,201 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
this.OutPacket(packet, ThrottleOutPacketType.Task);
|
this.OutPacket(packet, ThrottleOutPacketType.Task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Land Data Sending Methods
|
||||||
|
|
||||||
|
public void sendLandProperties(IClientAPI remote_client,int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity)
|
||||||
|
{
|
||||||
|
ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties);
|
||||||
|
// TODO: don't create new blocks if recycling an old packet
|
||||||
|
|
||||||
|
updatePacket.ParcelData.AABBMax = landData.AABBMax;
|
||||||
|
updatePacket.ParcelData.AABBMin = landData.AABBMin;
|
||||||
|
updatePacket.ParcelData.Area = landData.area;
|
||||||
|
updatePacket.ParcelData.AuctionID = landData.auctionID;
|
||||||
|
updatePacket.ParcelData.AuthBuyerID = landData.authBuyerID; //unemplemented
|
||||||
|
|
||||||
|
updatePacket.ParcelData.Bitmap = landData.landBitmapByteArray;
|
||||||
|
|
||||||
|
updatePacket.ParcelData.Desc = Helpers.StringToField(landData.landDesc);
|
||||||
|
updatePacket.ParcelData.Category = (byte) landData.category;
|
||||||
|
updatePacket.ParcelData.ClaimDate = landData.claimDate;
|
||||||
|
updatePacket.ParcelData.ClaimPrice = landData.claimPrice;
|
||||||
|
updatePacket.ParcelData.GroupID = landData.groupID;
|
||||||
|
updatePacket.ParcelData.GroupPrims = landData.groupPrims;
|
||||||
|
updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned;
|
||||||
|
updatePacket.ParcelData.LandingType = (byte) landData.landingType;
|
||||||
|
updatePacket.ParcelData.LocalID = landData.localID;
|
||||||
|
if (landData.area > 0)
|
||||||
|
{
|
||||||
|
updatePacket.ParcelData.MaxPrims =
|
||||||
|
Convert.ToInt32(
|
||||||
|
Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * simObjectCapacity *
|
||||||
|
Convert.ToDecimal(simObjectBonusFactor)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updatePacket.ParcelData.MaxPrims = 0;
|
||||||
|
}
|
||||||
|
updatePacket.ParcelData.MediaAutoScale = landData.mediaAutoScale;
|
||||||
|
updatePacket.ParcelData.MediaID = landData.mediaID;
|
||||||
|
updatePacket.ParcelData.MediaURL = Helpers.StringToField(landData.mediaURL);
|
||||||
|
updatePacket.ParcelData.MusicURL = Helpers.StringToField(landData.musicURL);
|
||||||
|
updatePacket.ParcelData.Name = Helpers.StringToField(landData.landName);
|
||||||
|
updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented
|
||||||
|
updatePacket.ParcelData.OtherCount = 0; //unemplemented
|
||||||
|
updatePacket.ParcelData.OtherPrims = landData.otherPrims;
|
||||||
|
updatePacket.ParcelData.OwnerID = landData.ownerID;
|
||||||
|
updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
|
||||||
|
updatePacket.ParcelData.ParcelFlags = landData.landFlags;
|
||||||
|
updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.EstateSettings.objectBonusFactor;
|
||||||
|
updatePacket.ParcelData.PassHours = landData.passHours;
|
||||||
|
updatePacket.ParcelData.PassPrice = landData.passPrice;
|
||||||
|
updatePacket.ParcelData.PublicCount = 0; //unemplemented
|
||||||
|
|
||||||
|
uint regionFlags = (uint) m_scene.RegionInfo.EstateSettings.regionFlags;
|
||||||
|
updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint) Simulator.RegionFlags.DenyAnonymous) >
|
||||||
|
0);
|
||||||
|
updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint) Simulator.RegionFlags.DenyIdentified) >
|
||||||
|
0);
|
||||||
|
updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint) Simulator.RegionFlags.DenyTransacted) >
|
||||||
|
0);
|
||||||
|
updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint) Simulator.RegionFlags.RestrictPushObject) >
|
||||||
|
0);
|
||||||
|
|
||||||
|
updatePacket.ParcelData.RentPrice = 0;
|
||||||
|
updatePacket.ParcelData.RequestResult = request_result;
|
||||||
|
updatePacket.ParcelData.SalePrice = landData.salePrice;
|
||||||
|
updatePacket.ParcelData.SelectedPrims = landData.selectedPrims;
|
||||||
|
updatePacket.ParcelData.SelfCount = 0; //unemplemented
|
||||||
|
updatePacket.ParcelData.SequenceID = sequence_id;
|
||||||
|
if (landData.simwideArea > 0)
|
||||||
|
{
|
||||||
|
updatePacket.ParcelData.SimWideMaxPrims =
|
||||||
|
Convert.ToInt32(
|
||||||
|
Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * simObjectCapacity *
|
||||||
|
Convert.ToDecimal(simObjectBonusFactor)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
updatePacket.ParcelData.SimWideMaxPrims = 0;
|
||||||
|
}
|
||||||
|
updatePacket.ParcelData.SimWideTotalPrims = landData.simwidePrims;
|
||||||
|
updatePacket.ParcelData.SnapSelection = snap_selection;
|
||||||
|
updatePacket.ParcelData.SnapshotID = landData.snapshotID;
|
||||||
|
updatePacket.ParcelData.Status = (byte) landData.landStatus;
|
||||||
|
updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims +
|
||||||
|
landData.selectedPrims;
|
||||||
|
updatePacket.ParcelData.UserLocation = landData.userLocation;
|
||||||
|
updatePacket.ParcelData.UserLookAt = landData.userLookAt;
|
||||||
|
remote_client.OutPacket((Packet) updatePacket, ThrottleOutPacketType.Task);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)
|
||||||
|
{
|
||||||
|
ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply);
|
||||||
|
replyPacket.Data.AgentID = this.AgentId;
|
||||||
|
replyPacket.Data.Flags = accessFlag;
|
||||||
|
replyPacket.Data.LocalID = localLandID;
|
||||||
|
replyPacket.Data.SequenceID = 0;
|
||||||
|
|
||||||
|
List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>();
|
||||||
|
foreach (LLUUID avatar in avatars)
|
||||||
|
{
|
||||||
|
ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock();
|
||||||
|
block.Flags = accessFlag;
|
||||||
|
block.ID = avatar;
|
||||||
|
block.Time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
replyPacket.List = list.ToArray();
|
||||||
|
this.OutPacket((Packet)replyPacket, ThrottleOutPacketType.Task);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendForceClientSelectObjects(List<uint> ObjectIDs)
|
||||||
|
{
|
||||||
|
bool firstCall = true;
|
||||||
|
int MAX_OBJECTS_PER_PACKET = 251;
|
||||||
|
ForceObjectSelectPacket pack = (ForceObjectSelectPacket)PacketPool.Instance.GetPacket(PacketType.ForceObjectSelect);
|
||||||
|
ForceObjectSelectPacket.DataBlock[] data;
|
||||||
|
while (ObjectIDs.Count > 0)
|
||||||
|
{
|
||||||
|
if (firstCall)
|
||||||
|
{
|
||||||
|
pack._Header.ResetList = true;
|
||||||
|
firstCall = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pack._Header.ResetList = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectIDs.Count > MAX_OBJECTS_PER_PACKET)
|
||||||
|
{
|
||||||
|
data = new ForceObjectSelectPacket.DataBlock[MAX_OBJECTS_PER_PACKET];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data = new ForceObjectSelectPacket.DataBlock[ObjectIDs.Count];
|
||||||
|
}
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < MAX_OBJECTS_PER_PACKET && ObjectIDs.Count > 0; i++)
|
||||||
|
{
|
||||||
|
data[i] = new ForceObjectSelectPacket.DataBlock();
|
||||||
|
data[i].LocalID = Convert.ToUInt32(ObjectIDs[0]);
|
||||||
|
ObjectIDs.RemoveAt(0);
|
||||||
|
}
|
||||||
|
pack.Data = data;
|
||||||
|
this.OutPacket((Packet)pack, ThrottleOutPacketType.Task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount)
|
||||||
|
{
|
||||||
|
int notifyCount = ownersAndCount.Count;
|
||||||
|
ParcelObjectOwnersReplyPacket pack = (ParcelObjectOwnersReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelObjectOwnersReply);
|
||||||
|
|
||||||
|
if (notifyCount > 0)
|
||||||
|
{
|
||||||
|
if (notifyCount > 32)
|
||||||
|
{
|
||||||
|
m_log.InfoFormat(
|
||||||
|
"[LAND]: More than {0} avatars own prims on this parcel. Only sending back details of first {0}"
|
||||||
|
+ " - a developer might want to investigate whether this is a hard limit", 32);
|
||||||
|
|
||||||
|
notifyCount = 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock
|
||||||
|
= new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount];
|
||||||
|
|
||||||
|
int num = 0;
|
||||||
|
foreach (LLUUID owner in ownersAndCount.Keys)
|
||||||
|
{
|
||||||
|
dataBlock[num] = new ParcelObjectOwnersReplyPacket.DataBlock();
|
||||||
|
dataBlock[num].Count = ownersAndCount[owner];
|
||||||
|
dataBlock[num].IsGroupOwned = false; //TODO: fix me when group support is added
|
||||||
|
dataBlock[num].OnlineStatus = true; //TODO: fix me later
|
||||||
|
dataBlock[num].OwnerID = owner;
|
||||||
|
|
||||||
|
num++;
|
||||||
|
|
||||||
|
if (num >= notifyCount)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pack.Data = dataBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.OutPacket(pack, ThrottleOutPacketType.Task);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Helper Methods
|
#region Helper Methods
|
||||||
|
@ -4704,7 +4899,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
if (handlerParcelPropertiesUpdateRequest != null)
|
if (handlerParcelPropertiesUpdateRequest != null)
|
||||||
{
|
{
|
||||||
handlerParcelPropertiesUpdateRequest(parcelPropertiesPacket, this);
|
LandUpdateArgs args = new LandUpdateArgs();
|
||||||
|
|
||||||
|
args.AuthBuyerID = parcelPropertiesPacket.ParcelData.AuthBuyerID;
|
||||||
|
args.Category = (Parcel.ParcelCategory)parcelPropertiesPacket.ParcelData.Category;
|
||||||
|
args.Desc = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.Desc);
|
||||||
|
args.GroupID = parcelPropertiesPacket.ParcelData.GroupID;
|
||||||
|
args.LandingType = parcelPropertiesPacket.ParcelData.LandingType;
|
||||||
|
args.MediaAutoScale = parcelPropertiesPacket.ParcelData.MediaAutoScale;
|
||||||
|
args.MediaID = parcelPropertiesPacket.ParcelData.MediaID;
|
||||||
|
args.MediaURL = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.MediaURL);
|
||||||
|
args.MusicURL = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.MusicURL);
|
||||||
|
args.Name = Helpers.FieldToUTF8String(parcelPropertiesPacket.ParcelData.Name);
|
||||||
|
args.ParcelFlags = parcelPropertiesPacket.ParcelData.ParcelFlags;
|
||||||
|
args.PassHours = parcelPropertiesPacket.ParcelData.PassHours;
|
||||||
|
args.PassPrice = parcelPropertiesPacket.ParcelData.PassPrice;
|
||||||
|
args.SalePrice = parcelPropertiesPacket.ParcelData.SalePrice;
|
||||||
|
args.SnapshotID = parcelPropertiesPacket.ParcelData.SnapshotID;
|
||||||
|
args.UserLocation = parcelPropertiesPacket.ParcelData.UserLocation;
|
||||||
|
args.UserLookAt = parcelPropertiesPacket.ParcelData.UserLookAt;
|
||||||
|
handlerParcelPropertiesUpdateRequest(args, parcelPropertiesPacket.ParcelData.LocalID, this);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PacketType.ParcelSelectObjects:
|
case PacketType.ParcelSelectObjects:
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
|
@ -56,7 +55,7 @@ namespace OpenSim.Region.Environment.Interfaces
|
||||||
|
|
||||||
void sendParcelOverlay(IClientAPI remote_client);
|
void sendParcelOverlay(IClientAPI remote_client);
|
||||||
void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
|
void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client);
|
||||||
void handleParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client);
|
void handleParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client);
|
||||||
void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client);
|
void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client);
|
||||||
void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
|
void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client);
|
||||||
void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client);
|
void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client);
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
|
@ -44,12 +43,12 @@ namespace OpenSim.Region.Environment.Interfaces
|
||||||
void sendLandUpdateToAvatarsOverMe();
|
void sendLandUpdateToAvatarsOverMe();
|
||||||
|
|
||||||
void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client);
|
void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client);
|
||||||
void updateLandProperties(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client);
|
void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client);
|
||||||
bool isEitherBannedOrRestricted(LLUUID avatar);
|
bool isEitherBannedOrRestricted(LLUUID avatar);
|
||||||
bool isBannedFromLand(LLUUID avatar);
|
bool isBannedFromLand(LLUUID avatar);
|
||||||
bool isRestrictedFromLand(LLUUID avatar);
|
bool isRestrictedFromLand(LLUUID avatar);
|
||||||
void sendLandUpdateToClient(IClientAPI remote_client);
|
void sendLandUpdateToClient(IClientAPI remote_client);
|
||||||
ParcelAccessListReplyPacket.ListBlock[] createAccessListArrayByFlag(ParcelManager.AccessList flag);
|
List<LLUUID> createAccessListArrayByFlag(ParcelManager.AccessList flag);
|
||||||
void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
|
void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
|
||||||
void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client);
|
void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client);
|
||||||
void updateLandBitmapByteArray();
|
void updateLandBitmapByteArray();
|
||||||
|
|
|
@ -672,11 +672,11 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
sendParcelOverlay(remote_client);
|
sendParcelOverlay(remote_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleParcelPropertiesUpdateRequest(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client)
|
public void handleParcelPropertiesUpdateRequest(LandUpdateArgs args, int localID, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
if (landList.ContainsKey(packet.ParcelData.LocalID))
|
if (landList.ContainsKey(localID))
|
||||||
{
|
{
|
||||||
landList[packet.ParcelData.LocalID].updateLandProperties(packet, remote_client);
|
landList[localID].updateLandProperties(args, remote_client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
|
||||||
using log4net;
|
using log4net;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
@ -121,123 +120,35 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
|
|
||||||
#region Packet Request Handling
|
#region Packet Request Handling
|
||||||
|
|
||||||
/// <summary>
|
public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
|
||||||
/// Sends land properties as requested
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sequence_id">ID sent by client for them to keep track of</param>
|
|
||||||
/// <param name="snap_selection">Bool sent by client for them to use</param>
|
|
||||||
/// <param name="remote_client">Object representing the client</param>
|
|
||||||
public void sendLandProperties(int sequence_id, bool snap_selection, int request_result,
|
|
||||||
IClientAPI remote_client)
|
|
||||||
{
|
{
|
||||||
ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ParcelProperties);
|
remote_client.sendLandProperties(remote_client, sequence_id, snap_selection, request_result, landData, m_scene.RegionInfo.EstateSettings.objectBonusFactor, m_scene.objectCapacity);
|
||||||
// TODO: don't create new blocks if recycling an old packet
|
|
||||||
|
|
||||||
updatePacket.ParcelData.AABBMax = landData.AABBMax;
|
|
||||||
updatePacket.ParcelData.AABBMin = landData.AABBMin;
|
|
||||||
updatePacket.ParcelData.Area = landData.area;
|
|
||||||
updatePacket.ParcelData.AuctionID = landData.auctionID;
|
|
||||||
updatePacket.ParcelData.AuthBuyerID = landData.authBuyerID; //unemplemented
|
|
||||||
|
|
||||||
updatePacket.ParcelData.Bitmap = landData.landBitmapByteArray;
|
|
||||||
|
|
||||||
updatePacket.ParcelData.Desc = Helpers.StringToField(landData.landDesc);
|
|
||||||
updatePacket.ParcelData.Category = (byte) landData.category;
|
|
||||||
updatePacket.ParcelData.ClaimDate = landData.claimDate;
|
|
||||||
updatePacket.ParcelData.ClaimPrice = landData.claimPrice;
|
|
||||||
updatePacket.ParcelData.GroupID = landData.groupID;
|
|
||||||
updatePacket.ParcelData.GroupPrims = landData.groupPrims;
|
|
||||||
updatePacket.ParcelData.IsGroupOwned = landData.isGroupOwned;
|
|
||||||
updatePacket.ParcelData.LandingType = (byte) landData.landingType;
|
|
||||||
updatePacket.ParcelData.LocalID = landData.localID;
|
|
||||||
if (landData.area > 0)
|
|
||||||
{
|
|
||||||
updatePacket.ParcelData.MaxPrims =
|
|
||||||
Convert.ToInt32(
|
|
||||||
Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * m_scene.objectCapacity *
|
|
||||||
Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
updatePacket.ParcelData.MaxPrims = 0;
|
|
||||||
}
|
|
||||||
updatePacket.ParcelData.MediaAutoScale = landData.mediaAutoScale;
|
|
||||||
updatePacket.ParcelData.MediaID = landData.mediaID;
|
|
||||||
updatePacket.ParcelData.MediaURL = Helpers.StringToField(landData.mediaURL);
|
|
||||||
updatePacket.ParcelData.MusicURL = Helpers.StringToField(landData.musicURL);
|
|
||||||
updatePacket.ParcelData.Name = Helpers.StringToField(landData.landName);
|
|
||||||
updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented
|
|
||||||
updatePacket.ParcelData.OtherCount = 0; //unemplemented
|
|
||||||
updatePacket.ParcelData.OtherPrims = landData.otherPrims;
|
|
||||||
updatePacket.ParcelData.OwnerID = landData.ownerID;
|
|
||||||
updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
|
|
||||||
updatePacket.ParcelData.ParcelFlags = landData.landFlags;
|
|
||||||
updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.EstateSettings.objectBonusFactor;
|
|
||||||
updatePacket.ParcelData.PassHours = landData.passHours;
|
|
||||||
updatePacket.ParcelData.PassPrice = landData.passPrice;
|
|
||||||
updatePacket.ParcelData.PublicCount = 0; //unemplemented
|
|
||||||
|
|
||||||
uint regionFlags = (uint) m_scene.RegionInfo.EstateSettings.regionFlags;
|
|
||||||
updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint) Simulator.RegionFlags.DenyAnonymous) >
|
|
||||||
0);
|
|
||||||
updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint) Simulator.RegionFlags.DenyIdentified) >
|
|
||||||
0);
|
|
||||||
updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint) Simulator.RegionFlags.DenyTransacted) >
|
|
||||||
0);
|
|
||||||
updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint) Simulator.RegionFlags.RestrictPushObject) >
|
|
||||||
0);
|
|
||||||
|
|
||||||
updatePacket.ParcelData.RentPrice = 0;
|
|
||||||
updatePacket.ParcelData.RequestResult = request_result;
|
|
||||||
updatePacket.ParcelData.SalePrice = landData.salePrice;
|
|
||||||
updatePacket.ParcelData.SelectedPrims = landData.selectedPrims;
|
|
||||||
updatePacket.ParcelData.SelfCount = 0; //unemplemented
|
|
||||||
updatePacket.ParcelData.SequenceID = sequence_id;
|
|
||||||
if (landData.simwideArea > 0)
|
|
||||||
{
|
|
||||||
updatePacket.ParcelData.SimWideMaxPrims =
|
|
||||||
Convert.ToInt32(
|
|
||||||
Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * m_scene.objectCapacity *
|
|
||||||
Convert.ToDecimal(m_scene.RegionInfo.EstateSettings.objectBonusFactor)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
updatePacket.ParcelData.SimWideMaxPrims = 0;
|
|
||||||
}
|
|
||||||
updatePacket.ParcelData.SimWideTotalPrims = landData.simwidePrims;
|
|
||||||
updatePacket.ParcelData.SnapSelection = snap_selection;
|
|
||||||
updatePacket.ParcelData.SnapshotID = landData.snapshotID;
|
|
||||||
updatePacket.ParcelData.Status = (byte) landData.landStatus;
|
|
||||||
updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims +
|
|
||||||
landData.selectedPrims;
|
|
||||||
updatePacket.ParcelData.UserLocation = landData.userLocation;
|
|
||||||
updatePacket.ParcelData.UserLookAt = landData.userLookAt;
|
|
||||||
remote_client.OutPacket((Packet) updatePacket, ThrottleOutPacketType.Task);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateLandProperties(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client)
|
public void updateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
if (remote_client.AgentId == landData.ownerID)
|
if (remote_client.AgentId == landData.ownerID)
|
||||||
{
|
{
|
||||||
//Needs later group support
|
//Needs later group support
|
||||||
LandData newData = landData.Copy();
|
LandData newData = landData.Copy();
|
||||||
newData.authBuyerID = packet.ParcelData.AuthBuyerID;
|
|
||||||
newData.category = (Parcel.ParcelCategory) packet.ParcelData.Category;
|
newData.authBuyerID = args.AuthBuyerID;
|
||||||
newData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc);
|
newData.category = args.Category;
|
||||||
newData.groupID = packet.ParcelData.GroupID;
|
newData.landDesc = args.Desc;
|
||||||
newData.landingType = packet.ParcelData.LandingType;
|
newData.groupID = args.GroupID;
|
||||||
newData.mediaAutoScale = packet.ParcelData.MediaAutoScale;
|
newData.landingType = args.LandingType;
|
||||||
newData.mediaID = packet.ParcelData.MediaID;
|
newData.mediaAutoScale = args.MediaAutoScale;
|
||||||
newData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL);
|
newData.mediaID = args.MediaID;
|
||||||
newData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL);
|
newData.mediaURL = args.MediaURL;
|
||||||
newData.landName = Helpers.FieldToUTF8String(packet.ParcelData.Name);
|
newData.musicURL = args.MusicURL;
|
||||||
newData.landFlags = packet.ParcelData.ParcelFlags;
|
newData.landName = args.Name;
|
||||||
newData.passHours = packet.ParcelData.PassHours;
|
newData.landFlags = args.ParcelFlags;
|
||||||
newData.passPrice = packet.ParcelData.PassPrice;
|
newData.passHours = args.PassHours;
|
||||||
newData.salePrice = packet.ParcelData.SalePrice;
|
newData.passPrice = args.PassPrice;
|
||||||
newData.snapshotID = packet.ParcelData.SnapshotID;
|
newData.salePrice = args.SalePrice;
|
||||||
newData.userLocation = packet.ParcelData.UserLocation;
|
newData.snapshotID = args.SnapshotID;
|
||||||
newData.userLookAt = packet.ParcelData.UserLookAt;
|
newData.userLocation = args.UserLocation;
|
||||||
|
newData.userLookAt = args.UserLookAt;
|
||||||
|
|
||||||
m_scene.LandChannel.updateLandObject(landData.localID, newData);
|
m_scene.LandChannel.updateLandObject(landData.localID, newData);
|
||||||
|
|
||||||
|
@ -351,63 +262,38 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
|
|
||||||
#region AccessList Functions
|
#region AccessList Functions
|
||||||
|
|
||||||
public ParcelAccessListReplyPacket.ListBlock[] createAccessListArrayByFlag(ParcelManager.AccessList flag)
|
public List<LLUUID> createAccessListArrayByFlag(ParcelManager.AccessList flag)
|
||||||
{
|
{
|
||||||
List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>();
|
List<LLUUID> list = new List<LLUUID>();
|
||||||
foreach (ParcelManager.ParcelAccessEntry entry in landData.parcelAccessList)
|
foreach (ParcelManager.ParcelAccessEntry entry in landData.parcelAccessList)
|
||||||
{
|
{
|
||||||
if (entry.Flags == flag)
|
if (entry.Flags == flag)
|
||||||
{
|
{
|
||||||
ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock();
|
list.Add(entry.AgentID);
|
||||||
|
|
||||||
listBlock.Flags = (uint) 0;
|
|
||||||
listBlock.ID = entry.AgentID;
|
|
||||||
listBlock.Time = 0;
|
|
||||||
|
|
||||||
list.Add(listBlock);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(list.Count == 0)
|
if(list.Count == 0)
|
||||||
{
|
{
|
||||||
ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock();
|
list.Add(LLUUID.Zero);
|
||||||
|
|
||||||
listBlock.Flags = (uint) 0;
|
|
||||||
listBlock.ID = LLUUID.Zero;
|
|
||||||
listBlock.Time = 0;
|
|
||||||
|
|
||||||
list.Add(listBlock);
|
|
||||||
}
|
}
|
||||||
return list.ToArray();
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID,
|
public void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID,
|
||||||
IClientAPI remote_client)
|
IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
ParcelAccessListReplyPacket replyPacket;
|
|
||||||
|
|
||||||
if (flags == (uint) ParcelManager.AccessList.Access || flags == (uint) ParcelManager.AccessList.Both)
|
if (flags == (uint) ParcelManager.AccessList.Access || flags == (uint) ParcelManager.AccessList.Both)
|
||||||
{
|
{
|
||||||
replyPacket = (ParcelAccessListReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply);
|
List<LLUUID> avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Access);
|
||||||
replyPacket.Data.AgentID = agentID;
|
remote_client.sendLandAccessListData(avatars,(uint) ParcelManager.AccessList.Access,landData.localID);
|
||||||
replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Access;
|
|
||||||
replyPacket.Data.LocalID = landData.localID;
|
|
||||||
replyPacket.Data.SequenceID = 0;
|
|
||||||
|
|
||||||
replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Access);
|
|
||||||
remote_client.OutPacket((Packet) replyPacket, ThrottleOutPacketType.Task);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both)
|
if (flags == (uint) ParcelManager.AccessList.Ban || flags == (uint) ParcelManager.AccessList.Both)
|
||||||
{
|
{
|
||||||
replyPacket = (ParcelAccessListReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply);
|
List<LLUUID> avatars = createAccessListArrayByFlag(ParcelManager.AccessList.Ban);
|
||||||
replyPacket.Data.AgentID = agentID;
|
remote_client.sendLandAccessListData(avatars, (uint)ParcelManager.AccessList.Ban, landData.localID);
|
||||||
replyPacket.Data.Flags = (uint) ParcelManager.AccessList.Ban;
|
|
||||||
replyPacket.Data.LocalID = landData.localID;
|
|
||||||
replyPacket.Data.SequenceID = 0;
|
|
||||||
|
|
||||||
replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Ban);
|
|
||||||
remote_client.OutPacket((Packet) replyPacket, ThrottleOutPacketType.Task);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -721,43 +607,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remote_client.sendForceClientSelectObjects(resultLocalIDs);
|
||||||
bool firstCall = true;
|
|
||||||
int MAX_OBJECTS_PER_PACKET = 251;
|
|
||||||
ForceObjectSelectPacket pack = (ForceObjectSelectPacket) PacketPool.Instance.GetPacket(PacketType.ForceObjectSelect);
|
|
||||||
// TODO: don't create new blocks if recycling an old packet
|
|
||||||
ForceObjectSelectPacket.DataBlock[] data;
|
|
||||||
while (resultLocalIDs.Count > 0)
|
|
||||||
{
|
|
||||||
if (firstCall)
|
|
||||||
{
|
|
||||||
pack._Header.ResetList = true;
|
|
||||||
firstCall = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pack._Header.ResetList = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resultLocalIDs.Count > MAX_OBJECTS_PER_PACKET)
|
|
||||||
{
|
|
||||||
data = new ForceObjectSelectPacket.DataBlock[MAX_OBJECTS_PER_PACKET];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data = new ForceObjectSelectPacket.DataBlock[resultLocalIDs.Count];
|
|
||||||
}
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < MAX_OBJECTS_PER_PACKET && resultLocalIDs.Count > 0; i++)
|
|
||||||
{
|
|
||||||
data[i] = new ForceObjectSelectPacket.DataBlock();
|
|
||||||
data[i].LocalID = Convert.ToUInt32(resultLocalIDs[0]);
|
|
||||||
resultLocalIDs.RemoveAt(0);
|
|
||||||
}
|
|
||||||
pack.Data = data;
|
|
||||||
remote_client.OutPacket((Packet) pack, ThrottleOutPacketType.Task);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -771,9 +621,6 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
public void sendLandObjectOwners(IClientAPI remote_client)
|
public void sendLandObjectOwners(IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
Dictionary<LLUUID, int> primCount = new Dictionary<LLUUID, int>();
|
Dictionary<LLUUID, int> primCount = new Dictionary<LLUUID, int>();
|
||||||
ParcelObjectOwnersReplyPacket pack
|
|
||||||
= (ParcelObjectOwnersReplyPacket) PacketPool.Instance.GetPacket(PacketType.ParcelObjectOwnersReply);
|
|
||||||
// TODO: don't create new blocks if recycling an old packet
|
|
||||||
|
|
||||||
foreach (SceneObjectGroup obj in primsOverMe)
|
foreach (SceneObjectGroup obj in primsOverMe)
|
||||||
{
|
{
|
||||||
|
@ -798,43 +645,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int notifyCount = primCount.Count;
|
remote_client.sendLandObjectOwners(primCount);
|
||||||
|
|
||||||
if (notifyCount > 0)
|
|
||||||
{
|
|
||||||
if (notifyCount > 32)
|
|
||||||
{
|
|
||||||
m_log.InfoFormat(
|
|
||||||
"[LAND]: More than {0} avatars own prims on this parcel. Only sending back details of first {0}"
|
|
||||||
+ " - a developer might want to investigate whether this is a hard limit", 32);
|
|
||||||
|
|
||||||
notifyCount = 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock
|
|
||||||
= new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount];
|
|
||||||
|
|
||||||
int num = 0;
|
|
||||||
foreach (LLUUID owner in primCount.Keys)
|
|
||||||
{
|
|
||||||
dataBlock[num] = new ParcelObjectOwnersReplyPacket.DataBlock();
|
|
||||||
dataBlock[num].Count = primCount[owner];
|
|
||||||
dataBlock[num].IsGroupOwned = false; //TODO: fix me when group support is added
|
|
||||||
dataBlock[num].OnlineStatus = true; //TODO: fix me later
|
|
||||||
dataBlock[num].OwnerID = owner;
|
|
||||||
|
|
||||||
num++;
|
|
||||||
|
|
||||||
if (num >= notifyCount)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pack.Data = dataBlock;
|
|
||||||
}
|
|
||||||
|
|
||||||
remote_client.OutPacket(pack, ThrottleOutPacketType.Task);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<LLUUID, int> getLandObjectOwners()
|
public Dictionary<LLUUID, int> getLandObjectOwners()
|
||||||
|
|
|
@ -645,5 +645,18 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
public void sendDetailedEstateData(LLUUID invoice)
|
public void sendDetailedEstateData(LLUUID invoice)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendLandProperties(IClientAPI remote_client, int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int simObjectCapacity)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void sendLandAccessListData(List<LLUUID> avatars, uint accessFlag, int localLandID)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void sendForceClientSelectObjects(List<uint> objectIDs)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public void sendLandObjectOwners(Dictionary<LLUUID, int> ownersAndCount)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue