|
|
|
@ -22,29 +22,17 @@ namespace Restock
|
|
|
|
|
if (file.fileExtension == "restockblacklist")
|
|
|
|
|
{
|
|
|
|
|
Debug.Log($"[Restock] Reading blacklist {file.url}.{file.fileExtension}");
|
|
|
|
|
foreach (string line in File.ReadAllLines(file.fullPath))
|
|
|
|
|
foreach (UrlDir.UrlFile blacklistFile in FindFilesInAssetListFile(file.fullPath, gameData))
|
|
|
|
|
{
|
|
|
|
|
string lineBeforeComment = line.Split(COMMENT_SEPARATOR, 2, StringSplitOptions.None)[0].Trim();
|
|
|
|
|
if (lineBeforeComment == string.Empty) continue;
|
|
|
|
|
|
|
|
|
|
foreach (UrlDir.UrlFile blacklistFile in FindFiles(lineBeforeComment, gameData))
|
|
|
|
|
{
|
|
|
|
|
blacklist.Add(blacklistFile);
|
|
|
|
|
}
|
|
|
|
|
blacklist.Add(blacklistFile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (file.fileExtension == "restockwhitelist")
|
|
|
|
|
{
|
|
|
|
|
Debug.Log($"[Restock] Reading whitelist {file.url}.{file.fileExtension}");
|
|
|
|
|
foreach (string line in File.ReadAllLines(file.fullPath))
|
|
|
|
|
foreach (UrlDir.UrlFile whitelistFile in FindFilesInAssetListFile(file.fullPath, gameData))
|
|
|
|
|
{
|
|
|
|
|
string lineBeforeComment = line.Split(COMMENT_SEPARATOR, 2, StringSplitOptions.None)[0].Trim();
|
|
|
|
|
if (lineBeforeComment == string.Empty) continue;
|
|
|
|
|
|
|
|
|
|
foreach (UrlDir.UrlFile whitelistFile in FindFiles(lineBeforeComment, gameData))
|
|
|
|
|
{
|
|
|
|
|
whitelist.Add(whitelistFile);
|
|
|
|
|
}
|
|
|
|
|
whitelist.Add(whitelistFile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -62,8 +50,22 @@ namespace Restock
|
|
|
|
|
Destroy(gameObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IEnumerable<UrlDir.UrlFile> FindFilesInAssetListFile(string filePath, UrlDir dir)
|
|
|
|
|
{
|
|
|
|
|
foreach (string line in File.ReadAllLines(filePath))
|
|
|
|
|
{
|
|
|
|
|
string lineBeforeComment = line.Split(COMMENT_SEPARATOR, 2, StringSplitOptions.None)[0].Trim();
|
|
|
|
|
if (lineBeforeComment == string.Empty) continue;
|
|
|
|
|
|
|
|
|
|
foreach (UrlDir.UrlFile urlFile in FindFilesForUrl(lineBeforeComment, dir))
|
|
|
|
|
{
|
|
|
|
|
yield return urlFile;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private readonly char[] PATH_SEPARATOR = new[] { '/' };
|
|
|
|
|
private IEnumerable<UrlDir.UrlFile> FindFiles(string url, UrlDir dir)
|
|
|
|
|
private IEnumerable<UrlDir.UrlFile> FindFilesForUrl(string url, UrlDir dir)
|
|
|
|
|
{
|
|
|
|
|
string[] splits = url.Split(PATH_SEPARATOR, 2);
|
|
|
|
|
|
|
|
|
@ -121,7 +123,7 @@ namespace Restock
|
|
|
|
|
{
|
|
|
|
|
if (regex.IsMatch(subDir.name))
|
|
|
|
|
{
|
|
|
|
|
foreach (UrlDir.UrlFile file in FindFiles(splits[1], subDir))
|
|
|
|
|
foreach (UrlDir.UrlFile file in FindFilesForUrl(splits[1], subDir))
|
|
|
|
|
{
|
|
|
|
|
yield return file;
|
|
|
|
|
}
|
|
|
|
|