OpenSim.Region.Framework.Scenes.UuidGatherer.GetScriptAssetUuids C# (CSharp) Method

GetScriptAssetUuids() protected method

Record the asset uuids embedded within the given script.
protected GetScriptAssetUuids ( UUID scriptUuid, AssetType>.IDictionary assetUuids ) : void
scriptUuid UUID
assetUuids AssetType>.IDictionary Dictionary in which to record the references
return void
        protected void GetScriptAssetUuids(UUID scriptUuid, IDictionary<UUID, AssetType> assetUuids)
        {
            AssetBase scriptAsset = GetAsset(scriptUuid);

            if (null != scriptAsset)
            {
                string script = Utils.BytesToString(scriptAsset.Data);
                //m_log.DebugFormat("[ARCHIVER]: Script {0}", script);
                MatchCollection uuidMatches = Util.UUIDPattern.Matches(script);
                //m_log.DebugFormat("[ARCHIVER]: Found {0} matches in script", uuidMatches.Count);

                foreach (Match uuidMatch in uuidMatches)
                {
                    UUID uuid = new UUID(uuidMatch.Value);
                    //m_log.DebugFormat("[ARCHIVER]: Recording {0} in script", uuid);

                    // Assume AssetIDs embedded in scripts are textures
                    assetUuids[uuid] = AssetType.Texture;
                }
            }
        }