Merge commit 'a0d178b284050df64d0eb5b9728565fd72615c22' into careminster

avinationmerge
Melanie 2012-08-25 18:08:10 +01:00
commit 007a45aa76
9 changed files with 66 additions and 37 deletions

1
.gitignore vendored
View File

@ -29,6 +29,7 @@ addon-modules/
bin/Debug/*.dll bin/Debug/*.dll
bin/*.dll.mdb bin/*.dll.mdb
bin/*.db bin/*.db
bin/*.db-journal
bin/addin-db-* bin/addin-db-*
bin/*.dll bin/*.dll
bin/OpenSim.vshost.exe.config bin/OpenSim.vshost.exe.config

View File

@ -93,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void StartScripts() public void StartScripts()
{ {
m_log.InfoFormat("[SCENE]: Starting scripts in {0}, please wait.", RegionInfo.RegionName); // m_log.InfoFormat("[SCENE]: Starting scripts in {0}, please wait.", RegionInfo.RegionName);
IScriptModule[] engines = RequestModuleInterfaces<IScriptModule>(); IScriptModule[] engines = RequestModuleInterfaces<IScriptModule>();

View File

@ -493,7 +493,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!InventoryService.AddFolder(folder)) if (!InventoryService.AddFolder(folder))
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[AGENT INVENTORY]: Failed to move create folder for user {0} {1}", "[AGENT INVENTORY]: Failed to create folder for user {0} {1}",
remoteClient.Name, remoteClient.AgentId); remoteClient.Name, remoteClient.AgentId);
} }
} }

View File

@ -3737,7 +3737,7 @@ namespace OpenSim.Region.Framework.Scenes
"[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.",
sp.Name, sp.UUID, RegionInfo.RegionName); sp.Name, sp.UUID, RegionInfo.RegionName);
sp.ControllingClient.Close(); sp.ControllingClient.Close(true);
sp = null; sp = null;
} }

View File

@ -342,7 +342,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool AddNewSceneObject( public bool AddNewSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel) SceneObjectGroup sceneObject, bool attachToBackup, Vector3? pos, Quaternion? rot, Vector3 vel)
{ {
AddNewSceneObject(sceneObject, true, false); AddNewSceneObject(sceneObject, attachToBackup, false);
if (pos != null) if (pos != null)
sceneObject.AbsolutePosition = (Vector3)pos; sceneObject.AbsolutePosition = (Vector3)pos;

View File

@ -974,7 +974,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (wasChild && HasAttachments()) if (wasChild && HasAttachments())
{ {
m_log.DebugFormat("[SCENE PRESENCE]: Restarting scripts in attachments..."); m_log.DebugFormat(
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
// Resume scripts // Resume scripts
Util.FireAndForget(delegate(object x) { Util.FireAndForget(delegate(object x) {
foreach (SceneObjectGroup sog in m_attachments) foreach (SceneObjectGroup sog in m_attachments)

View File

@ -5571,25 +5571,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// separated list. There is a space after /// separated list. There is a space after
/// each comma. /// each comma.
/// </summary> /// </summary>
public LSL_String llList2CSV(LSL_List src) public LSL_String llList2CSV(LSL_List src)
{ {
string ret = String.Empty;
int x = 0;
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (src.Data.Length > 0) return string.Join(", ",
(new List<object>(src.Data)).ConvertAll<string>(o =>
{ {
ret = src.Data[x++].ToString(); return o.ToString();
for (; x < src.Data.Length; x++) }).ToArray());
{
ret += ", "+src.Data[x].ToString();
}
}
return ret;
} }
/// <summary> /// <summary>

View File

@ -994,6 +994,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
// This delay exists to stop mono problems where script compilation and startup would stop the sim // This delay exists to stop mono problems where script compilation and startup would stop the sim
// working properly for the session. // working properly for the session.
System.Threading.Thread.Sleep(m_StartDelay); System.Threading.Thread.Sleep(m_StartDelay);
m_log.InfoFormat("[XEngine]: Performing initial script startup on {0}", m_Scene.Name);
} }
object[] o; object[] o;
@ -1009,13 +1011,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (m_InitialStartup) if (m_InitialStartup)
if (scriptsStarted % 50 == 0) if (scriptsStarted % 50 == 0)
m_log.InfoFormat( m_log.InfoFormat(
"[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.RegionInfo.RegionName); "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.Name);
} }
} }
if (m_InitialStartup) if (m_InitialStartup)
m_log.InfoFormat( m_log.InfoFormat(
"[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.RegionInfo.RegionName); "[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.Name);
// NOTE: Despite having a lockless queue, this lock is required // NOTE: Despite having a lockless queue, this lock is required
// to make sure there is never no compile thread while there // to make sure there is never no compile thread while there

View File

@ -230,9 +230,27 @@ namespace OpenSim.Services.InventoryService
{ {
// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); // m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID);
InventoryFolderBase rootFolder = GetRootFolder(principalID);
if (rootFolder == null)
{
m_log.WarnFormat(
"[XINVENTORY]: Found no root folder for {0} in GetFolderForType() when looking for {1}",
principalID, type);
return null;
}
return GetSystemFolderForType(rootFolder, type);
}
private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, AssetType type)
{
// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID);
XInventoryFolder[] folders = m_Database.GetFolders( XInventoryFolder[] folders = m_Database.GetFolders(
new string[] { "agentID", "type"}, new string[] { "agentID", "parentFolderID", "type"},
new string[] { principalID.ToString(), ((int)type).ToString() }); new string[] { rootFolder.Owner.ToString(), rootFolder.ID.ToString(), ((int)type).ToString() });
if (folders.Length == 0) if (folders.Length == 0)
{ {
@ -308,24 +326,40 @@ namespace OpenSim.Services.InventoryService
if (check != null) if (check != null)
return false; return false;
if (folder.Type == (short)AssetType.Folder if (folder.Type != (short)AssetType.Folder || folder.Type != (short)AssetType.Unknown)
|| folder.Type == (short)AssetType.Unknown
|| folder.Type == (short)AssetType.OutfitFolder
|| GetFolderForType(folder.Owner, (AssetType)(folder.Type)) == null)
{ {
XInventoryFolder xFolder = ConvertFromOpenSim(folder); InventoryFolderBase rootFolder = GetRootFolder(folder.Owner);
return m_Database.StoreFolder(xFolder);
} if (rootFolder == null)
else
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[XINVENTORY]: Folder of type {0} already exists when tried to add {1} to {2} for {3}", "[XINVENTORY]: Found no root folder for {0} in AddFolder() when looking for {1}",
folder.Type, folder.Name, folder.ParentID, folder.Owner); folder.Owner, folder.Type);
}
return false; return false;
} }
// Check we're not trying to add this as a system folder.
if (folder.ParentID == rootFolder.ID)
{
InventoryFolderBase existingSystemFolder
= GetSystemFolderForType(rootFolder, (AssetType)folder.Type);
if (existingSystemFolder != null)
{
m_log.WarnFormat(
"[XINVENTORY]: System folder of type {0} already exists when tried to add {1} to {2} for {3}",
folder.Type, folder.Name, folder.ParentID, folder.Owner);
return false;
}
}
}
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
return m_Database.StoreFolder(xFolder);
}
public virtual bool UpdateFolder(InventoryFolderBase folder) public virtual bool UpdateFolder(InventoryFolderBase folder)
{ {
// m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID); // m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID);