Skip to content

Commit

Permalink
June 2024 Release
Browse files Browse the repository at this point in the history
The Xbox.Services.API.C extension library (XSAPI) now has an additional .dll dependency, libHttpClient. This .dll must be included in the game's shipped package and configured properly for XSAPI to function.
The PC package has been updated to copy the dll into the corresponding asset folder for dependencies.
  • Loading branch information
edwarduwms authored Jun 20, 2024
1 parent 5f37c08 commit afb4270
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions Package/Assets/GDK-Tools/Source/Utilities/GdkUtilities.cs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ public class GdkUtilities
{
public static string XsapiLibName { get { return "Microsoft.Xbox.Services.GDK.C.Thunks.dll"; } }
public static string XCurlLibName { get { return "XCurl.dll"; } }

public static string HttpClientName { get { return "libHttpClient.GDK.dll"; } }
public static string GdkToolsPath
{
get
@@ -33,7 +33,7 @@ public static string GdkVersion
// Reset paths to get new versions
_xsapiLibPath = "";
_xCurlLibPath = "";

_httpClientPath = "";
_gdkVersion = RegUtil.GetRegKey(RegUtil.HKEY_LOCAL_MACHINE, @"SOFTWARE\WOW6432Node\Microsoft\GDK", "GRDKLatest");
}

@@ -73,6 +73,22 @@ public static string XCurlLibPath
}
}

public static string HttpClientPath
{
get
{
if (!File.Exists(_httpClientPath))
{
_httpClientPath = Path.Combine(Path.Combine(RegUtil.GetRegKey(RegUtil.HKEY_LOCAL_MACHINE, @"SOFTWARE\WOW6432Node\Microsoft\GDK", "GRDKInstallPath"),
GdkVersion),
Path.Combine(@"GRDK\ExtensionLibraries\Xbox.LibHttpClient\Redist\CommonConfiguration\neutral",
HttpClientName));
}

return _httpClientPath;
}
}

public static string RootPluginPath
{
get
@@ -139,6 +155,7 @@ public static string GameConfigPath
private static string _gdkVersion;
private static string _xsapiLibPath;
private static string _xCurlLibPath;
private static string _httpClientPath;
private static string _gdkToolsPath;
private static string _pluginDllPath;
private static string _rootPluginPath;
@@ -154,11 +171,16 @@ public static void PullGdkDlls()

string xsapiPath = Path.Combine(PluginDllPath, XsapiLibName);
string xCurlPath = Path.Combine(PluginDllPath, XCurlLibName);
bool requiresXCurl = int.Parse(GdkVersion.Substring(0, 4)) >= 2110;
string httpClientPath = Path.Combine(PluginDllPath, HttpClientName);

int gdkMajorVersion = int.Parse(GdkVersion.Substring(0, 4));
bool requiresXCurl = gdkMajorVersion >= 2110;
bool requiresHttpClient = gdkMajorVersion >= 2406;

if (!oldGdkVersion.Equals(GdkVersion) ||
!File.Exists(xsapiPath) ||
(requiresXCurl && !File.Exists(xCurlPath)))
(requiresXCurl && !File.Exists(xCurlPath)) ||
(requiresHttpClient && !File.Exists(httpClientPath)))
{
if (!File.Exists(XsapiLibPath))
{
@@ -172,6 +194,11 @@ public static void PullGdkDlls()
{
File.Copy(XCurlLibPath, Path.Combine(PluginDllPath, XCurlLibName), true);
}

if (File.Exists(HttpClientPath))
{
File.Copy(HttpClientPath, httpClientPath, true);
}
}
}

0 comments on commit afb4270

Please # to comment.