OpenSim.Region.ScriptEngine.Shared.Api.OSSL_Api.osGetNumberOfNotecardLines C# (CSharp) Method

osGetNumberOfNotecardLines() public method

Get the number of lines in the given notecard.
Instead of using the LSL Dataserver event to pull notecard data, this will simply read the number of note card lines and return this data as an integer. Warning - due to the synchronous method this function uses to fetch assets, its use may be dangerous and unreliable while running in grid mode.
public osGetNumberOfNotecardLines ( string name ) : int
name string Name of the notecard or its asset id
return int
        public int osGetNumberOfNotecardLines(string name)
        {
            CheckThreatLevel(ThreatLevel.VeryHigh, "osGetNumberOfNotecardLines");
            m_host.AddScriptLPS(1);

            UUID assetID = CacheNotecard(name);

            if (assetID == UUID.Zero)
            {
                OSSLShoutError("Notecard '" + name + "' could not be found.");
                return -1;
            }

            return NotecardCache.GetLines(assetID);
        }
OSSL_Api