mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
App.GetName + GetInstallFolder, GetBuildId
This commit is contained in:
parent
ef8234b958
commit
8d410969c3
@ -51,5 +51,15 @@ public void PurchaseTime()
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AppName()
|
||||
{
|
||||
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
||||
{
|
||||
var name = client.App.GetName( 4000 );
|
||||
Console.WriteLine( name );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -121,8 +121,10 @@ public Client( uint appId ) : base( appId )
|
||||
BetaName = native.apps.GetCurrentBetaName();
|
||||
OwnerSteamId = native.apps.GetAppOwner();
|
||||
var appInstallDir = native.apps.GetAppInstallDir(AppId);
|
||||
|
||||
if (!String.IsNullOrEmpty(appInstallDir) && Directory.Exists(appInstallDir))
|
||||
InstallFolder = new DirectoryInfo(appInstallDir);
|
||||
|
||||
BuildId = native.apps.GetAppBuildId();
|
||||
CurrentLanguage = native.apps.GetCurrentGameLanguage();
|
||||
AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated
|
||||
|
@ -72,5 +72,34 @@ public bool IsInstalled(uint appId)
|
||||
{
|
||||
return client.native.apps.BIsAppInstalled(appId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the appid's name
|
||||
/// Returns error if the current app Id does not have permission to use this interface
|
||||
/// </summary>
|
||||
public string GetName( uint appId )
|
||||
{
|
||||
var str = client.native.applist.GetAppName( appId );
|
||||
if ( str == null ) return "error";
|
||||
return str;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the app's install folder
|
||||
/// Returns error if the current app Id does not have permission to use this interface
|
||||
/// </summary>
|
||||
public string GetInstallFolder( uint appId )
|
||||
{
|
||||
return client.native.applist.GetAppInstallDir( appId );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the app's current build id
|
||||
/// Returns 0 if the current app Id does not have permission to use this interface
|
||||
/// </summary>
|
||||
public int GetBuildId( uint appId )
|
||||
{
|
||||
return client.native.applist.GetAppBuildId( appId );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user