mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 14:48:02 +03:00
Refactor
This commit is contained in:
parent
ca96362a5f
commit
e7aa122c1f
@ -14,7 +14,7 @@ namespace Steamworks
|
|||||||
public static class Apps
|
public static class Apps
|
||||||
{
|
{
|
||||||
static Internal.ISteamApps _internal;
|
static Internal.ISteamApps _internal;
|
||||||
internal static Internal.ISteamApps steamapps
|
internal static Internal.ISteamApps Internal
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -47,62 +47,62 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the active user is subscribed to the current App ID
|
/// Checks if the active user is subscribed to the current App ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsSubscribed => steamapps.BIsSubscribed();
|
public static bool IsSubscribed => Internal.BIsSubscribed();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID
|
/// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsSubscribedFromFamilySharing => steamapps.BIsSubscribedFromFamilySharing();
|
public static bool IsSubscribedFromFamilySharing => Internal.BIsSubscribedFromFamilySharing();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the license owned by the user provides low violence depots.
|
/// Checks if the license owned by the user provides low violence depots.
|
||||||
/// Low violence depots are useful for copies sold in countries that have content restrictions
|
/// Low violence depots are useful for copies sold in countries that have content restrictions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsLowVoilence => steamapps.BIsLowViolence();
|
public static bool IsLowVoilence => Internal.BIsLowViolence();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks whether the current App ID license is for Cyber Cafes.
|
/// Checks whether the current App ID license is for Cyber Cafes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsCybercafe => steamapps.BIsCybercafe();
|
public static bool IsCybercafe => Internal.BIsCybercafe();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// CChecks if the user has a VAC ban on their account
|
/// CChecks if the user has a VAC ban on their account
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsVACBanned => steamapps.BIsVACBanned();
|
public static bool IsVACBanned => Internal.BIsVACBanned();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current language that the user has set.
|
/// Gets the current language that the user has set.
|
||||||
/// This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title.
|
/// This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GameLanguage => steamapps.GetCurrentGameLanguage();
|
public static string GameLanguage => Internal.GetCurrentGameLanguage();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a list of the languages the current app supports.
|
/// Gets a list of the languages the current app supports.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string[] AvailablLanguages => steamapps.GetAvailableGameLanguages().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
|
public static string[] AvailablLanguages => Internal.GetAvailableGameLanguages().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the active user is subscribed to a specified AppId.
|
/// Checks if the active user is subscribed to a specified AppId.
|
||||||
/// Only use this if you need to check ownership of another game related to yours, a demo for example.
|
/// Only use this if you need to check ownership of another game related to yours, a demo for example.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsSubscribedToApp( AppId appid ) => steamapps.BIsSubscribedApp( appid.Value );
|
public static bool IsSubscribedToApp( AppId appid ) => Internal.BIsSubscribedApp( appid.Value );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the user owns a specific DLC and if the DLC is installed
|
/// Checks if the user owns a specific DLC and if the DLC is installed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsDlcInstalled( AppId appid ) => steamapps.BIsDlcInstalled( appid.Value );
|
public static bool IsDlcInstalled( AppId appid ) => Internal.BIsDlcInstalled( appid.Value );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the time of the purchase of the app
|
/// Returns the time of the purchase of the app
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static DateTime PurchaseTime( AppId appid ) => Facepunch.Steamworks.Utility.Epoch.ToDateTime( steamapps.GetEarliestPurchaseUnixTime( appid.Value ) );
|
public static DateTime PurchaseTime( AppId appid ) => Facepunch.Steamworks.Utility.Epoch.ToDateTime( Internal.GetEarliestPurchaseUnixTime( appid.Value ) );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the user is subscribed to the current app through a free weekend
|
/// Checks if the user is subscribed to the current app through a free weekend
|
||||||
/// This function will return false for users who have a retail or other type of license
|
/// This function will return false for users who have a retail or other type of license
|
||||||
/// Before using, please ask your Valve technical contact how to package and secure your free weekened
|
/// Before using, please ask your Valve technical contact how to package and secure your free weekened
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsSubscribedFromFreeWeekend => steamapps.BIsSubscribedFromFreeWeekend();
|
public static bool IsSubscribedFromFreeWeekend => Internal.BIsSubscribedFromFreeWeekend();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns metadata for all available DLC
|
/// Returns metadata for all available DLC
|
||||||
@ -112,11 +112,11 @@ namespace Steamworks
|
|||||||
var appid = default( SteamNative.AppId_t );
|
var appid = default( SteamNative.AppId_t );
|
||||||
var available = false;
|
var available = false;
|
||||||
|
|
||||||
for ( int i = 0; i < steamapps.GetDLCCount(); i++ )
|
for ( int i = 0; i < Internal.GetDLCCount(); i++ )
|
||||||
{
|
{
|
||||||
var sb = SteamNative.Helpers.TakeStringBuilder();
|
var sb = SteamNative.Helpers.TakeStringBuilder();
|
||||||
|
|
||||||
if ( !steamapps.BGetDLCDataByIndex( i, ref appid, ref available, sb, sb.Capacity ) )
|
if ( !Internal.BGetDLCDataByIndex( i, ref appid, ref available, sb, sb.Capacity ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
yield return new DlcInformation
|
yield return new DlcInformation
|
||||||
@ -131,12 +131,12 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Install/Uninstall control for optional DLC
|
/// Install/Uninstall control for optional DLC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void InstallDlc( AppId appid ) => steamapps.InstallDLC( appid.Value );
|
public static void InstallDlc( AppId appid ) => Internal.InstallDLC( appid.Value );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Install/Uninstall control for optional DLC
|
/// Install/Uninstall control for optional DLC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void UninstallDlc( AppId appid ) => steamapps.UninstallDLC( appid.Value );
|
public static void UninstallDlc( AppId appid ) => Internal.UninstallDLC( appid.Value );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns null if we're not on a beta branch, else the name of the branch
|
/// Returns null if we're not on a beta branch, else the name of the branch
|
||||||
@ -147,7 +147,7 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
var sb = SteamNative.Helpers.TakeStringBuilder();
|
var sb = SteamNative.Helpers.TakeStringBuilder();
|
||||||
|
|
||||||
if ( !steamapps.GetCurrentBetaName( sb, sb.Capacity ) )
|
if ( !Internal.GetCurrentBetaName( sb, sb.Capacity ) )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
@ -160,7 +160,7 @@ namespace Steamworks
|
|||||||
/// If you detect the game is out-of-date(for example, by having the client detect a version mismatch with a server),
|
/// If you detect the game is out-of-date(for example, by having the client detect a version mismatch with a server),
|
||||||
/// you can call use MarkContentCorrupt to force a verify, show a message to the user, and then quit.
|
/// you can call use MarkContentCorrupt to force a verify, show a message to the user, and then quit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void MarkContentCorrupt( bool missingFilesOnly ) => steamapps.MarkContentCorrupt( missingFilesOnly );
|
public static void MarkContentCorrupt( bool missingFilesOnly ) => Internal.MarkContentCorrupt( missingFilesOnly );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a list of all installed depots for a given App ID in mount order
|
/// Gets a list of all installed depots for a given App ID in mount order
|
||||||
@ -170,7 +170,7 @@ namespace Steamworks
|
|||||||
var depots = new SteamNative.DepotId_t[32];
|
var depots = new SteamNative.DepotId_t[32];
|
||||||
uint count = 0;
|
uint count = 0;
|
||||||
|
|
||||||
count = steamapps.GetInstalledDepots( appid.Value, depots, (uint) depots.Length );
|
count = Internal.GetInstalledDepots( appid.Value, depots, (uint) depots.Length );
|
||||||
|
|
||||||
for ( int i = 0; i < count; i++ )
|
for ( int i = 0; i < count; i++ )
|
||||||
{
|
{
|
||||||
@ -186,7 +186,7 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
var sb = SteamNative.Helpers.TakeStringBuilder();
|
var sb = SteamNative.Helpers.TakeStringBuilder();
|
||||||
|
|
||||||
if ( steamapps.GetAppInstallDir( appid.Value, sb, (uint) sb.Capacity ) == 0 )
|
if ( Internal.GetAppInstallDir( appid.Value, sb, (uint) sb.Capacity ) == 0 )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
@ -195,12 +195,12 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The app may not actually be owned by the current user, they may have it left over from a free weekend, etc.
|
/// The app may not actually be owned by the current user, they may have it left over from a free weekend, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsAppInstalled( AppId appid ) => steamapps.BIsAppInstalled( appid.Value );
|
public static bool IsAppInstalled( AppId appid ) => Internal.BIsAppInstalled( appid.Value );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Steam ID of the original owner of the current app. If it's different from the current user then it is borrowed..
|
/// Gets the Steam ID of the original owner of the current app. If it's different from the current user then it is borrowed..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static SteamId AppOwner => steamapps.GetAppOwner().Value;
|
public static SteamId AppOwner => Internal.GetAppOwner().Value;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the associated launch parameter if the game is run via steam://run/appid/?param1=value1;param2=value2;param3=value3 etc.
|
/// Gets the associated launch parameter if the game is run via steam://run/appid/?param1=value1;param2=value2;param3=value3 etc.
|
||||||
@ -208,7 +208,7 @@ namespace Steamworks
|
|||||||
/// Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,
|
/// Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,
|
||||||
/// but it is advised that you not param names beginning with an underscore for your own features.
|
/// but it is advised that you not param names beginning with an underscore for your own features.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetLaunchParam( string param ) => steamapps.GetLaunchQueryParam( param );
|
public static string GetLaunchParam( string param ) => Internal.GetLaunchQueryParam( param );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the download progress for optional DLC.
|
/// Gets the download progress for optional DLC.
|
||||||
@ -218,7 +218,7 @@ namespace Steamworks
|
|||||||
ulong punBytesDownloaded = 0;
|
ulong punBytesDownloaded = 0;
|
||||||
ulong punBytesTotal = 0;
|
ulong punBytesTotal = 0;
|
||||||
|
|
||||||
if ( !steamapps.GetDlcDownloadProgress( appid.Value, ref punBytesDownloaded, ref punBytesTotal ) )
|
if ( !Internal.GetDlcDownloadProgress( appid.Value, ref punBytesDownloaded, ref punBytesTotal ) )
|
||||||
return default( DownloadProgress );
|
return default( DownloadProgress );
|
||||||
|
|
||||||
return new DownloadProgress { BytesDownloaded = punBytesDownloaded, BytesTotal = punBytesTotal, Active = true };
|
return new DownloadProgress { BytesDownloaded = punBytesDownloaded, BytesTotal = punBytesTotal, Active = true };
|
||||||
@ -228,7 +228,7 @@ namespace Steamworks
|
|||||||
/// Gets the buildid of this app, may change at any time based on backend updates to the game.
|
/// Gets the buildid of this app, may change at any time based on backend updates to the game.
|
||||||
/// Defaults to 0 if you're not running a build downloaded from steam.
|
/// Defaults to 0 if you're not running a build downloaded from steam.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int BuildId => steamapps.GetAppBuildId();
|
public static int BuildId => Internal.GetAppBuildId();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -237,7 +237,7 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static async Task<FileDetails> GetFileDetails( string filename )
|
public static async Task<FileDetails> GetFileDetails( string filename )
|
||||||
{
|
{
|
||||||
var r = await steamapps.GetFileDetails( filename );
|
var r = await Internal.GetFileDetails( filename );
|
||||||
|
|
||||||
if ( !r.HasValue )
|
if ( !r.HasValue )
|
||||||
{
|
{
|
||||||
@ -266,7 +266,7 @@ namespace Steamworks
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
var sb = SteamNative.Helpers.TakeStringBuilder();
|
var sb = SteamNative.Helpers.TakeStringBuilder();
|
||||||
var len = steamapps.GetLaunchCommandLine( sb, sb.Capacity );
|
var len = Internal.GetLaunchCommandLine( sb, sb.Capacity );
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace Steamworks
|
|||||||
public static class Music
|
public static class Music
|
||||||
{
|
{
|
||||||
static Internal.ISteamMusic _internal;
|
static Internal.ISteamMusic _internal;
|
||||||
internal static Internal.ISteamMusic music
|
internal static Internal.ISteamMusic Internal
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -43,40 +43,40 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if Steam Music is enabled
|
/// Checks if Steam Music is enabled
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsEnabled => music.BIsEnabled();
|
public static bool IsEnabled => Internal.BIsEnabled();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// true if a song is currently playing, paused, or queued up to play; otherwise false.
|
/// true if a song is currently playing, paused, or queued up to play; otherwise false.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsPlaying => music.BIsPlaying();
|
public static bool IsPlaying => Internal.BIsPlaying();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the current status of the Steam Music player
|
/// Gets the current status of the Steam Music player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static AudioPlayback_Status Status => music.GetPlaybackStatus();
|
public static AudioPlayback_Status Status => Internal.GetPlaybackStatus();
|
||||||
|
|
||||||
|
|
||||||
public static void Play() => music.Play();
|
public static void Play() => Internal.Play();
|
||||||
|
|
||||||
public static void Pause() => music.Pause();
|
public static void Pause() => Internal.Pause();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Have the Steam Music player play the previous song.
|
/// Have the Steam Music player play the previous song.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void PlayPrevious() => music.PlayPrevious();
|
public static void PlayPrevious() => Internal.PlayPrevious();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Have the Steam Music player skip to the next song
|
/// Have the Steam Music player skip to the next song
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void PlayNext() => music.PlayNext();
|
public static void PlayNext() => Internal.PlayNext();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets/Sets the current volume of the Steam Music player
|
/// Gets/Sets the current volume of the Steam Music player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static float Volume
|
public static float Volume
|
||||||
{
|
{
|
||||||
get => music.GetVolume();
|
get => Internal.GetVolume();
|
||||||
set => music.SetVolume( value );
|
set => Internal.SetVolume( value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ namespace Steamworks
|
|||||||
public static class Parental
|
public static class Parental
|
||||||
{
|
{
|
||||||
static Internal.ISteamParentalSettings _internal;
|
static Internal.ISteamParentalSettings _internal;
|
||||||
internal static Internal.ISteamParentalSettings parentalsettings
|
internal static Internal.ISteamParentalSettings Internal
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -38,31 +38,31 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsParentalLockEnabled => parentalsettings.BIsParentalLockEnabled();
|
public static bool IsParentalLockEnabled => Internal.BIsParentalLockEnabled();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsParentalLockLocked => parentalsettings.BIsParentalLockLocked();
|
public static bool IsParentalLockLocked => Internal.BIsParentalLockLocked();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsAppBlocked( AppId app ) => parentalsettings.BIsAppBlocked( app.Value );
|
public static bool IsAppBlocked( AppId app ) => Internal.BIsAppBlocked( app.Value );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool BIsAppInBlockList( AppId app ) => parentalsettings.BIsAppInBlockList( app.Value );
|
public static bool BIsAppInBlockList( AppId app ) => Internal.BIsAppInBlockList( app.Value );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsFeatureBlocked( ParentalFeature feature ) => parentalsettings.BIsFeatureBlocked( feature );
|
public static bool IsFeatureBlocked( ParentalFeature feature ) => Internal.BIsFeatureBlocked( feature );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool BIsFeatureInBlockList( ParentalFeature feature ) => parentalsettings.BIsFeatureInBlockList( feature );
|
public static bool BIsFeatureInBlockList( ParentalFeature feature ) => Internal.BIsFeatureInBlockList( feature );
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ namespace Steamworks
|
|||||||
public static class Utils
|
public static class Utils
|
||||||
{
|
{
|
||||||
static Internal.ISteamUtils _internal;
|
static Internal.ISteamUtils _internal;
|
||||||
internal static Internal.ISteamUtils steamutils
|
internal static Internal.ISteamUtils Internal
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -56,26 +56,26 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the number of seconds since the application was active
|
/// Returns the number of seconds since the application was active
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static uint SecondsSinceAppActive => steamutils.GetSecondsSinceAppActive();
|
public static uint SecondsSinceAppActive => Internal.GetSecondsSinceAppActive();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the number of seconds since the user last moved the mouse etc
|
/// Returns the number of seconds since the user last moved the mouse etc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static uint SecondsSinceComputerActive => steamutils.GetSecondsSinceComputerActive();
|
public static uint SecondsSinceComputerActive => Internal.GetSecondsSinceComputerActive();
|
||||||
|
|
||||||
// the universe this client is connecting to
|
// the universe this client is connecting to
|
||||||
public static Universe ConnectedUniverse => steamutils.GetConnectedUniverse();
|
public static Universe ConnectedUniverse => Internal.GetConnectedUniverse();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)
|
/// Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static DateTime SteamServerTime => Facepunch.Steamworks.Utility.Epoch.ToDateTime( steamutils.GetServerRealTime() );
|
public static DateTime SteamServerTime => Facepunch.Steamworks.Utility.Epoch.ToDateTime( Internal.GetServerRealTime() );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
/// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||||
/// e.g "US" or "UK".
|
/// e.g "US" or "UK".
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string IpCountry => steamutils.GetIPCountry();
|
public static string IpCountry => Internal.GetIPCountry();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// returns true if the image exists, and the buffer was successfully filled out
|
/// returns true if the image exists, and the buffer was successfully filled out
|
||||||
@ -86,7 +86,7 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
width = 0;
|
width = 0;
|
||||||
height = 0;
|
height = 0;
|
||||||
return steamutils.GetImageSize( image, ref width, ref height );
|
return Internal.GetImageSize( image, ref width, ref height );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -100,7 +100,7 @@ namespace Steamworks
|
|||||||
var size = w * h * 4 * sizeof( char );
|
var size = w * h * 4 * sizeof( char );
|
||||||
var data = new byte[size];
|
var data = new byte[size];
|
||||||
|
|
||||||
if ( !steamutils.GetImageRGBA( image, data, data.Length ) )
|
if ( !Internal.GetImageRGBA( image, data, data.Length ) )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -109,17 +109,17 @@ namespace Steamworks
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if we're using a battery (ie, a laptop not plugged in)
|
/// Returns true if we're using a battery (ie, a laptop not plugged in)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool UsingBatteryPower => steamutils.GetCurrentBatteryPower() != 255;
|
public static bool UsingBatteryPower => Internal.GetCurrentBatteryPower() != 255;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns battery power [0-1]
|
/// Returns battery power [0-1]
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static float CurrentBatteryPower => Math.Min( steamutils.GetCurrentBatteryPower() / 100, 1.0f );
|
public static float CurrentBatteryPower => Math.Min( Internal.GetCurrentBatteryPower() / 100, 1.0f );
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// returns the appID of the current process
|
/// returns the appID of the current process
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static AppId AppId => steamutils.GetAppID();
|
public static AppId AppId => Internal.GetAppID();
|
||||||
|
|
||||||
static NotificationPosition overlayNotificationPosition = NotificationPosition.BottomRight;
|
static NotificationPosition overlayNotificationPosition = NotificationPosition.BottomRight;
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ namespace Steamworks
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
overlayNotificationPosition = value;
|
overlayNotificationPosition = value;
|
||||||
steamutils.SetOverlayNotificationPosition( value );
|
Internal.SetOverlayNotificationPosition( value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ namespace Steamworks
|
|||||||
/// Returns true if the overlay is running and the user can access it. The overlay process could take a few seconds to
|
/// Returns true if the overlay is running and the user can access it. The overlay process could take a few seconds to
|
||||||
/// start and hook the game process, so this function will initially return false while the overlay is loading.
|
/// start and hook the game process, so this function will initially return false while the overlay is loading.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsOverlayEnabled => steamutils.IsOverlayEnabled();
|
public static bool IsOverlayEnabled => Internal.IsOverlayEnabled();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Normally this call is unneeded if your game has a constantly running frame loop that calls the
|
/// Normally this call is unneeded if your game has a constantly running frame loop that calls the
|
||||||
@ -155,7 +155,7 @@ namespace Steamworks
|
|||||||
/// in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you
|
/// in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you
|
||||||
/// refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.
|
/// refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool DoesOverlayNeedPresent => steamutils.BOverlayNeedsPresent();
|
public static bool DoesOverlayNeedPresent => Internal.BOverlayNeedsPresent();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronous call to check if an executable file has been signed using the public key set on the signing tab
|
/// Asynchronous call to check if an executable file has been signed using the public key set on the signing tab
|
||||||
@ -163,7 +163,7 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static async Task<CheckFileSignature> CheckFileSignature( string filename )
|
public static async Task<CheckFileSignature> CheckFileSignature( string filename )
|
||||||
{
|
{
|
||||||
var r = await steamutils.CheckFileSignature( filename );
|
var r = await Internal.CheckFileSignature( filename );
|
||||||
|
|
||||||
if ( !r.HasValue )
|
if ( !r.HasValue )
|
||||||
{
|
{
|
||||||
@ -178,7 +178,7 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, GamepadTextInputLineMode lineInputMode, string description, int maxChars, string existingText = "" )
|
public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, GamepadTextInputLineMode lineInputMode, string description, int maxChars, string existingText = "" )
|
||||||
{
|
{
|
||||||
return steamutils.ShowGamepadTextInput( inputMode, lineInputMode, description, (uint)maxChars, existingText );
|
return Internal.ShowGamepadTextInput( inputMode, lineInputMode, description, (uint)maxChars, existingText );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -186,11 +186,11 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string GetEnteredGamepadText()
|
public static string GetEnteredGamepadText()
|
||||||
{
|
{
|
||||||
var len = steamutils.GetEnteredGamepadTextLength();
|
var len = Internal.GetEnteredGamepadTextLength();
|
||||||
if ( len == 0 ) return string.Empty;
|
if ( len == 0 ) return string.Empty;
|
||||||
|
|
||||||
var sb = Helpers.TakeStringBuilder();
|
var sb = Helpers.TakeStringBuilder();
|
||||||
if ( !steamutils.GetEnteredGamepadTextInput( sb, len ) )
|
if ( !Internal.GetEnteredGamepadTextInput( sb, len ) )
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
@ -200,19 +200,19 @@ namespace Steamworks
|
|||||||
/// returns the language the steam client is running in, you probably want
|
/// returns the language the steam client is running in, you probably want
|
||||||
/// Apps.CurrentGameLanguage instead, this is for very special usage cases
|
/// Apps.CurrentGameLanguage instead, this is for very special usage cases
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string SteamUILanguage => steamutils.GetSteamUILanguage();
|
public static string SteamUILanguage => Internal.GetSteamUILanguage();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// returns true if Steam itself is running in VR mode
|
/// returns true if Steam itself is running in VR mode
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsSteamRunningInVR => steamutils.IsSteamRunningInVR();
|
public static bool IsSteamRunningInVR => Internal.IsSteamRunningInVR();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition
|
/// Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SetOverlayNotificationInset( int x, int y )
|
public static void SetOverlayNotificationInset( int x, int y )
|
||||||
{
|
{
|
||||||
steamutils.SetOverlayNotificationInset( x, y );
|
Internal.SetOverlayNotificationInset( x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -220,13 +220,13 @@ namespace Steamworks
|
|||||||
/// Games much be launched through the Steam client to enable the Big Picture overlay. During development,
|
/// Games much be launched through the Steam client to enable the Big Picture overlay. During development,
|
||||||
/// a game can be added as a non-steam game to the developers library to test this feature
|
/// a game can be added as a non-steam game to the developers library to test this feature
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsSteamInBigPictureMode => steamutils.IsSteamInBigPictureMode();
|
public static bool IsSteamInBigPictureMode => Internal.IsSteamInBigPictureMode();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ask SteamUI to create and render its OpenVR dashboard
|
/// ask SteamUI to create and render its OpenVR dashboard
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void StartVRDashboard() => steamutils.StartVRDashboard();
|
public static void StartVRDashboard() => Internal.StartVRDashboard();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set whether the HMD content will be streamed via Steam In-Home Streaming
|
/// Set whether the HMD content will be streamed via Steam In-Home Streaming
|
||||||
@ -237,11 +237,11 @@ namespace Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool VrHeadsetStreaming
|
public static bool VrHeadsetStreaming
|
||||||
{
|
{
|
||||||
get => steamutils.IsVRHeadsetStreamingEnabled();
|
get => Internal.IsVRHeadsetStreamingEnabled();
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
steamutils.SetVRHeadsetStreamingEnabled( value );
|
Internal.SetVRHeadsetStreamingEnabled( value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ namespace Steamworks
|
|||||||
internal static bool IsCallComplete( SteamAPICall_t call, out bool failed )
|
internal static bool IsCallComplete( SteamAPICall_t call, out bool failed )
|
||||||
{
|
{
|
||||||
failed = false;
|
failed = false;
|
||||||
return steamutils.IsAPICallCompleted( call, ref failed );
|
return Internal.IsAPICallCompleted( call, ref failed );
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static T? GetResult<T>( SteamAPICall_t call ) where T : struct, ISteamCallback
|
internal static T? GetResult<T>( SteamAPICall_t call ) where T : struct, ISteamCallback
|
||||||
@ -263,7 +263,7 @@ namespace Steamworks
|
|||||||
{
|
{
|
||||||
bool failed = false;
|
bool failed = false;
|
||||||
|
|
||||||
if ( !steamutils.GetAPICallResult( call, ptr, size, t.GetCallbackId(), ref failed ) )
|
if ( !Internal.GetAPICallResult( call, ptr, size, t.GetCallbackId(), ref failed ) )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if ( failed )
|
if ( failed )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user