mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Resolve merge commits, stage 1
This commit is contained in:
@@ -209,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
sp.TeleportFlags = (TeleportFlags)teleportFlags;
|
||||
sp.Teleport(position);
|
||||
|
||||
foreach (SceneObjectGroup grp in sp.Attachments)
|
||||
foreach (SceneObjectGroup grp in sp.GetAttachments())
|
||||
sp.Scene.EventManager.TriggerOnScriptChangedEvent(grp.LocalId, (uint)Changed.TELEPORT);
|
||||
}
|
||||
else // Another region possibly in another simulator
|
||||
@@ -494,7 +494,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
|
||||
sp.Scene.CleanDroppedAttachments();
|
||||
// sp.Scene.CleanDroppedAttachments();
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
|
||||
@@ -560,11 +560,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
|
||||
{
|
||||
foreach (SceneObjectGroup sop in sp.Attachments)
|
||||
{
|
||||
sop.Scene.DeleteSceneObject(sop, true);
|
||||
}
|
||||
sp.Attachments.Clear();
|
||||
sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true);
|
||||
}
|
||||
|
||||
protected void KillEntity(Scene scene, uint localID)
|
||||
@@ -1088,10 +1084,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
#endregion
|
||||
|
||||
#region Enable Child Agent
|
||||
|
||||
/// <summary>
|
||||
/// This informs a single neighbouring region about agent "avatar".
|
||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
/// <param name="region"></param>
|
||||
public void EnableChildAgent(ScenePresence sp, GridRegion region)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER]: Enabling child agent in new neighbour {0}", region.RegionName);
|
||||
@@ -1153,6 +1152,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// This informs all neighbouring regions about agent "avatar".
|
||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
public void EnableChildAgents(ScenePresence sp)
|
||||
{
|
||||
List<GridRegion> neighbours = new List<GridRegion>();
|
||||
@@ -1340,7 +1340,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
Utils.LongToUInts(reg.RegionHandle, out x, out y);
|
||||
x = x / Constants.RegionSize;
|
||||
y = y / Constants.RegionSize;
|
||||
m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
|
||||
m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint + ")");
|
||||
|
||||
string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
|
||||
|
||||
@@ -1786,34 +1786,33 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
protected bool CrossAttachmentsIntoNewRegion(GridRegion destination, ScenePresence sp, bool silent)
|
||||
{
|
||||
List<SceneObjectGroup> m_attachments = sp.Attachments;
|
||||
lock (m_attachments)
|
||||
List<SceneObjectGroup> m_attachments = sp.GetAttachments();
|
||||
|
||||
// Validate
|
||||
foreach (SceneObjectGroup gobj in m_attachments)
|
||||
{
|
||||
// Validate
|
||||
foreach (SceneObjectGroup gobj in m_attachments)
|
||||
{
|
||||
if (gobj == null || gobj.IsDeleted)
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (SceneObjectGroup gobj in m_attachments)
|
||||
{
|
||||
// If the prim group is null then something must have happened to it!
|
||||
if (gobj != null && gobj.RootPart != null)
|
||||
{
|
||||
// Set the parent localID to 0 so it transfers over properly.
|
||||
gobj.RootPart.SetParentLocalId(0);
|
||||
gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
|
||||
gobj.RootPart.IsAttachment = false;
|
||||
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
|
||||
CrossPrimGroupIntoNewRegion(destination, gobj, silent);
|
||||
}
|
||||
}
|
||||
m_attachments.Clear();
|
||||
|
||||
return true;
|
||||
if (gobj == null || gobj.IsDeleted)
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (SceneObjectGroup gobj in m_attachments)
|
||||
{
|
||||
// If the prim group is null then something must have happened to it!
|
||||
if (gobj != null)
|
||||
{
|
||||
// Set the parent localID to 0 so it transfers over properly.
|
||||
gobj.RootPart.SetParentLocalId(0);
|
||||
gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
|
||||
gobj.IsAttachment = false;
|
||||
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
|
||||
CrossPrimGroupIntoNewRegion(destination, gobj, silent);
|
||||
}
|
||||
}
|
||||
|
||||
sp.ClearAttachments();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1862,7 +1861,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
int i = 0;
|
||||
if (sp.InTransitScriptStates.Count > 0)
|
||||
{
|
||||
sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
|
||||
List<SceneObjectGroup> attachments = sp.GetAttachments();
|
||||
|
||||
foreach (SceneObjectGroup sog in attachments)
|
||||
{
|
||||
if (i < sp.InTransitScriptStates.Count)
|
||||
{
|
||||
@@ -1871,8 +1872,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
sog.ResumeScripts();
|
||||
}
|
||||
else
|
||||
m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: InTransitScriptStates.Count={0} smaller than Attachments.Count={1}", sp.InTransitScriptStates.Count, sp.Attachments.Count);
|
||||
});
|
||||
m_log.ErrorFormat(
|
||||
"[ENTITY TRANSFER MODULE]: InTransitScriptStates.Count={0} smaller than Attachments.Count={1}",
|
||||
sp.InTransitScriptStates.Count, attachments.Count);
|
||||
}
|
||||
|
||||
sp.InTransitScriptStates.Clear();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -65,8 +65,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
|
||||
config.AddConfig("Modules");
|
||||
config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
|
||||
|
||||
m_scene = SceneSetupHelpers.SetupScene();
|
||||
SceneSetupHelpers.SetupSceneModules(m_scene, config, m_iam);
|
||||
m_scene = SceneHelpers.SetupScene();
|
||||
SceneHelpers.SetupSceneModules(m_scene, config, m_iam);
|
||||
|
||||
// Create user
|
||||
string userFirstName = "Jock";
|
||||
@@ -82,14 +82,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
|
||||
[Test]
|
||||
public void TestRezCoalescedObject()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
// Create asset
|
||||
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20);
|
||||
SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "Object1", 0x20);
|
||||
object1.AbsolutePosition = new Vector3(15, 30, 45);
|
||||
|
||||
SceneObjectGroup object2 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40);
|
||||
SceneObjectGroup object2 = SceneHelpers.CreateSceneObject(1, m_userId, "Object2", 0x40);
|
||||
object2.AbsolutePosition = new Vector3(25, 50, 75);
|
||||
|
||||
CoalescedSceneObjects coa = new CoalescedSceneObjects(m_userId, object1, object2);
|
||||
@@ -138,11 +138,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
|
||||
[Test]
|
||||
public void TestRezObject()
|
||||
{
|
||||
TestHelper.InMethod();
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
// Create asset
|
||||
SceneObjectGroup object1 = SceneSetupHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40);
|
||||
SceneObjectGroup object1 = SceneHelpers.CreateSceneObject(1, m_userId, "My Little Dog Object", 0x40);
|
||||
|
||||
UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060");
|
||||
AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1);
|
||||
|
||||
@@ -185,6 +185,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
|
||||
archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName, false);
|
||||
archread.Execute();
|
||||
}
|
||||
|
||||
foreach (InventoryNodeBase node in nodes)
|
||||
FixPerms(node);
|
||||
}
|
||||
@@ -197,18 +198,19 @@ namespace OpenSim.Region.CoreModules.Framework.Library
|
||||
archread.Close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void FixPerms(InventoryNodeBase node)
|
||||
{
|
||||
m_log.DebugFormat("[LIBRARY MODULE]: Fixing perms for {0} {1}", node.Name, node.ID);
|
||||
|
||||
if (node is InventoryItemBase)
|
||||
{
|
||||
InventoryItemBase item = (InventoryItemBase)node;
|
||||
item.BasePermissions = 0x7FFFFFFF;
|
||||
item.EveryOnePermissions = 0x7FFFFFFF;
|
||||
item.CurrentPermissions = 0x7FFFFFFF;
|
||||
item.NextPermissions = 0x7FFFFFFF;
|
||||
item.BasePermissions = (uint)PermissionMask.All;
|
||||
item.EveryOnePermissions = (uint)PermissionMask.All - (uint)PermissionMask.Modify;
|
||||
item.CurrentPermissions = (uint)PermissionMask.All;
|
||||
item.NextPermissions = (uint)PermissionMask.All;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
|
||||
m_scene.AddCommand(this, "monitor report",
|
||||
"monitor report",
|
||||
"Returns a variety of statistics about the current region and/or simulator",
|
||||
|
||||
@@ -186,7 +186,6 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string[] GetUserNames(UUID uuid)
|
||||
{
|
||||
string[] returnstring = new string[2];
|
||||
@@ -292,6 +291,25 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
return userID.ToString();
|
||||
}
|
||||
|
||||
public void AddUser(UUID uuid, string first, string last)
|
||||
{
|
||||
if (m_UserCache.ContainsKey(uuid))
|
||||
return;
|
||||
|
||||
UserData user = new UserData();
|
||||
user.Id = uuid;
|
||||
user.FirstName = first;
|
||||
user.LastName = last;
|
||||
// user.ProfileURL = we should initialize this to the default
|
||||
|
||||
AddUserInternal(user);
|
||||
}
|
||||
|
||||
public void AddUser(UUID uuid, string first, string last, string profileURL)
|
||||
{
|
||||
AddUser(uuid, profileURL + ";" + first + " " + last);
|
||||
}
|
||||
|
||||
public void AddUser(UUID id, string creatorData)
|
||||
{
|
||||
if (m_UserCache.ContainsKey(id))
|
||||
@@ -299,18 +317,17 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
|
||||
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, craetorData {1}", id, creatorData);
|
||||
|
||||
UserData user = new UserData();
|
||||
user.Id = id;
|
||||
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id);
|
||||
|
||||
if (account != null)
|
||||
{
|
||||
user.FirstName = account.FirstName;
|
||||
user.LastName = account.LastName;
|
||||
// user.ProfileURL = we should initialize this to the default
|
||||
AddUser(id, account.FirstName, account.LastName);
|
||||
}
|
||||
else
|
||||
{
|
||||
UserData user = new UserData();
|
||||
user.Id = id;
|
||||
|
||||
if (creatorData != null && creatorData != string.Empty)
|
||||
{
|
||||
//creatorData = <endpoint>;<name>
|
||||
@@ -338,17 +355,19 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
user.FirstName = "Unknown";
|
||||
user.LastName = "User";
|
||||
}
|
||||
|
||||
AddUserInternal(user);
|
||||
}
|
||||
|
||||
lock (m_UserCache)
|
||||
m_UserCache[id] = user;
|
||||
|
||||
//m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.HomeURL);
|
||||
}
|
||||
|
||||
public void AddUser(UUID uuid, string first, string last, string profileURL)
|
||||
void AddUserInternal(UserData user)
|
||||
{
|
||||
AddUser(uuid, profileURL + ";" + first + " " + last);
|
||||
lock (m_UserCache)
|
||||
m_UserCache[user.Id] = user;
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}",
|
||||
user.Id, user.FirstName, user.LastName, user.HomeURL);
|
||||
}
|
||||
|
||||
//public void AddUser(UUID uuid, string userData)
|
||||
|
||||
Reference in New Issue
Block a user