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

avinationmerge
Melanie Thielker 2010-06-27 21:05:06 +02:00
commit 2cced72d70
8 changed files with 66 additions and 37 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

@ -134,7 +134,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
{ {
m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); if (kvp.Key != UUID.Zero)
m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
} }
m_requestCallbackTimer.Enabled = true; m_requestCallbackTimer.Enabled = true;
@ -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

@ -1303,18 +1303,31 @@ namespace OpenSim.Region.CoreModules.World.Land
public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data)
{ {
for (int i = 0; i < data.Count; i++) lock (m_landList)
{ {
IncomingLandObjectFromStorage(data[i]); //Remove all the land objects in the sim and then process our new data
foreach (int n in m_landList.Keys)
{
m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID);
}
m_landIDList.Initialize();
m_landList.Clear();
for (int i = 0; i < data.Count; i++)
{
IncomingLandObjectFromStorage(data[i]);
}
} }
} }
public void IncomingLandObjectFromStorage(LandData data) public void IncomingLandObjectFromStorage(LandData data)
{ {
ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
new_land.LandData = data.Copy(); new_land.LandData = data.Copy();
new_land.SetLandBitmapFromByteArray(); new_land.SetLandBitmapFromByteArray();
AddLandObject(new_land); AddLandObject(new_land);
new_land.SendLandUpdateToAvatarsOverMe();
} }
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)

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

@ -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();