Committing diva's LandSnapshot update patch. Also included is a small

fix for the LandManagementModule. I changed LandSnapshot to use
CachedUserInfo to take a load off the user server. Also, missing owner
profiles are legit, warning removed.
0.6.0-stable
Melanie Thielker 2008-10-10 20:23:49 +00:00
parent 0644977819
commit 85ae8e3e94
2 changed files with 125 additions and 121 deletions

View File

@ -37,6 +37,7 @@ using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Modules.World.Land; using OpenSim.Region.Environment.Modules.World.Land;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenSim.Framework.Communications.Cache;
namespace OpenSim.Region.DataSnapshot.Providers namespace OpenSim.Region.DataSnapshot.Providers
{ {
@ -136,8 +137,8 @@ namespace OpenSim.Region.DataSnapshot.Providers
LandObject land = (LandObject)parcel_interface; LandObject land = (LandObject)parcel_interface;
LandData parcel = land.landData; LandData parcel = land.landData;
// if ((parcel.Flags & (uint)Parcel.ParcelFlags.ShowDirectory) == (uint)Parcel.ParcelFlags.ShowDirectory) // if ((parcel.Flags & (uint)Parcel.ParcelFlags.ShowDirectory) == (uint)Parcel.ParcelFlags.ShowDirectory)
// { // {
//TODO: make better method of marshalling data from LandData to XmlNode //TODO: make better method of marshalling data from LandData to XmlNode
XmlNode xmlparcel = nodeFactory.CreateNode(XmlNodeType.Element, "parcel", ""); XmlNode xmlparcel = nodeFactory.CreateNode(XmlNodeType.Element, "parcel", "");
@ -162,6 +163,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
directory_attr.Value = GetShowInSearch(parcel); directory_attr.Value = GetShowInSearch(parcel);
//XmlAttribute entities_attr = nodeFactory.CreateAttribute("entities"); //XmlAttribute entities_attr = nodeFactory.CreateAttribute("entities");
//entities_attr.Value = land.primsOverMe.Count.ToString(); //entities_attr.Value = land.primsOverMe.Count.ToString();
xmlparcel.Attributes.Append(directory_attr);
xmlparcel.Attributes.Append(scripts_attr); xmlparcel.Attributes.Append(scripts_attr);
xmlparcel.Attributes.Append(build_attr); xmlparcel.Attributes.Append(build_attr);
xmlparcel.Attributes.Append(public_attr); xmlparcel.Attributes.Append(public_attr);
@ -244,13 +246,13 @@ namespace OpenSim.Region.DataSnapshot.Providers
try try
{ {
XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", ""); XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", "");
UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(userOwnerUUID); CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userOwnerUUID);
username.InnerText = userProfile.FirstName + " " + userProfile.SurName; username.InnerText = profile.UserProfile.FirstName + " " + profile.UserProfile.SurName;
userblock.AppendChild(username); userblock.AppendChild(username);
} }
catch (Exception) catch (Exception)
{ {
m_log.Info("[DATASNAPSHOT]: Cannot find owner name; ignoring this parcel"); //m_log.Info("[DATASNAPSHOT]: Cannot find owner name; ignoring this parcel");
} }
xmlparcel.AppendChild(userblock); xmlparcel.AppendChild(userblock);
@ -263,7 +265,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
//} //}
parent.AppendChild(xmlparcel); parent.AppendChild(xmlparcel);
// } // }
} }
//snap.AppendChild(parent); //snap.AppendChild(parent);
} }
@ -327,7 +329,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
private string CheckForSale(LandData parcel) private string CheckForSale(LandData parcel)
{ {
if (parcel.SalePrice > 0) if ((parcel.Flags & (uint)Parcel.ParcelFlags.ForSale) == (uint)Parcel.ParcelFlags.ForSale)
return "true"; return "true";
else else
return "false"; return "false";
@ -349,13 +351,13 @@ namespace OpenSim.Region.DataSnapshot.Providers
public void OnNewClient(IClientAPI client) public void OnNewClient(IClientAPI client)
{ {
//Land hooks //Land hooks
client.OnParcelDivideRequest += delegate (int west, int south, int east, int north, client.OnParcelDivideRequest += delegate(int west, int south, int east, int north,
IClientAPI remote_client) { this.Stale = true; }; IClientAPI remote_client) { this.Stale = true; };
client.OnParcelJoinRequest += delegate (int west, int south, int east, int north, client.OnParcelJoinRequest += delegate(int west, int south, int east, int north,
IClientAPI remote_client) { this.Stale = true; }; IClientAPI remote_client) { this.Stale = true; };
client.OnParcelPropertiesUpdateRequest += delegate(LandUpdateArgs args, int local_id, client.OnParcelPropertiesUpdateRequest += delegate(LandUpdateArgs args, int local_id,
IClientAPI remote_client) { this.Stale = true; }; IClientAPI remote_client) { this.Stale = true; };
client.OnParcelBuy += delegate (UUID agentId, UUID groupId, bool final, bool groupOwned, client.OnParcelBuy += delegate(UUID agentId, UUID groupId, bool final, bool groupOwned,
bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated) bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated)
{ this.Stale = true; }; { this.Stale = true; };
} }
@ -409,3 +411,4 @@ namespace OpenSim.Region.DataSnapshot.Providers
} }
} }
} }

View File

@ -144,6 +144,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
{ {
if (landList.ContainsKey(local_id)) if (landList.ContainsKey(local_id))
{ {
newData.LocalID = local_id;
landList[local_id].landData = newData.Copy(); landList[local_id].landData = newData.Copy();
m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, landList[local_id]); m_scene.EventManager.TriggerLandObjectUpdated((uint)local_id, landList[local_id]);
} }