OpenSim.Region.ScriptEngine.XEngine.XEngine.PostScriptEvent C# (CSharp) Méthode

PostScriptEvent() public méthode

public PostScriptEvent ( UUID itemID, string name, Object p ) : bool
itemID UUID
name string
p Object
Résultat bool
        public bool PostScriptEvent(UUID itemID, string name, Object[] p)
        {
            Object[] lsl_p = new Object[p.Length];
            for (int i = 0; i < p.Length ; i++)
            {
                if (p[i] is int)
                    lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
                else if (p[i] is string)
                    lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
                else if (p[i] is Vector3)
                    lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
                else if (p[i] is Quaternion)
                    lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
                else if (p[i] is float)
                    lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
                else
                    lsl_p[i] = p[i];
            }

            return PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0]));
        }

Same methods

XEngine::PostScriptEvent ( UUID itemID, EventParams p ) : bool

Usage Example

        // timer: not handled here
        // listen: not handled here

        public void control(UUID itemID, UUID agentID, uint held, uint change)
        {
            myScriptEngine.PostScriptEvent(itemID, new EventParams(
                                               "control", new object[] {
                new LSL_Types.LSLString(agentID.ToString()),
                new LSL_Types.LSLInteger(held),
                new LSL_Types.LSLInteger(change)
            },
                                               new DetectParams[0]));
        }