* 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
parent
dd4100db4c
commit
cd79be569c
|
@ -582,6 +582,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
|
|
||||||
public void UpdateLandPrimCounts()
|
public void UpdateLandPrimCounts()
|
||||||
{
|
{
|
||||||
|
ResetAllLandPrimCounts();
|
||||||
foreach (EntityBase obj in m_scene.Entities.Values)
|
foreach (EntityBase obj in m_scene.Entities.Values)
|
||||||
{
|
{
|
||||||
if (obj is SceneObjectGroup)
|
if (obj is SceneObjectGroup)
|
||||||
|
@ -589,6 +590,8 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
|
m_scene.EventManager.TriggerParcelPrimCountAdd((SceneObjectGroup)obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FinalizeLandPrimCountUpdate();
|
||||||
|
landPrimCountTainted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PerformParcelPrimCountUpdate()
|
public void PerformParcelPrimCountUpdate()
|
||||||
|
|
|
@ -751,12 +751,15 @@ namespace OpenSim.Region.Environment.Modules.World.Land
|
||||||
landData.ownerPrims = 0;
|
landData.ownerPrims = 0;
|
||||||
landData.otherPrims = 0;
|
landData.otherPrims = 0;
|
||||||
landData.selectedPrims = 0;
|
landData.selectedPrims = 0;
|
||||||
|
|
||||||
|
|
||||||
lock (primsOverMe)
|
lock (primsOverMe)
|
||||||
primsOverMe.Clear();
|
primsOverMe.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPrimToCount(SceneObjectGroup obj)
|
public void addPrimToCount(SceneObjectGroup obj)
|
||||||
{
|
{
|
||||||
|
|
||||||
LLUUID prim_owner = obj.OwnerID;
|
LLUUID prim_owner = obj.OwnerID;
|
||||||
int prim_count = obj.PrimCount;
|
int prim_count = obj.PrimCount;
|
||||||
|
|
||||||
|
|
|
@ -438,6 +438,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
|
||||||
|
{
|
||||||
|
handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene;
|
||||||
|
if (handlerObjectBeingRemovedFromScene != null)
|
||||||
|
{
|
||||||
|
handlerObjectBeingRemovedFromScene(obj);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void TriggerShutdown()
|
public void TriggerShutdown()
|
||||||
{
|
{
|
||||||
handlerShutdown = OnShutdown;
|
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()
|
public void TriggerRequestParcelPrimCountUpdate()
|
||||||
|
|
|
@ -1675,6 +1675,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId)
|
public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId)
|
||||||
{
|
{
|
||||||
|
string message = "";
|
||||||
if (returnobjects.Length <= 0)
|
if (returnobjects.Length <= 0)
|
||||||
return false;
|
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.AddNewUser(returnobjects[i].OwnerID);
|
||||||
CommsManager.UserProfileCacheService.GetUserDetails(returnobjects[i].OwnerID);
|
|
||||||
if (userInfo != null)
|
}
|
||||||
|
if (userInfo != null)
|
||||||
|
{
|
||||||
|
if (userInfo.HasInventory)
|
||||||
{
|
{
|
||||||
LLUUID folderID = LLUUID.Zero;
|
LLUUID folderID = LLUUID.Zero;
|
||||||
|
|
||||||
|
@ -1716,76 +1724,96 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
folderID = userInfo.RootFolder.ID;
|
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 the user doesn't have permission, go on to the next one.
|
||||||
if (!permissionToDelete)
|
if (!permissionToDelete)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
string sceneObjectXml = returnobjects[i].ToXmlString2();
|
string sceneObjectXml = returnobjects[i].ToXmlString2();
|
||||||
AssetBase asset = CreateAsset(
|
AssetBase asset = CreateAsset(
|
||||||
returnobjects[i].GetPartName(returnobjects[i].LocalId),
|
returnobjects[i].GetPartName(returnobjects[i].LocalId),
|
||||||
returnobjects[i].GetPartDescription(returnobjects[i].LocalId),
|
returnobjects[i].GetPartDescription(returnobjects[i].LocalId),
|
||||||
(sbyte)InventoryType.Object,
|
(sbyte)InventoryType.Object,
|
||||||
(sbyte)AssetType.Object,
|
(sbyte)AssetType.Object,
|
||||||
Helpers.StringToField(sceneObjectXml));
|
Helpers.StringToField(sceneObjectXml));
|
||||||
AssetCache.AddAsset(asset);
|
AssetCache.AddAsset(asset);
|
||||||
|
|
||||||
InventoryItemBase item = new InventoryItemBase();
|
InventoryItemBase item = new InventoryItemBase();
|
||||||
item.Creator = returnobjects[i].RootPart.CreatorID;
|
item.Creator = returnobjects[i].RootPart.CreatorID;
|
||||||
item.Owner = returnobjects[i].OwnerID;
|
item.Owner = returnobjects[i].OwnerID;
|
||||||
item.ID = LLUUID.Random();
|
item.ID = LLUUID.Random();
|
||||||
item.AssetID = asset.FullID;
|
item.AssetID = asset.FullID;
|
||||||
item.Description = asset.Description;
|
item.Description = asset.Description;
|
||||||
item.Name = asset.Name;
|
item.Name = asset.Name;
|
||||||
item.AssetType = asset.Type;
|
item.AssetType = asset.Type;
|
||||||
item.InvType = asset.InvType;
|
item.InvType = asset.InvType;
|
||||||
item.Folder = folderID;
|
item.Folder = folderID;
|
||||||
if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
|
if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions())
|
||||||
{
|
{
|
||||||
uint perms = returnobjects[i].GetEffectivePermissions();
|
uint perms = returnobjects[i].GetEffectivePermissions();
|
||||||
uint nextPerms = (perms & 7) << 13;
|
uint nextPerms = (perms & 7) << 13;
|
||||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||||
perms &= ~(uint)PermissionMask.Copy;
|
perms &= ~(uint)PermissionMask.Copy;
|
||||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||||
perms &= ~(uint)PermissionMask.Transfer;
|
perms &= ~(uint)PermissionMask.Transfer;
|
||||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||||
perms &= ~(uint)PermissionMask.Modify;
|
perms &= ~(uint)PermissionMask.Modify;
|
||||||
|
|
||||||
item.BasePermissions = perms & returnobjects[i].RootPart.NextOwnerMask;
|
item.BasePermissions = perms & returnobjects[i].RootPart.NextOwnerMask;
|
||||||
item.CurrentPermissions = item.BasePermissions;
|
item.CurrentPermissions = item.BasePermissions;
|
||||||
item.NextPermissions = returnobjects[i].RootPart.NextOwnerMask;
|
item.NextPermissions = returnobjects[i].RootPart.NextOwnerMask;
|
||||||
item.EveryOnePermissions = returnobjects[i].RootPart.EveryoneMask & returnobjects[i].RootPart.NextOwnerMask;
|
item.EveryOnePermissions = returnobjects[i].RootPart.EveryoneMask & returnobjects[i].RootPart.NextOwnerMask;
|
||||||
item.CurrentPermissions |= 8; // Slam!
|
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
|
else
|
||||||
{
|
{
|
||||||
item.BasePermissions = returnobjects[i].GetEffectivePermissions();
|
CommsManager.UserProfileCacheService.RequestInventoryForUser(returnobjects[i].OwnerID);
|
||||||
item.CurrentPermissions = returnobjects[i].GetEffectivePermissions();
|
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.";
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue