Merge branch 'master' into careminster-presence-refactor
commit
37a7b87862
|
@ -35,8 +35,8 @@ namespace OpenSim.Framework
|
|||
|
||||
public interface ILandObject
|
||||
{
|
||||
int GetParcelMaxPrimCount(ILandObject thisObject);
|
||||
int GetSimulatorMaxPrimCount(ILandObject thisObject);
|
||||
int GetParcelMaxPrimCount();
|
||||
int GetSimulatorMaxPrimCount();
|
||||
int GetPrimsFree();
|
||||
|
||||
LandData LandData { get; set; }
|
||||
|
|
|
@ -251,11 +251,11 @@ namespace OpenSim.Framework
|
|||
// This just dumps a warning for any operation that takes more than 100 ms
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > LongCallTime)
|
||||
m_log.InfoFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing",
|
||||
m_log.DebugFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing",
|
||||
reqnum,url,method,tickdiff,tickdata);
|
||||
}
|
||||
|
||||
m_log.WarnFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
|
||||
m_log.DebugFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
|
||||
return ErrorResponseMap(errorMessage);
|
||||
}
|
||||
|
||||
|
@ -986,8 +986,11 @@ namespace OpenSim.Framework
|
|||
|
||||
try
|
||||
{
|
||||
using (WebResponse resp = request.GetResponse())
|
||||
using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse())
|
||||
{
|
||||
if (resp.StatusCode == HttpStatusCode.NotFound)
|
||||
return deserial;
|
||||
|
||||
if (resp.ContentLength != 0)
|
||||
{
|
||||
Stream respStream = resp.GetResponseStream();
|
||||
|
|
|
@ -367,7 +367,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
|||
}
|
||||
|
||||
if (!m_merge)
|
||||
m_scene.LandChannel.Clear(false);
|
||||
{
|
||||
bool setupDefaultParcel = (landData.Count == 0);
|
||||
m_scene.LandChannel.Clear(setupDefaultParcel);
|
||||
}
|
||||
|
||||
m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData);
|
||||
m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count);
|
||||
|
|
|
@ -313,6 +313,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
|||
Assert.That(loadedSoundAsset, Is.Not.Null, "loaded sound asset was null");
|
||||
Assert.That(loadedSoundAsset.Data, Is.EqualTo(soundData), "saved and loaded sound data do not match");
|
||||
|
||||
Assert.Greater(m_scene.LandChannel.AllParcels().Count, 0, "incorrect number of parcels");
|
||||
|
||||
// Temporary
|
||||
Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod());
|
||||
}
|
||||
|
|
|
@ -437,8 +437,12 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Like handleEventManagerOnSignificantClientMovement, but called with an AgentUpdate regardless of distance.
|
||||
/// </summary>
|
||||
/// <param name="avatar"></param>
|
||||
public void EventManagerOnClientMovement(ScenePresence avatar)
|
||||
//Like handleEventManagerOnSignificantClientMovement, but called with an AgentUpdate regardless of distance.
|
||||
//
|
||||
{
|
||||
ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
||||
if (over != null)
|
||||
|
@ -451,7 +455,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void ClientOnParcelAccessListRequest(UUID agentID, UUID sessionID, uint flags, int sequenceID,
|
||||
int landLocalID, IClientAPI remote_client)
|
||||
{
|
||||
|
@ -587,13 +590,13 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
}
|
||||
|
||||
m_landList.Clear();
|
||||
}
|
||||
|
||||
ResetSimLandObjects();
|
||||
|
||||
if (setupDefaultParcel)
|
||||
CreateDefaultParcel();
|
||||
}
|
||||
}
|
||||
|
||||
private void performFinalLandJoin(ILandObject master, ILandObject slave)
|
||||
{
|
||||
|
@ -1323,10 +1326,13 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
}
|
||||
|
||||
public void EventManagerOnNoLandDataFromStorage()
|
||||
{
|
||||
lock (m_landList)
|
||||
{
|
||||
ResetSimLandObjects();
|
||||
CreateDefaultParcel();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
public int GetPrimsFree()
|
||||
{
|
||||
m_scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
int free = GetSimulatorMaxPrimCount(this) - m_landData.SimwidePrims;
|
||||
int free = GetSimulatorMaxPrimCount() - m_landData.SimwidePrims;
|
||||
return free;
|
||||
}
|
||||
|
||||
|
@ -181,11 +181,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
overrideSimulatorMaxPrimCount = overrideDel;
|
||||
}
|
||||
|
||||
public int GetParcelMaxPrimCount(ILandObject thisObject)
|
||||
public int GetParcelMaxPrimCount()
|
||||
{
|
||||
if (overrideParcelMaxPrimCount != null)
|
||||
{
|
||||
return overrideParcelMaxPrimCount(thisObject);
|
||||
return overrideParcelMaxPrimCount(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -197,11 +197,12 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
return parcelMax;
|
||||
}
|
||||
}
|
||||
public int GetSimulatorMaxPrimCount(ILandObject thisObject)
|
||||
|
||||
public int GetSimulatorMaxPrimCount()
|
||||
{
|
||||
if (overrideSimulatorMaxPrimCount != null)
|
||||
{
|
||||
return overrideSimulatorMaxPrimCount(thisObject);
|
||||
return overrideSimulatorMaxPrimCount(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -244,8 +245,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
remote_client.SendLandProperties(seq_id,
|
||||
snap_selection, request_result, this,
|
||||
(float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
|
||||
GetParcelMaxPrimCount(this),
|
||||
GetSimulatorMaxPrimCount(this), regionFlags);
|
||||
GetParcelMaxPrimCount(),
|
||||
GetSimulatorMaxPrimCount(), regionFlags);
|
||||
}
|
||||
|
||||
public void UpdateLandProperties(LandUpdateArgs args, IClientAPI remote_client)
|
||||
|
|
|
@ -82,14 +82,14 @@ namespace OpenSim.Region.CoreModules.World.Region
|
|||
false, "region restart bluebox",
|
||||
"region restart bluebox <message> <delta seconds>+",
|
||||
"Schedule a region restart",
|
||||
"Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.",
|
||||
"Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.",
|
||||
HandleRegionRestart);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
false, "region restart notice",
|
||||
"region restart notice <message> <delta seconds>+",
|
||||
"Schedule a region restart",
|
||||
"Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.",
|
||||
"Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.",
|
||||
HandleRegionRestart);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
|
|
|
@ -927,9 +927,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
uint callbackID, string description, string name,
|
||||
sbyte invType, sbyte type, UUID olditemID)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
|
||||
remoteClient.Name, name, folderID, olditemID);
|
||||
// m_log.DebugFormat(
|
||||
// "[AGENT INVENTORY]: Received request from {0} to create inventory item link {1} in folder {2} pointing to {3}",
|
||||
// remoteClient.Name, name, folderID, olditemID);
|
||||
|
||||
if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
|
||||
return;
|
||||
|
@ -937,20 +937,25 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
ScenePresence presence;
|
||||
if (TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
bool linkAlreadyExists = false;
|
||||
List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID);
|
||||
foreach (InventoryItemBase item in existingItems)
|
||||
if (item.AssetID == olditemID)
|
||||
linkAlreadyExists = true;
|
||||
|
||||
if (linkAlreadyExists)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link already exists",
|
||||
remoteClient.Name, name, folderID, olditemID);
|
||||
|
||||
return;
|
||||
}
|
||||
// Disabled the check for duplicate links.
|
||||
//
|
||||
// When outfits are being adjusted, the viewer rapidly sends delete link messages followed by
|
||||
// create links. However, since these are handled asynchronously, the deletes do not complete before
|
||||
// the creates are handled. Therefore, we cannot enforce a duplicate link check.
|
||||
// InventoryItemBase existingLink = null;
|
||||
// List<InventoryItemBase> existingItems = InventoryService.GetFolderItems(remoteClient.AgentId, folderID);
|
||||
// foreach (InventoryItemBase item in existingItems)
|
||||
// if (item.AssetID == olditemID)
|
||||
// existingLink = item;
|
||||
//
|
||||
// if (existingLink != null)
|
||||
// {
|
||||
// m_log.WarnFormat(
|
||||
// "[AGENT INVENTORY]: Ignoring request from {0} to create item link {1} in folder {2} pointing to {3} since a link named {4} with id {5} already exists",
|
||||
// remoteClient.Name, name, folderID, olditemID, existingLink.Name, existingLink.ID);
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
|
||||
AssetBase asset = new AssetBase();
|
||||
asset.FullID = olditemID;
|
||||
|
@ -978,7 +983,11 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <param name="itemID"></param>
|
||||
private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs)
|
||||
{
|
||||
//m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId);
|
||||
// m_log.DebugFormat(
|
||||
// "[AGENT INVENTORY]: Removing inventory items {0} for {1}",
|
||||
// string.Join(",", itemIDs.ConvertAll<string>(uuid => uuid.ToString()).ToArray()),
|
||||
// remoteClient.Name);
|
||||
|
||||
InventoryService.DeleteItems(remoteClient.AgentId, itemIDs);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ namespace OpenSim.Region.OptionalModules
|
|||
scene.Permissions.OnRezObject += CanRezObject;
|
||||
scene.Permissions.OnObjectEntry += CanObjectEnter;
|
||||
scene.Permissions.OnDuplicateObject += CanDuplicateObject;
|
||||
|
||||
m_log.DebugFormat("[PRIM LIMITS]: Region {0} added", scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
|
@ -92,6 +93,7 @@ namespace OpenSim.Region.OptionalModules
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
scene.Permissions.OnRezObject -= CanRezObject;
|
||||
scene.Permissions.OnObjectEntry -= CanObjectEnter;
|
||||
scene.Permissions.OnDuplicateObject -= CanDuplicateObject;
|
||||
|
@ -104,11 +106,9 @@ namespace OpenSim.Region.OptionalModules
|
|||
|
||||
private bool CanRezObject(int objectCount, UUID owner, Vector3 objectPosition, Scene scene)
|
||||
{
|
||||
// This may be a little long winded and can probably be optomized
|
||||
int usedPrims = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).PrimCounts.Total;
|
||||
LandData landData = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).LandData;
|
||||
int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) *
|
||||
(float)scene.RegionInfo.ObjectCapacity * (float)scene.RegionInfo.RegionSettings.ObjectBonus);
|
||||
ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y);
|
||||
int usedPrims = lo.PrimCounts.Total;
|
||||
int simulatorCapacity = lo.GetSimulatorMaxPrimCount();
|
||||
|
||||
if (objectCount + usedPrims > simulatorCapacity)
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ namespace OpenSim.Region.OptionalModules
|
|||
|
||||
return true;
|
||||
}
|
||||
//OnMoveObject
|
||||
|
||||
private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
|
||||
{
|
||||
SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
|
||||
|
@ -128,9 +128,7 @@ namespace OpenSim.Region.OptionalModules
|
|||
ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);
|
||||
|
||||
int usedPrims = newParcel.PrimCounts.Total;
|
||||
LandData landData = newParcel.LandData;
|
||||
int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) *
|
||||
(float)scene.RegionInfo.ObjectCapacity * (float)scene.RegionInfo.RegionSettings.ObjectBonus);
|
||||
int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();
|
||||
|
||||
// The prim hasn't crossed a region boundry so we don't need to worry
|
||||
// about prim counts here
|
||||
|
@ -138,35 +136,38 @@ namespace OpenSim.Region.OptionalModules
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Prim counts are determined by the location of the root prim. if we're
|
||||
// moving a child prim, just let it pass
|
||||
if(!obj.IsRoot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Add Special Case here for temporary prims
|
||||
|
||||
// TODO: Add Special Case here for temporary prims
|
||||
|
||||
if(objectCount + usedPrims > simulatorCapacity)
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(obj.OwnerID, "Unable to move object because the destination parcel is too full");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//OnDuplicateObject
|
||||
private bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition)
|
||||
{
|
||||
// This may be a little long winded and can probably be optomized
|
||||
int usedPrims = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).PrimCounts.Total;
|
||||
LandData landData = scene.LandChannel.GetLandObject(objectPosition.X,objectPosition.Y).LandData;
|
||||
int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) *
|
||||
(float)scene.RegionInfo.ObjectCapacity * (float)scene.RegionInfo.RegionSettings.ObjectBonus);
|
||||
ILandObject lo = scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y);
|
||||
int usedPrims = lo.PrimCounts.Total;
|
||||
int simulatorCapacity = lo.GetSimulatorMaxPrimCount();
|
||||
|
||||
if(objectCount + usedPrims > simulatorCapacity)
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(owner, "Unable to duplicate object because the parcel is too full");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10587,31 +10587,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Integer llGetParcelMaxPrims(LSL_Vector pos, int sim_wide)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
// Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation
|
||||
// Which probably will be irrelevent in OpenSim....
|
||||
LandData land = World.GetLandData((float)pos.x, (float)pos.y);
|
||||
|
||||
float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus;
|
||||
ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y);
|
||||
|
||||
if (land == null)
|
||||
{
|
||||
if (lo == null)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sim_wide != 0)
|
||||
{
|
||||
decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor;
|
||||
|
||||
return (int)v;
|
||||
}
|
||||
|
||||
return lo.GetSimulatorMaxPrimCount();
|
||||
else
|
||||
{
|
||||
decimal v = land.Area * (decimal)(0.22) * (decimal)bonusfactor;
|
||||
|
||||
return (int)v;
|
||||
}
|
||||
|
||||
return lo.GetParcelMaxPrimCount();
|
||||
}
|
||||
|
||||
public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param)
|
||||
|
|
|
@ -30,6 +30,7 @@ using System.Collections;
|
|||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
|
@ -143,7 +144,7 @@ namespace OpenSim.Server.Handlers.Grid
|
|||
sb.Append("<gridinfo>\n");
|
||||
foreach (string k in _info.Keys)
|
||||
{
|
||||
sb.AppendFormat("<{0}>{1}</{0}>\n", k, _info[k]);
|
||||
sb.AppendFormat("<{0}>{1}</{0}>\n", k, SecurityElement.Escape(_info[k].ToString()));
|
||||
}
|
||||
sb.Append("</gridinfo>\n");
|
||||
|
||||
|
|
|
@ -40,10 +40,12 @@ namespace OpenSim.Tests.Common.Mock
|
|||
public class TestLandChannel : ILandChannel
|
||||
{
|
||||
private Scene m_scene;
|
||||
private List<ILandObject> m_parcels;
|
||||
|
||||
public TestLandChannel(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_parcels = new List<ILandObject>();
|
||||
}
|
||||
|
||||
public List<ILandObject> ParcelsNearPoint(Vector3 position)
|
||||
|
@ -53,12 +55,19 @@ namespace OpenSim.Tests.Common.Mock
|
|||
|
||||
public List<ILandObject> AllParcels()
|
||||
{
|
||||
return new List<ILandObject>();
|
||||
return m_parcels;
|
||||
}
|
||||
|
||||
public void Clear(bool setupDefaultParcel)
|
||||
{
|
||||
// Intentionally blank since we don't save any parcel data in the test channel
|
||||
m_parcels.Clear();
|
||||
|
||||
if (setupDefaultParcel)
|
||||
{
|
||||
ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
|
||||
obj.LandData.Name = "Your Parcel";
|
||||
m_parcels.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
protected ILandObject GetNoLand()
|
||||
|
|
Loading…
Reference in New Issue