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

integration
Melanie 2012-08-25 17:34:08 +01:00
commit a5c6cb2fc9
10 changed files with 143 additions and 49 deletions

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

@ -468,7 +468,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

@ -3562,7 +3562,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

@ -300,7 +300,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

@ -891,7 +891,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
foreach (SceneObjectGroup sog in m_attachments) foreach (SceneObjectGroup sog in m_attachments)
{ {

View File

@ -5828,7 +5828,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
List<SceneObjectPart> parts = GetLinkParts(linknumber); List<SceneObjectPart> parts = GetLinkParts(linknumber);
foreach (var part in parts) foreach (SceneObjectPart part in parts)
{ {
SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate); SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate);
} }
@ -6190,7 +6190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
List<SceneObjectPart> parts = GetLinkParts(linknumber); List<SceneObjectPart> parts = GetLinkParts(linknumber);
foreach (var part in parts) foreach (SceneObjectPart part in parts)
{ {
SetParticleSystem(part, rules); SetParticleSystem(part, rules);
} }
@ -7238,10 +7238,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
remaining = SetPrimParams(part, rules); remaining = SetPrimParams(part, rules);
while(remaining != null && remaining.Length > 2) while (remaining != null && remaining.Length > 2)
{ {
linknumber = remaining.GetLSLIntegerItem(0); linknumber = remaining.GetLSLIntegerItem(0);
rules = remaining.GetSublist(1,-1); rules = remaining.GetSublist(1, -1);
parts = GetLinkParts(linknumber); parts = GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
@ -7910,7 +7910,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_List llGetPrimitiveParams(LSL_List rules) public LSL_List llGetPrimitiveParams(LSL_List rules)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
return GetLinkPrimitiveParams(m_host, rules);
LSL_List result = new LSL_List();
LSL_List remaining = GetPrimParams(m_host, rules, ref result);
while (remaining != null && remaining.Length > 2)
{
int linknumber = remaining.GetLSLIntegerItem(0);
rules = remaining.GetSublist(1, -1);
List<SceneObjectPart> parts = GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts)
remaining = GetPrimParams(part, rules, ref result);
}
return result;
} }
public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules) public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules)
@ -7920,19 +7935,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
List<SceneObjectPart> parts = GetLinkParts(linknumber); List<SceneObjectPart> parts = GetLinkParts(linknumber);
LSL_List res = new LSL_List(); LSL_List res = new LSL_List();
LSL_List remaining = null;
foreach (var part in parts) foreach (SceneObjectPart part in parts)
{ {
LSL_List partRes = GetLinkPrimitiveParams(part, rules); remaining = GetPrimParams(part, rules, ref res);
res += partRes; }
while (remaining != null && remaining.Length > 2)
{
linknumber = remaining.GetLSLIntegerItem(0);
rules = remaining.GetSublist(1, -1);
parts = GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts)
remaining = GetPrimParams(part, rules, ref res);
} }
return res; return res;
} }
public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules) public LSL_List GetPrimParams(SceneObjectPart part, LSL_List rules, ref LSL_List res)
{ {
LSL_List res = new LSL_List();
int idx=0; int idx=0;
while (idx < rules.Length) while (idx < rules.Length)
{ {
@ -8077,7 +8101,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PRIM_TEXTURE: case (int)ScriptBaseClass.PRIM_TEXTURE:
if (remain < 1) if (remain < 1)
return res; return null;
int face = (int)rules.GetLSLIntegerItem(idx++); int face = (int)rules.GetLSLIntegerItem(idx++);
Primitive.TextureEntry tex = part.Shape.Textures; Primitive.TextureEntry tex = part.Shape.Textures;
@ -8117,7 +8141,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PRIM_COLOR: case (int)ScriptBaseClass.PRIM_COLOR:
if (remain < 1) if (remain < 1)
return res; return null;
face=(int)rules.GetLSLIntegerItem(idx++); face=(int)rules.GetLSLIntegerItem(idx++);
@ -8146,7 +8170,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PRIM_BUMP_SHINY: case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
if (remain < 1) if (remain < 1)
return res; return null;
face=(int)rules.GetLSLIntegerItem(idx++); face=(int)rules.GetLSLIntegerItem(idx++);
@ -8177,7 +8201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PRIM_FULLBRIGHT: case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
if (remain < 1) if (remain < 1)
return res; return null;
face=(int)rules.GetLSLIntegerItem(idx++); face=(int)rules.GetLSLIntegerItem(idx++);
@ -8219,7 +8243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PRIM_TEXGEN: case (int)ScriptBaseClass.PRIM_TEXGEN:
if (remain < 1) if (remain < 1)
return res; return null;
face=(int)rules.GetLSLIntegerItem(idx++); face=(int)rules.GetLSLIntegerItem(idx++);
@ -8260,7 +8284,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PRIM_GLOW: case (int)ScriptBaseClass.PRIM_GLOW:
if (remain < 1) if (remain < 1)
return res; return null;
face=(int)rules.GetLSLIntegerItem(idx++); face=(int)rules.GetLSLIntegerItem(idx++);
@ -8312,9 +8336,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
0 0
)); ));
break; break;
case (int)ScriptBaseClass.PRIM_LINK_TARGET:
if(remain < 3)
return null;
return rules.GetSublist(idx, -1);
} }
} }
return res;
return null;
} }
public LSL_List llGetPrimMediaParams(int face, LSL_List rules) public LSL_List llGetPrimMediaParams(int face, LSL_List rules)
@ -10752,16 +10782,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
public LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules) public LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules)
{ {
SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim)); SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim));
if (obj == null)
return new LSL_List();
if (obj.OwnerID != m_host.OwnerID) LSL_List result = new LSL_List();
return new LSL_List();
return GetLinkPrimitiveParams(obj, rules); if (obj != null && obj.OwnerID != m_host.OwnerID)
{
LSL_List remaining = GetPrimParams(obj, rules, ref result);
while (remaining != null && remaining.Length > 2)
{
int linknumber = remaining.GetLSLIntegerItem(0);
rules = remaining.GetSublist(1, -1);
List<SceneObjectPart> parts = GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts)
remaining = GetPrimParams(part, rules, ref result);
}
}
return result;
} }
public void print(string str) public void print(string str)

View File

@ -2246,11 +2246,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams"); CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
InitLSL(); InitLSL();
// One needs to cast m_LSL_Api because we're using functions not
// on the ILSL_Api interface.
LSL_Api LSL_Api = (LSL_Api)m_LSL_Api;
LSL_List retVal = new LSL_List(); LSL_List retVal = new LSL_List();
List<SceneObjectPart> parts = ((LSL_Api)m_LSL_Api).GetLinkParts(linknumber); LSL_List remaining = null;
List<SceneObjectPart> parts = LSL_Api.GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
{ {
retVal += ((LSL_Api)m_LSL_Api).GetLinkPrimitiveParams(part, rules); remaining = LSL_Api.GetPrimParams(part, rules, ref retVal);
}
while (remaining != null && remaining.Length > 2)
{
linknumber = remaining.GetLSLIntegerItem(0);
rules = remaining.GetSublist(1, -1);
parts = LSL_Api.GetLinkParts(linknumber);
foreach (SceneObjectPart part in parts)
remaining = LSL_Api.GetPrimParams(part, rules, ref retVal);
} }
return retVal; return retVal;
} }
@ -2965,7 +2979,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
InitLSL(); InitLSL();
return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); return m_LSL_Api.GetPrimitiveParamsEx(prim, rules);
} }
public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)

View File

@ -425,6 +425,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void print(string str); void print(string str);
void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules); LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
} }
} }

View File

@ -923,6 +923,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;
@ -938,13 +940,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);