当前位置: 首页>>代码示例>>C#>>正文


C# LSL_Types.LSLInteger类代码示例

本文整理汇总了C#中OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger的典型用法代码示例。如果您正苦于以下问题:C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类的具体用法?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger怎么用?C# OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类属于命名空间,在下文中一共展示了OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: modInvokeL

        public LSL_List modInvokeL(string fname, params object[] parms)
        {
//            m_log.DebugFormat(
//                "[MOD API]: Invoking dynamic function {0}, args '{1}' with {2} return type", 
//                fname, 
//                string.Join(",", Array.ConvertAll<object, string>(parms, o => o.ToString())), 
//                ((MethodInfo)MethodBase.GetCurrentMethod()).ReturnType);

            Type returntype = m_comms.LookupReturnType(fname);
            if (returntype != typeof(object[]))
                MODError(String.Format("return type mismatch for {0}",fname));

            object[] result = (object[])modInvoke(fname,parms);
            object[] llist = new object[result.Length];
            for (int i = 0; i < result.Length; i++)
            {
                if (result[i] is string)
                {
                    llist[i] = new LSL_String((string)result[i]);
                }
                else if (result[i] is int)
                {
                    llist[i] = new LSL_Integer((int)result[i]);
                }
                else if (result[i] is float)
                {
                    llist[i] = new LSL_Float((float)result[i]);
                }
                else if (result[i] is double)
                {
                    llist[i] = new LSL_Float((double)result[i]);
                }
                else if (result[i] is UUID)
                {
                    llist[i] = new LSL_Key(result[i].ToString());
                }
                else if (result[i] is OpenMetaverse.Vector3)
                {
                    OpenMetaverse.Vector3 vresult = (OpenMetaverse.Vector3)result[i];
                    llist[i] = new LSL_Vector(vresult.X, vresult.Y, vresult.Z);
                }
                else if (result[i] is OpenMetaverse.Quaternion)
                {
                    OpenMetaverse.Quaternion qresult = (OpenMetaverse.Quaternion)result[i];
                    llist[i] = new LSL_Rotation(qresult.X, qresult.Y, qresult.Z, qresult.W);
                }
                else
                {
                    MODError(String.Format("unknown list element {1} returned by {0}", fname, result[i].GetType().Name));
                }
            }

            return new LSL_List(llist);
        }
开发者ID:Kubwa,项目名称:opensim,代码行数:54,代码来源:MOD_Api.cs

示例2: ClearPrimMedia

        private LSL_Integer ClearPrimMedia(SceneObjectPart part, LSL_Integer face)
        {
            // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid
            // Assuming silently fail means sending back LSL_STATUS_OK.  Ideally, need to check this.
            // FIXME: Don't perform the media check directly
            if (face < 0 || face > part.GetNumberOfSides() - 1)
                return ScriptBaseClass.LSL_STATUS_NOT_FOUND;

            IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
            if (null == module)
                return ScriptBaseClass.LSL_STATUS_NOT_SUPPORTED;

            module.ClearMediaEntry(part, face);

            return ScriptBaseClass.LSL_STATUS_OK;
        }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:16,代码来源:LSL_Api.cs

示例3: osGetNumberOfAttachments

        public LSL_List osGetNumberOfAttachments(LSL_Key avatar, LSL_List attachmentPoints)
        {
            CheckThreatLevel(ThreatLevel.Moderate, "osGetNumberOfAttachments");

            m_host.AddScriptLPS(1);

            UUID targetUUID;
            ScenePresence target;
            LSL_List resp = new LSL_List();

            if (attachmentPoints.Length >= 1 && UUID.TryParse(avatar.ToString(), out targetUUID) && World.TryGetScenePresence(targetUUID, out target))
            {
                foreach (object point in attachmentPoints.Data)
                {
                    LSL_Integer ipoint = new LSL_Integer(
                        (point is LSL_Integer || point is int || point is uint) ?
                            (int)point :
                            0
                    );
                    resp.Add(ipoint);
                    if (ipoint == 0)
                    {
                        // indicates zero attachments
                        resp.Add(new LSL_Integer(0));
                    }
                    else
                    {
                        // gets the number of attachments on the attachment point
                        resp.Add(new LSL_Integer(target.GetAttachments((uint)ipoint).Count));
                    }
                }
            }

            return resp;
        }
开发者ID:nebadon2025,项目名称:opensimulator,代码行数:35,代码来源:OSSL_Api.cs

示例4: llSetPrimMediaParams

 public LSL_Integer llSetPrimMediaParams(LSL_Integer face, LSL_List rules)
 {
     m_host.AddScriptLPS(1);
     ScriptSleep(1000);
     return SetPrimMediaParams(m_host, face, rules);
 }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:6,代码来源:LSL_Api.cs

示例5: llClearPrimMedia

 public LSL_Integer llClearPrimMedia(LSL_Integer face)
 {
     m_host.AddScriptLPS(1);
     ScriptSleep(1000);
     return ClearPrimMedia(m_host, face);
 }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:6,代码来源:LSL_Api.cs

示例6: llScriptProfiler

 public void llScriptProfiler(LSL_Integer flags)
 {
     m_host.AddScriptLPS(1);
     // This does nothing for LSO scripts in SL
 }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:5,代码来源:LSL_Api.cs

示例7: llLinkSitTarget

 public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
 {
     m_host.AddScriptLPS(1);
     if (link == ScriptBaseClass.LINK_ROOT)
         SitTarget(m_host.ParentGroup.RootPart, offset, rot);
     else if (link == ScriptBaseClass.LINK_THIS)
         SitTarget(m_host, offset, rot);
     else
     {
         SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
         if (null != part)
         {
             SitTarget(part, offset, rot);
         }
     }
 }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:16,代码来源:LSL_Api.cs

示例8: llRegionSayTo

        public void  llRegionSayTo( LSL_Key target, LSL_Integer channel, LSL_String msg )
        {
            m_host.AddScriptLPS(1);
            NotImplemented("llRegionSayTo");

        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:6,代码来源:LSL_Api.cs

示例9: llScriptProfiler

        public void llScriptProfiler( LSL_Integer flags )
        {
            m_host.AddScriptLPS(1);
            NotImplemented("llScriptProfiler");

        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:6,代码来源:LSL_Api.cs

示例10: llSetLinkCamera

        public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at)
        {
            m_host.AddScriptLPS(1);

            if (link == ScriptBaseClass.LINK_SET ||
                link == ScriptBaseClass.LINK_ALL_CHILDREN ||
                link == ScriptBaseClass.LINK_ALL_OTHERS) return;

            SceneObjectPart part = null;

            switch (link)
            {
                case ScriptBaseClass.LINK_ROOT:
                    part = m_host.ParentGroup.RootPart;
                    break;
                case ScriptBaseClass.LINK_THIS:
                    part = m_host;
                    break;
                default:
                    part = m_host.ParentGroup.GetLinkNumPart(link);
                    break;
            }

            if (null != part)
            {
                part.SetCameraEyeOffset(eye);
                part.SetCameraAtOffset(at);
            }
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:29,代码来源:LSL_Api.cs

示例11: osNpcTouch

 public void osNpcTouch(LSL_Key npcLSL_Key, LSL_Key object_key, LSL_Integer link_num)
 {
     m_OSSL_Functions.osNpcTouch(npcLSL_Key, object_key, link_num);
 }
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:4,代码来源:OSSL_Stub.cs

示例12: llSetContentType

        public void llSetContentType(LSL_Key id, LSL_Integer type)
        {
            m_host.AddScriptLPS(1);

            if (m_UrlModule == null)
                return;

            // Make sure the content type is text/plain to start with
            m_UrlModule.HttpContentType(new UUID(id), "text/plain");

            // Is the object owner online and in the region
            ScenePresence agent = World.GetScenePresence(m_host.ParentGroup.OwnerID);
            if (agent == null || agent.IsChildAgent)
                return;  // Fail if the owner is not in the same region

            // Is it the embeded browser?
            string userAgent = m_UrlModule.GetHttpHeader(new UUID(id), "user-agent");
            if (userAgent.IndexOf("SecondLife") < 0)
                return; // Not the embedded browser. Is this check good enough?

            // Use the IP address of the client and check against the request
            // seperate logins from the same IP will allow all of them to get non-text/plain as long
            // as the owner is in the region. Same as SL!
            string logonFromIPAddress = agent.ControllingClient.RemoteEndPoint.Address.ToString();
            string requestFromIPAddress = m_UrlModule.GetHttpHeader(new UUID(id), "remote_addr");
            //m_log.Debug("IP from header='" + requestFromIPAddress + "' IP from endpoint='" + logonFromIPAddress + "'");
            if (requestFromIPAddress == null || requestFromIPAddress.Trim() == "")
                return;
            if (logonFromIPAddress == null || logonFromIPAddress.Trim() == "")
                return;

            // If the request isnt from the same IP address then the request cannot be from the owner
            if (!requestFromIPAddress.Trim().Equals(logonFromIPAddress.Trim()))
                return;

            switch (type)
            {
                case ScriptBaseClass.CONTENT_TYPE_HTML:
                    m_UrlModule.HttpContentType(new UUID(id), "text/html");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_XML:
                    m_UrlModule.HttpContentType(new UUID(id), "application/xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_XHTML:
                    m_UrlModule.HttpContentType(new UUID(id), "application/xhtml+xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_ATOM:
                    m_UrlModule.HttpContentType(new UUID(id), "application/atom+xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_JSON:
                    m_UrlModule.HttpContentType(new UUID(id), "application/json");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_LLSD:
                    m_UrlModule.HttpContentType(new UUID(id), "application/llsd+xml");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_FORM:
                    m_UrlModule.HttpContentType(new UUID(id), "application/x-www-form-urlencoded");
                    break;
                case ScriptBaseClass.CONTENT_TYPE_RSS:
                    m_UrlModule.HttpContentType(new UUID(id), "application/rss+xml");
                    break;
                default:
                    m_UrlModule.HttpContentType(new UUID(id), "text/plain");
                    break;
            }
        }
开发者ID:Barosonix,项目名称:Barosonix-Core,代码行数:66,代码来源:LSL_Api.cs

示例13: llSetLinkMedia

        public LSL_Integer llSetLinkMedia(LSL_Integer link, LSL_Integer face, LSL_List rules)
        {
            m_host.AddScriptLPS(1);
            ScriptSleep(m_sleepMsOnSetLinkMedia);
            if (link == ScriptBaseClass.LINK_ROOT)
                return SetPrimMediaParams(m_host.ParentGroup.RootPart, face, rules);
            else if (link == ScriptBaseClass.LINK_THIS)
                return SetPrimMediaParams(m_host, face, rules);
            else
            {
                SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
                if (null != part)
                    return SetPrimMediaParams(part, face, rules);
            }

            return ScriptBaseClass.LSL_STATUS_NOT_FOUND;
        }
开发者ID:Gitlab11,项目名称:opensim,代码行数:17,代码来源:LSL_Api.cs

示例14: llSetLinkCamera

 public void llSetLinkCamera(LSL_Integer link, LSL_Vector eye, LSL_Vector at)
 {
     m_LSL_Functions.llSetLinkCamera(link, eye, at);
 }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:4,代码来源:LSL_Stub.cs

示例15: llGetAgentList

 public LSL_List llGetAgentList(LSL_Integer scope, LSL_List options)
 {
     return m_LSL_Functions.llGetAgentList(scope, options);
 }
开发者ID:p07r0457,项目名称:opensim,代码行数:4,代码来源:LSL_Stub.cs


注:本文中的OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。