Merge branch 'master' into v3_support

0.7.4.1
BlueWall 2012-02-22 22:29:30 -05:00
commit af377470e1
11 changed files with 32 additions and 48 deletions

View File

@ -1704,14 +1704,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Offset the positions for the new region across the border // Offset the positions for the new region across the border
Vector3 oldGroupPosition = grp.RootPart.GroupPosition; Vector3 oldGroupPosition = grp.RootPart.GroupPosition;
grp.RootPart.GroupPosition = pos;
// If we fail to cross the border, then reset the position of the scene object on that border. // If we fail to cross the border, then reset the position of the scene object on that border.
uint x = 0, y = 0; uint x = 0, y = 0;
Utils.LongToUInts(newRegionHandle, out x, out y); Utils.LongToUInts(newRegionHandle, out x, out y);
GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent)) if (destination == null || !CrossPrimGroupIntoNewRegion(destination, pos, grp, silent))
{ {
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID); m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
@ -1741,7 +1740,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// true if the crossing itself was successful, false on failure /// true if the crossing itself was successful, false on failure
/// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region /// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
/// </returns> /// </returns>
protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent) protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent)
{ {
//m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
@ -1766,7 +1765,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
//if (m_interregionCommsOut != null) //if (m_interregionCommsOut != null)
// successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true); // successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true);
if (m_aScene.SimulationService != null) if (m_aScene.SimulationService != null)
successYN = m_aScene.SimulationService.CreateObject(destination, grp, true); successYN = m_aScene.SimulationService.CreateObject(destination, newPosition, grp, true);
if (successYN) if (successYN)
{ {
@ -1825,7 +1824,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
gobj.IsAttachment = false; gobj.IsAttachment = false;
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
CrossPrimGroupIntoNewRegion(destination, gobj, silent); CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, gobj, silent);
} }
} }

View File

@ -315,7 +315,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
* Object-related communications * Object-related communications
*/ */
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall)
{ {
if (destination == null) if (destination == null)
return false; return false;
@ -330,12 +330,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
// We need to make a local copy of the object // We need to make a local copy of the object
ISceneObject sogClone = sog.CloneForNewScene(); ISceneObject sogClone = sog.CloneForNewScene();
sogClone.SetState(sog.GetStateSnapshot(), s); sogClone.SetState(sog.GetStateSnapshot(), s);
return s.IncomingCreateObject(sogClone); return s.IncomingCreateObject(newPosition, sogClone);
} }
else else
{ {
// Use the object as it came through the wire // Use the object as it came through the wire
return s.IncomingCreateObject(sog); return s.IncomingCreateObject(newPosition, sog);
} }
} }
} }

View File

@ -282,13 +282,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
* Object-related communications * Object-related communications
*/ */
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall)
{ {
if (destination == null) if (destination == null)
return false; return false;
// Try local first // Try local first
if (m_localBackend.CreateObject(destination, sog, isLocalCall)) if (m_localBackend.CreateObject(destination, newPosition, sog, isLocalCall))
{ {
//m_log.Debug("[REST COMMS]: LocalBackEnd SendCreateObject succeeded"); //m_log.Debug("[REST COMMS]: LocalBackEnd SendCreateObject succeeded");
return true; return true;
@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
// else do the remote thing // else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
return m_remoteConnector.CreateObject(destination, sog, isLocalCall); return m_remoteConnector.CreateObject(destination, newPosition, sog, isLocalCall);
return false; return false;
} }

View File

@ -677,18 +677,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
bool permission = false; bool permission = false;
bool locked = false; bool locked = false;
if (!m_scene.Entities.ContainsKey(objId)) SceneObjectPart part = m_scene.GetSceneObjectPart(objId);
{
return false;
}
// If it's not an object, we cant edit it. if (part == null)
if ((!(m_scene.Entities[objId] is SceneObjectGroup)))
{
return false; return false;
}
SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[objId]; SceneObjectGroup group = part.ParentGroup;
UUID objectOwner = group.OwnerID; UUID objectOwner = group.OwnerID;
locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0); locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0);
@ -977,16 +971,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; if (m_bypassPermissions) return m_bypassPermissionsValue;
SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
// If we selected a sub-prim to edit, the objectID won't represent the object, but only a part.
// We have to check the permissions of the group, though.
if (part.ParentID != 0)
{
objectID = part.ParentUUID;
part = m_scene.GetSceneObjectPart(objectID);
}
return GenericObjectPermission(editorID, objectID, false); return GenericObjectPermission(editorID, objectID, false);
} }

View File

@ -1155,8 +1155,7 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
{ {
// If the item to be moved is no copy, we need to be able to // If the item to be moved is no copy, we need to be able to
// edit the prim. // edit the prim.

View File

@ -2317,7 +2317,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
/// <param name="sog"></param> /// <param name="sog"></param>
/// <returns></returns> /// <returns></returns>
public bool IncomingCreateObject(ISceneObject sog) public bool IncomingCreateObject(Vector3 newPosition, ISceneObject sog)
{ {
//m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition, //m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition,
// ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment); // ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment);
@ -2333,6 +2333,9 @@ namespace OpenSim.Region.Framework.Scenes
return false; return false;
} }
if (newPosition != Vector3.Zero)
newObject.RootPart.GroupPosition = newPosition;
if (!AddSceneObject(newObject)) if (!AddSceneObject(newObject))
{ {
m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName); m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName);
@ -4257,10 +4260,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="action"></param> /// <param name="action"></param>
public void ForEachRootScenePresence(Action<ScenePresence> action) public void ForEachRootScenePresence(Action<ScenePresence> action)
{ {
if (m_sceneGraph != null) m_sceneGraph.ForEachAvatar(action);
{
m_sceneGraph.ForEachAvatar(action);
}
} }
/// <summary> /// <summary>
@ -4269,10 +4269,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="action"></param> /// <param name="action"></param>
public void ForEachScenePresence(Action<ScenePresence> action) public void ForEachScenePresence(Action<ScenePresence> action)
{ {
if (m_sceneGraph != null) m_sceneGraph.ForEachScenePresence(action);
{
m_sceneGraph.ForEachScenePresence(action);
}
} }
/// <summary> /// <summary>

View File

@ -3223,7 +3223,7 @@ namespace OpenSim.Region.Framework.Scenes
((SceneObjectGroup)so).LocalId = 0; ((SceneObjectGroup)so).LocalId = 0;
((SceneObjectGroup)so).RootPart.ClearUpdateSchedule(); ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();
so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); so.SetState(cAgent.AttachmentObjectStates[i++], m_scene);
m_scene.IncomingCreateObject(so); m_scene.IncomingCreateObject(Vector3.Zero, so);
} }
} }
} }

View File

@ -3845,7 +3845,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Single prim // Single prim
if (m_host.LinkNum == 0) if (m_host.LinkNum == 0)
{ {
if (linknum == 0) if (linknum == 0 || linknum == ScriptBaseClass.LINK_ROOT)
return m_host.Name; return m_host.Name;
else else
return UUID.Zero.ToString(); return UUID.Zero.ToString();

View File

@ -136,6 +136,8 @@ namespace OpenSim.Server.Handlers.Simulation
int x = 0, y = 0; int x = 0, y = 0;
UUID uuid = UUID.Zero; UUID uuid = UUID.Zero;
string regionname = string.Empty; string regionname = string.Empty;
Vector3 newPosition = Vector3.Zero;
if (args.ContainsKey("destination_x") && args["destination_x"] != null) if (args.ContainsKey("destination_x") && args["destination_x"] != null)
Int32.TryParse(args["destination_x"].AsString(), out x); Int32.TryParse(args["destination_x"].AsString(), out x);
if (args.ContainsKey("destination_y") && args["destination_y"] != null) if (args.ContainsKey("destination_y") && args["destination_y"] != null)
@ -144,6 +146,8 @@ namespace OpenSim.Server.Handlers.Simulation
UUID.TryParse(args["destination_uuid"].AsString(), out uuid); UUID.TryParse(args["destination_uuid"].AsString(), out uuid);
if (args.ContainsKey("destination_name") && args["destination_name"] != null) if (args.ContainsKey("destination_name") && args["destination_name"] != null)
regionname = args["destination_name"].ToString(); regionname = args["destination_name"].ToString();
if (args.ContainsKey("new_position") && args["new_position"] != null)
Vector3.TryParse(args["new_position"], out newPosition);
GridRegion destination = new GridRegion(); GridRegion destination = new GridRegion();
destination.RegionID = uuid; destination.RegionID = uuid;
@ -199,7 +203,7 @@ namespace OpenSim.Server.Handlers.Simulation
try try
{ {
// This is the meaning of POST object // This is the meaning of POST object
result = CreateObject(destination, sog); result = CreateObject(destination, newPosition, sog);
} }
catch (Exception e) catch (Exception e)
{ {
@ -211,9 +215,9 @@ namespace OpenSim.Server.Handlers.Simulation
} }
// subclasses can override this // subclasses can override this
protected virtual bool CreateObject(GridRegion destination, ISceneObject sog) protected virtual bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog)
{ {
return m_SimulationService.CreateObject(destination, sog, false); return m_SimulationService.CreateObject(destination, newPosition, sog, false);
} }
protected virtual void DoObjectPut(Hashtable request, Hashtable responsedata, UUID regionID) protected virtual void DoObjectPut(Hashtable request, Hashtable responsedata, UUID regionID)

View File

@ -408,7 +408,7 @@ namespace OpenSim.Services.Connectors.Simulation
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall)
{ {
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CreateObject start"); // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CreateObject start");
@ -421,6 +421,7 @@ namespace OpenSim.Services.Connectors.Simulation
args["sog"] = OSD.FromString(sog.ToXml2()); args["sog"] = OSD.FromString(sog.ToXml2());
args["extra"] = OSD.FromString(sog.ExtraToXmlString()); args["extra"] = OSD.FromString(sog.ExtraToXmlString());
args["modified"] = OSD.FromBoolean(sog.HasGroupChanged); args["modified"] = OSD.FromBoolean(sog.HasGroupChanged);
args["new_position"] = newPosition.ToString();
string state = sog.GetStateSnapshot(); string state = sog.GetStateSnapshot();
if (state.Length > 0) if (state.Length > 0)

View File

@ -98,7 +98,7 @@ namespace OpenSim.Services.Interfaces
/// <param name="sog"></param> /// <param name="sog"></param>
/// <param name="isLocalCall"></param> /// <param name="isLocalCall"></param>
/// <returns></returns> /// <returns></returns>
bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall); bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall);
/// <summary> /// <summary>
/// Create an object from the user's inventory in the destination region. /// Create an object from the user's inventory in the destination region.