Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor

avinationmerge
Tom Grimshaw 2010-06-27 22:23:08 -07:00
commit 7807d11807
14 changed files with 86 additions and 62 deletions

View File

@ -67,7 +67,6 @@ namespace OpenSim.Data
/// really want is the assembly of your database class. /// really want is the assembly of your database class.
/// ///
/// </summary> /// </summary>
public class Migration public class Migration
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -173,8 +172,6 @@ namespace OpenSim.Data
ExecuteScript(_conn, script); ExecuteScript(_conn, script);
} }
public void Update() public void Update()
{ {
InitMigrationsTable(); InitMigrationsTable();
@ -186,8 +183,8 @@ namespace OpenSim.Data
return; return;
// to prevent people from killing long migrations. // to prevent people from killing long migrations.
m_log.InfoFormat("[MIGRATIONS] Upgrading {0} to latest revision {1}.", _type, migrations.Keys[migrations.Count - 1]); m_log.InfoFormat("[MIGRATIONS]: Upgrading {0} to latest revision {1}.", _type, migrations.Keys[migrations.Count - 1]);
m_log.Info("[MIGRATIONS] NOTE: this may take a while, don't interupt this process!"); m_log.Info("[MIGRATIONS]: NOTE - this may take a while, don't interrupt this process!");
foreach (KeyValuePair<int, string[]> kvp in migrations) foreach (KeyValuePair<int, string[]> kvp in migrations)
{ {
@ -206,7 +203,7 @@ namespace OpenSim.Data
} }
catch (Exception e) catch (Exception e)
{ {
m_log.DebugFormat("[MIGRATIONS] Cmd was {0}", e.Message.Replace("\n", " ")); m_log.DebugFormat("[MIGRATIONS]: Cmd was {0}", e.Message.Replace("\n", " "));
m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing."); m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing.");
ExecuteScript("ROLLBACK;"); ExecuteScript("ROLLBACK;");
} }

View File

@ -64,11 +64,19 @@ namespace OpenSim.Data.MySQL
public bool StoreFolder(XInventoryFolder folder) public bool StoreFolder(XInventoryFolder folder)
{ {
if (folder.folderName.Length > 64)
folder.folderName = folder.folderName.Substring(0, 64);
return m_Folders.Store(folder); return m_Folders.Store(folder);
} }
public bool StoreItem(XInventoryItem item) public bool StoreItem(XInventoryItem item)
{ {
if (item.inventoryName.Length > 64)
item.inventoryName = item.inventoryName.Substring(0, 64);
if (item.inventoryDescription.Length > 128)
item.inventoryDescription = item.inventoryDescription.Substring(0, 128);
return m_Items.Store(item); return m_Items.Store(item);
} }

View File

@ -66,11 +66,19 @@ namespace OpenSim.Data.SQLite
public bool StoreFolder(XInventoryFolder folder) public bool StoreFolder(XInventoryFolder folder)
{ {
if (folder.folderName.Length > 64)
folder.folderName = folder.folderName.Substring(0, 64);
return m_Folders.Store(folder); return m_Folders.Store(folder);
} }
public bool StoreItem(XInventoryItem item) public bool StoreItem(XInventoryItem item)
{ {
if (item.inventoryName.Length > 64)
item.inventoryName = item.inventoryName.Substring(0, 64);
if (item.inventoryDescription.Length > 128)
item.inventoryDescription = item.inventoryDescription.Substring(0, 128);
return m_Items.Store(item); return m_Items.Store(item);
} }

View File

@ -6316,8 +6316,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerObjectDuplicate != null) if (handlerObjectDuplicate != null)
{ {
handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset, handlerObjectDuplicate(dupe.ObjectData[i].ObjectLocalID, dupe.SharedData.Offset,
dupe.SharedData.DuplicateFlags, AgentandGroupData.AgentID, dupe.SharedData.DuplicateFlags, AgentId,
AgentandGroupData.GroupID); m_activeGroupID);
} }
} }
@ -6907,7 +6907,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerObjectDuplicateOnRay != null) if (handlerObjectDuplicateOnRay != null)
{ {
handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags, handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags,
dupeOnRay.AgentData.AgentID, dupeOnRay.AgentData.GroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd, AgentId, m_activeGroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection, dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection,
dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates); dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates);
} }

View File

@ -40,7 +40,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.CoreModules.Scripting.EmailModules namespace OpenSim.Region.CoreModules.Scripting.EmailModules
{ {
public class EmailModule : IEmailModule public class EmailModule : IRegionModule, IEmailModule
{ {
// //
// Log // Log

View File

@ -134,6 +134,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
{ {
if (kvp.Key != UUID.Zero)
m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
} }
@ -269,7 +270,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e); m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}{1}", e.Message, e.StackTrace);
} }
} }
@ -285,7 +286,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[ARCHIVER]: Terminating archive creation since asset requster callback failed with {0}", e); "[ARCHIVER]: Terminating archive creation since asset requester callback failed with {0}{1}",
e.Message, e.StackTrace);
} }
} }
} }

View File

@ -38,7 +38,7 @@ namespace OpenSim.Region.Framework.Interfaces
public int numLeft; public int numLeft;
} }
public interface IEmailModule : IRegionModule public interface IEmailModule
{ {
void SendEmail(UUID objectID, string address, string subject, string body); void SendEmail(UUID objectID, string address, string subject, string body);
Email GetNextEmail(UUID objectID, string sender, string subject); Email GetNextEmail(UUID objectID, string sender, string subject);

View File

@ -400,9 +400,9 @@ namespace OpenSim.Region.Framework.Scenes
if (Permissions.PropagatePermissions() && recipient != senderId) if (Permissions.PropagatePermissions() && recipient != senderId)
{ {
// First, make sore base is limited to the next perms // First, make sore base is limited to the next perms
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
// By default, current equals base // By default, current equals base
itemCopy.CurrentPermissions = itemCopy.BasePermissions; itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions;
// If this is an object, replace current perms // If this is an object, replace current perms
// with folded perms // with folded perms
@ -413,7 +413,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
// Ensure there is no escalation // Ensure there is no escalation
itemCopy.CurrentPermissions &= item.NextPermissions; itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move);
// Need slam bit on xfer // Need slam bit on xfer
itemCopy.CurrentPermissions |= 8; itemCopy.CurrentPermissions |= 8;
@ -916,14 +916,15 @@ namespace OpenSim.Region.Framework.Scenes
if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
{ {
agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions; agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
if (taskItem.InvType == (int)InventoryType.Object) if (taskItem.InvType == (int)InventoryType.Object)
agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move));
agentItem.CurrentPermissions = agentItem.BasePermissions ; else
agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
agentItem.CurrentPermissions |= 8; agentItem.CurrentPermissions |= 8;
agentItem.NextPermissions = taskItem.NextPermissions; agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
} }
else else
@ -1105,13 +1106,13 @@ namespace OpenSim.Region.Framework.Scenes
if (Permissions.PropagatePermissions()) if (Permissions.PropagatePermissions())
{ {
destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions & destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions &
srcTaskItem.NextPermissions; (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions & destTaskItem.GroupPermissions = srcTaskItem.GroupPermissions &
srcTaskItem.NextPermissions; (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions & destTaskItem.EveryonePermissions = srcTaskItem.EveryonePermissions &
srcTaskItem.NextPermissions; (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.BasePermissions = srcTaskItem.BasePermissions & destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
srcTaskItem.NextPermissions; (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.CurrentPermissions |= 8; // Slam! destTaskItem.CurrentPermissions |= 8; // Slam!
} }
} }

View File

@ -1848,9 +1848,31 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (m_parentScene.Permissions.CanDuplicateObject(original.Children.Count, original.UUID, AgentID, original.AbsolutePosition)) if (m_parentScene.Permissions.CanDuplicateObject(original.Children.Count, original.UUID, AgentID, original.AbsolutePosition))
{ {
SceneObjectGroup copy = original.Copy(AgentID, GroupID, true); SceneObjectGroup copy = original.Copy(true);
copy.AbsolutePosition = copy.AbsolutePosition + offset; copy.AbsolutePosition = copy.AbsolutePosition + offset;
if (original.OwnerID != AgentID)
{
copy.SetOwnerId(AgentID);
copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID);
List<SceneObjectPart> partList =
new List<SceneObjectPart>(copy.Children.Values);
if (m_parentScene.Permissions.PropagatePermissions())
{
foreach (SceneObjectPart child in partList)
{
child.Inventory.ChangeInventoryOwner(AgentID);
child.TriggerScriptChangedEvent(Changed.OWNER);
child.ApplyNextOwnerPermissions();
}
}
copy.RootPart.ObjectSaleType = 0;
copy.RootPart.SalePrice = 10;
}
Entities.Add(copy); Entities.Add(copy);
// Since we copy from a source group that is in selected // Since we copy from a source group that is in selected

View File

@ -1700,7 +1700,7 @@ namespace OpenSim.Region.Framework.Scenes
"[SCENE]: Storing {0}, {1} in {2}", "[SCENE]: Storing {0}, {1} in {2}",
Name, UUID, m_scene.RegionInfo.RegionName); Name, UUID, m_scene.RegionInfo.RegionName);
SceneObjectGroup backup_group = Copy(OwnerID, GroupID, false); SceneObjectGroup backup_group = Copy(false);
backup_group.RootPart.Velocity = RootPart.Velocity; backup_group.RootPart.Velocity = RootPart.Velocity;
backup_group.RootPart.Acceleration = RootPart.Acceleration; backup_group.RootPart.Acceleration = RootPart.Acceleration;
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity; backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
@ -1758,7 +1758,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Duplicates this object, including operations such as physics set up and attaching to the backup event. /// Duplicates this object, including operations such as physics set up and attaching to the backup event.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed) public SceneObjectGroup Copy(bool userExposed)
{ {
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
dupe.m_isBackedUp = false; dupe.m_isBackedUp = false;
@ -1781,7 +1781,9 @@ namespace OpenSim.Region.Framework.Scenes
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
if (!userExposed) if (!userExposed)
{
dupe.RootPart.IsAttachment = previousAttachmentStatus; dupe.RootPart.IsAttachment = previousAttachmentStatus;
}
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
@ -1806,16 +1808,6 @@ namespace OpenSim.Region.Framework.Scenes
dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
} }
// Now we've made a copy that replaces this one, we need to
// switch the owner to the person who did the copying
// Second Life copies an object and duplicates the first one in it's place
// So, we have to make a copy of this one, set it in it's place then set the owner on this one
if (userExposed)
{
SetRootPartOwner(m_rootPart, cAgentID, cGroupID);
m_rootPart.ScheduleFullUpdate();
}
List<SceneObjectPart> partList; List<SceneObjectPart> partList;
lockPartsForRead(true); lockPartsForRead(true);
@ -1837,12 +1829,6 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
newPart.LinkNum = part.LinkNum; newPart.LinkNum = part.LinkNum;
if (userExposed)
{
SetPartOwner(newPart, cAgentID, cGroupID);
newPart.ScheduleFullUpdate();
}
} }
} }
@ -3911,7 +3897,7 @@ namespace OpenSim.Region.Framework.Scenes
public virtual ISceneObject CloneForNewScene() public virtual ISceneObject CloneForNewScene()
{ {
SceneObjectGroup sog = Copy(this.OwnerID, this.GroupID, false); SceneObjectGroup sog = Copy(false);
sog.m_isDeleted = false; sog.m_isDeleted = false;
return sog; return sog;
} }

View File

@ -73,7 +73,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
public ContentManagementEntity(SceneObjectGroup Unchanged, bool physics) public ContentManagementEntity(SceneObjectGroup Unchanged, bool physics)
: base(Unchanged, false) : base(Unchanged, false)
{ {
m_UnchangedEntity = Unchanged.Copy(Unchanged.RootPart.OwnerID, Unchanged.RootPart.GroupID, false); m_UnchangedEntity = Unchanged.Copy(false);
} }
public ContentManagementEntity(string objectXML, Scene scene, bool physics) public ContentManagementEntity(string objectXML, Scene scene, bool physics)

View File

@ -80,7 +80,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
/// </summary> /// </summary>
public MetaEntity(SceneObjectGroup orig, bool physics) public MetaEntity(SceneObjectGroup orig, bool physics)
{ {
m_Entity = orig.Copy(orig.RootPart.OwnerID, orig.RootPart.GroupID, false); m_Entity = orig.Copy(false);
Initialize(physics); Initialize(physics);
} }

View File

@ -675,7 +675,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity
d.Vector3 pos = d.BodyGetPosition(Body); d.Vector3 pos = d.BodyGetPosition(Body);
Vector3 accel = new Vector3(-(m_dir.X - m_lastLinearVelocityVector.X / 0.1f), -(m_dir.Y - m_lastLinearVelocityVector.Y / 0.1f), m_dir.Z - m_lastLinearVelocityVector.Z / 0.1f); // Vector3 accel = new Vector3(-(m_dir.X - m_lastLinearVelocityVector.X / 0.1f), -(m_dir.Y - m_lastLinearVelocityVector.Y / 0.1f), m_dir.Z - m_lastLinearVelocityVector.Z / 0.1f);
Vector3 posChange = new Vector3(); Vector3 posChange = new Vector3();
posChange.X = pos.X - m_lastPositionVector.X; posChange.X = pos.X - m_lastPositionVector.X;
posChange.Y = pos.Y - m_lastPositionVector.Y; posChange.Y = pos.Y - m_lastPositionVector.Y;

View File

@ -1576,19 +1576,19 @@ Console.WriteLine(" JointCreateFixed");
//Console.WriteLine("Move " + m_primName); //Console.WriteLine("Move " + m_primName);
if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009
// NON-'VEHICLES' are dealt with here // NON-'VEHICLES' are dealt with here
if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) // if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f))
{ // {
d.Vector3 avel2 = d.BodyGetAngularVel(Body); // d.Vector3 avel2 = d.BodyGetAngularVel(Body);
/* // /*
if (m_angularlock.X == 1) // if (m_angularlock.X == 1)
avel2.X = 0; // avel2.X = 0;
if (m_angularlock.Y == 1) // if (m_angularlock.Y == 1)
avel2.Y = 0; // avel2.Y = 0;
if (m_angularlock.Z == 1) // if (m_angularlock.Z == 1)
avel2.Z = 0; // avel2.Z = 0;
d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z); // d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z);
*/ // */
} // }
//float PID_P = 900.0f; //float PID_P = 900.0f;
float m_mass = CalculateMass(); float m_mass = CalculateMass();