local commit with parcel media bits

Signed-off-by: Melanie <melanie@t-data.com>
prebuild-update
Jonathan Freedman 2010-08-29 21:28:31 -04:00 committed by Melanie
parent 374807d194
commit 4b2e3bd6c3
13 changed files with 306 additions and 200 deletions

View File

@ -677,7 +677,8 @@ namespace OpenSim.Data.MySQL
"MusicURL, PassHours, PassPrice, SnapshotUUID, " + "MusicURL, PassHours, PassPrice, SnapshotUUID, " +
"UserLocationX, UserLocationY, UserLocationZ, " + "UserLocationX, UserLocationY, UserLocationZ, " +
"UserLookAtX, UserLookAtY, UserLookAtZ, " + "UserLookAtX, UserLookAtY, UserLookAtZ, " +
"AuthbuyerID, OtherCleanTime, Dwell) values (" + "AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " +
"MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" +
"?UUID, ?RegionUUID, " + "?UUID, ?RegionUUID, " +
"?LocalLandID, ?Bitmap, ?Name, ?Description, " + "?LocalLandID, ?Bitmap, ?Name, ?Description, " +
"?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " +
@ -687,7 +688,8 @@ namespace OpenSim.Data.MySQL
"?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " + "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " +
"?UserLocationX, ?UserLocationY, ?UserLocationZ, " + "?UserLocationX, ?UserLocationY, ?UserLocationZ, " +
"?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " +
"?AuthbuyerID, ?OtherCleanTime, ?Dwell)"; "?AuthbuyerID, ?OtherCleanTime, ?Dwell, ?MediaType, ?MediaDescription, "+
"CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)";
FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID);
@ -1347,6 +1349,14 @@ namespace OpenSim.Data.MySQL
m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
} }
newData.MediaDescription = (string) row["MediaDescription"];
newData.MediaType = (string) row["MediaType"];
newData.MediaWidth = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[0]);
newData.MediaHeight = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[1]);
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
return newData; return newData;
@ -1651,6 +1661,14 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID); cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID);
cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime); cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime);
cmd.Parameters.AddWithValue("Dwell", land.Dwell); cmd.Parameters.AddWithValue("Dwell", land.Dwell);
cmd.Parameters.AddWithValue("MediaDescription", land.MediaDescription);
cmd.Parameters.AddWithValue("MediaType", land.MediaType);
cmd.Parameters.AddWithValue("MediaWidth", land.MediaWidth);
cmd.Parameters.AddWithValue("MediaHeight", land.MediaHeight);
cmd.Parameters.AddWithValue("MediaLoop", land.MediaLoop);
cmd.Parameters.AddWithValue("ObscureMusic", land.ObscureMusic);
cmd.Parameters.AddWithValue("ObscureMedia", land.ObscureMedia);
} }
/// <summary> /// <summary>

View File

@ -801,9 +801,19 @@ ALTER TABLE `regionwindlight` CHANGE COLUMN `cloud_scroll_x` `cloud_scroll_x` F
COMMIT; COMMIT;
:VERSION 35 #--------------------- :VERSION 35 #---------------------
-- Added post 0.7
BEGIN; BEGIN;
ALTER TABLE prims ADD COLUMN MediaURL varchar(255); ALTER TABLE prims ADD COLUMN MediaURL varchar(255);
ALTER TABLE primshapes ADD COLUMN Media TEXT; ALTER TABLE primshapes ADD COLUMN Media TEXT;
COMMIT; COMMIT;
:VERSION 36 #---------------------
BEGIN;
ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none' ;
ALTER TABLE `land` ADD COLUMN `MediaDescription` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0';
ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE;
COMMIT;

View File

@ -446,3 +446,13 @@ update land
where AuthbuyerID not like '%-%'; where AuthbuyerID not like '%-%';
COMMIT; COMMIT;
:VERSION 19
BEGIN ;
ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none' ;
ALTER TABLE `land` ADD COLUMN `MediaDescription` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0';
ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE;
COMMIT ;

View File

@ -1762,6 +1762,12 @@ namespace OpenSim.Data.SQLite
row["AuthbuyerID"] = land.AuthBuyerID.ToString(); row["AuthbuyerID"] = land.AuthBuyerID.ToString();
row["OtherCleanTime"] = land.OtherCleanTime; row["OtherCleanTime"] = land.OtherCleanTime;
row["Dwell"] = land.Dwell; row["Dwell"] = land.Dwell;
row["MediaType"] = land.MediaType;
row["MediaDescription"] = land.MediaDescription;
row["MediaSize"] = (string) land.MediaWidth + "," + (string) land.MediaHeight;
row["MediaLoop"] = land.MediaLoop.ToString();
row["ObscureMusic"] = land.ObscureMusic.ToString();
row["ObscureMedia"] = land.ObscureMedia.ToString();
} }
/// <summary> /// <summary>

View File

@ -90,6 +90,78 @@ namespace OpenSim.Framework
private Vector3 _userLookAt = new Vector3(); private Vector3 _userLookAt = new Vector3();
private int _dwell = 0; private int _dwell = 0;
private int _otherCleanTime = 0; private int _otherCleanTime = 0;
private string _mediaType = "none/none";
private string _mediaDescription = "";
private int _mediaHeight = 0;
private int _mediaWidth = 0;
private bool _mediaLoop = false;
private bool _obscureMusic = false;
private bool _obscureMedia = false;
/// <summary>
/// Whether to obscure parcel media URL
/// </summary>
[XmlIgnore]
public bool ObscureMedia {
get {
return _obscureMedia;
}
set {
_obscureMedia = value;
}
}
/// <summary>
/// Whether to obscure parcel music URL
/// </summary>
[XmlIgnore]
public bool ObscureMusic {
get {
return _obscureMusic;
}
set {
_obscureMusic = value;
}
}
/// <summary>
/// Whether to loop parcel media
/// </summary>
[XmlIgnore]
public bool MediaLoop {
get {
return _mediaLoop;
}
set {
_mediaLoop = value;
}
}
/// <summary>
/// Height of parcel media render
/// </summary>
[XmlIgnore]
public int MediaHeight {
get {
return _mediaHeight;
}
set {
_mediaHeight = value;
}
}
/// <summary>
/// Width of parcel media render
/// </summary>
[XmlIgnore]
public int MediaWidth {
get {
return _mediaWidth;
}
set {
_mediaWidth = value;
}
}
/// <summary> /// <summary>
/// Upper corner of the AABB for the parcel /// Upper corner of the AABB for the parcel
@ -358,20 +430,6 @@ namespace OpenSim.Framework
} }
} }
private int[] _mediaSize = new int[2];
public int[] MediaSize
{
get
{
return _mediaSize;
}
set
{
_mediaSize = value;
}
}
private string _mediaType = "";
public string MediaType public string MediaType
{ {
get get
@ -586,6 +644,17 @@ namespace OpenSim.Framework
} }
} }
/// <summary>
/// parcel media description
/// </summary>
public string MediaDescription {
get {
return _mediaDescription;
}
set {
_mediaDescription = value;
}
}
public LandData() public LandData()
{ {
@ -635,6 +704,13 @@ namespace OpenSim.Framework
landData._userLookAt = _userLookAt; landData._userLookAt = _userLookAt;
landData._otherCleanTime = _otherCleanTime; landData._otherCleanTime = _otherCleanTime;
landData._dwell = _dwell; landData._dwell = _dwell;
landData._mediaType = _mediaType;
landData._mediaDescription = _mediaDescription;
landData._mediaWidth = _mediaWidth;
landData._mediaHeight = _mediaHeight;
landData._mediaLoop = _mediaLoop;
landData._obscureMusic = _obscureMusic;
landData._obscureMedia = _obscureMedia;
landData._parcelAccessList.Clear(); landData._parcelAccessList.Clear();
foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList) foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)

View File

@ -49,5 +49,12 @@ namespace OpenSim.Framework
public UUID SnapshotID; public UUID SnapshotID;
public Vector3 UserLocation; public Vector3 UserLocation;
public Vector3 UserLookAt; public Vector3 UserLookAt;
public string MediaType;
public string MediaDescription;
public int MediaHeight;
public int MediaWidth;
public bool MediaLoop;
public bool ObscureMusic;
public bool ObscureMedia;
} }
} }

View File

@ -37,6 +37,7 @@ using System.Xml;
using log4net; using log4net;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenMetaverse.Messages.Linden;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Client; using OpenSim.Framework.Client;
@ -4199,94 +4200,101 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags)
{ {
ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ParcelProperties); ParcelPropertiesMessage updateMessage = new ParcelPropertiesMessage();
// TODO: don't create new blocks if recycling an old packet
updatePacket.ParcelData.AABBMax = landData.AABBMax; updateMessage.AABBMax = landData.AABBMax;
updatePacket.ParcelData.AABBMin = landData.AABBMin; updateMessage.AABBMin = landData.AABBMin;
updatePacket.ParcelData.Area = landData.Area; updateMessage.Area = landData.Area;
updatePacket.ParcelData.AuctionID = landData.AuctionID; updateMessage.AuctionID = landData.AuctionID;
updatePacket.ParcelData.AuthBuyerID = landData.AuthBuyerID; updateMessage.AuthBuyerID = landData.AuthBuyerID;
updatePacket.ParcelData.Bitmap = landData.Bitmap; updateMessage.Bitmap = landData.Bitmap;
updatePacket.ParcelData.Desc = Utils.StringToBytes(landData.Description); updateMessage.Desc = landData.Description;
updatePacket.ParcelData.Category = (byte)landData.Category; updateMessage.Category = landData.Category;
updatePacket.ParcelData.ClaimDate = landData.ClaimDate; updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate);
updatePacket.ParcelData.ClaimPrice = landData.ClaimPrice; updateMessage.ClaimPrice = landData.ClaimPrice;
updatePacket.ParcelData.GroupID = landData.GroupID; updateMessage.GroupID = landData.GroupID;
updatePacket.ParcelData.GroupPrims = landData.GroupPrims; updateMessage.GroupPrims = landData.GroupPrims;
updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned; updateMessage.IsGroupOwned = landData.IsGroupOwned;
updatePacket.ParcelData.LandingType = landData.LandingType; updateMessage.LandingType = (LandingType) landData.LandingType;
updatePacket.ParcelData.LocalID = landData.LocalID; updateMessage.LocalID = landData.LocalID;
if (landData.Area > 0) if (landData.Area > 0)
{ {
updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; updateMessage.MaxPrims = parcelObjectCapacity;
} }
else else
{ {
updatePacket.ParcelData.MaxPrims = 0; updateMessage.MaxPrims = 0;
} }
updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; updateMessage.MediaAutoScale = Convert.ToBoolean(landData.MediaAutoScale);
updatePacket.ParcelData.MediaID = landData.MediaID; updateMessage.MediaID = landData.MediaID;
updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL); updateMessage.MediaURL = landData.MediaURL;
updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL); updateMessage.MusicURL = landData.MusicURL;
updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name); updateMessage.Name = landData.Name;
updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; updateMessage.OtherCleanTime = landData.OtherCleanTime;
updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented updateMessage.OtherCount = 0; //TODO: Unimplemented
updatePacket.ParcelData.OtherPrims = landData.OtherPrims; updateMessage.OtherPrims = landData.OtherPrims;
updatePacket.ParcelData.OwnerID = landData.OwnerID; updateMessage.OwnerID = landData.OwnerID;
updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; updateMessage.OwnerPrims = landData.OwnerPrims;
updatePacket.ParcelData.ParcelFlags = landData.Flags; updateMessage.ParcelFlags = (ParcelFlags) landData.Flags;
updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; updateMessage.ParcelPrimBonus = simObjectBonusFactor;
updatePacket.ParcelData.PassHours = landData.PassHours; updateMessage.PassHours = landData.PassHours;
updatePacket.ParcelData.PassPrice = landData.PassPrice; updateMessage.PassPrice = landData.PassPrice;
updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented updateMessage.PublicCount = 0; //TODO: Unimplemented
updateMessage.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0;
updateMessage.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0;
updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; //updateMessage.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0;
updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; //updateMessage.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0;
updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0;
updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0;
updatePacket.ParcelData.RentPrice = 0; updateMessage.RentPrice = 0;
updatePacket.ParcelData.RequestResult = request_result; updateMessage.RequestResult = (ParcelResult) request_result;
updatePacket.ParcelData.SalePrice = landData.SalePrice; updateMessage.SalePrice = landData.SalePrice;
updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; updateMessage.SelectedPrims = landData.SelectedPrims;
updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented updateMessage.SelfCount = 0; //TODO: Unimplemented
updatePacket.ParcelData.SequenceID = sequence_id; updateMessage.SequenceID = sequence_id;
if (landData.SimwideArea > 0) if (landData.SimwideArea > 0)
{ {
updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity; updateMessage.SimWideMaxPrims = parcelObjectCapacity;
} }
else else
{ {
updatePacket.ParcelData.SimWideMaxPrims = 0; updateMessage.SimWideMaxPrims = 0;
} }
updatePacket.ParcelData.SimWideTotalPrims = landData.SimwidePrims; updateMessage.SimWideTotalPrims = landData.SimwidePrims;
updatePacket.ParcelData.SnapSelection = snap_selection; updateMessage.SnapSelection = snap_selection;
updatePacket.ParcelData.SnapshotID = landData.SnapshotID; updateMessage.SnapshotID = landData.SnapshotID;
updatePacket.ParcelData.Status = (byte)landData.Status; updateMessage.Status = (ParcelStatus) landData.Status;
updatePacket.ParcelData.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + updateMessage.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims +
landData.SelectedPrims; landData.SelectedPrims;
updatePacket.ParcelData.UserLocation = landData.UserLocation; updateMessage.UserLocation = landData.UserLocation;
updatePacket.ParcelData.UserLookAt = landData.UserLookAt; updateMessage.UserLookAt = landData.UserLookAt;
updatePacket.Header.Zerocoded = true;
updateMessage.MediaType = landData.MediaType;
updateMessage.MediaDesc = landData.MediaDescription;
updateMessage.MediaWidth = landData.MediaWidth;
updateMessage.MediaHeight = landData.MediaHeight;
updateMessage.MediaLoop = landData.MediaLoop;
updateMessage.ObscureMusic = landData.ObscureMusic;
updateMessage.ObscureMedia = landData.ObscureMedia;
try try
{ {
IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>();
if (eq != null) if (eq != null)
{ {
eq.ParcelProperties(updatePacket, this.AgentId); eq.ParcelProperties(updateMessage, this.AgentId);
} } else {
m_log.Warn("No EQ Interface when sending parcel data.");
}
} }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString());
m_log.Warn("sending parcel data via UDP");
OutPacket(updatePacket, ThrottleOutPacketType.Task);
} }
} }

View File

@ -34,6 +34,7 @@ using System.Threading;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Messages.Linden;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework; using OpenSim.Framework;
@ -137,10 +138,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
{ {
if (!queues.ContainsKey(agentId)) if (!queues.ContainsKey(agentId))
{ {
/*
m_log.DebugFormat( m_log.DebugFormat(
"[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}",
agentId, m_scene.RegionInfo.RegionName); agentId, m_scene.RegionInfo.RegionName);
*/
queues[agentId] = new Queue<OSD>(); queues[agentId] = new Queue<OSD>();
} }
@ -200,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
private void ClientClosed(UUID AgentID, Scene scene) private void ClientClosed(UUID AgentID, Scene scene)
{ {
m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName);
int count = 0; int count = 0;
while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5) while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5)
@ -284,7 +286,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
// Reuse open queues. The client does! // Reuse open queues. The client does!
if (m_AvatarQueueUUIDMapping.ContainsKey(agentID)) if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
{ {
m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); //m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
} }
else else
@ -365,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
{ {
// Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
array.Add(EventQueueHelper.KeepAliveEvent()); array.Add(EventQueueHelper.KeepAliveEvent());
m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName); //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName);
} }
else else
{ {
@ -394,8 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
responsedata["keepalive"] = false; responsedata["keepalive"] = false;
responsedata["reusecontext"] = false; responsedata["reusecontext"] = false;
responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
//m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
return responsedata; return responsedata;
//m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
} }
public Hashtable NoEvents(UUID requestID, UUID agentID) public Hashtable NoEvents(UUID requestID, UUID agentID)
@ -461,7 +463,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
{ {
// Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say!
array.Add(EventQueueHelper.KeepAliveEvent()); array.Add(EventQueueHelper.KeepAliveEvent());
m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
} }
else else
{ {
@ -697,9 +699,9 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
//m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item);
} }
public void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID) public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID)
{ {
OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesPacket); OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage);
Enqueue(item, avatarID); Enqueue(item, avatarID);
} }

View File

@ -30,6 +30,7 @@ using System.Net;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenMetaverse.Messages.Linden;
namespace OpenSim.Region.CoreModules.Framework.EventQueue namespace OpenSim.Region.CoreModules.Framework.EventQueue
{ {
@ -309,116 +310,6 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
return chatterBoxSessionAgentListUpdates; return chatterBoxSessionAgentListUpdates;
} }
public static OSD ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket)
{
OSDMap parcelProperties = new OSDMap();
OSDMap body = new OSDMap();
OSDArray ageVerificationBlock = new OSDArray();
OSDMap ageVerificationMap = new OSDMap();
ageVerificationMap.Add("RegionDenyAgeUnverified",
OSD.FromBoolean(parcelPropertiesPacket.AgeVerificationBlock.RegionDenyAgeUnverified));
ageVerificationBlock.Add(ageVerificationMap);
body.Add("AgeVerificationBlock", ageVerificationBlock);
// LL sims send media info in this event queue message but it's not in the UDP
// packet we construct this event queue message from. This should be refactored in
// other areas of the code so it can all be send in the same message. Until then we will
// still send the media info via UDP
//OSDArray mediaData = new OSDArray();
//OSDMap mediaDataMap = new OSDMap();
//mediaDataMap.Add("MediaDesc", OSD.FromString(""));
//mediaDataMap.Add("MediaHeight", OSD.FromInteger(0));
//mediaDataMap.Add("MediaLoop", OSD.FromInteger(0));
//mediaDataMap.Add("MediaType", OSD.FromString("type/type"));
//mediaDataMap.Add("MediaWidth", OSD.FromInteger(0));
//mediaDataMap.Add("ObscureMedia", OSD.FromInteger(0));
//mediaDataMap.Add("ObscureMusic", OSD.FromInteger(0));
//mediaData.Add(mediaDataMap);
//body.Add("MediaData", mediaData);
OSDArray parcelData = new OSDArray();
OSDMap parcelDataMap = new OSDMap();
OSDArray AABBMax = new OSDArray(3);
AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.X));
AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Y));
AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Z));
parcelDataMap.Add("AABBMax", AABBMax);
OSDArray AABBMin = new OSDArray(3);
AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.X));
AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Y));
AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Z));
parcelDataMap.Add("AABBMin", AABBMin);
parcelDataMap.Add("Area", OSD.FromInteger(parcelPropertiesPacket.ParcelData.Area));
parcelDataMap.Add("AuctionID", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.AuctionID)));
parcelDataMap.Add("AuthBuyerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.AuthBuyerID));
parcelDataMap.Add("Bitmap", OSD.FromBinary(parcelPropertiesPacket.ParcelData.Bitmap));
parcelDataMap.Add("Category", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Category));
parcelDataMap.Add("ClaimDate", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimDate));
parcelDataMap.Add("ClaimPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimPrice));
parcelDataMap.Add("Desc", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc)));
parcelDataMap.Add("GroupID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.GroupID));
parcelDataMap.Add("GroupPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.GroupPrims));
parcelDataMap.Add("IsGroupOwned", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.IsGroupOwned));
parcelDataMap.Add("LandingType", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LandingType));
parcelDataMap.Add("LocalID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LocalID));
parcelDataMap.Add("MaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.MaxPrims));
parcelDataMap.Add("MediaAutoScale", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.MediaAutoScale));
parcelDataMap.Add("MediaID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.MediaID));
parcelDataMap.Add("MediaURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL)));
parcelDataMap.Add("MusicURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL)));
parcelDataMap.Add("Name", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name)));
parcelDataMap.Add("OtherCleanTime", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCleanTime));
parcelDataMap.Add("OtherCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCount));
parcelDataMap.Add("OtherPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherPrims));
parcelDataMap.Add("OwnerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.OwnerID));
parcelDataMap.Add("OwnerPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OwnerPrims));
parcelDataMap.Add("ParcelFlags", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.ParcelFlags)));
parcelDataMap.Add("ParcelPrimBonus", OSD.FromReal(parcelPropertiesPacket.ParcelData.ParcelPrimBonus));
parcelDataMap.Add("PassHours", OSD.FromReal(parcelPropertiesPacket.ParcelData.PassHours));
parcelDataMap.Add("PassPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PassPrice));
parcelDataMap.Add("PublicCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PublicCount));
parcelDataMap.Add("RegionDenyAnonymous", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyAnonymous));
parcelDataMap.Add("RegionDenyIdentified", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyIdentified));
parcelDataMap.Add("RegionDenyTransacted", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyTransacted));
parcelDataMap.Add("RegionPushOverride", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionPushOverride));
parcelDataMap.Add("RentPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RentPrice));
parcelDataMap.Add("RequestResult", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RequestResult));
parcelDataMap.Add("SalePrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SalePrice));
parcelDataMap.Add("SelectedPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelectedPrims));
parcelDataMap.Add("SelfCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelfCount));
parcelDataMap.Add("SequenceID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SequenceID));
parcelDataMap.Add("SimWideMaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideMaxPrims));
parcelDataMap.Add("SimWideTotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideTotalPrims));
parcelDataMap.Add("SnapSelection", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.SnapSelection));
parcelDataMap.Add("SnapshotID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.SnapshotID));
parcelDataMap.Add("Status", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Status));
parcelDataMap.Add("TotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.TotalPrims));
OSDArray UserLocation = new OSDArray(3);
UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.X));
UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Y));
UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Z));
parcelDataMap.Add("UserLocation", UserLocation);
OSDArray UserLookAt = new OSDArray(3);
UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.X));
UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Y));
UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Z));
parcelDataMap.Add("UserLookAt", UserLookAt);
parcelData.Add(parcelDataMap);
body.Add("ParcelData", parcelData);
parcelProperties.Add("body", body);
parcelProperties.Add("message", OSD.FromString("ParcelProperties"));
return parcelProperties;
}
public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket)
{ {
OSDMap groupUpdate = new OSDMap(); OSDMap groupUpdate = new OSDMap();
@ -495,5 +386,14 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
return placesReply; return placesReply;
} }
public static OSD ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage)
{
OSDMap message = new OSDMap();
message.Add("message", OSD.FromString("ParcelProperties"));
OSD message_body = parcelPropertiesMessage.Serialize();
message.Add("body", message_body);
return message;
}
} }
} }

View File

@ -33,6 +33,8 @@ using System.Reflection;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenMetaverse.Messages.Linden;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Capabilities; using OpenSim.Framework.Capabilities;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
@ -1066,7 +1068,6 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
for (int y = 0; y < inc_y; y++) for (int y = 0; y < inc_y; y++)
{ {
ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); ILandObject currentParcel = GetLandObject(start_x + x, start_y + y);
if (currentParcel != null) if (currentParcel != null)
@ -1353,8 +1354,68 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
return RemoteParcelRequest(request, path, param, agentID, caps); return RemoteParcelRequest(request, path, param, agentID, caps);
})); }));
UUID parcelCapID = UUID.Random();
caps.RegisterHandler("ParcelPropertiesUpdate",
new RestStreamHandler("POST", "/CAPS/" + parcelCapID,
delegate(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
return ProcessPropertiesUpdate(request, path, param, agentID, caps);
}));
} }
private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps)
{
IClientAPI client;
if ( ! m_scene.TryGetClient(agentID, out client) ) {
m_log.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString() );
return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
}
ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage();
OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request);
properties.Deserialize(args);
LandUpdateArgs land_update = new LandUpdateArgs();
int parcelID = properties.LocalID;
land_update.AuthBuyerID = properties.AuthBuyerID;
land_update.Category = properties.Category;
land_update.Desc = properties.Desc;
land_update.GroupID = properties.GroupID;
land_update.LandingType = (byte) properties.Landing;
land_update.MediaAutoScale = (byte) Convert.ToInt32(properties.MediaAutoScale);
land_update.MediaID = properties.MediaID;
land_update.MediaURL = properties.MediaURL;
land_update.MusicURL = properties.MusicURL;
land_update.Name = properties.Name;
land_update.ParcelFlags = (uint) properties.ParcelFlags;
land_update.PassHours = (int) properties.PassHours;
land_update.PassPrice = (int) properties.PassPrice;
land_update.SalePrice = (int) properties.SalePrice;
land_update.SnapshotID = properties.SnapshotID;
land_update.UserLocation = properties.UserLocation;
land_update.UserLookAt = properties.UserLookAt;
land_update.MediaDescription = properties.MediaDesc;
land_update.MediaType = properties.MediaType;
land_update.MediaWidth = properties.MediaWidth;
land_update.MediaHeight = properties.MediaHeight;
land_update.MediaLoop = properties.MediaLoop;
land_update.ObscureMusic = properties.ObscureMusic;
land_update.ObscureMedia = properties.ObscureMedia;
ILandObject land;
lock (m_landList)
{
m_landList.TryGetValue(parcelID, out land);
}
if (land != null) {
land.UpdateLandProperties(land_update, client);
} else {
m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID);
}
return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty());
}
// we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the
// "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to.
// So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x

View File

@ -229,6 +229,13 @@ namespace OpenSim.Region.CoreModules.World.Land
newData.SnapshotID = args.SnapshotID; newData.SnapshotID = args.SnapshotID;
newData.UserLocation = args.UserLocation; newData.UserLocation = args.UserLocation;
newData.UserLookAt = args.UserLookAt; newData.UserLookAt = args.UserLookAt;
newData.MediaType = args.MediaType;
newData.MediaDescription = args.MediaDescription;
newData.MediaWidth = args.MediaWidth;
newData.MediaHeight = args.MediaHeight;
newData.MediaLoop = args.MediaLoop;
newData.ObscureMusic = args.ObscureMusic;
newData.ObscureMedia = args.ObscureMedia;
m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData);

View File

@ -28,6 +28,7 @@
using System.Net; using System.Net;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenMetaverse.Messages.Linden;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
namespace OpenSim.Region.Framework.Interfaces namespace OpenSim.Region.Framework.Interfaces
@ -54,7 +55,7 @@ namespace OpenSim.Region.Framework.Interfaces
uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket);
void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat,
bool isModerator, bool textMute); bool isModerator, bool textMute);
void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID); void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID);
void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID);
} }
} }

View File

@ -9137,8 +9137,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// we send to all // we send to all
landData.MediaID = new UUID(texture); landData.MediaID = new UUID(texture);
landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0;
landData.MediaSize[0] = width; landData.MediaWidth = width;
landData.MediaSize[1] = height; landData.MediaHeight = height;
landData.MediaType = mediaType; landData.MediaType = mediaType;
// do that one last, it will cause a ParcelPropertiesUpdate // do that one last, it will cause a ParcelPropertiesUpdate
@ -9224,8 +9224,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType)); list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType));
break; break;
case ParcelMediaCommandEnum.Size: case ParcelMediaCommandEnum.Size:
list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0])); list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaWidth));
list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1])); list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaHeight));
break; break;
default: default:
ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url;