* Fixes endless loop in the Land Module when selecting any object.

* Fixes returning objects when the object owner hasn't been in the simulator since the simulator started up last.
0.6.0-stable
Teravus Ovares 2008-05-24 21:13:44 +00:00
parent dd4100db4c
commit cd79be569c
4 changed files with 110 additions and 75 deletions

View File

@ -582,6 +582,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
public void UpdateLandPrimCounts()
{
ResetAllLandPrimCounts();
foreach (EntityBase obj in m_scene.Entities.Values)
{
if (obj is SceneObjectGroup)
@ -589,6 +590,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
}
}
FinalizeLandPrimCountUpdate();
landPrimCountTainted = false;
}
public void PerformParcelPrimCountUpdate()

View File

@ -751,12 +751,15 @@ namespace OpenSim.Region.Environment.Modules.World.Land
landData.ownerPrims = 0;
landData.otherPrims = 0;
landData.selectedPrims = 0;
lock (primsOverMe)
primsOverMe.Clear();
}
public void addPrimToCount(SceneObjectGroup obj)
{
LLUUID prim_owner = obj.OwnerID;
int prim_count = obj.PrimCount;

View File

@ -438,6 +438,16 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
{
handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
if (handlerObjectBeingRemovedFromScene != null)
{
handlerObjectBeingRemovedFromScene(obj);
}
}
public void TriggerShutdown()
{
handlerShutdown = OnShutdown;
@ -725,15 +735,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
{
handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
if (handlerObjectBeingRemovedFromScene != null)
{
handlerObjectBeingRemovedFromScene(obj);
}
}
public void TriggerRequestParcelPrimCountUpdate()

View File

@ -1675,6 +1675,7 @@ namespace OpenSim.Region.Environment.Scenes
}
public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId)
{
string message = "";
if (returnobjects.Length <= 0)
return false;
@ -1692,13 +1693,20 @@ namespace OpenSim.Region.Environment.Scenes
bool permissionToDelete = false;
bool permissionToDelete = false;
for (int i = 0; i < returnobjects.Length; i++)
for (int i = 0; i < returnobjects.Length; i++)
{
CachedUserInfo userInfo =
CommsManager.UserProfileCacheService.GetUserDetails(returnobjects[i].OwnerID);
if (userInfo == null)
{
CachedUserInfo userInfo =
CommsManager.UserProfileCacheService.GetUserDetails(returnobjects[i].OwnerID);
if (userInfo != null)
CommsManager.UserProfileCacheService.AddNewUser(returnobjects[i].OwnerID);
}
if (userInfo != null)
{
if (userInfo.HasInventory)
{
LLUUID folderID = LLUUID.Zero;
@ -1716,76 +1724,96 @@ namespace OpenSim.Region.Environment.Scenes
{
folderID = userInfo.RootFolder.ID;
}
permissionToDelete = ExternalChecks.ExternalChecksCanDeleteObject(returnobjects[i].UUID, AgentId);
permissionToDelete = ExternalChecks.ExternalChecksCanDeleteObject(returnobjects[i].UUID, AgentId);
// If the user doesn't have permission, go on to the next one.
if (!permissionToDelete)
continue;
// If the user doesn't have permission, go on to the next one.
if (!permissionToDelete)
continue;
string sceneObjectXml = returnobjects[i].ToXmlString2();
AssetBase asset = CreateAsset(
returnobjects[i].GetPartName(returnobjects[i].LocalId),
returnobjects[i].GetPartDescription(returnobjects[i].LocalId),
(sbyte)InventoryType.Object,
(sbyte)AssetType.Object,
Helpers.StringToField(sceneObjectXml));
AssetCache.AddAsset(asset);
string sceneObjectXml = returnobjects[i].ToXmlString2();
AssetBase asset = CreateAsset(
returnobjects[i].GetPartName(returnobjects[i].LocalId),
returnobjects[i].GetPartDescription(returnobjects[i].LocalId),
(sbyte)InventoryType.Object,
(sbyte)AssetType.Object,
Helpers.StringToField(sceneObjectXml));
AssetCache.AddAsset(asset);
InventoryItemBase item = new InventoryItemBase();
item.Creator = returnobjects[i].RootPart.CreatorID;
item.Owner = returnobjects[i].OwnerID;
item.ID = LLUUID.Random();
item.AssetID = asset.FullID;
item.Description = asset.Description;
item.Name = asset.Name;
item.AssetType = asset.Type;
item.InvType = asset.InvType;
item.Folder = folderID;
if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
{
uint perms = returnobjects[i].GetEffectivePermissions();
uint nextPerms = (perms & 7) << 13;
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
perms &= ~(uint)PermissionMask.Copy;
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
perms &= ~(uint)PermissionMask.Modify;
InventoryItemBase item = new InventoryItemBase();
item.Creator = returnobjects[i].RootPart.CreatorID;
item.Owner = returnobjects[i].OwnerID;
item.ID = LLUUID.Random();
item.AssetID = asset.FullID;
item.Description = asset.Description;
item.Name = asset.Name;
item.AssetType = asset.Type;
item.InvType = asset.InvType;
item.Folder = folderID;
if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
{
uint perms = returnobjects[i].GetEffectivePermissions();
uint nextPerms = (perms & 7) << 13;
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
perms &= ~(uint)PermissionMask.Copy;
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
perms &= ~(uint)PermissionMask.Transfer;
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
perms &= ~(uint)PermissionMask.Modify;
item.BasePermissions = perms & returnobjects[i].RootPart.NextOwnerMask;
item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = returnobjects[i].RootPart.NextOwnerMask;
item.EveryOnePermissions = returnobjects[i].RootPart.EveryoneMask & returnobjects[i].RootPart.NextOwnerMask;
item.CurrentPermissions |= 8; // Slam!
item.BasePermissions = perms & returnobjects[i].RootPart.NextOwnerMask;
item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = returnobjects[i].RootPart.NextOwnerMask;
item.EveryOnePermissions = returnobjects[i].RootPart.EveryoneMask & returnobjects[i].RootPart.NextOwnerMask;
item.CurrentPermissions |= 8; // Slam!
}
else
{
item.BasePermissions = returnobjects[i].GetEffectivePermissions();
item.CurrentPermissions = returnobjects[i].GetEffectivePermissions();
item.NextPermissions = returnobjects[i].RootPart.NextOwnerMask;
item.EveryOnePermissions = returnobjects[i].RootPart.EveryoneMask;
}
// TODO: add the new fields (Flags, Sale info, etc)
userInfo.AddItem(item);
ScenePresence notifyUser = GetScenePresence(item.Owner);
if (notifyUser != null)
{
notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item);
}
SceneObjectGroup ObjectDeleting = returnobjects[i];
returnobjects[i] = null;
DeleteSceneObjectGroup(ObjectDeleting);
ObjectDeleting = null;
}
else
{
item.BasePermissions = returnobjects[i].GetEffectivePermissions();
item.CurrentPermissions = returnobjects[i].GetEffectivePermissions();
item.NextPermissions = returnobjects[i].RootPart.NextOwnerMask;
item.EveryOnePermissions = returnobjects[i].RootPart.EveryoneMask;
CommsManager.UserProfileCacheService.RequestInventoryForUser(returnobjects[i].OwnerID);
message = "Still waiting on the inventory service, some of the items won't be returned until the inventory services completes it's task. Try again shortly.";
}
// TODO: add the new fields (Flags, Sale info, etc)
userInfo.AddItem(item);
ScenePresence notifyUser = GetScenePresence(item.Owner);
if (notifyUser != null)
{
notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item);
}
SceneObjectGroup ObjectDeleting = returnobjects[i];
returnobjects[i] = null;
DeleteSceneObjectGroup(ObjectDeleting);
ObjectDeleting = null;
}
return true;
else
{
message = "Still waiting on the inventory service, some of the items won't be returned until the inventory services completes it's task. Try again shortly.";
}
//return true;
}
return false;
if (message.Length != 0)
{
ScenePresence returningavatar = GetScenePresence(AgentId);
if (returningavatar != null)
{
returningavatar.ControllingClient.SendAlertMessage(message);
}
return false;
}
return true;
}