Patch from Melanie: 0001077: [PATCH] LSL types cannot be cast implicitly or explicitly in many cases Thanks Melanie!

* Also, I moved the event parser and re-writer to a separate static object.   More work will be done here shortly.
This commit is contained in:
Teravus Ovares
2008-04-30 03:36:13 +00:00
parent 0880abc402
commit 36bf16d35e
11 changed files with 684 additions and 339 deletions

View File

@@ -72,7 +72,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
{
object[] resobj = new object[]
{
httpInfo.reqID.ToString(), httpInfo.status, null, httpInfo.response_body
new LSL_Types.LSLString(httpInfo.reqID.ToString()), new LSL_Types.LSLInteger(httpInfo.status), null, new LSL_Types.LSLString(httpInfo.response_body)
};
sman.m_EventQueueManager.AddToScriptQueue(

View File

@@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
object[] resobj = new object[]
{
//lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage()
lInfo.GetChannel(), lInfo.GetName(), lInfo.GetSourceItemID().ToString(), lInfo.GetMessage()
new LSL_Types.LSLInteger(lInfo.GetChannel()), new LSL_Types.LSLString(lInfo.GetName()), new LSL_Types.LSLString(lInfo.GetSourceItemID().ToString()), new LSL_Types.LSLString(lInfo.GetMessage())
};
m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(

View File

@@ -314,7 +314,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
else
{
m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "sensor", EventQueueManager.llDetectNull,
new object[] { SensedObjects.Length });
new object[] { new LSL_Types.LSLInteger(SensedObjects.Length) });
}
}
}

View File

@@ -60,9 +60,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
//Deliver data to prim's remote_data handler
object[] resobj = new object[]
{
2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), String.Empty,
rInfo.GetIntValue(),
rInfo.GetStrVal()
new LSL_Types.LSLInteger(2), new LSL_Types.LSLString(rInfo.GetChannelKey().ToString()), new LSL_Types.LSLString(rInfo.GetMessageID().ToString()), new LSL_Types.LSLString(String.Empty),
new LSL_Types.LSLInteger(rInfo.GetIntValue()),
new LSL_Types.LSLString(rInfo.GetStrVal())
};
m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
rInfo.GetLocalID(), rInfo.GetItemID(), "remote_data", EventQueueManager.llDetectNull, resobj
@@ -83,9 +83,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
//Deliver data to prim's remote_data handler
object[] resobj = new object[]
{
3, srdInfo.channel.ToString(), srdInfo.GetReqID().ToString(), String.Empty,
srdInfo.idata,
srdInfo.sdata
new LSL_Types.LSLInteger(3), new LSL_Types.LSLString(srdInfo.channel.ToString()), new LSL_Types.LSLString(srdInfo.GetReqID().ToString()), new LSL_Types.LSLString(String.Empty),
new LSL_Types.LSLInteger(srdInfo.idata),
new LSL_Types.LSLString(srdInfo.sdata)
};
m_CmdManager.m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
srdInfo.m_localID, srdInfo.m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj

View File

@@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void changed(uint localID, uint change)
{
// Add to queue for all scripts in localID, Object pass change.
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "changed", EventQueueManager.llDetectNull, new object[] { (int)change });
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "changed", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(change) });
}
public void state_entry(uint localID)
@@ -115,7 +115,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
detstruct._key = new LSL_Types.key[1];
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { (int)1 });
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
}
public void touch_end(uint localID, IClientAPI remoteClient)
@@ -124,7 +124,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
detstruct._key = new LSL_Types.key[1];
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { (int)1 });
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
}
public void OnRezScript(uint localID, LLUUID itemID, string script)
@@ -145,7 +145,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void money(uint localID, LLUUID agentID, int amount)
{
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "money", EventQueueManager.llDetectNull, new object[] { agentID.ToString(), (int)amount });
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "money", EventQueueManager.llDetectNull, new object[] { agentID.ToString(), new LSL_Types.LSLInteger(amount) });
}
// TODO: Replace placeholders below
@@ -154,9 +154,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
// then queued in EventQueueManager.
// When queued in EventQueueManager they need to be LSL compatible (name and params)
public void state_exit(uint localID, LLUUID itemID)
public void state_exit(uint localID)
{
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_exit", EventQueueManager.llDetectNull);
// Add to queue for all scripts in ObjectID object
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "state_exit", EventQueueManager.llDetectNull, new object[] { });
}
public void touch(uint localID, LLUUID itemID)
@@ -166,22 +167,22 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void touch_end(uint localID, LLUUID itemID)
{
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end", EventQueueManager.llDetectNull);
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) });
}
public void collision_start(uint localID, LLUUID itemID)
{
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start", EventQueueManager.llDetectNull, new object[] { (int)1 });
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) });
}
public void collision(uint localID, LLUUID itemID)
{
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision", EventQueueManager.llDetectNull, new object[] { (int)1 });
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) });
}
public void collision_end(uint localID, LLUUID itemID)
{
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end", EventQueueManager.llDetectNull, new object[] { (int)1 });
myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) });
}
public void land_collision_start(uint localID, LLUUID itemID)
@@ -237,7 +238,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos)
{
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "at_target", EventQueueManager.llDetectNull, new object[] { (int)handle, new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z), new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) });
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "at_target", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(handle), new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z), new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) });
}
public void not_at_target(uint localID)