mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
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:
@@ -80,6 +80,15 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
// Set it if it changed
|
||||
if (m_state != value)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_ScriptEngine.m_EventManager.state_exit(m_localID);
|
||||
|
||||
}
|
||||
catch (AppDomainUnloadedException)
|
||||
{
|
||||
Console.WriteLine("[SCRIPT]: state change called when script was unloaded. Nothing to worry about, but noting the occurance");
|
||||
}
|
||||
m_state = value;
|
||||
try
|
||||
{
|
||||
@@ -2136,7 +2145,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.TaskInventory[invItemID].PermsMask=0;
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0});
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {new LSL_Types.LSLInteger(0)});
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2158,7 +2167,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.TaskInventory[invItemID].PermsMask=perm;
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm});
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {new LSL_Types.LSLInteger(perm)});
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2175,7 +2184,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_host.TaskInventory[invItemID].PermsMask=perm;
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)perm});
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {new LSL_Types.LSLInteger(perm)});
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2202,7 +2211,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
// Requested agent is not in range, refuse perms
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)0});
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {new LSL_Types.LSLInteger(0)});
|
||||
}
|
||||
|
||||
void handleScriptAnswer(IClientAPI client, LLUUID taskID, LLUUID itemID, int answer)
|
||||
@@ -2220,7 +2229,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
m_host.TaskInventory[invItemID].PermsMask=answer;
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {(int)answer});
|
||||
m_localID, m_itemID, "run_time_permissions", EventQueueManager.llDetectNull, new Object[] {new LSL_Types.LSLInteger(answer)});
|
||||
}
|
||||
|
||||
public string llGetPermissionsKey()
|
||||
@@ -2600,7 +2609,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
object[] resobj = new object[]
|
||||
{
|
||||
m_host.LinkNum + 1, num, msg, id
|
||||
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
|
||||
};
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
@@ -2627,7 +2636,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
partItemID = item.ItemID;
|
||||
Object[] resobj = new object[]
|
||||
{
|
||||
m_host.LinkNum + 1, num, msg, id
|
||||
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
|
||||
};
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
@@ -2655,7 +2664,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
partItemID = item.ItemID;
|
||||
Object[] resobj = new object[]
|
||||
{
|
||||
m_host.LinkNum + 1, num, msg, id
|
||||
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
|
||||
};
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
@@ -2685,7 +2694,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
partItemID = item.ItemID;
|
||||
Object[] resobj = new object[]
|
||||
{
|
||||
m_host.LinkNum + 1, num, msg, id
|
||||
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
|
||||
};
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
@@ -2709,7 +2718,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
object[] resobj = new object[]
|
||||
{
|
||||
m_host.LinkNum + 1, num, msg, id
|
||||
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
|
||||
};
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
@@ -2737,7 +2746,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
partItemID = item.ItemID;
|
||||
Object[] resObjDef = new object[]
|
||||
{
|
||||
m_host.LinkNum + 1, num, msg, id
|
||||
new LSL_Types.LSLInteger(m_host.LinkNum + 1), new LSL_Types.LSLInteger(num), new LSL_Types.LSLString(msg), new LSL_Types.LSLString(id)
|
||||
};
|
||||
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(
|
||||
@@ -3058,7 +3067,14 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return Convert.ToInt32(src.Data[index]);
|
||||
try
|
||||
{
|
||||
return Convert.ToInt32(src.Data[index]);
|
||||
}
|
||||
catch (System.FormatException e)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public double osList2Double(LSL_Types.list src, int index)
|
||||
@@ -3086,7 +3102,14 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
return Convert.ToDouble(src.Data[index]);
|
||||
try
|
||||
{
|
||||
return Convert.ToDouble(src.Data[index]);
|
||||
}
|
||||
catch (System.FormatException e)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
public string llList2String(LSL_Types.list src, int index)
|
||||
@@ -3112,18 +3135,9 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
}
|
||||
if (index >= src.Length)
|
||||
{
|
||||
return "00000000-0000-0000-0000-000000000000";
|
||||
}
|
||||
//return OpenSim.Framework.ToString(src[index]);
|
||||
LLUUID tmpkey;
|
||||
if (LLUUID.TryParse(src.Data[index].ToString(), out tmpkey))
|
||||
{
|
||||
return tmpkey.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return "00000000-0000-0000-0000-000000000000";
|
||||
return "";
|
||||
}
|
||||
return src.Data[index].ToString();
|
||||
}
|
||||
|
||||
public LSL_Types.Vector3 llList2Vector(LSL_Types.list src, int index)
|
||||
@@ -4317,7 +4331,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if (xmlrpcMod.IsEnabled())
|
||||
{
|
||||
LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID);
|
||||
object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), String.Empty, 0, String.Empty };
|
||||
object[] resobj = new object[] { new LSL_Types.LSLInteger(1), new LSL_Types.LSLString(channelID.ToString()), new LSL_Types.LSLString(LLUUID.Zero.ToString()), new LSL_Types.LSLString(String.Empty), new LSL_Types.LSLInteger(0), new LSL_Types.LSLString(String.Empty) };
|
||||
m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
str = str.Replace('<', ' ');
|
||||
str = str.Replace('>', ' ');
|
||||
string[] tmps = str.Split(new Char[] { ',', '<', '>' });
|
||||
if(tmps.Length < 3)
|
||||
{
|
||||
x=y=z=0;
|
||||
return;
|
||||
}
|
||||
bool res;
|
||||
res = Double.TryParse(tmps[0], out x);
|
||||
res = res & Double.TryParse(tmps[1], out y);
|
||||
@@ -76,14 +81,27 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ">";
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", x, y, z);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static explicit operator LSLString(Vector3 vec)
|
||||
{
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
|
||||
return new LSLString(s);
|
||||
}
|
||||
|
||||
public static explicit operator string(Vector3 vec)
|
||||
{
|
||||
return "<" + vec.x.ToString() + ", " + vec.y.ToString() + ", " + vec.z.ToString() + ">";
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static explicit operator Vector3(string s)
|
||||
{
|
||||
return new Vector3(s);
|
||||
}
|
||||
|
||||
public static bool operator ==(Vector3 lhs, Vector3 rhs)
|
||||
{
|
||||
return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z);
|
||||
@@ -278,6 +296,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
str = str.Replace('<', ' ');
|
||||
str = str.Replace('>', ' ');
|
||||
string[] tmps = str.Split(new Char[] { ',', '<', '>' });
|
||||
if(tmps.Length < 4)
|
||||
{
|
||||
x=y=z=s=0;
|
||||
return;
|
||||
}
|
||||
bool res;
|
||||
res = Double.TryParse(tmps[0], out x);
|
||||
res = res & Double.TryParse(tmps[1], out y);
|
||||
@@ -307,14 +330,27 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "<" + x.ToString() + ", " + y.ToString() + ", " + z.ToString() + ", " + s.ToString() + ">";
|
||||
string st=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s);
|
||||
return st;
|
||||
}
|
||||
|
||||
public static explicit operator string(Quaternion r)
|
||||
{
|
||||
return "<" + r.x.ToString() + ", " + r.y.ToString() + ", " + r.z.ToString() + ", " + r.s.ToString() + ">";
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static explicit operator LSLString(Quaternion r)
|
||||
{
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
|
||||
return new LSLString(s);
|
||||
}
|
||||
|
||||
public static explicit operator Quaternion(string s)
|
||||
{
|
||||
return new Quaternion(s);
|
||||
}
|
||||
|
||||
public static bool operator ==(Quaternion lhs, Quaternion rhs)
|
||||
{
|
||||
// Return true if the fields match:
|
||||
@@ -369,12 +405,20 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public int Length
|
||||
{
|
||||
get { return m_data.Length; }
|
||||
get {
|
||||
if(m_data == null)
|
||||
m_data=new Object[0];
|
||||
return m_data.Length;
|
||||
}
|
||||
}
|
||||
|
||||
public object[] Data
|
||||
{
|
||||
get { return m_data; }
|
||||
get {
|
||||
if(m_data == null)
|
||||
m_data=new Object[0];
|
||||
return m_data;
|
||||
}
|
||||
}
|
||||
|
||||
public static list operator +(list a, list b)
|
||||
@@ -571,13 +615,20 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
if(Data.Length == 0)
|
||||
return new list(); // Don't even bother
|
||||
|
||||
string[] keys;
|
||||
|
||||
if(stride == 1) // The simple case
|
||||
{
|
||||
Object[] ret=new Object[Data.Length];
|
||||
|
||||
Array.Copy(Data, 0, ret, 0, Data.Length);
|
||||
|
||||
Array.Sort(ret);
|
||||
keys=new string[Data.Length];
|
||||
int k;
|
||||
for(k=0;k<Data.Length;k++)
|
||||
keys[k]=Data[k].ToString();
|
||||
|
||||
Array.Sort(keys, ret);
|
||||
|
||||
if(ascending == 0)
|
||||
Array.Reverse(ret);
|
||||
@@ -588,7 +639,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
int len=(Data.Length+stride-1)/stride;
|
||||
|
||||
string[] keys=new string[len];
|
||||
keys=new string[len];
|
||||
Object[][] vals=new Object[len][];
|
||||
|
||||
int i;
|
||||
@@ -1016,17 +1067,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
if (o is String)
|
||||
{
|
||||
string s = (string)o;
|
||||
return s == this.value;
|
||||
}
|
||||
if (o is key)
|
||||
{
|
||||
key k = (key)o;
|
||||
return this.value == k.value;
|
||||
}
|
||||
return false;
|
||||
return o.ToString() == value;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@@ -1046,6 +1087,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
{
|
||||
m_string = s;
|
||||
}
|
||||
|
||||
public LSLString(double d)
|
||||
{
|
||||
string s=String.Format("{0:0.000000}", d);
|
||||
m_string=s;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Operators
|
||||
@@ -1071,44 +1119,47 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return new LSLString(s);
|
||||
}
|
||||
|
||||
// Commented out:
|
||||
/*
|
||||
[echo] Build Directory is /home/tedd/opensim/trunk/OpenSim/Region/ScriptEngine/Common/bin/Debug
|
||||
[csc] Compiling 5 files to '/home/tedd/opensim/trunk/OpenSim/Region/ScriptEngine/Common/bin/Debug/OpenSim.Region.ScriptEngine.Common.dll'.
|
||||
[csc] error CS0121: The call is ambiguous between the following methods or properties: `OpenSim.Region.ScriptEngine.Common.LSL_Types.LSLString.operator /(OpenSim.Region.ScriptEngine.Common.LSL_Types.LSLString, OpenSim.Region.ScriptEngine.Common.LSL_Types.LSLString)' and `string.operator /(string, string)'
|
||||
[csc] /home/tedd/opensim/trunk/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs(602,32): (Location of the symbol related to previous error)
|
||||
[csc] /usr/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error)
|
||||
[csc] Compilation failed: 1 error(s), 0 warnings
|
||||
*/
|
||||
//public static bool operator ==(LSLString s1, LSLString s2)
|
||||
//{
|
||||
// return s1.m_string == s2.m_string;
|
||||
//}
|
||||
//public static bool operator !=(LSLString s1, LSLString s2)
|
||||
//{
|
||||
// return s1.m_string != s2.m_string;
|
||||
//}
|
||||
public static string ToString(LSLString s)
|
||||
{
|
||||
return s.m_string;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return m_string;
|
||||
}
|
||||
|
||||
public static bool operator ==(LSLString s1, string s2)
|
||||
{
|
||||
return s1.m_string == s2;
|
||||
}
|
||||
|
||||
public static bool operator !=(LSLString s1, string s2)
|
||||
{
|
||||
return s1.m_string != s2;
|
||||
}
|
||||
|
||||
public static explicit operator double(LSLString s)
|
||||
{
|
||||
return Convert.ToDouble(s.m_string);
|
||||
}
|
||||
|
||||
public static explicit operator LSLInteger(LSLString s)
|
||||
{
|
||||
return new LSLInteger(Convert.ToInt32(s.m_string));
|
||||
}
|
||||
|
||||
public static explicit operator LSLString(double d)
|
||||
{
|
||||
return new LSLString(d);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Overriders
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
if (o is String)
|
||||
{
|
||||
string s = (string)o;
|
||||
return s == this.m_string;
|
||||
}
|
||||
if (o is key)
|
||||
{
|
||||
key k = (key)o;
|
||||
return this.m_string == k.value;
|
||||
}
|
||||
if (o is LSLString)
|
||||
{
|
||||
LSLString s = (string)o;
|
||||
return this.m_string == s;
|
||||
}
|
||||
return false;
|
||||
return m_string == o.ToString();
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@@ -1154,6 +1205,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return i.value;
|
||||
}
|
||||
|
||||
static public explicit operator LSLString(LSLInteger i)
|
||||
{
|
||||
return new LSLString(i.ToString());
|
||||
}
|
||||
|
||||
static public implicit operator Boolean(LSLInteger i)
|
||||
{
|
||||
if (i.value == 0)
|
||||
@@ -1171,6 +1227,11 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return new LSLInteger(i);
|
||||
}
|
||||
|
||||
static public explicit operator LSLInteger(string s)
|
||||
{
|
||||
return new LSLInteger(int.Parse(s));
|
||||
}
|
||||
|
||||
static public implicit operator LSLInteger(double d)
|
||||
{
|
||||
return new LSLInteger(d);
|
||||
@@ -1182,6 +1243,17 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static LSLInteger operator ++(LSLInteger i)
|
||||
{
|
||||
i.value++;
|
||||
return i;
|
||||
}
|
||||
|
||||
public static LSLInteger operator --(LSLInteger i)
|
||||
{
|
||||
i.value--;
|
||||
return i;
|
||||
}
|
||||
|
||||
//static public implicit operator System.Double(LSLInteger i)
|
||||
//{
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
|
||||
void OnRezScript(uint localID, LLUUID itemID, string script);
|
||||
void OnRemoveScript(uint localID, LLUUID itemID);
|
||||
void state_exit(uint localID, LLUUID itemID);
|
||||
void state_exit(uint localID);
|
||||
void touch(uint localID, LLUUID itemID);
|
||||
void touch_end(uint localID, LLUUID itemID);
|
||||
void collision_start(uint localID, LLUUID itemID);
|
||||
|
||||
Reference in New Issue
Block a user