* Fix a null ref that causes a stack unwind when crossing borders. Less stack unwinding.. the faster it goes.
* Tweak XEngine so that it's partially functional again. It's still not great, but basic things work.avinationmerge
parent
58359788a9
commit
01c3be2746
|
@ -182,6 +182,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
||||||
|
if (obj == null)
|
||||||
|
return;
|
||||||
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0
|
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0
|
||||||
|| avatar.Scene.RegionInfo.RegionSettings.AllowDamage)
|
|| avatar.Scene.RegionInfo.RegionSettings.AllowDamage)
|
||||||
{
|
{
|
||||||
|
|
|
@ -231,6 +231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
ItemID = ScriptTask.ItemID;
|
ItemID = ScriptTask.ItemID;
|
||||||
AssetID = ScriptTask.AssetID;
|
AssetID = ScriptTask.AssetID;
|
||||||
}
|
}
|
||||||
|
LocalID = part.LocalId;
|
||||||
|
|
||||||
PrimName = part.ParentGroup.Name;
|
PrimName = part.ParentGroup.Name;
|
||||||
StartParam = startParam;
|
StartParam = startParam;
|
||||||
|
|
|
@ -1316,13 +1316,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
|
|
||||||
ScriptInstance instance = null;
|
ScriptInstance instance = null;
|
||||||
// Create the object record
|
// Create the object record
|
||||||
|
UUID appDomain = assetID;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lockScriptsForRead(true);
|
lockScriptsForRead(true);
|
||||||
if ((!m_Scripts.ContainsKey(itemID)) ||
|
if ((!m_Scripts.ContainsKey(itemID)) ||
|
||||||
(m_Scripts[itemID].AssetID != assetID))
|
(m_Scripts[itemID].AssetID != assetID))
|
||||||
{
|
{
|
||||||
lockScriptsForRead(false);
|
lockScriptsForRead(false);
|
||||||
|
instance = new ScriptInstance(this, part,
|
||||||
|
item,
|
||||||
|
startParam, postOnRez,
|
||||||
|
m_MaxScriptQueue);
|
||||||
|
|
||||||
|
|
||||||
UUID appDomain = assetID;
|
|
||||||
|
|
||||||
if (part.ParentGroup.IsAttachment)
|
if (part.ParentGroup.IsAttachment)
|
||||||
appDomain = part.ParentGroup.RootPart.UUID;
|
appDomain = part.ParentGroup.RootPart.UUID;
|
||||||
|
@ -1345,9 +1353,39 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
sandbox = AppDomain.CreateDomain(
|
sandbox = AppDomain.CreateDomain(
|
||||||
m_Scene.RegionInfo.RegionID.ToString(),
|
m_Scene.RegionInfo.RegionID.ToString(),
|
||||||
evidence, appSetup);
|
evidence, appSetup);
|
||||||
|
if (m_AppDomains.ContainsKey(appDomain))
|
||||||
|
{
|
||||||
m_AppDomains[appDomain].AssemblyResolve +=
|
m_AppDomains[appDomain].AssemblyResolve +=
|
||||||
new ResolveEventHandler(
|
new ResolveEventHandler(
|
||||||
AssemblyResolver.OnAssemblyResolve);
|
AssemblyResolver.OnAssemblyResolve);
|
||||||
|
if (m_DomainScripts.ContainsKey(appDomain))
|
||||||
|
{
|
||||||
|
m_DomainScripts[appDomain].Add(itemID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_DomainScripts.Add(appDomain, new List<UUID>());
|
||||||
|
m_DomainScripts[appDomain].Add(itemID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_AppDomains.Add(appDomain, sandbox);
|
||||||
|
m_AppDomains[appDomain].AssemblyResolve +=
|
||||||
|
new ResolveEventHandler(
|
||||||
|
AssemblyResolver.OnAssemblyResolve);
|
||||||
|
if (m_DomainScripts.ContainsKey(appDomain))
|
||||||
|
{
|
||||||
|
m_DomainScripts[appDomain].Add(itemID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_DomainScripts.Add(appDomain, new List<UUID>());
|
||||||
|
m_DomainScripts[appDomain].Add(itemID);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1373,12 +1411,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_DomainScripts[appDomain].Add(itemID);
|
|
||||||
|
|
||||||
instance = new ScriptInstance(this, part,
|
|
||||||
item,
|
|
||||||
startParam, postOnRez,
|
|
||||||
m_MaxScriptQueue);
|
|
||||||
|
|
||||||
instance.Load(m_AppDomains[appDomain], assembly, stateSource);
|
instance.Load(m_AppDomains[appDomain], assembly, stateSource);
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
|
@ -1502,6 +1535,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
if (handlerObjectRemoved != null)
|
if (handlerObjectRemoved != null)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||||
|
if (part != null)
|
||||||
handlerObjectRemoved(part.UUID);
|
handlerObjectRemoved(part.UUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue