* 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
|
||||
{
|
||||
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
||||
if (obj == null)
|
||||
return;
|
||||
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0
|
||||
|| avatar.Scene.RegionInfo.RegionSettings.AllowDamage)
|
||||
{
|
||||
|
|
|
@ -231,6 +231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
|||
ItemID = ScriptTask.ItemID;
|
||||
AssetID = ScriptTask.AssetID;
|
||||
}
|
||||
LocalID = part.LocalId;
|
||||
|
||||
PrimName = part.ParentGroup.Name;
|
||||
StartParam = startParam;
|
||||
|
|
|
@ -1316,13 +1316,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
|
||||
ScriptInstance instance = null;
|
||||
// Create the object record
|
||||
UUID appDomain = assetID;
|
||||
|
||||
|
||||
|
||||
lockScriptsForRead(true);
|
||||
if ((!m_Scripts.ContainsKey(itemID)) ||
|
||||
(m_Scripts[itemID].AssetID != assetID))
|
||||
{
|
||||
lockScriptsForRead(false);
|
||||
instance = new ScriptInstance(this, part,
|
||||
item,
|
||||
startParam, postOnRez,
|
||||
m_MaxScriptQueue);
|
||||
|
||||
|
||||
UUID appDomain = assetID;
|
||||
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
appDomain = part.ParentGroup.RootPart.UUID;
|
||||
|
@ -1345,9 +1353,39 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
sandbox = AppDomain.CreateDomain(
|
||||
m_Scene.RegionInfo.RegionID.ToString(),
|
||||
evidence, appSetup);
|
||||
if (m_AppDomains.ContainsKey(appDomain))
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
|
@ -1373,12 +1411,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
return false;
|
||||
}
|
||||
}
|
||||
m_DomainScripts[appDomain].Add(itemID);
|
||||
|
||||
instance = new ScriptInstance(this, part,
|
||||
item,
|
||||
startParam, postOnRez,
|
||||
m_MaxScriptQueue);
|
||||
|
||||
instance.Load(m_AppDomains[appDomain], assembly, stateSource);
|
||||
// m_log.DebugFormat(
|
||||
|
@ -1502,6 +1535,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
if (handlerObjectRemoved != null)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
if (part != null)
|
||||
handlerObjectRemoved(part.UUID);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue