Merge branch 'careminster' into windlight

avinationmerge
unknown 2009-12-07 18:14:02 +01:00
commit dbd8c400ce
39 changed files with 638 additions and 341 deletions

View File

@ -413,8 +413,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController
ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>();
if (null == terrainModule) throw new Exception("terrain module not available"); if (null == terrainModule) throw new Exception("terrain module not available");
if (Uri.IsWellFormedUriString(file, UriKind.Absolute))
{
m_log.Info("[RADMIN]: Terrain path is URL");
Uri result;
if (Uri.TryCreate(file, UriKind.RelativeOrAbsolute, out result))
{
// the url is valid
string fileType = file.Substring(file.LastIndexOf('/') + 1);
terrainModule.LoadFromStream(fileType, result);
}
}
else
{
terrainModule.LoadFromFile(file); terrainModule.LoadFromFile(file);
}
responseData["success"] = false; responseData["success"] = false;
response.Value = responseData; response.Value = responseData;

View File

@ -479,7 +479,9 @@ namespace OpenSim.Data.MySQL
} }
else else
{ {
m_log.Warn("[REGION DB]: Database contains an orphan child prim " + prim.UUID + " pointing to missing parent " + prim.ParentUUID); m_log.WarnFormat(
"[REGION DB]: Database contains an orphan child prim {0} {1} at {2} in region {3} pointing to missing parent {4}. This prim will not be loaded.",
prim.Name, prim.UUID, prim.AbsolutePosition, regionID, prim.ParentUUID);
} }
} }
} }

View File

@ -819,7 +819,10 @@ namespace OpenSim.Data.SQLite
SQLiteUtil.createCol(users, "homeLookAtZ", typeof (Double)); SQLiteUtil.createCol(users, "homeLookAtZ", typeof (Double));
SQLiteUtil.createCol(users, "created", typeof (Int32)); SQLiteUtil.createCol(users, "created", typeof (Int32));
SQLiteUtil.createCol(users, "lastLogin", typeof (Int32)); SQLiteUtil.createCol(users, "lastLogin", typeof (Int32));
//TODO: Please delete this column. It's now a brick
SQLiteUtil.createCol(users, "rootInventoryFolderID", typeof (String)); SQLiteUtil.createCol(users, "rootInventoryFolderID", typeof (String));
SQLiteUtil.createCol(users, "userInventoryURI", typeof (String)); SQLiteUtil.createCol(users, "userInventoryURI", typeof (String));
SQLiteUtil.createCol(users, "userAssetURI", typeof (String)); SQLiteUtil.createCol(users, "userAssetURI", typeof (String));
SQLiteUtil.createCol(users, "profileCanDoMask", typeof (Int32)); SQLiteUtil.createCol(users, "profileCanDoMask", typeof (Int32));
@ -980,7 +983,6 @@ namespace OpenSim.Data.SQLite
user.Created = Convert.ToInt32(row["created"]); user.Created = Convert.ToInt32(row["created"]);
user.LastLogin = Convert.ToInt32(row["lastLogin"]); user.LastLogin = Convert.ToInt32(row["lastLogin"]);
user.RootInventoryFolderID = new UUID((String) row["rootInventoryFolderID"]);
user.UserInventoryURI = (String) row["userInventoryURI"]; user.UserInventoryURI = (String) row["userInventoryURI"];
user.UserAssetURI = (String) row["userAssetURI"]; user.UserAssetURI = (String) row["userAssetURI"];
user.CanDoMask = Convert.ToUInt32(row["profileCanDoMask"]); user.CanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
@ -1026,7 +1028,8 @@ namespace OpenSim.Data.SQLite
row["created"] = user.Created; row["created"] = user.Created;
row["lastLogin"] = user.LastLogin; row["lastLogin"] = user.LastLogin;
row["rootInventoryFolderID"] = user.RootInventoryFolderID.ToString(); //TODO: Get rid of rootInventoryFolderID in a safe way.
row["rootInventoryFolderID"] = UUID.Zero.ToString();
row["userInventoryURI"] = user.UserInventoryURI; row["userInventoryURI"] = user.UserInventoryURI;
row["userAssetURI"] = user.UserAssetURI; row["userAssetURI"] = user.UserAssetURI;
row["profileCanDoMask"] = user.CanDoMask; row["profileCanDoMask"] = user.CanDoMask;

View File

@ -170,8 +170,8 @@ namespace OpenSim.Data.Tests
{ {
UserProfileData u0 = NewUser(zero,fname0,lname0); UserProfileData u0 = NewUser(zero,fname0,lname0);
UserProfileData u4 = NewUser(user4,fname2,lname2); UserProfileData u4 = NewUser(user4,fname2,lname2);
db.AddNewUserProfile(u0); db.AddNewUserProfile(u0); //UserID 0 should fail to save.
db.AddNewUserProfile(u4); db.AddNewUserProfile(u4); //The first name and last name are already in use (from T010), so this should fail too
Assert.That(db.GetUserByUUID(zero),Is.Null); Assert.That(db.GetUserByUUID(zero),Is.Null);
Assert.That(db.GetUserByUUID(user4),Is.Null); Assert.That(db.GetUserByUUID(user4),Is.Null);
} }
@ -267,8 +267,6 @@ namespace OpenSim.Data.Tests
Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt), "Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt))"); Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt), "Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt))");
Assert.That(created,Is.EqualTo(u1a.Created), "Assert.That(created,Is.EqualTo(u1a.Created))"); Assert.That(created,Is.EqualTo(u1a.Created), "Assert.That(created,Is.EqualTo(u1a.Created))");
Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin), "Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin))"); Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin), "Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin))");
// RootInventoryFolderID is not tested because it is saved in SQLite,
// but not in MySQL
Assert.That(userinvuri,Is.EqualTo(u1a.UserInventoryURI), "Assert.That(userinvuri,Is.EqualTo(u1a.UserInventoryURI))"); Assert.That(userinvuri,Is.EqualTo(u1a.UserInventoryURI), "Assert.That(userinvuri,Is.EqualTo(u1a.UserInventoryURI))");
Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI), "Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI))"); Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI), "Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI))");
Assert.That(candomask,Is.EqualTo(u1a.CanDoMask), "Assert.That(candomask,Is.EqualTo(u1a.CanDoMask))"); Assert.That(candomask,Is.EqualTo(u1a.CanDoMask), "Assert.That(candomask,Is.EqualTo(u1a.CanDoMask))");
@ -367,8 +365,6 @@ namespace OpenSim.Data.Tests
Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt), "Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt))"); Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt), "Assert.That(homelookat,Is.EqualTo(u1a.HomeLookAt))");
Assert.That(created,Is.EqualTo(u1a.Created), "Assert.That(created,Is.EqualTo(u1a.Created))"); Assert.That(created,Is.EqualTo(u1a.Created), "Assert.That(created,Is.EqualTo(u1a.Created))");
Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin), "Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin))"); Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin), "Assert.That(lastlogin,Is.EqualTo(u1a.LastLogin))");
// RootInventoryFolderID is not tested because it is saved in SQLite,
// but not in MySQL
Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI), "Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI))"); Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI), "Assert.That(userasseturi,Is.EqualTo(u1a.UserAssetURI))");
Assert.That(candomask,Is.EqualTo(u1a.CanDoMask), "Assert.That(candomask,Is.EqualTo(u1a.CanDoMask))"); Assert.That(candomask,Is.EqualTo(u1a.CanDoMask), "Assert.That(candomask,Is.EqualTo(u1a.CanDoMask))");
Assert.That(wantdomask,Is.EqualTo(u1a.WantDoMask), "Assert.That(wantdomask,Is.EqualTo(u1a.WantDoMask))"); Assert.That(wantdomask,Is.EqualTo(u1a.WantDoMask), "Assert.That(wantdomask,Is.EqualTo(u1a.WantDoMask))");
@ -395,7 +391,6 @@ namespace OpenSim.Data.Tests
Assert.That(u1a, Constraints.PropertyCompareConstraint(u) Assert.That(u1a, Constraints.PropertyCompareConstraint(u)
.IgnoreProperty(x=>x.HomeRegionX) .IgnoreProperty(x=>x.HomeRegionX)
.IgnoreProperty(x=>x.HomeRegionY) .IgnoreProperty(x=>x.HomeRegionY)
.IgnoreProperty(x=>x.RootInventoryFolderID)
); );
} }

View File

@ -244,7 +244,6 @@ namespace OpenSim.Framework.Communications.Services
InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString();
ArrayList InventoryRoot = new ArrayList(); ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash); InventoryRoot.Add(InventoryRootHash);
userProfile.RootInventoryFolderID = inventData.RootFolderID;
logResponse.InventoryRoot = InventoryRoot; logResponse.InventoryRoot = InventoryRoot;
logResponse.InventorySkeleton = AgentInventoryArray; logResponse.InventorySkeleton = AgentInventoryArray;
@ -501,7 +500,6 @@ namespace OpenSim.Framework.Communications.Services
InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString(); InventoryRootHash["folder_id"] = inventData.RootFolderID.ToString();
ArrayList InventoryRoot = new ArrayList(); ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash); InventoryRoot.Add(InventoryRootHash);
userProfile.RootInventoryFolderID = inventData.RootFolderID;
// Inventory Library Section // Inventory Library Section

View File

@ -697,9 +697,6 @@ namespace OpenSim.Framework.Communications
// local service (standalone) // local service (standalone)
m_log.Debug("[USERSTORAGE]: using IInventoryService to create user's inventory"); m_log.Debug("[USERSTORAGE]: using IInventoryService to create user's inventory");
m_InventoryService.CreateUserInventory(userProf.ID); m_InventoryService.CreateUserInventory(userProf.ID);
InventoryFolderBase rootfolder = m_InventoryService.GetRootFolder(userProf.ID);
if (rootfolder != null)
userProf.RootInventoryFolderID = rootfolder.ID;
} }
else if (m_commsManager.InterServiceInventoryService != null) else if (m_commsManager.InterServiceInventoryService != null)
{ {

View File

@ -724,12 +724,20 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
catch(Exception e) catch(Exception e)
{ {
string errorMessage
= String.Format(
"Requested method [{0}] from {1} threw exception: {2} {3}",
methodName, request.RemoteIPEndPoint.Address, e.Message, e.StackTrace);
m_log.ErrorFormat("[BASE HTTP SERVER]: {0}", errorMessage);
// if the registered XmlRpc method threw an exception, we pass a fault-code along // if the registered XmlRpc method threw an exception, we pass a fault-code along
xmlRpcResponse = new XmlRpcResponse(); xmlRpcResponse = new XmlRpcResponse();
// Code probably set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php // Code probably set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
xmlRpcResponse.SetFault(-32603, String.Format("Requested method [{0}] threw exception: {1}", xmlRpcResponse.SetFault(-32603, errorMessage);
methodName, e.Message));
} }
// if the method wasn't found, we can't determine KeepAlive state anyway, so lets do it only here // if the method wasn't found, we can't determine KeepAlive state anyway, so lets do it only here
response.KeepAlive = m_rpcHandlersKeepAlive[methodName]; response.KeepAlive = m_rpcHandlersKeepAlive[methodName];
} }

View File

@ -188,7 +188,15 @@ namespace OpenSim.Framework.Servers.HttpServer
try try
{ {
IPAddress addr = IPAddress.Parse(req.Headers["remote_addr"]); IPAddress addr = IPAddress.Parse(req.Headers["remote_addr"]);
int port = Int32.Parse(req.Headers["remote_port"]); // sometimes req.Headers["remote_port"] returns a comma separated list, so use
// the first one in the list and log it
string[] strPorts = req.Headers["remote_port"].Split(new char[] { ',' });
if (strPorts.Length > 1)
{
_log.ErrorFormat("[OSHttpRequest]: format exception on addr/port {0}:{1}, ignoring",
req.Headers["remote_addr"], req.Headers["remote_port"]);
}
int port = Int32.Parse(strPorts[0]);
_remoteIPEndPoint = new IPEndPoint(addr, port); _remoteIPEndPoint = new IPEndPoint(addr, port);
} }
catch (FormatException) catch (FormatException)

View File

@ -108,10 +108,13 @@ namespace OpenSim.Framework
} }
} }
else else
{
if (m_itemLock.RecursiveReadCount>0)
{ {
m_itemLock.ExitReadLock(); m_itemLock.ExitReadLock();
} }
} }
}
/// <summary> /// <summary>
/// Lock our inventory list for writing (many can read, one can write) /// Lock our inventory list for writing (many can read, one can write)
@ -143,10 +146,13 @@ namespace OpenSim.Framework
LockedByThread = Thread.CurrentThread; LockedByThread = Thread.CurrentThread;
} }
else else
{
if (m_itemLock.RecursiveWriteCount > 0)
{ {
m_itemLock.ExitWriteLock(); m_itemLock.ExitWriteLock();
} }
} }
}
#region ICloneable Members #region ICloneable Members

View File

@ -119,8 +119,6 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
private string m_profileUrl; private string m_profileUrl;
private UUID m_rootInventoryFolderId;
/// <summary> /// <summary>
/// The second component of a users account name /// The second component of a users account name
/// </summary> /// </summary>
@ -312,12 +310,6 @@ namespace OpenSim.Framework
set { m_lastLogin = value; } set { m_lastLogin = value; }
} }
public UUID RootInventoryFolderID
{
get { return m_rootInventoryFolderId; }
set { m_rootInventoryFolderId = value; }
}
public string UserInventoryURI public string UserInventoryURI
{ {
get { return m_userInventoryUri; } get { return m_userInventoryUri; }

View File

@ -201,6 +201,7 @@ namespace OpenSim.Grid.UserServer.Modules
} }
return response; return response;
} }
public XmlRpcResponse XmlRPCUserMovedtoRegion(XmlRpcRequest request, IPEndPoint remoteClient) public XmlRpcResponse XmlRPCUserMovedtoRegion(XmlRpcRequest request, IPEndPoint remoteClient)
{ {
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();

View File

@ -352,6 +352,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private IHyperAssetService m_hyperAssets; private IHyperAssetService m_hyperAssets;
private const bool m_checkPackets = true; private const bool m_checkPackets = true;
private Timer m_propertiesPacketTimer;
private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>();
#endregion Class Members #endregion Class Members
#region Properties #region Properties
@ -433,6 +436,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_udpClient.OnQueueEmpty += HandleQueueEmpty; m_udpClient.OnQueueEmpty += HandleQueueEmpty;
m_udpClient.OnPacketStats += PopulateStats; m_udpClient.OnPacketStats += PopulateStats;
m_propertiesPacketTimer = new Timer(100);
m_propertiesPacketTimer.Elapsed += ProcessObjectPropertiesPacket;
RegisterLocalPacketHandlers(); RegisterLocalPacketHandlers();
} }
@ -3562,42 +3568,88 @@ namespace OpenSim.Region.ClientStack.LindenUDP
string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask,
uint BaseMask, byte saleType, int salePrice) uint BaseMask, byte saleType, int salePrice)
{ {
ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties); //ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
// TODO: don't create new blocks if recycling an old packet // TODO: don't create new blocks if recycling an old packet
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; ObjectPropertiesPacket.ObjectDataBlock block =
proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); new ObjectPropertiesPacket.ObjectDataBlock();
proper.ObjectData[0].ItemID = ItemID;
proper.ObjectData[0].CreationDate = CreationDate;
proper.ObjectData[0].CreatorID = CreatorUUID;
proper.ObjectData[0].FolderID = FolderUUID;
proper.ObjectData[0].FromTaskID = FromTaskUUID;
proper.ObjectData[0].GroupID = GroupUUID;
proper.ObjectData[0].InventorySerial = InventorySerial;
proper.ObjectData[0].LastOwnerID = LastOwnerUUID; block.ItemID = ItemID;
block.CreationDate = CreationDate;
block.CreatorID = CreatorUUID;
block.FolderID = FolderUUID;
block.FromTaskID = FromTaskUUID;
block.GroupID = GroupUUID;
block.InventorySerial = InventorySerial;
block.LastOwnerID = LastOwnerUUID;
// proper.ObjectData[0].LastOwnerID = UUID.Zero; // proper.ObjectData[0].LastOwnerID = UUID.Zero;
proper.ObjectData[0].ObjectID = ObjectUUID; block.ObjectID = ObjectUUID;
if (OwnerUUID == GroupUUID) if (OwnerUUID == GroupUUID)
proper.ObjectData[0].OwnerID = UUID.Zero; block.OwnerID = UUID.Zero;
else else
proper.ObjectData[0].OwnerID = OwnerUUID; block.OwnerID = OwnerUUID;
proper.ObjectData[0].TouchName = Util.StringToBytes256(TouchTitle); block.TouchName = Util.StringToBytes256(TouchTitle);
proper.ObjectData[0].TextureID = TextureID; block.TextureID = TextureID;
proper.ObjectData[0].SitName = Util.StringToBytes256(SitTitle); block.SitName = Util.StringToBytes256(SitTitle);
proper.ObjectData[0].Name = Util.StringToBytes256(ItemName); block.Name = Util.StringToBytes256(ItemName);
proper.ObjectData[0].Description = Util.StringToBytes256(ItemDescription); block.Description = Util.StringToBytes256(ItemDescription);
proper.ObjectData[0].OwnerMask = OwnerMask; block.OwnerMask = OwnerMask;
proper.ObjectData[0].NextOwnerMask = NextOwnerMask; block.NextOwnerMask = NextOwnerMask;
proper.ObjectData[0].GroupMask = GroupMask; block.GroupMask = GroupMask;
proper.ObjectData[0].EveryoneMask = EveryoneMask; block.EveryoneMask = EveryoneMask;
proper.ObjectData[0].BaseMask = BaseMask; block.BaseMask = BaseMask;
// proper.ObjectData[0].AggregatePerms = 53; // proper.ObjectData[0].AggregatePerms = 53;
// proper.ObjectData[0].AggregatePermTextures = 0; // proper.ObjectData[0].AggregatePermTextures = 0;
// proper.ObjectData[0].AggregatePermTexturesOwner = 0; // proper.ObjectData[0].AggregatePermTexturesOwner = 0;
proper.ObjectData[0].SaleType = saleType; block.SaleType = saleType;
proper.ObjectData[0].SalePrice = salePrice; block.SalePrice = salePrice;
lock (m_propertiesPacketTimer)
{
m_propertiesBlocks.Add(block);
int length = 0;
foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks)
{
length += b.Length;
}
if (length > 1100) // FIXME: use real MTU
{
ProcessObjectPropertiesPacket(null, null);
m_propertiesPacketTimer.Stop();
return;
}
m_propertiesPacketTimer.Stop();
m_propertiesPacketTimer.Start();
}
//proper.Header.Zerocoded = true;
//OutPacket(proper, ThrottleOutPacketType.Task);
}
private void ProcessObjectPropertiesPacket(Object sender, ElapsedEventArgs e)
{
ObjectPropertiesPacket proper = (ObjectPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
lock (m_propertiesPacketTimer)
{
m_propertiesPacketTimer.Stop();
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
int index = 0;
foreach (ObjectPropertiesPacket.ObjectDataBlock b in m_propertiesBlocks)
{
proper.ObjectData[index++] = b;
}
m_propertiesBlocks.Clear();
}
proper.Header.Zerocoded = true; proper.Header.Zerocoded = true;
OutPacket(proper, ThrottleOutPacketType.Task); OutPacket(proper, ThrottleOutPacketType.Task);
} }
@ -5504,6 +5556,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId)
{ {
// Linden Client limitation..
if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f
|| avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f)
{
ScenePresence avatar = null;
if (((Scene)m_scene).TryGetAvatar(AgentId, out avatar))
{
if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f)
{
avSetStartLocationRequestPacket.StartLocationData.LocationPos.X = avatar.AbsolutePosition.X;
}
if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f)
{
avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y = avatar.AbsolutePosition.Y;
}
}
}
TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest; TeleportLocationRequest handlerSetStartLocationRequest = OnSetStartLocationRequest;
if (handlerSetStartLocationRequest != null) if (handlerSetStartLocationRequest != null)
{ {

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *

View File

@ -527,7 +527,6 @@ namespace OpenSim.Region.CoreModules.InterGrid
userProfile.Partner = UUID.Zero; userProfile.Partner = UUID.Zero;
userProfile.PasswordHash = "$1$"; userProfile.PasswordHash = "$1$";
userProfile.PasswordSalt = ""; userProfile.PasswordSalt = "";
userProfile.RootInventoryFolderID = UUID.Zero;
userProfile.SurName = agentData.lastname; userProfile.SurName = agentData.lastname;
userProfile.UserAssetURI = homeScene.CommsManager.NetworkServersInfo.AssetURL; userProfile.UserAssetURI = homeScene.CommsManager.NetworkServersInfo.AssetURL;
userProfile.UserFlags = 0; userProfile.UserFlags = 0;

View File

@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
IConfig authorizationConfig = source.Configs["AuthorizationService"]; IConfig authorizationConfig = source.Configs["AuthorizationService"];
if (authorizationConfig == null) if (authorizationConfig == null)
{ {
m_log.Error("[REMOTE AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini"); m_log.Info("[REMOTE AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini");
return; return;
} }

View File

@ -471,20 +471,45 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (terr != null) if (terr != null)
{ {
m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName); m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + m_scene.RegionInfo.RegionName);
if (File.Exists(Util.dataDir() + "/terrain.raw"))
{
File.Delete(Util.dataDir() + "/terrain.raw");
}
try try
{ {
FileStream input = new FileStream(Util.dataDir() + "/terrain.raw", FileMode.CreateNew);
string localfilename = "terrain.raw";
if (terrainData.Length == 851968)
{
localfilename = Path.Combine(Util.dataDir(),"terrain.raw"); // It's a .LLRAW
}
if (terrainData.Length == 196662) // 24-bit 256x256 Bitmap
localfilename = Path.Combine(Util.dataDir(), "terrain.bmp");
if (terrainData.Length == 256 * 256 * 4) // It's a .R32
localfilename = Path.Combine(Util.dataDir(), "terrain.r32");
if (terrainData.Length == 256 * 256 * 8) // It's a .R64
localfilename = Path.Combine(Util.dataDir(), "terrain.r64");
if (File.Exists(localfilename))
{
File.Delete(localfilename);
}
FileStream input = new FileStream(localfilename, FileMode.CreateNew);
input.Write(terrainData, 0, terrainData.Length); input.Write(terrainData, 0, terrainData.Length);
input.Close(); input.Close();
FileInfo x = new FileInfo(localfilename);
terr.LoadFromFile(localfilename);
remoteClient.SendAlertMessage("Your terrain was loaded as a ." + x.Extension + " file. It may take a few moments to appear.");
} }
catch (IOException e) catch (IOException e)
{ {
m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); m_log.ErrorFormat("[TERRAIN]: Error Saving a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString());
remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space"); remoteClient.SendAlertMessage("There was an IO Exception loading your terrain. Please check free space.");
return; return;
} }
@ -502,29 +527,16 @@ namespace OpenSim.Region.CoreModules.World.Estate
return; return;
} }
try
{
terr.LoadFromFile(Util.dataDir() + "/terrain.raw");
remoteClient.SendAlertMessage("Your terrain was loaded. Give it a minute or two to apply");
}
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[TERRAIN]: Error loading a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString()); m_log.ErrorFormat("[TERRAIN]: Error loading a terrain file uploaded via the estate tools. It gave us the following error: {0}", e.ToString());
remoteClient.SendAlertMessage("There was a general error loading your terrain. Please fix the terrain file and try again"); remoteClient.SendAlertMessage("There was a general error loading your terrain. Please fix the terrain file and try again");
} }
} }
else else
{ {
remoteClient.SendAlertMessage("Unable to apply terrain. Cannot get an instance of the terrain module"); remoteClient.SendAlertMessage("Unable to apply terrain. Cannot get an instance of the terrain module");
} }
} }
private void handleUploadTerrain(IClientAPI remote_client, string clientFileName) private void handleUploadTerrain(IClientAPI remote_client, string clientFileName)

View File

@ -29,6 +29,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Net;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
@ -258,6 +259,16 @@ namespace OpenSim.Region.CoreModules.World.Terrain
} }
} }
/// <summary>
/// Loads a terrain file from the specified URI
/// </summary>
/// <param name="filename">The name of the terrain to load</param>
/// <param name="pathToTerrainHeightmap">The URI to the terrain height map</param>
public void LoadFromStream(string filename, Uri pathToTerrainHeightmap)
{
LoadFromStream(filename, URIFetch(pathToTerrainHeightmap));
}
/// <summary> /// <summary>
/// Loads a terrain file from a stream and installs it in the scene. /// Loads a terrain file from a stream and installs it in the scene.
/// </summary> /// </summary>
@ -267,7 +278,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
{ {
foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders) foreach (KeyValuePair<string, ITerrainLoader> loader in m_loaders)
{ {
if (@filename.EndsWith(loader.Key)) if (filename.EndsWith(loader.Key))
{ {
lock (m_scene) lock (m_scene)
{ {
@ -295,6 +306,25 @@ namespace OpenSim.Region.CoreModules.World.Terrain
throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename)); throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename));
} }
private static Stream URIFetch(Uri uri)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
// request.Credentials = credentials;
request.ContentLength = 0;
request.KeepAlive = false;
WebResponse response = request.GetResponse();
Stream file = response.GetResponseStream();
if (response.ContentLength == 0)
throw new Exception(String.Format("{0} returned an empty file", uri.ToString()));
// return new BufferedStream(file, (int) response.ContentLength);
return new BufferedStream(file, 1000000);
}
/// <summary> /// <summary>
/// Modify Land /// Modify Land
/// </summary> /// </summary>

View File

@ -51,7 +51,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// </param> /// </param>
/// <param name="stream"></param> /// <param name="stream"></param>
void LoadFromStream(string filename, Stream stream); void LoadFromStream(string filename, Stream stream);
void LoadFromStream(string filename, System.Uri pathToTerrainHeightmap);
/// <summary> /// <summary>
/// Save a terrain to a stream. /// Save a terrain to a stream.
/// </summary> /// </summary>

View File

@ -448,5 +448,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
SendAnimPack(animIDs, sequenceNums, objectIDs); SendAnimPack(animIDs, sequenceNums, objectIDs);
} }
public void Close()
{
m_animations = null;
m_scenePresence = null;
}
} }
} }

View File

@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Scenes
private readonly Dictionary<UUID,EntityBase> m_eb_uuid = new Dictionary<UUID, EntityBase>(); private readonly Dictionary<UUID,EntityBase> m_eb_uuid = new Dictionary<UUID, EntityBase>();
private readonly Dictionary<uint, EntityBase> m_eb_localID = new Dictionary<uint, EntityBase>(); private readonly Dictionary<uint, EntityBase> m_eb_localID = new Dictionary<uint, EntityBase>();
//private readonly Dictionary<UUID, ScenePresence> m_pres_uuid = new Dictionary<UUID, ScenePresence>(); //private readonly Dictionary<UUID, ScenePresence> m_pres_uuid = new Dictionary<UUID, ScenePresence>();
private readonly Object m_lock = new Object(); private System.Threading.ReaderWriterLockSlim m_lock = new System.Threading.ReaderWriterLockSlim();
[Obsolete("Use Add() instead.")] [Obsolete("Use Add() instead.")]
public void Add(UUID id, EntityBase eb) public void Add(UUID id, EntityBase eb)
@ -50,7 +50,8 @@ namespace OpenSim.Region.Framework.Scenes
public void Add(EntityBase entity) public void Add(EntityBase entity)
{ {
lock (m_lock) m_lock.EnterWriteLock();
try
{ {
try try
{ {
@ -62,11 +63,16 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("Add Entity failed: {0}", e.Message); m_log.ErrorFormat("Add Entity failed: {0}", e.Message);
} }
} }
finally
{
m_lock.ExitWriteLock();
}
} }
public void InsertOrReplace(EntityBase entity) public void InsertOrReplace(EntityBase entity)
{ {
lock (m_lock) m_lock.EnterWriteLock();
try
{ {
try try
{ {
@ -78,15 +84,24 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("Insert or Replace Entity failed: {0}", e.Message); m_log.ErrorFormat("Insert or Replace Entity failed: {0}", e.Message);
} }
} }
finally
{
m_lock.ExitWriteLock();
}
} }
public void Clear() public void Clear()
{ {
lock (m_lock) m_lock.EnterWriteLock();
try
{ {
m_eb_uuid.Clear(); m_eb_uuid.Clear();
m_eb_localID.Clear(); m_eb_localID.Clear();
} }
finally
{
m_lock.ExitWriteLock();
}
} }
public int Count public int Count
@ -123,7 +138,8 @@ namespace OpenSim.Region.Framework.Scenes
public bool Remove(uint localID) public bool Remove(uint localID)
{ {
lock (m_lock) m_lock.EnterWriteLock();
try
{ {
try try
{ {
@ -141,11 +157,16 @@ namespace OpenSim.Region.Framework.Scenes
return false; return false;
} }
} }
finally
{
m_lock.ExitWriteLock();
}
} }
public bool Remove(UUID id) public bool Remove(UUID id)
{ {
lock (m_lock) m_lock.EnterWriteLock();
try
{ {
try try
{ {
@ -163,13 +184,18 @@ namespace OpenSim.Region.Framework.Scenes
return false; return false;
} }
} }
finally
{
m_lock.ExitWriteLock();
}
} }
public List<EntityBase> GetAllByType<T>() public List<EntityBase> GetAllByType<T>()
{ {
List<EntityBase> tmp = new List<EntityBase>(); List<EntityBase> tmp = new List<EntityBase>();
lock (m_lock) m_lock.EnterReadLock();
try
{ {
try try
{ {
@ -187,23 +213,33 @@ namespace OpenSim.Region.Framework.Scenes
tmp = null; tmp = null;
} }
} }
finally
{
m_lock.ExitReadLock();
}
return tmp; return tmp;
} }
public List<EntityBase> GetEntities() public List<EntityBase> GetEntities()
{ {
lock (m_lock) m_lock.EnterReadLock();
try
{ {
return new List<EntityBase>(m_eb_uuid.Values); return new List<EntityBase>(m_eb_uuid.Values);
} }
finally
{
m_lock.ExitReadLock();
}
} }
public EntityBase this[UUID id] public EntityBase this[UUID id]
{ {
get get
{ {
lock (m_lock) m_lock.EnterReadLock();
try
{ {
EntityBase entity; EntityBase entity;
if (m_eb_uuid.TryGetValue(id, out entity)) if (m_eb_uuid.TryGetValue(id, out entity))
@ -211,6 +247,10 @@ namespace OpenSim.Region.Framework.Scenes
else else
return null; return null;
} }
finally
{
m_lock.ExitReadLock();
}
} }
set set
{ {
@ -222,7 +262,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
get get
{ {
lock (m_lock) m_lock.EnterReadLock();
try
{ {
EntityBase entity; EntityBase entity;
if (m_eb_localID.TryGetValue(localID, out entity)) if (m_eb_localID.TryGetValue(localID, out entity))
@ -230,6 +271,10 @@ namespace OpenSim.Region.Framework.Scenes
else else
return null; return null;
} }
finally
{
m_lock.ExitReadLock();
}
} }
set set
{ {
@ -239,18 +284,28 @@ namespace OpenSim.Region.Framework.Scenes
public bool TryGetValue(UUID key, out EntityBase obj) public bool TryGetValue(UUID key, out EntityBase obj)
{ {
lock (m_lock) m_lock.EnterReadLock();
try
{ {
return m_eb_uuid.TryGetValue(key, out obj); return m_eb_uuid.TryGetValue(key, out obj);
} }
finally
{
m_lock.ExitReadLock();
}
} }
public bool TryGetValue(uint key, out EntityBase obj) public bool TryGetValue(uint key, out EntityBase obj)
{ {
lock (m_lock) m_lock.EnterReadLock();
try
{ {
return m_eb_localID.TryGetValue(key, out obj); return m_eb_localID.TryGetValue(key, out obj);
} }
finally
{
m_lock.ExitReadLock();
}
} }
/// <summary> /// <summary>

View File

@ -1725,12 +1725,21 @@ namespace OpenSim.Region.Framework.Scenes
} }
if (folderID == UUID.Zero && folder == null) if (folderID == UUID.Zero && folder == null)
{
if (action == DeRezAction.Delete)
{
// Deletes go to trash by default
//
folder = InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
}
else
{ {
// Catch all. Use lost & found // Catch all. Use lost & found
// //
folder = InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); folder = InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
} }
}
if (folder == null) // None of the above if (folder == null) // None of the above
{ {
@ -2388,6 +2397,12 @@ namespace OpenSim.Region.Framework.Scenes
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item); item = InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
if (m_AvatarFactory != null)
{
m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
}
} }
} }

View File

@ -3048,6 +3048,7 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around. // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around.
// TODO: The HomeRegion property can be removed then, too // TODO: The HomeRegion property can be removed then, too
UserProfile.HomeRegion = RegionInfo.RegionHandle; UserProfile.HomeRegion = RegionInfo.RegionHandle;
UserProfile.HomeLocation = position; UserProfile.HomeLocation = position;
UserProfile.HomeLookAt = lookAt; UserProfile.HomeLookAt = lookAt;
CommsManager.UserService.UpdateUserProfile(UserProfile); CommsManager.UserService.UpdateUserProfile(UserProfile);

View File

@ -26,6 +26,7 @@
*/ */
using System; using System;
using System.Threading;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using OpenMetaverse; using OpenMetaverse;
@ -96,6 +97,8 @@ namespace OpenSim.Region.Framework.Scenes
protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>(); protected internal Dictionary<UUID, SceneObjectGroup> SceneObjectGroupsByFullID = new Dictionary<UUID, SceneObjectGroup>();
private readonly Object m_dictionary_lock = new Object(); private readonly Object m_dictionary_lock = new Object();
private Object m_updateLock = new Object();
#endregion #endregion
protected internal SceneGraph(Scene parent, RegionInfo regInfo) protected internal SceneGraph(Scene parent, RegionInfo regInfo)
@ -369,6 +372,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
protected internal void UpdateObjectGroups() protected internal void UpdateObjectGroups()
{ {
if (!Monitor.TryEnter(m_updateLock))
return;
List<SceneObjectGroup> updates; List<SceneObjectGroup> updates;
// Some updates add more updates to the updateList. // Some updates add more updates to the updateList.
@ -395,6 +401,7 @@ namespace OpenSim.Region.Framework.Scenes
"[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e); "[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e);
} }
} }
Monitor.Exit(m_updateLock);
} }
protected internal void AddPhysicalPrim(int number) protected internal void AddPhysicalPrim(int number)
@ -1554,6 +1561,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="parentPrim"></param> /// <param name="parentPrim"></param>
/// <param name="childPrims"></param> /// <param name="childPrims"></param>
protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) protected internal void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds)
{
Monitor.Enter(m_updateLock);
try
{ {
SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId); SceneObjectGroup parentGroup = GetGroupByPrim(parentPrimId);
@ -1593,17 +1603,24 @@ namespace OpenSim.Region.Framework.Scenes
// occur on link to invoke this elsewhere (such as object selection) // occur on link to invoke this elsewhere (such as object selection)
parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected);
parentGroup.TriggerScriptChangedEvent(Changed.LINK); parentGroup.TriggerScriptChangedEvent(Changed.LINK);
parentGroup.HasGroupChanged = true;
parentGroup.ScheduleGroupForFullUpdate();
if (client != null) // if (client != null)
{ // {
parentGroup.GetProperties(client); // parentGroup.GetProperties(client);
// }
// else
// {
// foreach (ScenePresence p in GetScenePresences())
// {
// parentGroup.GetProperties(p.ControllingClient);
// }
// }
} }
else finally
{ {
foreach (ScenePresence p in GetScenePresences()) Monitor.Exit(m_updateLock);
{
parentGroup.GetProperties(p.ControllingClient);
}
} }
} }
@ -1617,6 +1634,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
protected internal void DelinkObjects(List<uint> primIds, bool sendEvents) protected internal void DelinkObjects(List<uint> primIds, bool sendEvents)
{
Monitor.Enter(m_updateLock);
try
{ {
List<SceneObjectPart> childParts = new List<SceneObjectPart>(); List<SceneObjectPart> childParts = new List<SceneObjectPart>();
List<SceneObjectPart> rootParts = new List<SceneObjectPart>(); List<SceneObjectPart> rootParts = new List<SceneObjectPart>();
@ -1628,7 +1648,9 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID); SceneObjectPart part = m_parentScene.GetSceneObjectPart(primID);
if (part != null) if (part != null)
{ {
if (part.LinkNum < 2) // Root or single if (part.ParentGroup.Children.Count != 1) // Skip single
{
if (part.LinkNum < 2) // Root
rootParts.Add(part); rootParts.Add(part);
else else
childParts.Add(part); childParts.Add(part);
@ -1637,6 +1659,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!affectedGroups.Contains(group)) if (!affectedGroups.Contains(group))
affectedGroups.Add(group); affectedGroups.Add(group);
} }
}
else else
{ {
m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID); m_log.ErrorFormat("Viewer requested unlink of nonexistent part {0}", primID);
@ -1723,6 +1746,11 @@ namespace OpenSim.Region.Framework.Scenes
g.ScheduleGroupForFullUpdate(); g.ScheduleGroupForFullUpdate();
} }
} }
finally
{
Monitor.Exit(m_updateLock);
}
}
protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID)
{ {

View File

@ -125,10 +125,13 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
else else
{
if (m_partsLock.RecursiveReadCount > 0)
{ {
m_partsLock.ExitReadLock(); m_partsLock.ExitReadLock();
} }
} }
}
public void lockPartsForWrite(bool locked) public void lockPartsForWrite(bool locked)
{ {
if (locked) if (locked)
@ -154,10 +157,13 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
else else
{
if (m_partsLock.RecursiveWriteCount > 0)
{ {
m_partsLock.ExitWriteLock(); m_partsLock.ExitWriteLock();
} }
} }
}
public bool HasGroupChanged public bool HasGroupChanged
{ {
@ -2292,14 +2298,14 @@ namespace OpenSim.Region.Framework.Scenes
public void LinkToGroup(SceneObjectGroup objectGroup) public void LinkToGroup(SceneObjectGroup objectGroup)
{ {
// Make sure we have sent any pending unlinks or stuff. // Make sure we have sent any pending unlinks or stuff.
if (objectGroup.RootPart.UpdateFlag > 0) //if (objectGroup.RootPart.UpdateFlag > 0)
{ //{
m_log.WarnFormat( // m_log.WarnFormat(
"[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.", // "[SCENE OBJECT GROUP]: Forcing send of linkset {0}, {1} to {2}, {3} as its still waiting.",
objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); // objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
objectGroup.RootPart.SendScheduledUpdates(); // objectGroup.RootPart.SendScheduledUpdates();
} //}
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", // "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
@ -2389,8 +2395,8 @@ namespace OpenSim.Region.Framework.Scenes
// unmoved prims! // unmoved prims!
ResetChildPrimPhysicsPositions(); ResetChildPrimPhysicsPositions();
HasGroupChanged = true; //HasGroupChanged = true;
ScheduleGroupForFullUpdate(); //ScheduleGroupForFullUpdate();
} }
/// <summary> /// <summary>
@ -2483,8 +2489,8 @@ namespace OpenSim.Region.Framework.Scenes
linkPart.Rezzed = RootPart.Rezzed; linkPart.Rezzed = RootPart.Rezzed;
HasGroupChanged = true; //HasGroupChanged = true;
ScheduleGroupForFullUpdate(); //ScheduleGroupForFullUpdate();
} }
/// <summary> /// <summary>
@ -2775,11 +2781,16 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
{ {
if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) if (part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0)
{
if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax ||
part.Scale.Y > m_scene.RegionInfo.PhysPrimMax ||
part.Scale.Z > m_scene.RegionInfo.PhysPrimMax)
{ {
UsePhysics = false; // Reset physics UsePhysics = false; // Reset physics
break; break;
} }
} }
}
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
{ {

View File

@ -269,8 +269,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[PRIM INVENTORY]: " + "[PRIM INVENTORY]: " +
"Couldn't start script {0}, {1} since asset ID {2} could not be found", "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found",
item.Name, item.ItemID, item.AssetID); item.Name, item.ItemID, m_part.AbsolutePosition,
m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID);
} }
else else
{ {
@ -317,9 +318,20 @@ namespace OpenSim.Region.Framework.Scenes
m_items.LockItemsForRead(true); m_items.LockItemsForRead(true);
if (m_items.ContainsKey(itemId)) if (m_items.ContainsKey(itemId))
{ {
TaskInventoryItem item = m_items[itemId]; if (m_items.ContainsKey(itemId))
{
m_items.LockItemsForRead(false); m_items.LockItemsForRead(false);
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
}
else
{
m_items.LockItemsForRead(false);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
itemId, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
} }
else else
{ {
@ -347,8 +359,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[PRIM INVENTORY]: " + "[PRIM INVENTORY]: " +
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}", "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
itemId, m_part.Name, m_part.UUID); itemId, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
} }
} }
@ -542,8 +555,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[PRIM INVENTORY]: " + "[PRIM INVENTORY]: " +
"Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory", "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
item.ItemID, m_part.Name, m_part.UUID); item.ItemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
} }
m_items.LockItemsForWrite(false); m_items.LockItemsForWrite(false);

View File

@ -790,37 +790,13 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void SendPrimUpdates() public void SendPrimUpdates()
{ {
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
m_sceneViewer.SendPrimUpdates(); m_sceneViewer.SendPrimUpdates();
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
} }
/// <summary>
/// Environment.TickCount is an int but it counts all 32 bits so it goes positive
/// and negative every 24.9 days. This trims down TickCount so it doesn't wrap
/// for the callers.
/// This trims it to a 12 day interval so don't let your frame time get too long.
/// </summary>
/// <returns></returns>
const Int32 EnvironmentTickCountMask = 0x3fffffff;
private static Int32 EnvironmentTickCount() {
return Environment.TickCount & EnvironmentTickCountMask;
}
/// <summary>
/// Environment.TickCount is an int but it counts all 32 bits so it goes positive
/// and negative every 24.9 days. Subtracts the passed value (previously fetched by
/// 'EnvironmentTickCount()') and accounts for any wrapping.
/// </summary>
/// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
private static Int32 EnvironmentTickCountSubtract(Int32 prevValue) {
Int32 diff = EnvironmentTickCount() - prevValue;
return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1);
}
#region Status Methods #region Status Methods
/// <summary> /// <summary>
@ -1166,7 +1142,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="collisionPoint"></param> /// <param name="collisionPoint"></param>
/// <param name="localid"></param> /// <param name="localid"></param>
/// <param name="distance"></param> /// <param name="distance"></param>
public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance) public void RayCastCameraCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 pNormal)
{ {
const float POSITION_TOLERANCE = 0.02f; const float POSITION_TOLERANCE = 0.02f;
const float VELOCITY_TOLERANCE = 0.02f; const float VELOCITY_TOLERANCE = 0.02f;
@ -1209,7 +1185,7 @@ namespace OpenSim.Region.Framework.Scenes
// return; // return;
//} //}
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
++m_movementUpdateCount; ++m_movementUpdateCount;
if (m_movementUpdateCount < 1) if (m_movementUpdateCount < 1)
@ -1539,7 +1515,7 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.EventManager.TriggerOnClientMovement(this); m_scene.EventManager.TriggerOnClientMovement(this);
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
} }
public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client) public void DoAutoPilot(uint not_used, Vector3 Pos, IClientAPI remote_client)
@ -1764,11 +1740,14 @@ namespace OpenSim.Region.Framework.Scenes
UUID avOnTargetAlready = part.GetAvatarOnSitTarget(); UUID avOnTargetAlready = part.GetAvatarOnSitTarget();
bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
// bool SitTargetisSet = bool SitTargetisSet =
// (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 0f && (!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f &&
// avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f)); (
avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 1f // Valid Zero Rotation quaternion
bool SitTargetisSet = ((Vector3.Zero != avSitOffSet) || (Quaternion.Identity != avSitOrientation)); || avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f && avSitOrientation.W == 0f // W-Z Mapping was invalid at one point
|| avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 0f // Invalid Quaternion
)
));
//Console.WriteLine("SendSitResponse offset=" + offset + " UnOccup=" + SitTargetUnOccupied + //Console.WriteLine("SendSitResponse offset=" + offset + " UnOccup=" + SitTargetUnOccupied +
// " TargSet=" + SitTargetisSet); // " TargSet=" + SitTargetisSet);
@ -1862,12 +1841,23 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_requestedSitTargetID = part.LocalId; m_requestedSitTargetID = part.LocalId;
//m_requestedSitOffset = offset; //m_requestedSitOffset = offset;
//offset.X += part.Scale.X;// *offset.X;
//offset.Y += part.Scale.Y;// * offset.Y;
//offset.Z += part.Scale.Z;// * offset.Z;
//m_requestedSitOffset = offset;
m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset);
} }
else else
{ {
m_log.Warn("Sit requested on unknown object: " + targetID.ToString()); m_log.Warn("Sit requested on unknown object: " + targetID.ToString());
} }
if (m_scene.PhysicsScene.SupportsRayCast())
{
//m_scene.PhysicsScene.RaycastWorld(Vector3.Zero,Vector3.Zero, 0.01f,new RaycastCallback());
}
SendSitResponse(remoteClient, targetID, offset); SendSitResponse(remoteClient, targetID, offset);
} }
@ -1982,7 +1972,7 @@ namespace OpenSim.Region.Framework.Scenes
SendFullUpdateToAllClients(); SendFullUpdateToAllClients();
} }
public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance) public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal)
{ {
if(hitYN) if(hitYN)
{ {
@ -2057,7 +2047,7 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
Rotation = rotation; Rotation = rotation;
Vector3 direc = vec * rotation; Vector3 direc = vec * rotation;
@ -2099,7 +2089,7 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Add the force instead of only setting it to support multiple forces per frame? // TODO: Add the force instead of only setting it to support multiple forces per frame?
m_forceToApply = direc; m_forceToApply = direc;
m_isNudging = Nudging; m_isNudging = Nudging;
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCount() - m_perfMonMS); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
} }
#endregion #endregion
@ -2168,7 +2158,7 @@ namespace OpenSim.Region.Framework.Scenes
// server. // server.
if (remoteClient.IsActive) if (remoteClient.IsActive)
{ {
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
PhysicsActor actor = m_physicsActor; PhysicsActor actor = m_physicsActor;
Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero; Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero;
@ -2181,7 +2171,7 @@ namespace OpenSim.Region.Framework.Scenes
remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient))); pos, velocity, Vector3.Zero, m_bodyRot, CollisionPlane, m_uuid, null, GetUpdatePriority(remoteClient)));
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
m_scene.StatsReporter.AddAgentUpdates(1); m_scene.StatsReporter.AddAgentUpdates(1);
} }
} }
@ -2191,11 +2181,11 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void SendTerseUpdateToAllClients() public void SendTerseUpdateToAllClients()
{ {
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
m_scene.ForEachClient(SendTerseUpdateToClient); m_scene.ForEachClient(SendTerseUpdateToClient);
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
} }
public void SendCoarseLocations() public void SendCoarseLocations()
@ -2215,7 +2205,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p)
{ {
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
List<Vector3> CoarseLocations = new List<Vector3>(); List<Vector3> CoarseLocations = new List<Vector3>();
List<UUID> AvatarUUIDs = new List<UUID>(); List<UUID> AvatarUUIDs = new List<UUID>();
@ -2251,7 +2241,7 @@ namespace OpenSim.Region.Framework.Scenes
m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations);
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
} }
public void CoarseLocationChange() public void CoarseLocationChange()
@ -2288,7 +2278,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void SendInitialFullUpdateToAllClients() public void SendInitialFullUpdateToAllClients()
{ {
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
ScenePresence[] avatars = m_scene.GetScenePresences(); ScenePresence[] avatars = m_scene.GetScenePresences();
@ -2314,14 +2304,14 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_scene.StatsReporter.AddAgentUpdates(avatars.Length); m_scene.StatsReporter.AddAgentUpdates(avatars.Length);
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
//Animator.SendAnimPack(); //Animator.SendAnimPack();
} }
public void SendFullUpdateToAllClients() public void SendFullUpdateToAllClients()
{ {
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
// only send update from root agents to other clients; children are only "listening posts" // only send update from root agents to other clients; children are only "listening posts"
List<ScenePresence> avatars = m_scene.GetAvatars(); List<ScenePresence> avatars = m_scene.GetAvatars();
@ -2331,7 +2321,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_scene.StatsReporter.AddAgentUpdates(avatars.Count); m_scene.StatsReporter.AddAgentUpdates(avatars.Count);
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
Animator.SendAnimPack(); Animator.SendAnimPack();
} }
@ -2373,7 +2363,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void SendAppearanceToAllOtherAgents() public void SendAppearanceToAllOtherAgents()
{ {
m_perfMonMS = EnvironmentTickCount(); m_perfMonMS = Util.EnvironmentTickCount();
m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
{ {
@ -2383,7 +2373,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
}); });
m_scene.StatsReporter.AddAgentTime(EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
} }
/// <summary> /// <summary>
@ -3084,6 +3074,8 @@ namespace OpenSim.Region.Framework.Scenes
// The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents( // The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents(
// as of this comment the interval is set in AddToPhysicalScene // as of this comment the interval is set in AddToPhysicalScene
if (Animator!=null)
Animator.UpdateMovementAnimations();
CollisionEventUpdate collisionData = (CollisionEventUpdate)e; CollisionEventUpdate collisionData = (CollisionEventUpdate)e;
Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList; Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList;
@ -3096,7 +3088,7 @@ namespace OpenSim.Region.Framework.Scenes
m_lastColCount = coldata.Count; m_lastColCount = coldata.Count;
} }
if (coldata.Count != 0) if (coldata.Count != 0 && Animator != null)
{ {
switch (Animator.CurrentMovementAnimation) switch (Animator.CurrentMovementAnimation)
{ {
@ -3205,6 +3197,8 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneViewer.Close(); m_sceneViewer.Close();
RemoveFromPhysicalScene(); RemoveFromPhysicalScene();
m_animator.Close();
m_animator = null;
} }
public ScenePresence() public ScenePresence()

View File

@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes
UnAckedBytes = 24, UnAckedBytes = 24,
} }
// Sending a stats update every 3 seconds // Sending a stats update every 3 seconds-
private int statsUpdatesEveryMS = 3000; private int statsUpdatesEveryMS = 3000;
private float statsUpdateFactor = 0; private float statsUpdateFactor = 0;
private float m_timeDilation = 0; private float m_timeDilation = 0;

View File

@ -36,7 +36,7 @@ namespace OpenSim.Region.Physics.Manager
{ {
public delegate void physicsCrash(); public delegate void physicsCrash();
public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance); public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal);
public abstract class PhysicsScene public abstract class PhysicsScene
{ {
@ -204,7 +204,7 @@ namespace OpenSim.Region.Physics.Manager
public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod) public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod)
{ {
if (retMethod != null) if (retMethod != null)
retMethod(false, Vector3.Zero, 0, 999999999999f); retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero);
} }
private class NullPhysicsScene : PhysicsScene private class NullPhysicsScene : PhysicsScene

View File

@ -1242,8 +1242,11 @@ namespace OpenSim.Region.Physics.OdePlugin
public void SendCollisions() public void SendCollisions()
{ {
if (m_eventsubscription > m_requestedUpdateFrequency) if (m_eventsubscription > m_requestedUpdateFrequency)
{
if (CollisionEventsThisFrame != null)
{ {
base.SendCollisionUpdate(CollisionEventsThisFrame); base.SendCollisionUpdate(CollisionEventsThisFrame);
}
CollisionEventsThisFrame = new CollisionEventUpdate(); CollisionEventsThisFrame = new CollisionEventUpdate();
m_eventsubscription = 0; m_eventsubscription = 0;
} }

View File

@ -743,6 +743,8 @@ namespace OpenSim.Region.Physics.OdePlugin
break; break;
} }
} }
if (returnMass > _parent_scene.maximumMassObject)
returnMass = _parent_scene.maximumMassObject;
return returnMass; return returnMass;
}// end CalculateMass }// end CalculateMass
@ -753,6 +755,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (Body != (IntPtr) 0) if (Body != (IntPtr) 0)
{ {
float newmass = CalculateMass(); float newmass = CalculateMass();
//m_log.Info("[PHYSICS]: New Mass: " + newmass.ToString()); //m_log.Info("[PHYSICS]: New Mass: " + newmass.ToString());
d.MassSetBoxTotal(out pMass, newmass, _size.X, _size.Y, _size.Z); d.MassSetBoxTotal(out pMass, newmass, _size.X, _size.Y, _size.Z);

View File

@ -145,6 +145,7 @@ namespace OpenSim.Region.Physics.OdePlugin
uint hitConsumerID = 0; uint hitConsumerID = 0;
float distance = 999999999999f; float distance = 999999999999f;
Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f); Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f);
Vector3 snormal = Vector3.Zero;
// Find closest contact and object. // Find closest contact and object.
lock (m_contactResults) lock (m_contactResults)
@ -157,6 +158,7 @@ namespace OpenSim.Region.Physics.OdePlugin
hitConsumerID = cResult.ConsumerID; hitConsumerID = cResult.ConsumerID;
distance = cResult.Depth; distance = cResult.Depth;
hitYN = true; hitYN = true;
snormal = cResult.Normal;
} }
} }
@ -165,7 +167,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// Return results // Return results
if (req.callbackMethod != null) if (req.callbackMethod != null)
req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance); req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance, snormal);
} }
// This is the standard Near. Uses space AABBs to speed up detection. // This is the standard Near. Uses space AABBs to speed up detection.
@ -310,7 +312,8 @@ namespace OpenSim.Region.Physics.OdePlugin
collisionresult.ConsumerID = ((OdePrim)p1).m_localID; collisionresult.ConsumerID = ((OdePrim)p1).m_localID;
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z); collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
collisionresult.Depth = contacts[i].depth; collisionresult.Depth = contacts[i].depth;
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
contacts[i].normal.Z);
lock (m_contactResults) lock (m_contactResults)
m_contactResults.Add(collisionresult); m_contactResults.Add(collisionresult);
} }
@ -325,6 +328,8 @@ namespace OpenSim.Region.Physics.OdePlugin
collisionresult.ConsumerID = ((OdePrim)p2).m_localID; collisionresult.ConsumerID = ((OdePrim)p2).m_localID;
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z); collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
collisionresult.Depth = contacts[i].depth; collisionresult.Depth = contacts[i].depth;
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
contacts[i].normal.Z);
lock (m_contactResults) lock (m_contactResults)
m_contactResults.Add(collisionresult); m_contactResults.Add(collisionresult);
@ -358,5 +363,6 @@ namespace OpenSim.Region.Physics.OdePlugin
public Vector3 Pos; public Vector3 Pos;
public float Depth; public float Depth;
public uint ConsumerID; public uint ConsumerID;
public Vector3 Normal;
} }
} }

View File

@ -207,6 +207,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private float avMovementDivisorWalk = 1.3f; private float avMovementDivisorWalk = 1.3f;
private float avMovementDivisorRun = 0.8f; private float avMovementDivisorRun = 0.8f;
private float minimumGroundFlightOffset = 3f; private float minimumGroundFlightOffset = 3f;
public float maximumMassObject = 10000.01f;
public bool meshSculptedPrim = true; public bool meshSculptedPrim = true;
public bool forceSimplePrimMeshing = false; public bool forceSimplePrimMeshing = false;
@ -480,6 +481,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false);
minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f);
maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", 10000.01f);
} }
} }

View File

@ -3588,6 +3588,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
parentPrim.DelinkFromGroup(part.LocalId, true); parentPrim.DelinkFromGroup(part.LocalId, true);
} }
parentPrim.HasGroupChanged = true;
parentPrim.ScheduleGroupForFullUpdate();
parentPrim.TriggerScriptChangedEvent(Changed.LINK); parentPrim.TriggerScriptChangedEvent(Changed.LINK);
if (parts.Count > 0) if (parts.Count > 0)
@ -3599,6 +3601,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
part.UpdateFlag = 0; part.UpdateFlag = 0;
newRoot.ParentGroup.LinkToGroup(part.ParentGroup); newRoot.ParentGroup.LinkToGroup(part.ParentGroup);
} }
newRoot.ParentGroup.HasGroupChanged = true;
newRoot.ParentGroup.ScheduleGroupForFullUpdate();
} }
} }
else else
@ -3607,6 +3611,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
parentPrim.DelinkFromGroup(childPrim.LocalId, true); parentPrim.DelinkFromGroup(childPrim.LocalId, true);
parentPrim.HasGroupChanged = true;
parentPrim.ScheduleGroupForFullUpdate();
parentPrim.TriggerScriptChangedEvent(Changed.LINK); parentPrim.TriggerScriptChangedEvent(Changed.LINK);
} }
} }
@ -3626,6 +3632,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
parentPrim.DelinkFromGroup(part.LocalId, true); parentPrim.DelinkFromGroup(part.LocalId, true);
parentPrim.TriggerScriptChangedEvent(Changed.LINK); parentPrim.TriggerScriptChangedEvent(Changed.LINK);
} }
parentPrim.HasGroupChanged = true;
parentPrim.ScheduleGroupForFullUpdate();
} }
public LSL_String llGetLinkKey(int linknum) public LSL_String llGetLinkKey(int linknum)

View File

@ -149,10 +149,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
else else
{
if (m_scriptsLock.RecursiveReadCount > 0)
{ {
m_scriptsLock.ExitReadLock(); m_scriptsLock.ExitReadLock();
} }
} }
}
private void lockScriptsForWrite(bool locked) private void lockScriptsForWrite(bool locked)
{ {
if (locked) if (locked)
@ -178,10 +181,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
else else
{
if (m_scriptsLock.RecursiveWriteCount > 0)
{ {
m_scriptsLock.ExitWriteLock(); m_scriptsLock.ExitWriteLock();
} }
} }
}
public string ScriptEngineName public string ScriptEngineName
{ {

View File

@ -67,7 +67,7 @@ namespace OpenSim.Services.Connectors
IConfig authorizationConfig = source.Configs["AuthorizationService"]; IConfig authorizationConfig = source.Configs["AuthorizationService"];
if (authorizationConfig == null) if (authorizationConfig == null)
{ {
m_log.Error("[AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini"); m_log.Info("[AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini");
throw new Exception("Authorization connector init error"); throw new Exception("Authorization connector init error");
} }

Binary file not shown.

Binary file not shown.

View File

@ -91,7 +91,7 @@
; Maximum total size, and maximum size where a prim can be physical ; Maximum total size, and maximum size where a prim can be physical
NonPhysicalPrimMax = 256 NonPhysicalPrimMax = 256
PhysicalPrimMax = 10 PhysicalPrimMax = 10 ; (I think this was moved to the Regions.ini!)
ClampPrimSize = false ClampPrimSize = false
; Region crossing ; Region crossing
@ -342,7 +342,7 @@
; The MessagingServer is a companion of the UserServer. It uses ; The MessagingServer is a companion of the UserServer. It uses
; user_send_key and user_recv_key, too ; user_send_key and user_recv_key, too
;messaging_server_url = "http://127.0.0.1:8006" messaging_server_url = "http://127.0.0.1:8006"
; What is reported as the "X-Secondlife-Shard" ; What is reported as the "X-Secondlife-Shard"
; Defaults to the user server url if not set ; Defaults to the user server url if not set
@ -597,6 +597,9 @@
body_motor_joint_maxforce_tensor_linux = 5 body_motor_joint_maxforce_tensor_linux = 5
body_motor_joint_maxforce_tensor_win = 5 body_motor_joint_maxforce_tensor_win = 5
; Maximum mass an object can be before it is clamped
maximum_mass_object = 10000.01
; ## ; ##
; ## Sculpted Prim settings ; ## Sculpted Prim settings
; ## ; ##
@ -1155,7 +1158,6 @@
safemode = false safemode = false
[VivoxVoice] [VivoxVoice]
; The VivoxVoice module will allow you to provide voice on your ; The VivoxVoice module will allow you to provide voice on your
; region(s). It uses the same voice technology as the LL grid and ; region(s). It uses the same voice technology as the LL grid and
; works with recent LL clients (we have tested 1.22.9.110075, so ; works with recent LL clients (we have tested 1.22.9.110075, so
@ -1296,6 +1298,15 @@
RootReprioritizationDistance = 10.0 RootReprioritizationDistance = 10.0
ChildReprioritizationDistance = 20.0 ChildReprioritizationDistance = 20.0
[WebStats]
; View region statistics via a web page
; See http://opensimulator.org/wiki/FAQ#Region_Statistics_on_a_Web_Page
; Use a web browser and type in the "Login URI" + "/SStats/"
; For example- http://127.0.0.1:9000/SStats/
; enabled=false
;; ;;
;; These are defaults that are overwritten below in [Architecture]. ;; These are defaults that are overwritten below in [Architecture].
;; These defaults allow OpenSim to work out of the box with ;; These defaults allow OpenSim to work out of the box with