*Renamed everything Parcels and ParcelData to Land and LandData

*Added missing files (I hope)
afrisby
mingchen 2007-07-16 19:40:25 +00:00
parent 7fabf9612a
commit 2873b82b78
16 changed files with 274 additions and 873 deletions

View File

@ -71,7 +71,7 @@ namespace OpenSim.Framework.Interfaces
public delegate void ParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client); public delegate void ParcelDivideRequest(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 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(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client);
public delegate void ParcelSelectObjects(int parcel_local_id, int request_type, IClientAPI remote_client); public delegate void ParcelSelectObjects(int land_local_id, int request_type, IClientAPI remote_client);
public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client); public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client);
public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client); public delegate void EstateOwnerMessageRequest(EstateOwnerMessagePacket packet, IClientAPI remote_client);

View File

@ -48,11 +48,11 @@ namespace OpenSim.Framework.Interfaces
[System.Obsolete("Use DataStorage instead")] [System.Obsolete("Use DataStorage instead")]
void SaveMap(float[] heightmap); void SaveMap(float[] heightmap);
void SaveParcels(ParcelData[] parcels); void SaveLandObjects(LandData[] lands);
void SaveParcel(ParcelData parcel); void SaveLandObject(LandData land);
void RemoveParcel(ParcelData parcel); void RemoveLandObject(LandData land);
void RemoveAllParcels(); void RemoveAllLandObjects();
void LoadParcels(ILocalStorageParcelReceiver recv); void LoadLandObjects(ILocalStorageLandObjectReceiver recv);
void ShutDown(); void ShutDown();
} }
@ -62,10 +62,10 @@ namespace OpenSim.Framework.Interfaces
void PrimFromStorage(PrimData prim); void PrimFromStorage(PrimData prim);
} }
public interface ILocalStorageParcelReceiver public interface ILocalStorageLandObjectReceiver
{ {
void ParcelFromStorage(ParcelData data); void LandFromStorage(LandData data);
void NoParcelDataFromStorage(); void NoLandDataFromStorage();
} }
} }

View File

@ -1,120 +1,120 @@
/* /*
* Copyright (c) Contributors, http://www.openmetaverse.org/ * Copyright (c) Contributors, http://www.openmetaverse.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the * * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
using libsecondlife; using libsecondlife;
namespace OpenSim.Framework.Types namespace OpenSim.Framework.Types
{ {
public class ParcelData public class LandData
{ {
public byte[] parcelBitmapByteArray = new byte[512]; public byte[] landBitmapByteArray = new byte[512];
public string parcelName = "Your Parcel"; public string landName = "Your Parcel";
public string parcelDesc = ""; public string landDesc = "";
public LLUUID ownerID = new LLUUID(); public LLUUID ownerID = new LLUUID();
public bool isGroupOwned = false; public bool isGroupOwned = false;
public LLVector3 AABBMin = new LLVector3(); public LLVector3 AABBMin = new LLVector3();
public LLVector3 AABBMax = new LLVector3(); public LLVector3 AABBMax = new LLVector3();
public int area = 0; public int area = 0;
public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned
public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID
public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category
public int claimDate = 0; //Unemplemented public int claimDate = 0; //Unemplemented
public int claimPrice = 0; //Unemplemented public int claimPrice = 0; //Unemplemented
public LLUUID groupID = new LLUUID(); //Unemplemented public LLUUID groupID = new LLUUID(); //Unemplemented
public int groupPrims = 0; public int groupPrims = 0;
public int otherPrims = 0; public int otherPrims = 0;
public int ownerPrims = 0; public int ownerPrims = 0;
public int selectedPrims = 0; public int selectedPrims = 0;
public int simwidePrims = 0; public int simwidePrims = 0;
public int simwideArea = 0; public int simwideArea = 0;
public int salePrice = 0; //Unemeplemented. Parcels price. public int salePrice = 0; //Unemeplemented. Parcels price.
public Parcel.ParcelStatus parcelStatus = Parcel.ParcelStatus.Leased; public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased;
public uint parcelFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts; public uint landFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts;
public byte landingType = 0; public byte landingType = 0;
public byte mediaAutoScale = 0; public byte mediaAutoScale = 0;
public LLUUID mediaID = LLUUID.Zero; public LLUUID mediaID = LLUUID.Zero;
public int localID = 0; public int localID = 0;
public LLUUID globalID = new LLUUID(); public LLUUID globalID = new LLUUID();
public string mediaURL = ""; public string mediaURL = "";
public string musicURL = ""; public string musicURL = "";
public float passHours = 0; public float passHours = 0;
public int passPrice = 0; public int passPrice = 0;
public LLUUID snapshotID = LLUUID.Zero; public LLUUID snapshotID = LLUUID.Zero;
public LLVector3 userLocation = new LLVector3(); public LLVector3 userLocation = new LLVector3();
public LLVector3 userLookAt = new LLVector3(); public LLVector3 userLookAt = new LLVector3();
public ParcelData() public LandData()
{ {
globalID = LLUUID.Random(); globalID = LLUUID.Random();
} }
public ParcelData Copy() public LandData Copy()
{ {
ParcelData parcelData = new ParcelData(); LandData landData = new LandData();
parcelData.AABBMax = this.AABBMax; landData.AABBMax = this.AABBMax;
parcelData.AABBMin = this.AABBMin; landData.AABBMin = this.AABBMin;
parcelData.area = this.area; landData.area = this.area;
parcelData.auctionID = this.auctionID; landData.auctionID = this.auctionID;
parcelData.authBuyerID = this.authBuyerID; landData.authBuyerID = this.authBuyerID;
parcelData.category = this.category; landData.category = this.category;
parcelData.claimDate = this.claimDate; landData.claimDate = this.claimDate;
parcelData.claimPrice = this.claimPrice; landData.claimPrice = this.claimPrice;
parcelData.globalID = this.globalID; landData.globalID = this.globalID;
parcelData.groupID = this.groupID; landData.groupID = this.groupID;
parcelData.groupPrims = this.groupPrims; landData.groupPrims = this.groupPrims;
parcelData.otherPrims = this.otherPrims; landData.otherPrims = this.otherPrims;
parcelData.ownerPrims = this.ownerPrims; landData.ownerPrims = this.ownerPrims;
parcelData.selectedPrims = this.selectedPrims; landData.selectedPrims = this.selectedPrims;
parcelData.isGroupOwned = this.isGroupOwned; landData.isGroupOwned = this.isGroupOwned;
parcelData.localID = this.localID; landData.localID = this.localID;
parcelData.landingType = this.landingType; landData.landingType = this.landingType;
parcelData.mediaAutoScale = this.mediaAutoScale; landData.mediaAutoScale = this.mediaAutoScale;
parcelData.mediaID = this.mediaID; landData.mediaID = this.mediaID;
parcelData.mediaURL = this.mediaURL; landData.mediaURL = this.mediaURL;
parcelData.musicURL = this.musicURL; landData.musicURL = this.musicURL;
parcelData.ownerID = this.ownerID; landData.ownerID = this.ownerID;
parcelData.parcelBitmapByteArray = (byte[])this.parcelBitmapByteArray.Clone(); landData.landBitmapByteArray = (byte[])this.landBitmapByteArray.Clone();
parcelData.parcelDesc = this.parcelDesc; landData.landDesc = this.landDesc;
parcelData.parcelFlags = this.parcelFlags; landData.landFlags = this.landFlags;
parcelData.parcelName = this.parcelName; landData.landName = this.landName;
parcelData.parcelStatus = this.parcelStatus; landData.landStatus = this.landStatus;
parcelData.passHours = this.passHours; landData.passHours = this.passHours;
parcelData.passPrice = this.passPrice; landData.passPrice = this.passPrice;
parcelData.salePrice = this.salePrice; landData.salePrice = this.salePrice;
parcelData.snapshotID = this.snapshotID; landData.snapshotID = this.snapshotID;
parcelData.userLocation = this.userLocation; landData.userLocation = this.userLocation;
parcelData.userLookAt = this.userLookAt; landData.userLookAt = this.userLookAt;
return parcelData; return landData;
} }
} }
} }

View File

@ -240,13 +240,13 @@ namespace OpenSim
{ {
m_log.Notice("Parcels - Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]"); m_log.Notice("Parcels - Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]");
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
scene.localStorage.LoadParcels((ILocalStorageParcelReceiver)scene.LandManager); scene.localStorage.LoadLandObjects((ILocalStorageLandObjectReceiver)scene.LandManager);
} }
else else
{ {
m_log.Notice("Parcels - No master avatar found, using null."); m_log.Notice("Parcels - No master avatar found, using null.");
scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero; scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero;
scene.localStorage.LoadParcels((ILocalStorageParcelReceiver)scene.LandManager); scene.localStorage.LoadLandObjects((ILocalStorageLandObjectReceiver)scene.LandManager);
} }
scene.performParcelPrimCountUpdate(); scene.performParcelPrimCountUpdate();
scene.StartTimer(); scene.StartTimer();

View File

@ -583,17 +583,17 @@ namespace OpenSim.Region.ClientStack
} }
break; break;
case PacketType.ParcelDivide: case PacketType.ParcelDivide:
ParcelDividePacket parcelDivide = (ParcelDividePacket)Pack; ParcelDividePacket landDivide = (ParcelDividePacket)Pack;
if (OnParcelDivideRequest != null) if (OnParcelDivideRequest != null)
{ {
OnParcelDivideRequest((int)Math.Round(parcelDivide.ParcelData.West), (int)Math.Round(parcelDivide.ParcelData.South), (int)Math.Round(parcelDivide.ParcelData.East), (int)Math.Round(parcelDivide.ParcelData.North), this); OnParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), (int)Math.Round(landDivide.ParcelData.South), (int)Math.Round(landDivide.ParcelData.East), (int)Math.Round(landDivide.ParcelData.North), this);
} }
break; break;
case PacketType.ParcelJoin: case PacketType.ParcelJoin:
ParcelJoinPacket parcelJoin = (ParcelJoinPacket)Pack; ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack;
if (OnParcelJoinRequest != null) if (OnParcelJoinRequest != null)
{ {
OnParcelJoinRequest((int)Math.Round(parcelJoin.ParcelData.West), (int)Math.Round(parcelJoin.ParcelData.South), (int)Math.Round(parcelJoin.ParcelData.East), (int)Math.Round(parcelJoin.ParcelData.North), this); OnParcelJoinRequest((int)Math.Round(landJoin.ParcelData.West), (int)Math.Round(landJoin.ParcelData.South), (int)Math.Round(landJoin.ParcelData.East), (int)Math.Round(landJoin.ParcelData.North), this);
} }
break; break;
case PacketType.ParcelPropertiesUpdate: case PacketType.ParcelPropertiesUpdate:

View File

@ -32,7 +32,7 @@ using OpenSim.Framework.Types;
using OpenSim.Region; using OpenSim.Region;
using OpenSim.Region.Environment; using OpenSim.Region.Environment;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Environment.Parcels; using OpenSim.Region.Environment.LandManagement;
using System.Collections.Generic; using System.Collections.Generic;
@ -55,9 +55,9 @@ namespace OpenSim.Region.Interfaces
void StoreTerrain(double[,] terrain); void StoreTerrain(double[,] terrain);
double[,] LoadTerrain(); double[,] LoadTerrain();
void StoreParcel(Environment.Parcels.Parcel Parcel); void StoreParcel(Land Parcel);
void RemoveParcel(uint ID); void RemoveLandObject(uint ID);
List<Environment.Parcels.Parcel> LoadParcels(); List<Land> LoadLandObjects();
void Shutdown(); void Shutdown();
} }

View File

@ -1,599 +0,0 @@
using System;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Parcels
{
#region Parcel Class
/// <summary>
/// Keeps track of a specific parcel's information
/// </summary>
public class Parcel
{
#region Member Variables
public ParcelData parcelData = new ParcelData();
public List<SceneObject> primsOverMe = new List<SceneObject>();
public Scene m_world;
private bool[,] parcelBitmap = new bool[64, 64];
#endregion
#region Constructors
public Parcel(LLUUID owner_id, bool is_group_owned, Scene world)
{
m_world = world;
parcelData.ownerID = owner_id;
parcelData.isGroupOwned = is_group_owned;
}
#endregion
#region Member Functions
#region General Functions
/// <summary>
/// Checks to see if this parcel contains a point
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns>Returns true if the parcel contains the specified point</returns>
public bool containsPoint(int x, int y)
{
if (x >= 0 && y >= 0 && x <= 256 && x <= 256)
{
return (parcelBitmap[x / 4, y / 4] == true);
}
else
{
return false;
}
}
public Parcel Copy()
{
Parcel newParcel = new Parcel(this.parcelData.ownerID, this.parcelData.isGroupOwned, m_world);
//Place all new variables here!
newParcel.parcelBitmap = (bool[,])(this.parcelBitmap.Clone());
newParcel.parcelData = parcelData.Copy();
return newParcel;
}
#endregion
#region Packet Request Handling
/// <summary>
/// Sends parcel 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 sendParcelProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
{
ParcelPropertiesPacket updatePacket = new ParcelPropertiesPacket();
updatePacket.ParcelData.AABBMax = parcelData.AABBMax;
updatePacket.ParcelData.AABBMin = parcelData.AABBMin;
updatePacket.ParcelData.Area = parcelData.area;
updatePacket.ParcelData.AuctionID = parcelData.auctionID;
updatePacket.ParcelData.AuthBuyerID = parcelData.authBuyerID; //unemplemented
updatePacket.ParcelData.Bitmap = parcelData.parcelBitmapByteArray;
updatePacket.ParcelData.Desc = Helpers.StringToField(parcelData.parcelDesc);
updatePacket.ParcelData.Category = (byte)parcelData.category;
updatePacket.ParcelData.ClaimDate = parcelData.claimDate;
updatePacket.ParcelData.ClaimPrice = parcelData.claimPrice;
updatePacket.ParcelData.GroupID = parcelData.groupID;
updatePacket.ParcelData.GroupPrims = parcelData.groupPrims;
updatePacket.ParcelData.IsGroupOwned = parcelData.isGroupOwned;
updatePacket.ParcelData.LandingType = (byte)parcelData.landingType;
updatePacket.ParcelData.LocalID = parcelData.localID;
if (parcelData.area > 0)
{
updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(parcelData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor)));
}
else
{
updatePacket.ParcelData.MaxPrims = 0;
}
updatePacket.ParcelData.MediaAutoScale = parcelData.mediaAutoScale;
updatePacket.ParcelData.MediaID = parcelData.mediaID;
updatePacket.ParcelData.MediaURL = Helpers.StringToField(parcelData.mediaURL);
updatePacket.ParcelData.MusicURL = Helpers.StringToField(parcelData.musicURL);
updatePacket.ParcelData.Name = Helpers.StringToField(parcelData.parcelName);
updatePacket.ParcelData.OtherCleanTime = 0; //unemplemented
updatePacket.ParcelData.OtherCount = 0; //unemplemented
updatePacket.ParcelData.OtherPrims = parcelData.otherPrims;
updatePacket.ParcelData.OwnerID = parcelData.ownerID;
updatePacket.ParcelData.OwnerPrims = parcelData.ownerPrims;
updatePacket.ParcelData.ParcelFlags = parcelData.parcelFlags;
updatePacket.ParcelData.ParcelPrimBonus = m_world.RegionInfo.estateSettings.objectBonusFactor;
updatePacket.ParcelData.PassHours = parcelData.passHours;
updatePacket.ParcelData.PassPrice = parcelData.passPrice;
updatePacket.ParcelData.PublicCount = 0; //unemplemented
updatePacket.ParcelData.RegionDenyAnonymous = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
updatePacket.ParcelData.RegionDenyIdentified = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
updatePacket.ParcelData.RegionDenyTransacted = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
updatePacket.ParcelData.RegionPushOverride = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
updatePacket.ParcelData.RentPrice = 0;
updatePacket.ParcelData.RequestResult = request_result;
updatePacket.ParcelData.SalePrice = parcelData.salePrice;
updatePacket.ParcelData.SelectedPrims = parcelData.selectedPrims;
updatePacket.ParcelData.SelfCount = 0;//unemplemented
updatePacket.ParcelData.SequenceID = sequence_id;
if (parcelData.simwideArea > 0)
{
updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(parcelData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor)));
}
else
{
updatePacket.ParcelData.SimWideMaxPrims = 0;
}
updatePacket.ParcelData.SimWideTotalPrims = parcelData.simwidePrims;
updatePacket.ParcelData.SnapSelection = snap_selection;
updatePacket.ParcelData.SnapshotID = parcelData.snapshotID;
updatePacket.ParcelData.Status = (byte)parcelData.parcelStatus;
updatePacket.ParcelData.TotalPrims = parcelData.ownerPrims + parcelData.groupPrims + parcelData.otherPrims + parcelData.selectedPrims;
updatePacket.ParcelData.UserLocation = parcelData.userLocation;
updatePacket.ParcelData.UserLookAt = parcelData.userLookAt;
remote_client.OutPacket((Packet)updatePacket);
}
public void updateParcelProperties(ParcelPropertiesUpdatePacket packet, IClientAPI remote_client)
{
if (remote_client.AgentId == parcelData.ownerID)
{
//Needs later group support
parcelData.authBuyerID = packet.ParcelData.AuthBuyerID;
parcelData.category = (libsecondlife.Parcel.ParcelCategory)packet.ParcelData.Category;
parcelData.parcelDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc);
parcelData.groupID = packet.ParcelData.GroupID;
parcelData.landingType = packet.ParcelData.LandingType;
parcelData.mediaAutoScale = packet.ParcelData.MediaAutoScale;
parcelData.mediaID = packet.ParcelData.MediaID;
parcelData.mediaURL = Helpers.FieldToUTF8String(packet.ParcelData.MediaURL);
parcelData.musicURL = Helpers.FieldToUTF8String(packet.ParcelData.MusicURL);
parcelData.parcelName = Helpers.FieldToUTF8String(packet.ParcelData.Name);
parcelData.parcelFlags = packet.ParcelData.ParcelFlags;
parcelData.passHours = packet.ParcelData.PassHours;
parcelData.passPrice = packet.ParcelData.PassPrice;
parcelData.salePrice = packet.ParcelData.SalePrice;
parcelData.snapshotID = packet.ParcelData.SnapshotID;
parcelData.userLocation = packet.ParcelData.UserLocation;
parcelData.userLookAt = packet.ParcelData.UserLookAt;
sendParcelUpdateToAvatarsOverMe();
}
}
public void sendParcelUpdateToAvatarsOverMe()
{
List<ScenePresence> avatars = m_world.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
Parcel over = m_world.LandManager.getParcel((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
if (over.parcelData.localID == this.parcelData.localID)
{
sendParcelProperties(0, false, 0, avatars[i].ControllingClient);
}
}
}
#endregion
#region Update Functions
/// <summary>
/// Updates the AABBMin and AABBMax values after area/shape modification of parcel
/// </summary>
private void updateAABBAndAreaValues()
{
int min_x = 64;
int min_y = 64;
int max_x = 0;
int max_y = 0;
int tempArea = 0;
int x, y;
for (x = 0; x < 64; x++)
{
for (y = 0; y < 64; y++)
{
if (parcelBitmap[x, y] == true)
{
if (min_x > x) min_x = x;
if (min_y > y) min_y = y;
if (max_x < x) max_x = x;
if (max_y < y) max_y = y;
tempArea += 16; //16sqm parcel
}
}
}
parcelData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_world.Terrain.get((min_x * 4), (min_y * 4)));
parcelData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_world.Terrain.get((max_x * 4), (max_y * 4)));
parcelData.area = tempArea;
}
public void updateParcelBitmapByteArray()
{
parcelData.parcelBitmapByteArray = convertParcelBitmapToBytes();
}
/// <summary>
/// Update all settings in parcel such as area, bitmap byte array, etc
/// </summary>
public void forceUpdateParcelInfo()
{
this.updateAABBAndAreaValues();
this.updateParcelBitmapByteArray();
}
public void setParcelBitmapFromByteArray()
{
parcelBitmap = convertBytesToParcelBitmap();
}
#endregion
#region Parcel Bitmap Functions
/// <summary>
/// Sets the parcel's bitmap manually
/// </summary>
/// <param name="bitmap">64x64 block representing where this parcel is on a map</param>
public void setParcelBitmap(bool[,] bitmap)
{
if (bitmap.GetLength(0) != 64 || bitmap.GetLength(1) != 64 || bitmap.Rank != 2)
{
//Throw an exception - The bitmap is not 64x64
throw new Exception("Error: Invalid Parcel Bitmap");
}
else
{
//Valid: Lets set it
parcelBitmap = bitmap;
forceUpdateParcelInfo();
}
}
/// <summary>
/// Gets the parcels bitmap manually
/// </summary>
/// <returns></returns>
public bool[,] getParcelBitmap()
{
return parcelBitmap;
}
/// <summary>
/// Converts the parcel bitmap to a packet friendly byte array
/// </summary>
/// <returns></returns>
private byte[] convertParcelBitmapToBytes()
{
byte[] tempConvertArr = new byte[512];
byte tempByte = 0;
int x, y, i, byteNum = 0;
i = 0;
for (y = 0; y < 64; y++)
{
for (x = 0; x < 64; x++)
{
tempByte = Convert.ToByte(tempByte | Convert.ToByte(parcelBitmap[x, y]) << (i++ % 8));
if (i % 8 == 0)
{
tempConvertArr[byteNum] = tempByte;
tempByte = (byte)0;
i = 0;
byteNum++;
}
}
}
return tempConvertArr;
}
private bool[,] convertBytesToParcelBitmap()
{
bool[,] tempConvertMap = new bool[64, 64];
tempConvertMap.Initialize();
byte tempByte = 0;
int x = 0, y = 0, i = 0, bitNum = 0;
for (i = 0; i < 512; i++)
{
tempByte = parcelData.parcelBitmapByteArray[i];
for (bitNum = 0; bitNum < 8; bitNum++)
{
bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1);
tempConvertMap[x, y] = bit;
x++;
if (x > 63)
{
x = 0;
y++;
}
}
}
return tempConvertMap;
}
/// <summary>
/// Full sim parcel creation
/// </summary>
/// <returns></returns>
public static bool[,] basicFullRegionParcelBitmap()
{
return getSquareParcelBitmap(0, 0, 256, 256);
}
/// <summary>
/// Used to modify the bitmap between the x and y points. Points use 64 scale
/// </summary>
/// <param name="start_x"></param>
/// <param name="start_y"></param>
/// <param name="end_x"></param>
/// <param name="end_y"></param>
/// <returns></returns>
public static bool[,] getSquareParcelBitmap(int start_x, int start_y, int end_x, int end_y)
{
bool[,] tempBitmap = new bool[64, 64];
tempBitmap.Initialize();
tempBitmap = modifyParcelBitmapSquare(tempBitmap, start_x, start_y, end_x, end_y, true);
return tempBitmap;
}
/// <summary>
/// Change a parcel's bitmap at within a square and set those points to a specific value
/// </summary>
/// <param name="parcel_bitmap"></param>
/// <param name="start_x"></param>
/// <param name="start_y"></param>
/// <param name="end_x"></param>
/// <param name="end_y"></param>
/// <param name="set_value"></param>
/// <returns></returns>
public static bool[,] modifyParcelBitmapSquare(bool[,] parcel_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value)
{
if (parcel_bitmap.GetLength(0) != 64 || parcel_bitmap.GetLength(1) != 64 || parcel_bitmap.Rank != 2)
{
//Throw an exception - The bitmap is not 64x64
throw new Exception("Error: Invalid Parcel Bitmap in modifyParcelBitmapSquare()");
}
int x, y;
for (y = 0; y < 64; y++)
{
for (x = 0; x < 64; x++)
{
if (x >= start_x / 4 && x < end_x / 4
&& y >= start_y / 4 && y < end_y / 4)
{
parcel_bitmap[x, y] = set_value;
}
}
}
return parcel_bitmap;
}
/// <summary>
/// Join the true values of 2 bitmaps together
/// </summary>
/// <param name="bitmap_base"></param>
/// <param name="bitmap_add"></param>
/// <returns></returns>
public static bool[,] mergeParcelBitmaps(bool[,] bitmap_base, bool[,] bitmap_add)
{
if (bitmap_base.GetLength(0) != 64 || bitmap_base.GetLength(1) != 64 || bitmap_base.Rank != 2)
{
//Throw an exception - The bitmap is not 64x64
throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_base in mergeParcelBitmaps");
}
if (bitmap_add.GetLength(0) != 64 || bitmap_add.GetLength(1) != 64 || bitmap_add.Rank != 2)
{
//Throw an exception - The bitmap is not 64x64
throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeParcelBitmaps");
}
int x, y;
for (y = 0; y < 64; y++)
{
for (x = 0; x < 64; x++)
{
if (bitmap_add[x, y])
{
bitmap_base[x, y] = true;
}
}
}
return bitmap_base;
}
#endregion
#region Object Select and Object Owner Listing
public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client)
{
List<uint> resultLocalIDs = new List<uint>();
foreach (SceneObject obj in primsOverMe)
{
if (obj.rootLocalID > 0)
{
if (request_type == LandManager.PARCEL_SELECT_OBJECTS_OWNER && obj.rootPrimitive.OwnerID == this.parcelData.ownerID)
{
resultLocalIDs.Add(obj.rootLocalID);
}
else if (request_type == LandManager.PARCEL_SELECT_OBJECTS_GROUP && false) //TODO: change false to group support!
{
}
else if (request_type == LandManager.PARCEL_SELECT_OBJECTS_OTHER && obj.rootPrimitive.OwnerID != remote_client.AgentId)
{
resultLocalIDs.Add(obj.rootLocalID);
}
}
}
bool firstCall = true;
int MAX_OBJECTS_PER_PACKET = 251;
ForceObjectSelectPacket pack = new ForceObjectSelectPacket();
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);
}
}
public void sendParcelObjectOwners(IClientAPI remote_client)
{
Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>();
foreach (SceneObject obj in primsOverMe)
{
if (!ownersAndCount.ContainsKey(obj.rootPrimitive.OwnerID))
{
ownersAndCount.Add(obj.rootPrimitive.OwnerID, 0);
}
ownersAndCount[obj.rootPrimitive.OwnerID] += obj.primCount;
}
if (ownersAndCount.Count > 0)
{
ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[32];
if (ownersAndCount.Count < 32)
{
dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[ownersAndCount.Count];
}
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++;
}
ParcelObjectOwnersReplyPacket pack = new ParcelObjectOwnersReplyPacket();
pack.Data = dataBlock;
remote_client.OutPacket(pack);
}
}
#endregion
#region Object Returning
public void returnObject(SceneObject obj)
{
}
public void returnParcelObjects(int type, LLUUID owner)
{
}
#endregion
#region Object Adding/Removing from Parcel
public void resetParcelPrimCounts()
{
parcelData.groupPrims = 0;
parcelData.ownerPrims = 0;
parcelData.otherPrims = 0;
parcelData.selectedPrims = 0;
primsOverMe.Clear();
}
public void addPrimToCount(SceneObject obj)
{
LLUUID prim_owner = obj.rootPrimitive.OwnerID;
int prim_count = obj.primCount;
if (obj.isSelected)
{
parcelData.selectedPrims += prim_count;
}
else
{
if (prim_owner == parcelData.ownerID)
{
parcelData.ownerPrims += prim_count;
}
else
{
parcelData.otherPrims += prim_count;
}
}
primsOverMe.Add(obj);
}
public void removePrimFromCount(SceneObject obj)
{
if (primsOverMe.Contains(obj))
{
LLUUID prim_owner = obj.rootPrimitive.OwnerID;
int prim_count = obj.primCount;
if (prim_owner == parcelData.ownerID)
{
parcelData.ownerPrims -= prim_count;
}
else if (prim_owner == parcelData.groupID)
{
parcelData.groupPrims -= prim_count;
}
else
{
parcelData.otherPrims -= prim_count;
}
primsOverMe.Remove(obj);
}
}
#endregion
#endregion
}
#endregion
}

View File

@ -4,7 +4,7 @@ using OpenSim.Framework.Communications;
using OpenSim.Framework.Servers; using OpenSim.Framework.Servers;
using OpenSim.Region.Capabilities; using OpenSim.Region.Capabilities;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Environment.Parcels; using OpenSim.Region.Environment.LandManagement;
namespace OpenSim.Region.Environment namespace OpenSim.Region.Environment
{ {

View File

@ -45,7 +45,7 @@ using OpenSim.Region.Terrain;
using Caps = OpenSim.Region.Capabilities.Caps; using Caps = OpenSim.Region.Capabilities.Caps;
using Timer = System.Timers.Timer; using Timer = System.Timers.Timer;
using OpenSim.Region.Environment.Parcels; using OpenSim.Region.Environment.LandManagement;
namespace OpenSim.Region.Environment.Scenes namespace OpenSim.Region.Environment.Scenes
{ {
@ -63,7 +63,7 @@ namespace OpenSim.Region.Environment.Scenes
private uint _primCount = 702000; private uint _primCount = 702000;
private System.Threading.Mutex _primAllocateMutex = new Mutex(false); private System.Threading.Mutex _primAllocateMutex = new Mutex(false);
private int storageCount; private int storageCount;
private int parcelPrimCheckCount; private int landPrimCheckCount;
private Mutex updateLock; private Mutex updateLock;
protected AuthenticateSessionsBase authenticateHandler; protected AuthenticateSessionsBase authenticateHandler;
@ -146,7 +146,7 @@ namespace OpenSim.Region.Environment.Scenes
m_scriptManager = new ScriptManager(this); m_scriptManager = new ScriptManager(this);
m_eventManager = new EventManager(); m_eventManager = new EventManager();
m_eventManager.OnParcelPrimCountAdd += new EventManager.OnParcelPrimCountAddDelegate(m_LandManager.addPrimToParcelCounts); m_eventManager.OnParcelPrimCountAdd += new EventManager.OnParcelPrimCountAddDelegate(m_LandManager.addPrimToLandPrimCounts);
MainLog.Instance.Verbose("World.cs - creating new entitities instance"); MainLog.Instance.Verbose("World.cs - creating new entitities instance");
Entities = new Dictionary<LLUUID, EntityBase>(); Entities = new Dictionary<LLUUID, EntityBase>();
@ -244,14 +244,14 @@ namespace OpenSim.Region.Environment.Scenes
storageCount = 0; storageCount = 0;
} }
this.parcelPrimCheckCount++; this.landPrimCheckCount++;
if (this.parcelPrimCheckCount > 50) //check every 5 seconds for tainted prims if (this.landPrimCheckCount > 50) //check every 5 seconds for tainted prims
{ {
if (m_LandManager.parcelPrimCountTainted) if (m_LandManager.landPrimCountTainted)
{ {
//Perform parcel update of prim count //Perform land update of prim count
performParcelPrimCountUpdate(); performParcelPrimCountUpdate();
this.parcelPrimCheckCount = 0; this.landPrimCheckCount = 0;
} }
} }
@ -513,7 +513,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (this.Entities.ContainsKey(sceneObject.rootUUID)) if (this.Entities.ContainsKey(sceneObject.rootUUID))
{ {
m_LandManager.removePrimFromParcelCounts(sceneObject); m_LandManager.removePrimFromLandPrimCounts(sceneObject);
this.Entities.Remove(sceneObject.rootUUID); this.Entities.Remove(sceneObject.rootUUID);
m_LandManager.setPrimsTainted(); m_LandManager.setPrimsTainted();
} }
@ -910,10 +910,10 @@ namespace OpenSim.Region.Environment.Scenes
public void performParcelPrimCountUpdate() public void performParcelPrimCountUpdate()
{ {
m_LandManager.resetAllParcelPrimCounts(); m_LandManager.resetAllLandPrimCounts();
m_eventManager.TriggerParcelPrimCountUpdate(); m_eventManager.TriggerParcelPrimCountUpdate();
m_LandManager.finalizeParcelPrimCountUpdate(); m_LandManager.finalizeLandPrimCountUpdate();
m_LandManager.parcelPrimCountTainted = false; m_LandManager.landPrimCountTainted = false;
} }
#endregion #endregion

View File

@ -132,7 +132,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
/// <summary> /// <summary>
/// Sends my primitive info to the parcel manager for it to keep tally of all of the prims! /// Sends my primitive info to the land manager for it to keep tally of all of the prims!
/// </summary> /// </summary>
private void ProcessParcelPrimCountUpdate() private void ProcessParcelPrimCountUpdate()
{ {

View File

@ -82,7 +82,7 @@ namespace SimpleApp
if (masterAvatar != null) if (masterAvatar != null)
{ {
world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
world.LandManager.NoParcelDataFromStorage(); world.LandManager.NoLandDataFromStorage();
} }
world.StartTimer(); world.StartTimer();

View File

@ -82,25 +82,25 @@ namespace OpenSim.Region.Storage.LocalStorageBDB
} }
public void SaveParcels(ParcelData[] parcel_data) public void SaveLandObjects(LandData[] land_data)
{ {
} }
public void SaveParcel(ParcelData parcel) public void SaveLandObject(LandData land)
{ {
} }
public void RemoveParcel(ParcelData parcel) public void RemoveLandObject(LandData land)
{ {
} }
public void RemoveAllParcels() public void RemoveAllLandObjects()
{ {
} }
public void LoadParcels(ILocalStorageParcelReceiver recv) public void LoadLandObjects(ILocalStorageLandObjectReceiver recv)
{ {
recv.NoParcelDataFromStorage(); recv.NoLandDataFromStorage();
} }
public void ShutDown() public void ShutDown()

View File

@ -157,106 +157,106 @@ namespace OpenSim.Region.Storage.LocalStorageDb4o
db.Commit(); db.Commit();
} }
public void SaveParcel(ParcelData parcel) public void SaveLandObject(LandData landObject)
{ {
IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); IObjectSet result = db.Query(new UUIDLandQuery(landObject.globalID));
if (result.Count > 0) if (result.Count > 0)
{ {
//Old Parcel //Old Land
ParcelData updateParcel = (ParcelData)result.Next(); LandData updateLand = (LandData)result.Next();
updateParcel.AABBMax = parcel.AABBMax; updateLand.AABBMax = landObject.AABBMax;
updateParcel.AABBMin = parcel.AABBMin; updateLand.AABBMin = landObject.AABBMin;
updateParcel.area = parcel.area; updateLand.area = landObject.area;
updateParcel.auctionID = parcel.auctionID; updateLand.auctionID = landObject.auctionID;
updateParcel.authBuyerID = parcel.authBuyerID; updateLand.authBuyerID = landObject.authBuyerID;
updateParcel.category = parcel.category; updateLand.category = landObject.category;
updateParcel.claimDate = parcel.claimDate; updateLand.claimDate = landObject.claimDate;
updateParcel.claimPrice = parcel.claimPrice; updateLand.claimPrice = landObject.claimPrice;
updateParcel.groupID = parcel.groupID; updateLand.groupID = landObject.groupID;
updateParcel.groupPrims = parcel.groupPrims; updateLand.groupPrims = landObject.groupPrims;
updateParcel.isGroupOwned = parcel.isGroupOwned; updateLand.isGroupOwned = landObject.isGroupOwned;
updateParcel.landingType = parcel.landingType; updateLand.landingType = landObject.landingType;
updateParcel.mediaAutoScale = parcel.mediaAutoScale; updateLand.mediaAutoScale = landObject.mediaAutoScale;
updateParcel.mediaID = parcel.mediaID; updateLand.mediaID = landObject.mediaID;
updateParcel.mediaURL = parcel.mediaURL; updateLand.mediaURL = landObject.mediaURL;
updateParcel.musicURL = parcel.musicURL; updateLand.musicURL = landObject.musicURL;
updateParcel.localID = parcel.localID; updateLand.localID = landObject.localID;
updateParcel.ownerID = parcel.ownerID; updateLand.ownerID = landObject.ownerID;
updateParcel.passHours = parcel.passHours; updateLand.passHours = landObject.passHours;
updateParcel.passPrice = parcel.passPrice; updateLand.passPrice = landObject.passPrice;
updateParcel.parcelBitmapByteArray = (byte[])parcel.parcelBitmapByteArray.Clone(); updateLand.landBitmapByteArray = (byte[])landObject.landBitmapByteArray.Clone();
updateParcel.parcelDesc = parcel.parcelDesc; updateLand.landDesc = landObject.landDesc;
updateParcel.parcelFlags = parcel.parcelFlags; updateLand.landFlags = landObject.landFlags;
updateParcel.parcelName = parcel.parcelName; updateLand.landName = landObject.landName;
updateParcel.parcelStatus = parcel.parcelStatus; updateLand.landStatus = landObject.landStatus;
updateParcel.salePrice = parcel.salePrice; updateLand.salePrice = landObject.salePrice;
updateParcel.snapshotID = parcel.snapshotID; updateLand.snapshotID = landObject.snapshotID;
updateParcel.userLocation = parcel.userLocation; updateLand.userLocation = landObject.userLocation;
updateParcel.userLookAt = parcel.userLookAt; updateLand.userLookAt = landObject.userLookAt;
db.Set(updateParcel); db.Set(updateLand);
} }
else else
{ {
db.Set(parcel); db.Set(landObject);
} }
db.Commit(); db.Commit();
} }
public void SaveParcels(ParcelData[] parcel_data) public void SaveLandObjects(LandData[] landObject_data)
{ {
MainLog.Instance.Notice("Parcel Backup: Saving Parcels..."); MainLog.Instance.Notice("Land Backup: Saving Lands...");
int i; int i;
for (i = 0; i < parcel_data.GetLength(0); i++) for (i = 0; i < landObject_data.GetLength(0); i++)
{ {
SaveParcel(parcel_data[i]); SaveLandObject(landObject_data[i]);
} }
MainLog.Instance.Notice("Parcel Backup: Parcel Save Complete"); MainLog.Instance.Notice("Land Backup: Land Save Complete");
} }
public void RemoveParcel(ParcelData parcel) public void RemoveLandObject(LandData landObject)
{ {
IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); IObjectSet result = db.Query(new UUIDLandQuery(landObject.globalID));
if (result.Count > 0) if (result.Count > 0)
{ {
db.Delete(result[0]); db.Delete(result[0]);
} }
db.Commit(); db.Commit();
} }
public void RemoveAllParcels() public void RemoveAllLandObjects()
{ {
MainLog.Instance.Notice("Parcel Backup: Removing all parcels..."); MainLog.Instance.Notice("Land Backup: Removing all land objects...");
IObjectSet result = db.Get(typeof(ParcelData)); IObjectSet result = db.Get(typeof(LandData));
if (result.Count > 0) if (result.Count > 0)
{ {
foreach (ParcelData parcelData in result) foreach (LandData landData in result)
{ {
RemoveParcel(parcelData); RemoveLandObject(landData);
} }
} }
} }
public void LoadParcels(ILocalStorageParcelReceiver recv) public void LoadLandObjects(ILocalStorageLandObjectReceiver recv)
{ {
MainLog.Instance.Notice("Parcel Backup: Loading Parcels..."); MainLog.Instance.Notice("Land Backup: Loading Lands...");
IObjectSet result = db.Get(typeof(ParcelData)); IObjectSet result = db.Get(typeof(LandData));
if (result.Count > 0) if (result.Count > 0)
{ {
MainLog.Instance.Notice("Parcel Backup: Parcels exist in database."); MainLog.Instance.Notice("Land Backup: Lands exist in database.");
foreach (ParcelData parcelData in result) foreach (LandData landData in result)
{ {
recv.ParcelFromStorage(parcelData); recv.LandFromStorage(landData);
} }
} }
else else
{ {
MainLog.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel."); MainLog.Instance.Notice("Land Backup: No landObjects exist. Creating basic landObject.");
recv.NoParcelDataFromStorage(); recv.NoLandDataFromStorage();
} }
MainLog.Instance.Notice("Parcel Backup: Parcels Restored"); MainLog.Instance.Notice("Land Backup: Lands Restored");
} }
public void ShutDown() public void ShutDown()
{ {

View File

@ -1,47 +1,47 @@
/* /*
* Copyright (c) Contributors, http://www.openmetaverse.org/ * Copyright (c) Contributors, http://www.openmetaverse.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the * * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
using Db4objects.Db4o.Query; using Db4objects.Db4o.Query;
using libsecondlife; using libsecondlife;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
namespace OpenSim.Region.Storage.LocalStorageDb4o namespace OpenSim.Region.Storage.LocalStorageDb4o
{ {
public class UUIDParcelQuery : Predicate public class UUIDLandQuery : Predicate
{ {
private LLUUID globalIDSearch; private LLUUID globalIDSearch;
public UUIDParcelQuery(LLUUID find) public UUIDLandQuery(LLUUID find)
{ {
globalIDSearch = find; globalIDSearch = find;
} }
public bool Match(ParcelData parcel) public bool Match(LandData land)
{ {
return (parcel.globalID == globalIDSearch); return (land.globalID == globalIDSearch);
} }
} }
} }

View File

@ -167,26 +167,26 @@ namespace OpenSim.Region.Storage.LocalStorageSQLite
} }
public void SaveParcels(ParcelData[] parcel_manager) public void SaveLandObjects(LandData[] land_manager)
{ {
} }
public void SaveParcel(ParcelData parcel) public void SaveLandObject(LandData land)
{ {
} }
public void RemoveParcel(ParcelData parcel) public void RemoveLandObject(LandData land)
{ {
} }
public void RemoveAllParcels() public void RemoveAllLandObjects()
{ {
} }
public void LoadParcels(ILocalStorageParcelReceiver recv) public void LoadLandObjects(ILocalStorageLandObjectReceiver recv)
{ {
recv.NoParcelDataFromStorage(); recv.NoLandDataFromStorage();
} }
public void ShutDown() public void ShutDown()

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Region.Environment; using OpenSim.Region.Environment.LandManagement;
using OpenSim.Region.Interfaces; using OpenSim.Region.Interfaces;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using libsecondlife; using libsecondlife;
@ -43,19 +43,19 @@ namespace OpenSim.DataStore.NullStorage
return null; return null;
} }
public void RemoveParcel(uint id) public void RemoveLandObject(uint id)
{ {
} }
public void StoreParcel(OpenSim.Region.Environment.Parcels.Parcel parcel) public void StoreParcel(Land land)
{ {
} }
public List<OpenSim.Region.Environment.Parcels.Parcel> LoadParcels() public List<Land> LoadLandObjects()
{ {
return new List<OpenSim.Region.Environment.Parcels.Parcel>(); return new List<Land>();
} }
public void Shutdown() public void Shutdown()