Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim

prebuild-update
Melanie 2010-06-29 20:36:36 +01:00
commit 5d11833ae1
13 changed files with 142 additions and 46 deletions

View File

@ -768,8 +768,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
bool canEditObjectsChanged = ((rights ^ userFlags) & (int)FriendRights.CanModifyObjects) != 0; bool canEditObjectsChanged = ((rights ^ userFlags) & (int)FriendRights.CanModifyObjects) != 0;
if (canEditObjectsChanged) if (canEditObjectsChanged)
friendClient.SendChangeUserRights(userID, friendID, rights); friendClient.SendChangeUserRights(userID, friendID, rights);
} }
// update local cache
//m_Friends[friendID].Friends = m_FriendsService.GetFriends(friendID);
foreach (FriendInfo finfo in m_Friends[friendID].Friends)
if (finfo.Friend == userID.ToString())
finfo.TheirFlags = rights;
return true; return true;
} }

View File

@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return ret; return ret;
} }
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, public override UUID DeleteToInventory(DeRezAction action, UUID folderID,
SceneObjectGroup objectGroup, IClientAPI remoteClient) SceneObjectGroup objectGroup, IClientAPI remoteClient)
{ {
UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient); UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);

View File

@ -286,22 +286,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
// Deleting someone else's item // Deleting someone else's item
// //
if (remoteClient == null || if (remoteClient == null ||
objectGroup.OwnerID != remoteClient.AgentId) objectGroup.OwnerID != remoteClient.AgentId)
{ {
// Folder skeleton may not be loaded and we
// have to wait for the inventory to find
// the destination folder
//
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
} }
else else
{ {
// Assume inventory skeleton was loaded during login
// and all folders can be found
//
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder); folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
} }
} }
@ -332,7 +324,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (folder == null) // None of the above if (folder == null) // None of the above
{ {
//folder = userInfo.RootFolder.FindFolder(folderID);
folder = new InventoryFolderBase(folderID); folder = new InventoryFolderBase(folderID);
if (folder == null) // Nowhere to put it if (folder == null) // Nowhere to put it

View File

@ -96,7 +96,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory
Object[] args = new Object[] { m_Config, MainServer.Instance, "HGInventoryService" }; Object[] args = new Object[] { m_Config, MainServer.Instance, "HGInventoryService" };
ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:HGInventoryServiceInConnector", args); ServerUtils.LoadPlugin<IServiceConnector>("OpenSim.Server.Handlers.dll:XInventoryInConnector", args);
} }
} }

View File

@ -134,7 +134,6 @@ 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);
} }
@ -270,7 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}{1}", e.Message, e.StackTrace); m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e);
} }
} }
@ -286,8 +285,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[ARCHIVER]: Terminating archive creation since asset requester callback failed with {0}{1}", "[ARCHIVER]: Terminating archive creation since asset requster callback failed with {0}", e);
e.Message, e.StackTrace);
} }
} }
} }

View File

@ -356,14 +356,26 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
} }
foreach (IScriptModule e in engines) foreach (IScriptModule e in engines)
{ {
if (e != null) if (e != null)
{
// Stop an exception in setting saved state from propogating since this is not fatal.
try
{ {
if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
break; break;
} }
catch (Exception ex)
{
m_log.WarnFormat(
"[PRIM INVENTORY]: Could not set script state for old key {0}, new key {1} in prim {2} {3}. Exception {4}{5}",
oldID, newID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
} }
}
}
m_part.ParentGroup.m_savedScriptState.Remove(oldID); m_part.ParentGroup.m_savedScriptState.Remove(oldID);
} }
} }
@ -1020,6 +1032,10 @@ namespace OpenSim.Region.Framework.Scenes
foreach (IScriptModule e in engines) foreach (IScriptModule e in engines)
{ {
if (e != null) if (e != null)
{
// Stop any exception from the script engine from propogating since setting state
// isn't essential.
try
{ {
string n = e.GetXMLState(item.ItemID); string n = e.GetXMLState(item.ItemID);
if (n != String.Empty) if (n != String.Empty)
@ -1029,6 +1045,13 @@ namespace OpenSim.Region.Framework.Scenes
break; break;
} }
} }
catch (Exception ex)
{
m_log.WarnFormat(
"[PRIM INVENTORY]: Could not retrieve script state for item {0} {1} in prim {2} {3}. Exception {4}{5}",
item.Name, item.ItemID, m_part.Name, m_part.UUID, ex.Message, ex.StackTrace);
}
}
} }
} }
} }

View File

@ -705,22 +705,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
//A and B should both be normalized //A and B should both be normalized
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
LSL_Rotation rotBetween;
// Check for zero vectors. If either is zero, return zero rotation. Otherwise,
// continue calculation.
if (a == new LSL_Vector(0.0f, 0.0f, 0.0f) || b == new LSL_Vector(0.0f, 0.0f, 0.0f))
{
rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
}
else
{
a = LSL_Vector.Norm(a);
b = LSL_Vector.Norm(b);
double dotProduct = LSL_Vector.Dot(a, b); double dotProduct = LSL_Vector.Dot(a, b);
// There are two degenerate cases possible. These are for vectors 180 or
// 0 degrees apart. These have to be detected and handled individually.
//
// Check for vectors 180 degrees apart.
// A dot product of -1 would mean the angle between vectors is 180 degrees.
if (dotProduct < -0.9999999f)
{
// First assume X axis is orthogonal to the vectors.
LSL_Vector orthoVector = new LSL_Vector(1.0f, 0.0f, 0.0f);
orthoVector = orthoVector - a * (a.x / LSL_Vector.Dot(a, a));
// Check for near zero vector. A very small non-zero number here will create
// a rotation in an undesired direction.
if (LSL_Vector.Mag(orthoVector) > 0.0001)
{
rotBetween = new LSL_Rotation(orthoVector.x, orthoVector.y, orthoVector.z, 0.0f);
}
// If the magnitude of the vector was near zero, then assume the X axis is not
// orthogonal and use the Z axis instead.
else
{
// Set 180 z rotation.
rotBetween = new LSL_Rotation(0.0f, 0.0f, 1.0f, 0.0f);
}
}
// Check for parallel vectors.
// A dot product of 1 would mean the angle between vectors is 0 degrees.
else if (dotProduct > 0.9999999f)
{
// Set zero rotation.
rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
}
else
{
// All special checks have been performed so get the axis of rotation.
LSL_Vector crossProduct = LSL_Vector.Cross(a, b); LSL_Vector crossProduct = LSL_Vector.Cross(a, b);
double magProduct = LSL_Vector.Mag(a) * LSL_Vector.Mag(b); // Quarternion s value is the length of the unit vector + dot product.
double angle = Math.Acos(dotProduct / magProduct); double qs = 1.0 + dotProduct;
LSL_Vector axis = LSL_Vector.Norm(crossProduct); rotBetween = new LSL_Rotation(crossProduct.x, crossProduct.y, crossProduct.z, qs);
double s = Math.Sin(angle / 2); // Normalize the rotation.
double mag = LSL_Rotation.Mag(rotBetween);
double x = axis.x * s; // We shouldn't have to worry about a divide by zero here. The qs value will be
double y = axis.y * s; // non-zero because we already know if we're here, then the dotProduct is not -1 so
double z = axis.z * s; // qs will not be zero. Also, we've already handled the input vectors being zero so the
double w = Math.Cos(angle / 2); // crossProduct vector should also not be zero.
rotBetween.x = rotBetween.x / mag;
if (Double.IsNaN(x) || Double.IsNaN(y) || Double.IsNaN(z) || Double.IsNaN(w)) rotBetween.y = rotBetween.y / mag;
return new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f); rotBetween.z = rotBetween.z / mag;
rotBetween.s = rotBetween.s / mag;
return new LSL_Rotation((float)x, (float)y, (float)z, (float)w); // Check for undefined values and set zero rotation if any found. This code might not actually be required
// any longer since zero vectors are checked for at the top.
if (Double.IsNaN(rotBetween.x) || Double.IsNaN(rotBetween.y) || Double.IsNaN(rotBetween.z) || Double.IsNaN(rotBetween.s))
{
rotBetween = new LSL_Rotation(0.0f, 0.0f, 0.0f, 1.0f);
}
}
}
return rotBetween;
} }
public void llWhisper(int channelID, string text) public void llWhisper(int channelID, string text)

View File

@ -44,6 +44,8 @@ namespace OpenSim.Server.Handlers.Asset
{ {
public class XInventoryInConnector : ServiceConnector public class XInventoryInConnector : ServiceConnector
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IInventoryService m_InventoryService; private IInventoryService m_InventoryService;
private string m_ConfigName = "InventoryService"; private string m_ConfigName = "InventoryService";
@ -53,6 +55,8 @@ namespace OpenSim.Server.Handlers.Asset
if (configName != String.Empty) if (configName != String.Empty)
m_ConfigName = configName; m_ConfigName = configName;
m_log.DebugFormat("[XInventoryInConnector]: Starting with config name {0}", m_ConfigName);
IConfig serverConfig = config.Configs[m_ConfigName]; IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null) if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));

View File

@ -255,7 +255,11 @@ namespace OpenSim.Services.GridService
{ {
m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName); m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName);
} }
regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort + ":" + regInfo.RegionName; string name = regInfo.RegionName;
regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort;
if (name != string.Empty)
regInfo.RegionName += ":" + name;
// Try get the map image // Try get the map image
//regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL);
// I need a texture that works for this... the one I tried doesn't seem to be working // I need a texture that works for this... the one I tried doesn't seem to be working

View File

@ -108,13 +108,13 @@ namespace OpenSim.Services.InventoryService
// Warp! Root folder for travelers // Warp! Root folder for travelers
XInventoryFolder[] folders = m_Database.GetFolders( XInventoryFolder[] folders = m_Database.GetFolders(
new string[] { "agentID", "folderName"}, new string[] { "agentID", "folderName"},
new string[] { principalID.ToString(), "Suitcase" }); new string[] { principalID.ToString(), "My Suitcase" });
if (folders.Length > 0) if (folders.Length > 0)
return ConvertToOpenSim(folders[0]); return ConvertToOpenSim(folders[0]);
// make one // make one
XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "Suitcase"); XInventoryFolder suitcase = CreateFolder(principalID, UUID.Zero, (int)AssetType.Folder, "My Suitcase");
return ConvertToOpenSim(suitcase); return ConvertToOpenSim(suitcase);
} }

View File

@ -200,7 +200,14 @@ namespace OpenSim.Services.InventoryService
if (folders.Length == 0) if (folders.Length == 0)
return null; return null;
return ConvertToOpenSim(folders[0]); XInventoryFolder root = null;
foreach (XInventoryFolder folder in folders)
if (folder.folderName == "My Inventory")
root = folder;
if (folders == null) // oops
root = folders[0];
return ConvertToOpenSim(root);
} }
public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type)

View File

@ -198,6 +198,10 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; CHANGE THIS ; CHANGE THIS
ExternalName = "http://127.0.0.1:8002" ExternalName = "http://127.0.0.1:8002"
; Does this grid allow incoming links to any region in it?
; If false, HG TPs happen only to the Default regions specified in [GridService] section
AllowTeleportsToAnyRegion = true
[UserAgentService] [UserAgentService]
LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService" LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService"
;; for the service ;; for the service

View File

@ -68,3 +68,8 @@
[GatekeeperService] [GatekeeperService]
ExternalName = "http://127.0.0.1:9000" ExternalName = "http://127.0.0.1:9000"
; Does this grid allow incoming links to any region in it?
; If false, HG TPs happen only to the Default regions specified in [GridService] section
AllowTeleportsToAnyRegion = true