mirror of
https://github.com/opensim/opensim.git
synced 2026-08-02 23:18:34 +08:00
Script region crossing. This has not user functionality, but lays all the
groundwork.
This commit is contained in:
@@ -232,7 +232,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
||||
}
|
||||
|
||||
public void OnRezScript(uint localID, UUID itemID, string script,
|
||||
int startParam, bool postOnRez, string engine)
|
||||
int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
List<IScriptModule> engines =
|
||||
new List<IScriptModule>(
|
||||
|
||||
@@ -39,8 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||
public enum StateSource
|
||||
{
|
||||
NewRez = 0,
|
||||
PrimCrossing = 1,
|
||||
AttachmentCrossing = 2
|
||||
PrimCrossing = 1
|
||||
}
|
||||
|
||||
public interface IScriptWorkItem
|
||||
|
||||
@@ -286,6 +286,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
PostEvent(new EventParams("changed",
|
||||
new Object[] {new LSL_Types.LSLInteger(256)}, new DetectParams[0]));
|
||||
}
|
||||
else if (stateSource == StateSource.PrimCrossing)
|
||||
{
|
||||
// CHANGED_REGION
|
||||
PostEvent(new EventParams("changed",
|
||||
new Object[] {new LSL_Types.LSLInteger(512)}, new DetectParams[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -313,6 +319,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
}
|
||||
else
|
||||
{
|
||||
ScenePresence presence = m_Engine.World.GetScenePresence(part.OwnerID);
|
||||
|
||||
if (presence != null && (!postOnRez))
|
||||
presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
|
||||
|
||||
// m_Engine.Log.ErrorFormat("[Script] Unable to load script state, file not found");
|
||||
Start();
|
||||
PostEvent(new EventParams("state_entry",
|
||||
@@ -856,8 +867,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
|
||||
public string GetXMLState()
|
||||
{
|
||||
bool run = Running;
|
||||
Stop(100);
|
||||
Running = run;
|
||||
return ScriptSerializer.Serialize(this);
|
||||
Running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine)
|
||||
public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
List<IScriptModule> engines = new List<IScriptModule>(m_Scene.RequestModuleInterfaces<IScriptModule>());
|
||||
|
||||
@@ -388,7 +388,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
if (engine != ScriptEngineName)
|
||||
return;
|
||||
|
||||
Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez};
|
||||
Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez, (StateSource)stateSource};
|
||||
|
||||
lock (m_CompileQueue)
|
||||
{
|
||||
@@ -471,6 +471,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
string script =(string)p[2];
|
||||
int startParam = (int)p[3];
|
||||
bool postOnRez = (bool)p[4];
|
||||
StateSource stateSource = (StateSource)p[5];
|
||||
|
||||
// Get the asset ID of the script, so we can check if we
|
||||
// already have it.
|
||||
@@ -505,8 +506,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
{
|
||||
assembly = m_Compiler.PerformScriptCompile(script,
|
||||
assetID.ToString());
|
||||
if (presence != null && (!postOnRez))
|
||||
presence.ControllingClient.SendAgentAlertMessage("Compile successful", false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -584,7 +583,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
m_AppDomains[appDomain],
|
||||
part.ParentGroup.RootPart.Name,
|
||||
item.Name, startParam, postOnRez,
|
||||
StateSource.NewRez, m_MaxScriptQueue);
|
||||
stateSource, m_MaxScriptQueue);
|
||||
|
||||
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}",
|
||||
part.ParentGroup.RootPart.Name, item.Name);
|
||||
|
||||
Reference in New Issue
Block a user