mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
discover servers
This commit is contained in:
1 parent
c292ddcd6a
commit
b285e9f1d0
7 files changed
+59
-348
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using System.Text.Json;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using BlitzKit.Game.Models;
|
||||
using CUE4Parse_Conversion;
|
||||
@@ -40,7 +41,24 @@ public partial class GameInterface
|
||||
}
|
||||
|
||||
readonly Dictionary<string, (int, string)> texturePaths = [];
|
||||
readonly string textureCache = "../../temp/textures.json";
|
||||
readonly string textureCache = $"{temp}textures.json";
|
||||
|
||||
[GeneratedRegex(@"\+ClientDiscoveryBindingSources\s*=\s*\(Type=\w+,URL=""(.+)""\)")]
|
||||
private static partial Regex DiscoveryRegex();
|
||||
|
||||
public string[] DiscoveryUrls()
|
||||
{
|
||||
if (provider.TryGetGameFile("Blitz/Config/DefaultEngine.ini", out var file))
|
||||
{
|
||||
var bytes = file.Read();
|
||||
var content = Encoding.UTF8.GetString(bytes);
|
||||
var matches = DiscoveryRegex().Matches(content);
|
||||
|
||||
return [.. matches.Select(match => match.Groups[1].Value)];
|
||||
}
|
||||
|
||||
throw new FileNotFoundException("Engine config not found");
|
||||
}
|
||||
|
||||
public void DiscoverTextures(string[] tankTags)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user