Exemplo n.º 1
0
        private void Op_Lneq()
        {
            LSLList rhs = (LSLList)_state.Operands.Pop();
            LSLList lhs = (LSLList)_state.Operands.Pop();

            SafeOperandsPush(lhs.Members.Count == rhs.Members.Count ? 0 : 1);
        }
Exemplo n.º 2
0
        private void Op_ListPrepend()
        {
            LSLList b = (LSLList)_state.Operands.Pop();
            object  a = (object)_state.Operands.Pop();

            SafeOperandsPush(b.Prepend(a));
        }
Exemplo n.º 3
0
        public void TestSetAndClearMaterialsForFaceClearsEntry()
        {
            var sop = SceneUtil.RandomSOP("Root", 1);
            sop.OwnerMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify);
            var group = new SceneObjectGroup(sop);
            var lslSystemApi = new LSLSystemAPI(engine, sop, 0, UUID.Zero);

            // Check that its Zeroed
            var emptyResult = new LSLList(new List<object> { UUID.Zero.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 });
            var rules = new LSLList(new List<object> { ScriptBaseClass.PRIM_NORMAL, 0 });
            LSLList asList = lslSystemApi.llGetPrimitiveParams(rules);
            Assert.That(asList.ToString(), Is.EqualTo(emptyResult.ToString()));

            // Set a value and check it
            var textureId = UUID.Random();
            var faceZeroData = new LSLList(new List<object> { textureId.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 });
            var setMaterialsRequest = rules.Append(faceZeroData);
            lslSystemApi.llSetLinkPrimitiveParamsFast(0, setMaterialsRequest);
            LSLList setMaterialsResult = lslSystemApi.llGetLinkPrimitiveParams(0, rules);
            Assert.That(setMaterialsResult.ToString(), Is.EqualTo(faceZeroData.ToString()));

            // Clear it and Check thats its zeroed
            var clearMaterialsRequest = rules.Append(emptyResult);
            lslSystemApi.llSetLinkPrimitiveParamsFast(0, clearMaterialsRequest);
            LSLList clearMaterialsResult = lslSystemApi.llGetLinkPrimitiveParams(0, clearMaterialsRequest);
            Assert.That(clearMaterialsResult.ToString(), Is.EqualTo(emptyResult.ToString()));
        }
Exemplo n.º 4
0
        private void Op_ListAppend()
        {
            object  b = _state.Operands.Pop();
            LSLList a = (LSLList)_state.Operands.Pop();

            SafeOperandsPush(a.Append(b));
        }
Exemplo n.º 5
0
        public void TestJsonSimpleObjectWithNullInValue()
        {
            var expectedResult = new LSLList(new List <object> {
                "dummy", ScriptBaseClass.JSON_NULL
            });
            var asList = lslSystemApi.llJson2List("{ \"dummy\" : null }");

            Assert.IsTrue(expectedResult.Equals(asList));
        }
Exemplo n.º 6
0
        public void TestJsonArrayWithNull()
        {
            var expectedResult = new LSLList(new List <object> {
                ScriptBaseClass.JSON_NULL
            });
            var asList = lslSystemApi.llJson2List("[ null ]");

            Assert.IsTrue(expectedResult.Equals(asList));
        }
Exemplo n.º 7
0
        public void TestJsonSimpleObject()
        {
            var expectedResult = new LSLList(new List <object> {
                "dummy", "data"
            });
            LSLList asList = lslSystemApi.llJson2List("{ \"dummy\" : \"data\" }");

            Assert.IsTrue(expectedResult.Equals(asList));
        }
Exemplo n.º 8
0
 public void TestGetMaterialsForFace()
 {
     var sop = SceneUtil.RandomSOP("Root", 1);
     var group = new SceneObjectGroup(sop);
     var lslSystemApi = new LSLSystemAPI(engine, sop, 0, UUID.Zero);
     var expectedResult = new LSLList(new List<object> { UUID.Zero.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 });
     var rules = new LSLList(new List<object> { ScriptBaseClass.PRIM_NORMAL, 0 });
     LSLList asList = lslSystemApi.llGetPrimitiveParams(rules);
     Assert.That(asList.ToString(), Is.EqualTo(expectedResult.ToString()));
 }
Exemplo n.º 9
0
        private void Op_Linit_g()
        {
            int gidx = this.GetIntOperand();

            LSLList newVal = new LSLList();

            _state.MemInfo.ReplaceStored(_state.Globals[gidx], newVal);

            _state.Globals[gidx] = newVal;
        }
Exemplo n.º 10
0
        private void Op_Linit_l()
        {
            int lidx = this.GetIntOperand();

            LSLList newVal = new LSLList();

            _state.MemInfo.ReplaceStored(_state.TopFrame.Locals[lidx], newVal);

            _state.TopFrame.Locals[lidx] = newVal;
        }
Exemplo n.º 11
0
        private string _LSLListToString(LSLList list)
        {
            StringBuilder contents = new StringBuilder();

            for (int index = 0; index < list.Data.Length; ++index)
            {
                contents.Append(list.GetLSLStringItem(index));
            }

            return(contents.ToString());
        }
Exemplo n.º 12
0
        private string _LSLListToString(LSLList list)
        {
            StringBuilder contents = new StringBuilder();

            foreach (object obj in list.Members)
            {
                contents.Append(_PrimitiveToString(obj));
            }

            return(contents.ToString());
        }
Exemplo n.º 13
0
        public void TestSetAndGetMaterialsForFaceForNoModSOP()
        {
            var sop = SceneUtil.RandomSOP("Root", 1);
            sop.OwnerMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer);
            var group = new SceneObjectGroup(sop);
            var lslSystemApi = new LSLSystemAPI(engine, sop, 0, UUID.Zero);

            var textureId = UUID.Random();
            var faceZeroData = new LSLList(new List<object> { textureId.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 });
            var rules = new LSLList(new List<object> { ScriptBaseClass.PRIM_NORMAL, 0 });
            var request = rules.Append(faceZeroData);

            lslSystemApi.llSetLinkPrimitiveParamsFast(0, request);
            LSLList result = lslSystemApi.llGetLinkPrimitiveParams(0, rules);
            Assert.That(result.ToString(), !Is.EqualTo(faceZeroData.ToString()));
        }
Exemplo n.º 14
0
        public void Normalize()
        {
            if (Args != null)
            {
                for (int i = 0; i < Args.Length; i++)
                {
                    object obj = Args[i];

                    object[] objarr = obj as object[];
                    if (objarr != null)
                    {
                        Args[i] = new LSLList(objarr);
                    }
                }
            }
        }
Exemplo n.º 15
0
        private void Op_Linit_l()
        {
            int lidx = this.GetIntOperand();

            LSLList newVal = new LSLList();
            _state.MemInfo.ReplaceStored(_state.TopFrame.Locals[lidx], newVal);

            _state.TopFrame.Locals[lidx] = newVal;
        }
Exemplo n.º 16
0
 public void TestJsonSimpleObject()
 {
     var expectedResult = new LSLList(new List<object> { "dummy", "data" });
     LSLList asList = lslSystemApi.llJson2List("{ \"dummy\" : \"data\" }");
     Assert.IsTrue(expectedResult.Equals(asList));
 }
Exemplo n.º 17
0
 public void TestJsonSimpleObjectWithNullInValue()
 {
     var expectedResult = new LSLList(new List<object>{ "dummy", ScriptBaseClass.JSON_NULL });
     var asList = lslSystemApi.llJson2List("{ \"dummy\" : null }");
     Assert.IsTrue(expectedResult.Equals(asList));
 }
Exemplo n.º 18
0
 public void TestJsonArrayWithNull()
 {
     var expectedResult = new LSLList(new List<object> { ScriptBaseClass.JSON_NULL });
     var asList = lslSystemApi.llJson2List("[ null ]");
     Assert.IsTrue(expectedResult.Equals(asList));
 }
Exemplo n.º 19
0
        private void Op_Linit_g()
        {
            int gidx = this.GetIntOperand();

            LSLList newVal = new LSLList();
            _state.MemInfo.ReplaceStored(_state.Globals[gidx], newVal);

            _state.Globals[gidx] = newVal;
        }
Exemplo n.º 20
0
 private static LSLList ConvToLSLType(LSLList o)
 {
     return o;
 }
Exemplo n.º 21
0
        private string _LSLListToString(LSLList list)
        {
            StringBuilder contents = new StringBuilder();
            foreach (object obj in list.Members)
            {
                contents.Append(_PrimitiveToString(obj));
            }

            return contents.ToString();
        }