Skip to content

Commit 687dc0f

Browse files
committed
Add setting to skip CDN requesting
1 parent 3174962 commit 687dc0f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

TACTSharp/CDN.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ public async Task<string> GetPatchServiceFile(string product, string file = "ver
199199
}
200200
}
201201

202+
if (!Settings.TryCDN)
203+
throw new FileNotFoundException();
204+
202205
for (var i = 0; i < CDNServers.Count; i++)
203206
{
204207
var url = $"http://{CDNServers[i]}/{ProductDirectory}/{type}/{hash[0]}{hash[1]}/{hash[2]}{hash[3]}/{hash}";
@@ -340,6 +343,9 @@ public unsafe bool TryGetLocalFile(string eKey, out ReadOnlySpan<byte> data)
340343
}
341344
}
342345

346+
if (!Settings.TryCDN)
347+
throw new FileNotFoundException();
348+
343349
lock (cdnLock)
344350
{
345351
if (CDNServers.Count == 0)

TACTSharp/Settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class Settings
1212
public string CacheDir = "cache";
1313
public string CDNDir = "";
1414
public bool ListfileFallback = true;
15+
public bool TryCDN = true;
1516
public string ListfileURL = "https://github.com/wowdev/wow-listfile/releases/latest/download/community-listfile.csv";
1617
}
1718
}

0 commit comments

Comments
 (0)