Documentation Rework (#599)

This commit is contained in:
Thunder 2021-10-21 03:40:56 -04:00 committed by GitHub
parent 132b1a579b
commit c106d01fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 559 additions and 340 deletions

View File

@ -9,9 +9,19 @@ namespace Steamworks
//
// ESteamIPType
//
/// <summary>
/// Specifies the type of IP.
/// </summary>
internal enum SteamIPType : int
{
/// <summary>
/// IPv4
/// </summary>
Type4 = 0,
/// <summary>
/// IPv6
/// </summary>
Type6 = 1,
}
@ -31,6 +41,9 @@ public enum Universe : int
//
// EResult
//
/// <summary>
/// Determines the result of a request.
/// </summary>
public enum Result : int
{
None = 0,

View File

@ -27,41 +27,41 @@ internal static void InstallEvents()
}
/// <summary>
/// posted after the user gains ownership of DLC and that DLC is installed
/// Posted after the user gains ownership of DLC and that DLC is installed.
/// </summary>
public static event Action<AppId> OnDlcInstalled;
/// <summary>
/// posted after the user gains executes a Steam URL with command line or query parameters
/// Posted after the user gains executes a Steam URL with command line or query parameters
/// such as steam://run/appid//-commandline/?param1=value1(and)param2=value2(and)param3=value3 etc
/// while the game is already running. The new params can be queried
/// with GetLaunchQueryParam and GetLaunchCommandLine
/// with GetLaunchQueryParam and GetLaunchCommandLine.
/// </summary>
public static event Action OnNewLaunchParameters;
/// <summary>
/// Checks if the active user is subscribed to the current App ID
/// Gets whether or not the active user is subscribed to the current App ID.
/// </summary>
public static bool IsSubscribed => Internal.BIsSubscribed();
/// <summary>
/// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID
/// Gets whether or not the user borrowed this game via Family Sharing. If true, call GetAppOwner() to get the lender SteamID.
/// </summary>
public static bool IsSubscribedFromFamilySharing => Internal.BIsSubscribedFromFamilySharing();
/// <summary>
/// Checks if the license owned by the user provides low violence depots.
/// Gets whether or not the license owned by the user provides low violence depots.
/// Low violence depots are useful for copies sold in countries that have content restrictions
/// </summary>
public static bool IsLowViolence => Internal.BIsLowViolence();
/// <summary>
/// Checks whether the current App ID license is for Cyber Cafes.
/// Gets whether or not the current App ID license is for Cyber Cafes.
/// </summary>
public static bool IsCybercafe => Internal.BIsCybercafe();
/// <summary>
/// CChecks if the user has a VAC ban on their account
/// Gets whether or not the user has a VAC ban on their account.
/// </summary>
public static bool IsVACBanned => Internal.BIsVACBanned();
@ -77,19 +77,22 @@ internal static void InstallEvents()
public static string[] AvailableLanguages => Internal.GetAvailableGameLanguages().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
/// <summary>
/// Checks if the active user is subscribed to a specified AppId.
/// Gets whether or not the active user is subscribed to a specified App ID.
/// Only use this if you need to check ownership of another game related to yours, a demo for example.
/// </summary>
/// <param name="appid">The App ID of the DLC to check.</param>
public static bool IsSubscribedToApp( AppId appid ) => Internal.BIsSubscribedApp( appid.Value );
/// <summary>
/// Checks if the user owns a specific DLC and if the DLC is installed
/// Gets whether or not the user owns a specific DLC and if the DLC is installed.
/// </summary>
/// <param name="appid">The App ID of the DLC to check.</param>
public static bool IsDlcInstalled( AppId appid ) => Internal.BIsDlcInstalled( appid.Value );
/// <summary>
/// Returns the time of the purchase of the app
/// Returns the time of the purchase of the app.
/// </summary>
/// <param>The App ID to check the purchase time for.</param>
public static DateTime PurchaseTime( AppId appid = default )
{
if ( appid == 0 )
@ -99,14 +102,14 @@ internal static void InstallEvents()
}
/// <summary>
/// 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
/// Before using, please ask your Valve technical contact how to package and secure your free weekened
/// 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.
/// Before using, please ask your Valve technical contact how to package and secure your free weekened.
/// </summary>
public static bool IsSubscribedFromFreeWeekend => Internal.BIsSubscribedFromFreeWeekend();
/// <summary>
/// Returns metadata for all available DLC
/// Returns metadata for all available DLC.
/// </summary>
public static IEnumerable<DlcInformation> DlcInformation()
{
@ -128,17 +131,19 @@ public static IEnumerable<DlcInformation> DlcInformation()
}
/// <summary>
/// Install/Uninstall control for optional DLC
/// Install control for optional DLC.
/// </summary>
/// <param name="appid">The App ID of the DLC to install.</param>
public static void InstallDlc( AppId appid ) => Internal.InstallDLC( appid.Value );
/// <summary>
/// Install/Uninstall control for optional DLC
/// Uninstall control for optional DLC.
/// </summary>
/// <param name="appid">The App ID of the DLC to uninstall.</param>
public static void UninstallDlc( AppId appid ) => Internal.UninstallDLC( appid.Value );
/// <summary>
/// Returns null if we're not on a beta branch, else the name of the branch
/// Gets the name of the beta branch that is launched, or <see langword="null"/> if the application is not running on a beta branch.
/// </summary>
public static string CurrentBetaName
{
@ -152,16 +157,19 @@ public static string CurrentBetaName
}
/// <summary>
/// Allows you to force verify game content on next launch.
///
/// Force verify game content on next launch.
/// <para>
/// 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 MarkContentCorrupt to force a verify, show a message to the user, and then quit.
/// </para>
/// </summary>
/// <param name="missingFilesOnly">Whether or not to only verify missing files.</param>
public static void MarkContentCorrupt( bool missingFilesOnly ) => Internal.MarkContentCorrupt( missingFilesOnly );
/// <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.
/// </summary>
/// <param name="appid">The App ID.</param>
public static IEnumerable<DepotId> InstalledDepots( AppId appid = default )
{
if ( appid == 0 )
@ -180,6 +188,7 @@ public static string CurrentBetaName
/// Gets the install folder for a specific App ID.
/// This works even if the application is not installed, based on where the game would be installed with the default Steam library location.
/// </summary>
/// <param name="appid">The App ID.</param>
public static string AppInstallDir( AppId appid = default )
{
if ( appid == 0 )
@ -192,26 +201,32 @@ public static string CurrentBetaName
}
/// <summary>
/// The app may not actually be owned by the current user, they may have it left over from a free weekend, etc.
/// Gets whether or not the app is owned by the current user. The app may not actually be owned by the current user; they may have it left over from a free weekend, etc.
/// </summary>
/// <param name="appid">The App ID.</param>
public static bool IsAppInstalled( AppId appid ) => Internal.BIsAppInstalled( appid.Value );
/// <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>
public static SteamId AppOwner => Internal.GetAppOwner().Value;
/// <summary>
/// Gets the associated launch parameter if the game is run via steam://run/appid/?param1=value1;param2=value2;param3=value3 etc.
/// Parameter names starting with the character '@' are reserved for internal use and will always return an empty string.
/// Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,
/// <para>
/// Parameter names starting with the character '<c>@</c>' are reserved for internal use and will always return an empty string.
/// Parameter names starting with an underscore '<c>_</c>' 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.
/// </para>
/// </summary>
/// <param name="param">The name of the parameter.</param>
/// <returns>The launch parameter value.</returns>
public static string GetLaunchParam( string param ) => Internal.GetLaunchQueryParam( param );
/// <summary>
/// Gets the download progress for optional DLC.
/// </summary>
/// <param name="appid">The App ID to check the progress for.</param>
public static DownloadProgress DlcDownloadProgress( AppId appid )
{
ulong punBytesDownloaded = 0;
@ -224,16 +239,16 @@ public static DownloadProgress DlcDownloadProgress( AppId appid )
}
/// <summary>
/// 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.
/// Gets the Build ID of this app, which can change at any time based on backend updates to the game.
/// Defaults to <c>0</c> if you're not running a build downloaded from steam.
/// </summary>
public static int BuildId => Internal.GetAppBuildId();
/// <summary>
/// Asynchronously retrieves metadata details about a specific file in the depot manifest.
/// Currently provides:
/// </summary>
/// <param name="filename">The name of the file.</param>
public static async Task<FileDetails?> GetFileDetailsAsync( string filename )
{
var r = await Internal.GetFileDetails( filename );
@ -267,8 +282,10 @@ public static string CommandLine
}
/// <summary>
/// check if game is a timed trial with limited playtime
/// Check if game is a timed trial with limited playtime.
/// </summary>
/// <param name="secondsAllowed">The amount of seconds left on the timed trial.</param>
/// <param name="secondsPlayed">The amount of seconds played on the timed trial.</param>
public static bool IsTimedTrial( out int secondsAllowed, out int secondsPlayed )
{
uint a = 0;

View File

@ -13,7 +13,7 @@ public static class SteamClient
/// <summary>
/// Initialize the steam client.
/// If asyncCallbacks is false you need to call RunCallbacks manually every frame.
/// If <paramref name="asyncCallbacks"/> is false you need to call <see cref="RunCallbacks"/> manually every frame.
/// </summary>
public static void Init( uint appid, bool asyncCallbacks = true )
{
@ -25,7 +25,7 @@ public static void Init( uint appid, bool asyncCallbacks = true )
if ( !SteamAPI.Init() )
{
throw new System.Exception( "SteamApi_Init returned false. Steam isn't running, couldn't find Steam, AppId is ureleased, Don't own AppId." );
throw new System.Exception( "SteamApi_Init returned false. Steam isn't running, couldn't find Steam, App ID is ureleased, Don't own App ID." );
}
AppId = appid;
@ -94,6 +94,9 @@ internal static void ShutdownInterfaces()
/// </summary>
public static bool IsValid => initialized;
/// <summary>
/// Shuts down the steam client.
/// </summary>
public static void Shutdown()
{
if ( !IsValid ) return;
@ -119,13 +122,15 @@ public static void RunCallbacks()
/// <summary>
/// Checks if the current user's Steam client is connected to the Steam servers.
/// If it's not then no real-time services provided by the Steamworks API will be enabled. The Steam
/// <para>
/// If it's not, no real-time services provided by the Steamworks API will be enabled. The Steam
/// client will automatically be trying to recreate the connection as often as possible. When the
/// connection is restored a SteamServersConnected_t callback will be posted.
/// You usually don't need to check for this yourself. All of the API calls that rely on this will
/// check internally. Forcefully disabling stuff when the player loses access is usually not a
/// very good experience for the player and you could be preventing them from accessing APIs that do not
/// need a live connection to Steam.
/// </para>
/// </summary>
public static bool IsLoggedOn => SteamUser.Internal.BLoggedOn();
@ -138,28 +143,30 @@ public static void RunCallbacks()
public static SteamId SteamId => SteamUser.Internal.GetSteamID();
/// <summary>
/// returns the local players name - guaranteed to not be NULL.
/// this is the same name as on the users community profile page
/// returns the local players name - guaranteed to not be <see langword="null"/>.
/// This is the same name as on the user's community profile page.
/// </summary>
public static string Name => SteamFriends.Internal.GetPersonaName();
/// <summary>
/// gets the status of the current user
/// Gets the status of the current user.
/// </summary>
public static FriendState State => SteamFriends.Internal.GetPersonaState();
/// <summary>
/// returns the appID of the current process
/// Returns the App ID of the current process.
/// </summary>
public static AppId AppId { get; internal set; }
/// <summary>
/// Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't
/// this returns true then it starts the Steam client if required and launches your game again through it,
/// Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't.
/// <para>
/// This returns true then it starts the Steam client if required and launches your game again through it,
/// and you should quit your process as soon as possible. This effectively runs steam://run/AppId so it
/// may not relaunch the exact executable that called it, as it will always relaunch from the version
/// installed in your Steam library folder/
/// Note that during development, when not launching via Steam, this might always return true.
/// </para>
/// </summary>
public static bool RestartAppIfNecessary( uint appid )
{

View File

@ -8,7 +8,7 @@
namespace Steamworks
{
/// <summary>
/// Undocumented Parental Settings
/// Class for utilizing the Steam Friends API.
/// </summary>
public class SteamFriends : SteamClientClass<SteamFriends>
{
@ -39,54 +39,54 @@ internal void InstallEvents()
}
/// <summary>
/// Called when chat message has been received from a friend. You'll need to turn on
/// ListenForFriendsMessages to recieve this. (friend, msgtype, message)
/// Invoked when a chat message has been received from a friend. You'll need to enable
/// <see cref="ListenForFriendsMessages"/> to recieve this. (friend, msgtype, message)
/// </summary>
public static event Action<Friend, string, string> OnChatMessage;
/// <summary>
/// Called when a chat message has been received in a Steam group chat that we are in. Associated Functions: JoinClanChatRoom. (friend, msgtype, message)
/// Invoked when a chat message has been received in a Steam group chat that we are in. Associated Functions: JoinClanChatRoom. (friend, msgtype, message)
/// </summary>
public static event Action<Friend, string, string> OnClanChatMessage;
/// <summary>
/// called when a friends' status changes
/// Invoked when a friends' status changes.
/// </summary>
public static event Action<Friend> OnPersonaStateChange;
/// <summary>
/// Called when the user tries to join a game from their friends list
/// rich presence will have been set with the "connect" key which is set here
/// Invoked when the user tries to join a game from their friends list.
/// Rich presence will have been set with the "connect" key which is set here.
/// </summary>
public static event Action<Friend, string> OnGameRichPresenceJoinRequested;
/// <summary>
/// Posted when game overlay activates or deactivates
/// the game can use this to be pause or resume single player games
/// Invoked when game overlay activates or deactivates.
/// The game can use this to be pause or resume single player games.
/// </summary>
public static event Action<bool> OnGameOverlayActivated;
/// <summary>
/// Called when the user tries to join a different game server from their friends list
/// game client should attempt to connect to specified server when this is received
/// Invoked when the user tries to join a different game server from their friends list.
/// Game client should attempt to connect to specified server when this is received.
/// </summary>
public static event Action<string, string> OnGameServerChangeRequested;
/// <summary>
/// Called when the user tries to join a lobby from their friends list
/// game client should attempt to connect to specified lobby when this is received
/// Invoked when the user tries to join a lobby from their friends list.
/// Game client should attempt to connect to specified lobby when this is received.
/// </summary>
public static event Action<Lobby, SteamId> OnGameLobbyJoinRequested;
/// <summary>
/// Callback indicating updated data about friends rich presence information
/// Invoked when a friend's rich presence data is updated.
/// </summary>
public static event Action<Friend> OnFriendRichPresenceUpdate;
/// <summary>
/// Dispatched when an overlay browser instance is navigated to a
/// protocol/scheme registered by RegisterProtocolInOverlayBrowser()
/// Invoked when an overlay browser instance is navigated to a
/// protocol/scheme registered by <see cref="RegisterProtocolInOverlayBrowser(string)"/>.
/// </summary>
public static event Action<string> OnOverlayBrowserProtocol;
@ -140,16 +140,28 @@ private static IEnumerable<Friend> GetFriendsWithFlag(FriendFlags flag)
}
}
/// <summary>
/// Gets an <see cref="IEnumerable{T}"/> of friends that the current user has.
/// </summary>
/// <returns>An <see cref="IEnumerable{T}"/> of friends.</returns>
public static IEnumerable<Friend> GetFriends()
{
return GetFriendsWithFlag(FriendFlags.Immediate);
}
/// <summary>
/// Gets an <see cref="IEnumerable{T}"/> of blocked users that the current user has.
/// </summary>
/// <returns>An <see cref="IEnumerable{T}"/> of blocked users.</returns>
public static IEnumerable<Friend> GetBlocked()
{
return GetFriendsWithFlag(FriendFlags.Blocked);
}
/// <summary>
/// Gets an <see cref="IEnumerable{T}"/> of friend requests that the current user has.
/// </summary>
/// <returns>An <see cref="IEnumerable{T}"/> of friend requests.</returns>
public static IEnumerable<Friend> GetFriendsRequested()
{
return GetFriendsWithFlag( FriendFlags.FriendshipRequested );
@ -195,7 +207,7 @@ public static IEnumerable<Clan> GetClans()
}
/// <summary>
/// The dialog to open. Valid options are:
/// Opens a specific overlay window. Valid options are:
/// "friends",
/// "community",
/// "players",
@ -267,18 +279,33 @@ internal static async Task CacheUserInformationAsync( SteamId steamid, bool name
await Task.Delay( 500 );
}
/// <summary>
/// Returns a small avatar of the user with the given <paramref name="steamid"/>.
/// </summary>
/// <param name="steamid">The <see cref="SteamId"/> of the user to get.</param>
/// <returns>A <see cref="Data.Image"/> with a value if the image was successfully retrieved.</returns>
public static async Task<Data.Image?> GetSmallAvatarAsync( SteamId steamid )
{
await CacheUserInformationAsync( steamid, false );
return SteamUtils.GetImage( Internal.GetSmallFriendAvatar( steamid ) );
}
/// <summary>
/// Returns a medium avatar of the user with the given <paramref name="steamid"/>.
/// </summary>
/// <param name="steamid">The <see cref="SteamId"/> of the user to get.</param>
/// <returns>A <see cref="Data.Image"/> with a value if the image was successfully retrieved.</returns>
public static async Task<Data.Image?> GetMediumAvatarAsync( SteamId steamid )
{
await CacheUserInformationAsync( steamid, false );
return SteamUtils.GetImage( Internal.GetMediumFriendAvatar( steamid ) );
}
/// <summary>
/// Returns a large avatar of the user with the given <paramref name="steamid"/>.
/// </summary>
/// <param name="steamid">The <see cref="SteamId"/> of the user to get.</param>
/// <returns>A <see cref="Data.Image"/> with a value if the image was successfully retrieved.</returns>
public static async Task<Data.Image?> GetLargeAvatarAsync( SteamId steamid )
{
await CacheUserInformationAsync( steamid, false );
@ -346,6 +373,11 @@ public static bool ListenForFriendsMessages
}
}
/// <summary>
/// Gets whether or not the current user is following the user with the given <paramref name="steamID"/>.
/// </summary>
/// <param name="steamID">The <see cref="SteamId"/> to check.</param>
/// <returns>Boolean.</returns>
public static async Task<bool> IsFollowing(SteamId steamID)
{
var r = await Internal.IsFollowing(steamID);

View File

@ -3,6 +3,9 @@
namespace Steamworks
{
/// <summary>
/// Class for utilizing Steam Input.
/// </summary>
public class SteamInput : SteamClientClass<SteamInput>
{
internal static ISteamInput Internal => Interface as ISteamInput;
@ -16,7 +19,7 @@ internal override void InitializeInterface( bool server )
/// <summary>
/// You shouldn't really need to call this because it get called by RunCallbacks on SteamClient
/// You shouldn't really need to call this because it gets called by <see cref="SteamClient.RunCallbacks"/>
/// but Valve think it might be a nice idea if you call it right before you get input info -
/// just to make sure the info you're getting is 100% up to date.
/// </summary>
@ -28,7 +31,7 @@ public static void RunFrame()
static readonly InputHandle_t[] queryArray = new InputHandle_t[STEAM_CONTROLLER_MAX_COUNT];
/// <summary>
/// Return a list of connected controllers.
/// Gets a list of connected controllers.
/// </summary>
public static IEnumerable<Controller> Controllers
{

View File

@ -10,7 +10,7 @@
namespace Steamworks
{
/// <summary>
/// Undocumented Parental Settings
/// Class for utilizing the Steam Inventory API.
/// </summary>
public class SteamInventory : SteamSharedClass<SteamInventory>
{
@ -65,7 +65,7 @@ static void LoadDefinitions()
/// <summary>
/// Call this if you're going to want to access definition information. You should be able to get
/// away with calling this once at the start if your game, assuming your items don't change all the time.
/// This will trigger OnDefinitionsUpdated at which point Definitions should be set.
/// This will trigger <see cref="OnDefinitionsUpdated"/> at which point Definitions should be set.
/// </summary>
public static void LoadItemDefinitions()
{
@ -83,7 +83,7 @@ public static void LoadItemDefinitions()
}
/// <summary>
/// Will call LoadItemDefinitions and wait until Definitions is not null
/// Will call <see cref="LoadItemDefinitions"/> and wait until Definitions is not null
/// </summary>
public static async Task<bool> WaitForDefinitions( float timeoutSeconds = 30 )
{
@ -300,7 +300,7 @@ public static bool GetAllItems()
/// <summary>
/// Grant all promotional items the user is eligible for
/// Grant all promotional items the user is eligible for.
/// </summary>
public static async Task<InventoryResult?> GrantPromoItemsAsync()
{

View File

@ -8,7 +8,7 @@
namespace Steamworks
{
/// <summary>
/// Functions for clients to access matchmaking services, favorites, and to operate on game lobbies
/// Methods for clients to access matchmaking services, favorites, and to operate on game lobbies
/// </summary>
public class SteamMatchmaking : SteamClientClass<SteamMatchmaking>
{
@ -83,69 +83,69 @@ static private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callbac
}
/// <summary>
/// Someone invited you to a lobby
/// Invoked when the current user is invited to a lobby.
/// </summary>
public static event Action<Friend, Lobby> OnLobbyInvite;
/// <summary>
/// You joined a lobby
/// Invoked when the current user joins a lobby.
/// </summary>
public static event Action<Lobby> OnLobbyEntered;
/// <summary>
/// You created a lobby
/// Invoked when the current user creates a lobby.
/// </summary>
public static event Action<Result, Lobby> OnLobbyCreated;
/// <summary>
/// A game server has been associated with the lobby
/// Invoked when a game server has been associated with a lobby.
/// </summary>
public static event Action<Lobby, uint, ushort, SteamId> OnLobbyGameCreated;
/// <summary>
/// The lobby metadata has changed
/// Invoked when a lobby's metadata is modified.
/// </summary>
public static event Action<Lobby> OnLobbyDataChanged;
/// <summary>
/// The lobby member metadata has changed
/// Invoked when a member in a lobby's metadata is modified.
/// </summary>
public static event Action<Lobby, Friend> OnLobbyMemberDataChanged;
/// <summary>
/// The lobby member joined
/// Invoked when a member joins a lobby.
/// </summary>
public static event Action<Lobby, Friend> OnLobbyMemberJoined;
/// <summary>
/// The lobby member left the room
/// Invoked when a lobby member leaves the lobby.
/// </summary>
public static event Action<Lobby, Friend> OnLobbyMemberLeave;
/// <summary>
/// The lobby member left the room
/// Invoked when a lobby member leaves the lobby.
/// </summary>
public static event Action<Lobby, Friend> OnLobbyMemberDisconnected;
/// <summary>
/// The lobby member was kicked. The 3rd param is the user that kicked them.
/// Invoked when a lobby member is kicked from a lobby. The 3rd param is the user that kicked them.
/// </summary>
public static event Action<Lobby, Friend, Friend> OnLobbyMemberKicked;
/// <summary>
/// The lobby member was banned. The 3rd param is the user that banned them.
/// Invoked when a lobby member is kicked from a lobby. The 3rd param is the user that kicked them.
/// </summary>
public static event Action<Lobby, Friend, Friend> OnLobbyMemberBanned;
/// <summary>
/// A chat message was recieved from a member of a lobby
/// Invoked when a chat message is received from a member of the lobby.
/// </summary>
public static event Action<Lobby, Friend, string> OnChatMessage;
public static LobbyQuery LobbyList => new LobbyQuery();
/// <summary>
/// Creates a new invisible lobby. Call lobby.SetPublic to take it online.
/// Creates a new invisible lobby. Call <see cref="Lobby.SetPublic"/> to take it online.
/// </summary>
public static async Task<Lobby?> CreateLobbyAsync( int maxMembers = 100 )
{
@ -156,7 +156,7 @@ static private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callbac
}
/// <summary>
/// Attempts to directly join the specified lobby
/// Attempts to directly join the specified lobby.
/// </summary>
public static async Task<Lobby?> JoinLobbyAsync( SteamId lobbyId )
{
@ -167,7 +167,7 @@ static private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callbac
}
/// <summary>
/// Get a list of servers that are on your favorites list
/// Get a list of servers that are on the current user's favorites list.
/// </summary>
public static IEnumerable<ServerInfo> GetFavoriteServers()
{
@ -191,7 +191,7 @@ public static IEnumerable<ServerInfo> GetFavoriteServers()
}
/// <summary>
/// Get a list of servers that you have added to your play history
/// Get a list of servers that the current user has added to their history.
/// </summary>
public static IEnumerable<ServerInfo> GetHistoryServers()
{

View File

@ -8,7 +8,7 @@
namespace Steamworks
{
/// <summary>
/// Functions for clients to access matchmaking services, favorites, and to operate on game lobbies
/// Methods for clients to access matchmaking services, favorites, and to operate on game lobbies
/// </summary>
internal class SteamMatchmakingServers : SteamClientClass<SteamMatchmakingServers>
{

View File

@ -31,22 +31,22 @@ internal static void InstallEvents()
}
/// <summary>
/// Playback status changed
/// Invoked when playback status is changed.
/// </summary>
public static event Action OnPlaybackChanged;
/// <summary>
/// Volume changed, parameter is new volume
/// Invoked when the volume of the music player is changed.
/// </summary>
public static event Action<float> OnVolumeChanged;
/// <summary>
/// Checks if Steam Music is enabled
/// Checks if Steam Music is enabled.
/// </summary>
public static bool IsEnabled => Internal.BIsEnabled();
/// <summary>
/// true if a song is currently playing, paused, or queued up to play; otherwise false.
/// <see langword="true"/> if a song is currently playing, paused, or queued up to play; otherwise <see langword="false"/>.
/// </summary>
public static bool IsPlaying => Internal.BIsPlaying();
@ -55,23 +55,28 @@ internal static void InstallEvents()
/// </summary>
public static MusicStatus Status => Internal.GetPlaybackStatus();
/// <summary>
/// Plays the music player.
/// </summary>
public static void Play() => Internal.Play();
/// <summary>
/// Pauses the music player.
/// </summary>
public static void Pause() => Internal.Pause();
/// <summary>
/// Have the Steam Music player play the previous song.
/// Forces the music player to play the previous song.
/// </summary>
public static void PlayPrevious() => Internal.PlayPrevious();
/// <summary>
/// Have the Steam Music player skip to the next song
/// Forces the music player to skip to the next song.
/// </summary>
public static void PlayNext() => Internal.PlayNext();
/// <summary>
/// Gets/Sets the current volume of the Steam Music player
/// Gets and sets the current volume of the Steam Music player
/// </summary>
public static float Volume
{

View File

@ -8,6 +8,9 @@
namespace Steamworks
{
/// <summary>
/// Class for utilizing the Steam Network API.
/// </summary>
public class SteamNetworking : SteamSharedClass<SteamNetworking>
{
internal static ISteamNetworking Internal => Interface as ISteamNetworking;
@ -26,20 +29,20 @@ internal static void InstallEvents( bool server )
}
/// <summary>
/// This SteamId wants to send you a message. You should respond by calling AcceptP2PSessionWithUser
/// if you want to recieve their messages
/// Invoked when a <see cref="SteamId"/> wants to send the current user a message. You should respond by calling <see cref="AcceptP2PSessionWithUser(SteamId)"/>
/// if you want to recieve their messages.
/// </summary>
public static Action<SteamId> OnP2PSessionRequest;
/// <summary>
/// Called when packets can't get through to the specified user.
/// Invoked when packets can't get through to the specified user.
/// All queued packets unsent at this point will be dropped, further attempts
/// to send will retry making the connection (but will be dropped if we fail again).
/// </summary>
public static Action<SteamId, P2PSessionError> OnP2PConnectionFailed;
/// <summary>
/// This should be called in response to a OnP2PSessionRequest
/// This should be called in response to a <see cref="OnP2PSessionRequest"/>.
/// </summary>
public static bool AcceptP2PSessionWithUser( SteamId user ) => Internal.AcceptP2PSessionWithUser( user );
@ -53,7 +56,7 @@ internal static void InstallEvents( bool server )
/// <summary>
/// This should be called when you're done communicating with a user, as this will
/// free up all of the resources allocated for the connection under-the-hood.
/// If the remote user tries to send data to you again, a new OnP2PSessionRequest
/// If the remote user tries to send data to you again, a new <see cref="OnP2PSessionRequest"/>
/// callback will be posted
/// </summary>
public static bool CloseP2PSessionWithUser( SteamId user ) => Internal.CloseP2PSessionWithUser( user );
@ -77,7 +80,7 @@ public static bool IsP2PPacketAvailable( out uint msgSize, int channel = 0 )
}
/// <summary>
/// Reads in a packet that has been sent from another user via SendP2PPacket..
/// Reads in a packet that has been sent from another user via <c>SendP2PPacket</c>.
/// </summary>
public unsafe static P2Packet? ReadP2PPacket( int channel = 0 )
{
@ -106,7 +109,7 @@ public static bool IsP2PPacketAvailable( out uint msgSize, int channel = 0 )
}
/// <summary>
/// Reads in a packet that has been sent from another user via SendP2PPacket..
/// Reads in a packet that has been sent from another user via <c>SendP2PPacket</c>.
/// </summary>
public unsafe static bool ReadP2PPacket( byte[] buffer, ref uint size, ref SteamId steamid, int channel = 0 )
{
@ -116,7 +119,7 @@ public unsafe static bool ReadP2PPacket( byte[] buffer, ref uint size, ref Steam
}
/// <summary>
/// Reads in a packet that has been sent from another user via SendP2PPacket..
/// Reads in a packet that has been sent from another user via <c>SendP2PPacket</c>.
/// </summary>
public unsafe static bool ReadP2PPacket( byte* buffer, uint cbuf, ref uint size, ref SteamId steamid, int channel = 0 )
{

View File

@ -114,7 +114,7 @@ private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCall
/// Creates a "server" socket that listens for clients to connect to by calling
/// Connect, over ordinary UDP (IPv4 or IPv6)
///
/// To use this derive a class from SocketManager and override as much as you want.
/// To use this derive a class from <see cref="SocketManager"/> and override as much as you want.
///
/// </summary>
public static T CreateNormalSocket<T>( NetAddress address ) where T : SocketManager, new()
@ -132,7 +132,7 @@ private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCall
/// Creates a "server" socket that listens for clients to connect to by calling
/// Connect, over ordinary UDP (IPv4 or IPv6).
///
/// To use this you should pass a class that inherits ISocketManager. You can use
/// To use this you should pass a class that inherits <see cref="ISocketManager"/>. You can use
/// SocketManager to get connections and send messages, but the ISocketManager class
/// will received all the appropriate callbacks.
///
@ -155,7 +155,7 @@ public static SocketManager CreateNormalSocket( NetAddress address, ISocketManag
}
/// <summary>
/// Connect to a socket created via <method>CreateListenSocketIP</method>
/// Connect to a socket created via <c>CreateListenSocketIP</c>.
/// </summary>
public static T ConnectNormal<T>( NetAddress address ) where T : ConnectionManager, new()
{
@ -167,7 +167,7 @@ public static SocketManager CreateNormalSocket( NetAddress address, ISocketManag
}
/// <summary>
/// Connect to a socket created via <method>CreateListenSocketIP</method>
/// Connect to a socket created via <c>CreateListenSocketIP</c>.
/// </summary>
public static ConnectionManager ConnectNormal( NetAddress address, IConnectionManager iface )
{
@ -185,9 +185,9 @@ public static ConnectionManager ConnectNormal( NetAddress address, IConnectionMa
}
/// <summary>
/// Creates a server that will be relayed via Valve's network (hiding the IP and improving ping)
/// Creates a server that will be relayed via Valve's network (hiding the IP and improving ping).
///
/// To use this derive a class from SocketManager and override as much as you want.
/// To use this derive a class from <see cref="SocketManager"/> and override as much as you want.
///
/// </summary>
public static T CreateRelaySocket<T>( int virtualport = 0 ) where T : SocketManager, new()
@ -201,10 +201,10 @@ public static ConnectionManager ConnectNormal( NetAddress address, IConnectionMa
}
/// <summary>
/// Creates a server that will be relayed via Valve's network (hiding the IP and improving ping)
/// Creates a server that will be relayed via Valve's network (hiding the IP and improving ping).
///
/// To use this you should pass a class that inherits ISocketManager. You can use
/// SocketManager to get connections and send messages, but the ISocketManager class
/// To use this you should pass a class that inherits <see cref="ISocketManager"/>. You can use
/// <see cref="SocketManager"/> to get connections and send messages, but the <see cref="ISocketManager"/> class
/// will received all the appropriate callbacks.
///
/// </summary>
@ -226,7 +226,7 @@ public static SocketManager CreateRelaySocket( int virtualport, ISocketManager i
}
/// <summary>
/// Connect to a relay server
/// Connect to a relay server.
/// </summary>
public static T ConnectRelay<T>( SteamId serverId, int virtualport = 0 ) where T : ConnectionManager, new()
{
@ -239,7 +239,7 @@ public static SocketManager CreateRelaySocket( int virtualport, ISocketManager i
}
/// <summary>
/// Connect to a relay server
/// Connect to a relay server.
/// </summary>
public static ConnectionManager ConnectRelay( SteamId serverId, int virtualport, IConnectionManager iface )
{

View File

@ -8,7 +8,7 @@
namespace Steamworks
{
/// <summary>
/// Undocumented Parental Settings
/// Provides Steam Networking utilities.
/// </summary>
public class SteamNetworkingUtils : SteamSharedClass<SteamNetworkingUtils>
{
@ -30,7 +30,7 @@ static void InstallCallbacks( bool server )
/// <summary>
/// A function to receive debug network information on. This will do nothing
/// unless you set DebugLevel to something other than None.
/// unless you set <see cref="DebugLevel"/> to something other than <see cref="NetDebugOutput.None"/>.
///
/// You should set this to an appropriate level instead of setting it to the highest
/// and then filtering it by hand because a lot of energy is used by creating the strings
@ -50,21 +50,24 @@ static void InstallCallbacks( bool server )
/// relay network. If you do not call this, the initialization will
/// be delayed until the first time you use a feature that requires access
/// to the relay network, which will delay that first access.
///
/// <para>
/// You can also call this to force a retry if the previous attempt has failed.
/// Performing any action that requires access to the relay network will also
/// trigger a retry, and so calling this function is never strictly necessary,
/// but it can be useful to call it a program launch time, if access to the
/// relay network is anticipated.
///
/// </para>
/// <para>
/// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
/// callbacks to know when initialization has completed.
/// Typically initialization completes in a few seconds.
///
/// </para>
/// <para>
/// Note: dedicated servers hosted in known data centers do *not* need
/// to call this, since they do not make routing decisions. However, if
/// the dedicated server will be using P2P functionality, it will act as
/// a "client" and this should be called.
/// </para>
/// </summary>
public static void InitRelayNetworkAccess()
{
@ -105,7 +108,7 @@ public static int EstimatePingTo( NetPingLocation target )
/// <summary>
/// If you need ping information straight away, wait on this. It will return
/// immediately if you already have up to date ping data
/// immediately if you already have up to date ping data.
/// </summary>
public static async Task WaitForPingDataAsync( float maxAgeInSeconds = 60 * 5 )
{
@ -124,7 +127,7 @@ public static async Task WaitForPingDataAsync( float maxAgeInSeconds = 60 * 5 )
/// <summary>
/// [0 - 100] - Randomly discard N pct of packets
/// [0 - 100] - Randomly discard N pct of packets.
/// </summary>
public static float FakeSendPacketLoss
{
@ -133,7 +136,7 @@ public static float FakeSendPacketLoss
}
/// <summary>
/// [0 - 100] - Randomly discard N pct of packets
/// [0 - 100] - Randomly discard N pct of packets.
/// </summary>
public static float FakeRecvPacketLoss
{
@ -142,7 +145,7 @@ public static float FakeRecvPacketLoss
}
/// <summary>
/// Delay all packets by N ms
/// Delay all packets by N ms.
/// </summary>
public static float FakeSendPacketLag
{
@ -151,7 +154,7 @@ public static float FakeSendPacketLag
}
/// <summary>
/// Delay all packets by N ms
/// Delay all packets by N ms.
/// </summary>
public static float FakeRecvPacketLag
{
@ -160,7 +163,7 @@ public static float FakeRecvPacketLag
}
/// <summary>
/// Timeout value (in ms) to use when first connecting
/// Timeout value (in ms) to use when first connecting.
/// </summary>
public static int ConnectionTimeout
{
@ -169,7 +172,7 @@ public static int ConnectionTimeout
}
/// <summary>
/// Timeout value (in ms) to use after connection is established
/// Timeout value (in ms) to use after connection is established.
/// </summary>
public static int Timeout
{
@ -180,7 +183,7 @@ public static int Timeout
/// <summary>
/// Upper limit of buffered pending bytes to be sent.
/// If this is reached SendMessage will return LimitExceeded.
/// Default is 524288 bytes (512k)
/// Default is 524288 bytes (512k).
/// </summary>
public static int SendBufferSize
{
@ -194,9 +197,10 @@ public static int SendBufferSize
/// we don't know our identity or can't get a cert. On the server, it means that
/// we won't automatically reject a connection due to a failure to authenticate.
/// (You can examine the incoming connection and decide whether to accept it.)
///
/// <para>
/// This is a dev configuration value, and you should not let users modify it in
/// production.
/// </para>
/// </summary>
public static int AllowWithoutAuth
{
@ -210,10 +214,11 @@ public static int AllowWithoutAuth
/// 1: Allowed, but prefer encrypted
/// 2: Allowed, and preferred
/// 3: Required. (Fail the connection if the peer requires encryption.)
///
/// <para>
/// This is a dev configuration value, since its purpose is to disable encryption.
/// You should not let users modify it in production. (But note that it requires
/// the peer to also modify their value in order for encryption to be disabled.)
/// </para>
/// </summary>
public static int Unencrypted
{
@ -222,15 +227,17 @@ public static int Unencrypted
}
/// <summary>
/// Get Debug Information via OnDebugOutput event
///
/// Except when debugging, you should only use NetDebugOutput.Msg
/// or NetDebugOutput.Warning. For best performance, do NOT
/// Get Debug Information via <see cref="OnDebugOutput"/> event.
/// <para>
/// Except when debugging, you should only use <see cref="NetDebugOutput.Msg"/>
/// or <see cref="NetDebugOutput.Warning"/>. For best performance, do NOT
/// request a high detail level and then filter out messages in the callback.
///
/// </para>
/// <para>
/// This incurs all of the expense of formatting the messages, which are then discarded.
/// Setting a high priority value (low numeric value) here allows the library to avoid
/// doing this work.
/// </para>
/// </summary>
public static NetDebugOutput DebugLevel
{
@ -245,12 +252,12 @@ public static NetDebugOutput DebugLevel
}
/// <summary>
/// So we can remember and provide a Get for DebugLEvel
/// So we can remember and provide a Get for DebugLevel.
/// </summary>
private static NetDebugOutput _debugLevel;
/// <summary>
/// We need to keep the delegate around until it's not used anymore
/// We need to keep the delegate around until it's not used anymore.
/// </summary>
static NetDebugFunc _debugFunc;

View File

@ -30,18 +30,23 @@ internal void InstallEvents( bool server )
}
/// <summary>
/// The list of possible Party beacon locations has changed
/// Invoked when the list of possible Party beacon locations has changed
/// </summary>
public static event Action OnBeaconLocationsUpdated;
/// <summary>
/// The list of active beacons may have changed
/// Invoked when the list of active beacons may have changed
/// </summary>
public static event Action OnActiveBeaconsUpdated;
/// <summary>
/// Gets the amount of beacons that are active.
/// </summary>
public static int ActiveBeaconCount => (int) Internal.GetNumActiveBeacons();
/// <summary>
/// Gets an <see cref="IEnumerable{T}"/> of active beacons.
/// </summary>
public static IEnumerable<PartyBeacon> ActiveBeacons
{
get

View File

@ -28,30 +28,30 @@ internal void InstallEvents( bool server )
}
/// <summary>
/// Called when a session is connected
/// Invoked when a session is connected.
/// </summary>
public static event Action<RemotePlaySession> OnSessionConnected;
/// <summary>
/// Called when a session becomes disconnected
/// Invoked when a session becomes disconnected.
/// </summary>
public static event Action<RemotePlaySession> OnSessionDisconnected;
/// <summary>
/// Get the number of currently connected Steam Remote Play sessions
/// Gets the number of currently connected Steam Remote Play sessions
/// </summary>
public static int SessionCount => (int) Internal.GetSessionCount();
/// <summary>
/// Get the currently connected Steam Remote Play session ID at the specified index.
/// IsValid will return false if it's out of bounds
/// IsValid will return <see langword="false"/> if it's out of bounds
/// </summary>
public static RemotePlaySession GetSession( int index ) => (RemotePlaySession) Internal.GetSessionID( index ).Value;
/// <summary>
/// Invite a friend to Remote Play Together
/// This returns false if the invite can't be sent
/// Invite a friend to Remote Play Together.
/// This returns <see langword="false"/> if the invite can't be sent
/// </summary>
public static bool SendInvite( SteamId steamid ) => Internal.BSendRemotePlayTogetherInvite( steamid );
}

View File

@ -8,7 +8,7 @@
namespace Steamworks
{
/// <summary>
/// Undocumented Parental Settings
/// Class for utilizing the Steam Remote Storage API.
/// </summary>
public class SteamRemoteStorage : SteamClientClass<SteamRemoteStorage>
{
@ -24,6 +24,9 @@ internal override void InitializeInterface( bool server )
/// Creates a new file, writes the bytes to the file, and then closes the file.
/// If the target file already exists, it is overwritten
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <param name="data">The bytes of data.</param>
/// <returns>A boolean, detailing whether or not the operation was successful.</returns>
public unsafe static bool FileWrite( string filename, byte[] data )
{
fixed ( byte* ptr = data )
@ -35,6 +38,7 @@ public unsafe static bool FileWrite( string filename, byte[] data )
/// <summary>
/// Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
/// </summary>
/// <param name="filename">The path of the file.</param>
public unsafe static byte[] FileRead( string filename )
{
var size = FileSize( filename );
@ -51,26 +55,35 @@ public unsafe static byte[] FileRead( string filename )
/// <summary>
/// Checks whether the specified file exists.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>Whether or not the file exists.</returns>
public static bool FileExists( string filename ) => Internal.FileExists( filename );
/// <summary>
/// Checks if a specific file is persisted in the steam cloud.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>Boolean.</returns>
public static bool FilePersisted( string filename ) => Internal.FilePersisted( filename );
/// <summary>
/// Gets the specified file's last modified date/time.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>A <see cref="DateTime"/> describing when the file was modified last.</returns>
public static DateTime FileTime( string filename ) => Epoch.ToDateTime( Internal.GetFileTimestamp( filename ) );
/// <summary>
/// Gets the specified files size in bytes. 0 if not exists.
/// Returns the specified files size in bytes, or <c>0</c> if the file does not exist.
/// </summary>
/// <param name="filename">The path of the file.</param>
/// <returns>The size of the file in bytes, or <c>0</c> if the file doesn't exist.</returns>
public static int FileSize( string filename ) => Internal.GetFileSize( filename );
/// <summary>
/// Deletes the file from remote storage, but leaves it on the local disk and remains accessible from the API.
/// </summary>
/// <returns>A boolean, detailing whether or not the operation was successful.</returns>
public static bool FileForget( string filename ) => Internal.FileForget( filename );
/// <summary>
@ -80,7 +93,7 @@ public unsafe static byte[] FileRead( string filename )
/// <summary>
/// Number of bytes total
/// Gets the total number of quota bytes.
/// </summary>
public static ulong QuotaBytes
{
@ -93,7 +106,7 @@ public static ulong QuotaBytes
}
/// <summary>
/// Number of bytes used
/// Gets the total number of quota bytes that have been used.
/// </summary>
public static ulong QuotaUsedBytes
{
@ -106,7 +119,7 @@ public static ulong QuotaUsedBytes
}
/// <summary>
/// Number of bytes remaining until your quota is used
/// Number of bytes remaining until the quota is used.
/// </summary>
public static ulong QuotaRemainingBytes
{
@ -119,7 +132,7 @@ public static ulong QuotaRemainingBytes
}
/// <summary>
/// returns true if IsCloudEnabledForAccount AND IsCloudEnabledForApp
/// returns <see langword="true"/> if <see cref="IsCloudEnabledForAccount"/> AND <see cref="IsCloudEnabledForApp"/> are <see langword="true"/>.
/// </summary>
public static bool IsCloudEnabled => IsCloudEnabledForAccount && IsCloudEnabledForApp;
@ -149,7 +162,7 @@ public static bool IsCloudEnabledForApp
public static int FileCount => Internal.GetFileCount();
/// <summary>
/// Get a list of filenames synchronized by Steam Cloud
/// Gets a list of filenames synchronized by Steam Cloud.
/// </summary>
public static IEnumerable<string> Files
{

View File

@ -8,7 +8,7 @@
namespace Steamworks
{
/// <summary>
/// Undocumented Parental Settings
/// Class for utilizing the Steam Screenshots API.
/// </summary>
public class SteamScreenshots : SteamClientClass<SteamScreenshots>
{
@ -33,19 +33,19 @@ internal static void InstallEvents()
}
/// <summary>
/// A screenshot has been requested by the user from the Steam screenshot hotkey.
/// This will only be called if Hooked is true, in which case Steam
/// Invoked when a screenshot has been requested by the user from the Steam screenshot hotkey.
/// This will only be called if <see cref="Hooked"/> is true, in which case Steam
/// will not take the screenshot itself.
/// </summary>
public static event Action OnScreenshotRequested;
/// <summary>
/// A screenshot successfully written or otherwise added to the library and can now be tagged.
/// Invoked when a screenshot has been successfully written or otherwise added to the library and can now be tagged.
/// </summary>
public static event Action<Screenshot> OnScreenshotReady;
/// <summary>
/// A screenshot attempt failed
/// Invoked when a screenshot attempt failed.
/// </summary>
public static event Action<Result> OnScreenshotFailed;
@ -81,15 +81,17 @@ internal static void InstallEvents()
/// <summary>
/// Causes the Steam overlay to take a screenshot.
/// If screenshots are being hooked by the game then a
/// ScreenshotRequested callback is sent back to the game instead.
/// <see cref="OnScreenshotRequested"/> callback is sent back to the game instead.
/// </summary>
public static void TriggerScreenshot() => Internal.TriggerScreenshot();
/// <summary>
/// Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or if the game handles them.
/// <para>
/// Hooking is disabled by default, and only ever enabled if you do so with this function.
/// If the hooking is enabled, then the ScreenshotRequested_t callback will be sent if the user presses the hotkey or
/// when TriggerScreenshot is called, and then the game is expected to call WriteScreenshot or AddScreenshotToLibrary in response.
/// If the hooking is enabled, then the <see cref="OnScreenshotRequested"/> callback will be sent if the user presses the hotkey or
/// when TriggerScreenshot is called, and then the game is expected to call <see cref="WriteScreenshot(byte[], int, int)"/> or <see cref="AddScreenshot(string, string, int, int)"/> in response.
/// </para>
/// </summary>
public static bool Hooked
{

View File

@ -32,35 +32,35 @@ internal static void InstallEvents()
}
/// <summary>
/// User has been authed or rejected
/// Invoked when aser has been authed or rejected
/// </summary>
public static event Action<SteamId, SteamId, AuthResponse> OnValidateAuthTicketResponse;
/// <summary>
/// Called when a connections to the Steam back-end has been established.
/// Invoked when a connection to the Steam back-end has been established.
/// This means the server now is logged on and has a working connection to the Steam master server.
/// </summary>
public static event Action OnSteamServersConnected;
/// <summary>
/// This will occur periodically if the Steam client is not connected, and has failed when retrying to establish a connection (result, stilltrying)
/// This will occur periodically if the Steam client is not connected, and has failed when retrying to establish a connection (result, stilltrying).
/// </summary>
public static event Action<Result, bool> OnSteamServerConnectFailure;
/// <summary>
/// Disconnected from Steam
/// Invoked when the server is disconnected from Steam
/// </summary>
public static event Action<Result> OnSteamServersDisconnected;
/// <summary>
/// Called when authentication status changes, useful for grabbing SteamId once aavailability is current
/// Invoked when authentication status changes, useful for grabbing <see cref="SteamId"/> once availability is current.
/// </summary>
public static event Action<SteamNetworkingAvailability> OnSteamNetAuthenticationStatus;
/// <summary>
/// Initialize the steam server.
/// If asyncCallbacks is false you need to call RunCallbacks manually every frame.
/// If <paramref name="asyncCallbacks"/> is <see langword="false"/> you need to call <see cref="RunCallbacks"/> manually every frame.
/// </summary>
public static void Init( AppId appid, SteamServerInit init, bool asyncCallbacks = true )
{
@ -207,7 +207,7 @@ public static string MapName
private static string _mapname;
/// <summary>
/// Gets or sets the current ModDir
/// Gets or sets the current ModDir.
/// </summary>
public static string ModDir
{
@ -217,7 +217,7 @@ public static string ModDir
private static string _modDir = "";
/// <summary>
/// Gets the current product
/// Gets the current product.
/// </summary>
public static string Product
{
@ -227,7 +227,7 @@ public static string Product
private static string _product = "";
/// <summary>
/// Gets or sets the current Product
/// Gets or sets the current Product.
/// </summary>
public static string GameDescription
{
@ -237,7 +237,7 @@ public static string GameDescription
private static string _gameDescription = "";
/// <summary>
/// Gets or sets the current ServerName
/// Gets or sets the current ServerName.
/// </summary>
public static string ServerName
{
@ -247,7 +247,7 @@ public static string ServerName
private static string _serverName = "";
/// <summary>
/// Set whether the server should report itself as passworded
/// Set whether the server should report itself as passworded.
/// </summary>
public static bool Passworded
{
@ -272,6 +272,9 @@ public static string GameTags
}
private static string _gametags = "";
/// <summary>
/// Gets the SteamId of the server.
/// </summary>
public static SteamId SteamId => Internal.GetSteamID();
/// <summary>
@ -284,7 +287,7 @@ public static void LogOnAnonymous()
}
/// <summary>
/// Log onto Steam anonymously.
/// Log off of Steam.
/// </summary>
public static void LogOff()
{
@ -293,14 +296,14 @@ public static void LogOff()
/// <summary>
/// Returns true if the server is connected and registered with the Steam master server
/// You should have called LogOnAnonymous etc on startup.
/// You should have called <see cref="LogOnAnonymous"/> etc on startup.
/// </summary>
public static bool LoggedOn => Internal.BLoggedOn();
/// <summary>
/// To the best of its ability this tries to get the server's
/// current public ip address. Be aware that this is likely to return
/// null for the first few seconds after initialization.
/// current public IP address. Be aware that this is likely to return
/// <see langword="null"/> for the first few seconds after initialization.
/// </summary>
public static System.Net.IPAddress PublicIp => Internal.GetPublicIP();
@ -369,7 +372,7 @@ public static void SetKey( string Key, string Value )
}
/// <summary>
/// Remove all key values
/// Remove all key values.
/// </summary>
public static void ClearKeys()
{
@ -449,7 +452,7 @@ public static unsafe void HandleIncomingPacket( IntPtr ptr, int size, uint addre
}
/// <summary>
/// Does the user own this app (which could be DLC)
/// Does the user own this app (which could be DLC).
/// </summary>
public static UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamid, AppId appid )
{

View File

@ -18,10 +18,12 @@ internal override void InitializeInterface( bool server )
/// <summary>
/// Downloads stats for the user
/// If the user has no stats will return fail
/// these stats will only be auto-updated for clients playing on the server
/// Downloads stats for the user.
/// If the user has no stats, this will return <see cref="Result.Fail"/>.
/// These stats will only be auto-updated for clients playing on the server.
/// </summary>
/// <param name="steamid">The SteamId of the user to get stats for.</param>
/// <returns>A task describing the progress and result of the download.</returns>
public static async Task<Result> RequestUserStatsAsync( SteamId steamid )
{
var r = await Internal.RequestUserStats( steamid );
@ -33,6 +35,9 @@ public static async Task<Result> RequestUserStatsAsync( SteamId steamid )
/// Set the named stat for this user. Setting stats should follow the rules
/// you defined in Steamworks.
/// </summary>
/// <param name="steamid">The SteamId of the user to set stats for.</param>
/// <param name="name">The name of the stat.</param>
/// <param name="stat">The value of the stat.</param>
public static bool SetInt( SteamId steamid, string name, int stat )
{
return Internal.SetUserStat( steamid, name, stat );
@ -42,6 +47,9 @@ public static bool SetInt( SteamId steamid, string name, int stat )
/// Set the named stat for this user. Setting stats should follow the rules
/// you defined in Steamworks.
/// </summary>
/// <param name="steamid">The SteamId of the user to set stats for.</param>
/// <param name="name">The name of the stat.</param>
/// <param name="stat">The value of the stat.</param>
public static bool SetFloat( SteamId steamid, string name, float stat )
{
return Internal.SetUserStat( steamid, name, stat );
@ -49,9 +57,12 @@ public static bool SetFloat( SteamId steamid, string name, float stat )
/// <summary>
/// Get the named stat for this user. If getting the stat failed, will return
/// defaultValue. You should have called Refresh for this userid - which downloads
/// the stats from the backend. If you didn't call it this will always return defaultValue.
/// <paramref name="defaultValue"/>. You should have called <see cref="RequestUserStatsAsync(SteamId)"/> for this SteamID - which downloads
/// the stats from the backend. If you didn't call it this will always return <paramref name="defaultValue"/>.
/// </summary>
/// <param name="steamid">The SteamId of the user to get stats for.</param>
/// <param name="name">The name of the stat.</param>
/// <param name="defaultValue">The value to return if the stats cannot be received.</param>
public static int GetInt( SteamId steamid, string name, int defaultValue = 0 )
{
int data = defaultValue;
@ -67,6 +78,9 @@ public static int GetInt( SteamId steamid, string name, int defaultValue = 0 )
/// defaultValue. You should have called Refresh for this userid - which downloads
/// the stats from the backend. If you didn't call it this will always return defaultValue.
/// </summary>
/// <param name="steamid">The SteamId of the user to get stats for.</param>
/// <param name="name">The name of the stat.</param>
/// <param name="defaultValue">The value to return if the stats cannot be received.</param>
public static float GetFloat( SteamId steamid, string name, float defaultValue = 0 )
{
float data = defaultValue;
@ -78,25 +92,29 @@ public static float GetFloat( SteamId steamid, string name, float defaultValue =
}
/// <summary>
/// Unlocks the specified achievement for the specified user. Must have called Refresh on a steamid first.
/// Remember to use Commit after use.
/// Unlocks the specified achievement for the specified user. Must have called <see cref="RequestUserStatsAsync(SteamId)"/> on a SteamID first.
/// Remember to use <see cref="StoreUserStats(SteamId)"/> after use.
/// </summary>
/// <param name="steamid">The SteamId of the user to unlock the achievement for.</param>
/// <param name="name">The ID of the achievement.</param>
public static bool SetAchievement( SteamId steamid, string name )
{
return Internal.SetUserAchievement( steamid, name );
}
/// <summary>
/// Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first.
/// Remember to use Commit after use.
/// Resets the unlock status of an achievement for the specified user. Must have called <see cref="RequestUserStatsAsync(SteamId)"/> on a SteamID first.
/// Remember to use <see cref="StoreUserStats(SteamId)"/> after use.
/// </summary>
/// <param name="steamid">The SteamId of the user to clear the achievement for.</param>
/// <param name="name">The ID of the achievement.</param>
public static bool ClearAchievement( SteamId steamid, string name )
{
return Internal.ClearUserAchievement( steamid, name );
}
/// <summary>
/// Return true if available, exists and unlocked
/// Return <see langword="true"/> if available, exists and unlocked
/// </summary>
public static bool GetAchievement( SteamId steamid, string name )
{
@ -110,9 +128,11 @@ public static bool GetAchievement( SteamId steamid, string name )
/// <summary>
/// Once you've set a stat change on a user you need to commit your changes.
/// You can do that using this function. The callback will let you know if
/// You can do that using this method. The callback will let you know if
/// your action succeeded, but most of the time you can fire and forget.
/// </summary>
/// <param name="steamid">The SteamId of the user to store stats for.</param>
/// <returns>A task describing the progress and result of the commit.</returns>
public static async Task<Result> StoreUserStats( SteamId steamid )
{
var r = await Internal.StoreUserStats( steamid );

View File

@ -32,12 +32,12 @@ internal static void InstallEvents( bool server )
}
/// <summary>
/// Posted after Download call
/// Invoked after an item is downloaded.
/// </summary>
public static event Action<Result> OnDownloadItemResult;
/// <summary>
/// Posted when new item is subscribed
/// Invoked when a new item is subscribed.
/// </summary>
public static event Action<AppId, PublishedFileId> OnItemSubscribed;
public static event Action<AppId, PublishedFileId> OnItemUnsubscribed;
@ -50,24 +50,24 @@ public static async Task<bool> DeleteFileAsync( PublishedFileId fileId )
}
/// <summary>
/// Start downloading this item. You'll get notified of completion via OnDownloadItemResult.
/// Start downloading this item. You'll get notified of completion via <see cref="OnDownloadItemResult"/>.
/// </summary>
/// <param name="fileId">The ID of the file you want to download</param>
/// <param name="highPriority">If true this should go straight to the top of the download list</param>
/// <returns>true if nothing went wrong and the download is started</returns>
/// <param name="fileId">The ID of the file to download.</param>
/// <param name="highPriority">If <see langword="true"/> this should go straight to the top of the download list.</param>
/// <returns><see langword="true"/> if nothing went wrong and the download is started.</returns>
public static bool Download( PublishedFileId fileId, bool highPriority = false )
{
return Internal.DownloadItem( fileId, highPriority );
}
/// <summary>
/// Will attempt to download this item asyncronously - allowing you to instantly react to its installation
/// Will attempt to download this item asyncronously - allowing you to instantly react to its installation.
/// </summary>
/// <param name="fileId">The ID of the file you want to download</param>
/// <param name="fileId">The ID of the file you download.</param>
/// <param name="progress">An optional callback</param>
/// <param name="ct">Allows you to send a message to cancel the download anywhere during the process</param>
/// <param name="milisecondsUpdateDelay">How often to call the progress function</param>
/// <returns>true if downloaded and installed correctly</returns>
/// <param name="ct">Allows to send a message to cancel the download anywhere during the process.</param>
/// <param name="milisecondsUpdateDelay">How often to call the progress function.</param>
/// <returns><see langword="true"/> if downloaded and installed properly.</returns>
public static async Task<bool> DownloadAsync( PublishedFileId fileId, Action<float> progress = null, int milisecondsUpdateDelay = 60, CancellationToken ct = default )
{
var item = new Steamworks.Ugc.Item( fileId );
@ -135,7 +135,7 @@ public static bool Download( PublishedFileId fileId, bool highPriority = false )
}
/// <summary>
/// Utility function to fetch a single item. Internally this uses Ugc.FileQuery -
/// Utility function to fetch a single item. Internally this uses <c>Ugc.FileQuery</c> -
/// which you can use to query multiple items if you need to.
/// </summary>
public static async Task<Ugc.Item?> QueryFileAsync( PublishedFileId fileId )
@ -179,12 +179,12 @@ public static async Task<bool> StopPlaytimeTrackingForAllItems()
public static void SuspendDownloads() => Internal.SuspendDownloads(true);
/// <summary>
/// Resumes all workshop downloads
/// Resumes all workshop downloads.
/// </summary>
public static void ResumeDownloads() => Internal.SuspendDownloads(false);
/// <summary>
/// Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not
/// Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not.
/// </summary>
public static bool ShowWorkshopEula()
{
@ -192,7 +192,7 @@ public static bool ShowWorkshopEula()
}
/// <summary>
/// Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA
/// Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA.
/// </summary>
public static async Task<bool?> GetWorkshopEulaStatus()
{

View File

@ -43,7 +43,7 @@ internal static void InstallEvents()
}
/// <summary>
/// Called when a connections to the Steam back-end has been established.
/// Invoked when a connections to the Steam back-end has been established.
/// This means the Steam client now has a working connection to the Steam servers.
/// Usually this will have occurred before the game has launched, and should only be seen if the
/// user has dropped connection due to a networking issue or a Steam server update.
@ -51,14 +51,14 @@ internal static void InstallEvents()
public static event Action OnSteamServersConnected;
/// <summary>
/// Called when a connection attempt has failed.
/// Invoked when a connection attempt has failed.
/// This will occur periodically if the Steam client is not connected,
/// and has failed when retrying to establish a connection.
/// </summary>
public static event Action OnSteamServerConnectFailure;
/// <summary>
/// Called if the client has lost connection to the Steam servers.
/// Invoked when the client has lost connection to the Steam servers.
/// Real-time services will be disabled until a matching OnSteamServersConnected has been posted.
/// </summary>
public static event Action OnSteamServersDisconnected;
@ -72,25 +72,25 @@ internal static void InstallEvents()
public static event Action OnClientGameServerDeny;
/// <summary>
/// Called whenever the users licenses (owned packages) changes.
/// Invoked whenever the users licenses (owned packages) changes.
/// </summary>
public static event Action OnLicensesUpdated;
/// <summary>
/// Called when an auth ticket has been validated.
/// The first parameter is the steamid of this user
/// The second is the Steam ID that owns the game, this will be different from the first
/// if the game is being borrowed via Steam Family Sharing
/// Invoked when an auth ticket has been validated.
/// The first parameter is the <see cref="SteamId"/> of this user
/// The second is the <see cref="SteamId"/> that owns the game, which will be different from the first
/// if the game is being borrowed via Steam Family Sharing.
/// </summary>
public static event Action<SteamId, SteamId, AuthResponse> OnValidateAuthTicketResponse;
/// <summary>
/// Used internally for GetAuthSessionTicketAsync
/// Used internally for <see cref="GetAuthSessionTicketAsync(double)"/>.
/// </summary>
internal static event Action<GetAuthSessionTicketResponse_t> OnGetAuthSessionTicketResponse;
/// <summary>
/// Called when a user has responded to a microtransaction authorization request.
/// Invoked when a user has responded to a microtransaction authorization request.
/// ( appid, orderid, user authorized )
/// </summary>
public static event Action<AppId, ulong, bool> OnMicroTxnAuthorizationResponse;
@ -110,9 +110,6 @@ internal static void InstallEvents()
/// </summary>
public static event Action<DurationControl> OnDurationControl;
static bool _recordingVoice;
/// <summary>
@ -120,7 +117,6 @@ internal static void InstallEvents()
/// Once started, use GetAvailableVoice and GetVoice to get the data, and then call StopVoiceRecording
/// when the user has released their push-to-talk hotkey or the game session has completed.
/// </summary>
public static bool VoiceRecord
{
get => _recordingVoice;
@ -134,7 +130,7 @@ public static bool VoiceRecord
/// <summary>
/// Returns true if we have voice data waiting to be read
/// Returns true if we have voice data waiting to be read.
/// </summary>
public static bool HasVoiceData
{
@ -304,7 +300,7 @@ public static unsafe int DecompressVoice( IntPtr from, int length, IntPtr to, in
}
/// <summary>
/// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.
/// Retrieve an authentication ticket to be sent to the entity who wishes to authenticate you.
/// </summary>
public static unsafe AuthTicket GetAuthSessionTicket()
{
@ -329,7 +325,7 @@ public static unsafe AuthTicket GetAuthSessionTicket()
/// <summary>
/// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you.
/// This waits for a positive response from the backend before returning the ticket. This means
/// the ticket is definitely ready to go as soon as it returns. Will return null if the callback
/// the ticket is definitely ready to go as soon as it returns. Will return <see langword="null"/> if the callback
/// times out or returns negatively.
/// </summary>
public static async Task<AuthTicket> GetAuthSessionTicketAsync( double timeoutSeconds = 10.0f )

View File

@ -38,25 +38,25 @@ internal static void InstallEvents()
/// <summary>
/// called when the achivement icon is loaded
/// Invoked when an achivement icon is loaded.
/// </summary>
internal static event Action<string, int> OnAchievementIconFetched;
/// <summary>
/// called when the latests stats and achievements have been received
/// from the server
/// Invoked when the latests stats and achievements have been received
/// from the server.
/// </summary>
public static event Action<SteamId, Result> OnUserStatsReceived;
/// <summary>
/// result of a request to store the user stats for a game
/// Result of a request to store the user stats for a game.
/// </summary>
public static event Action<Result> OnUserStatsStored;
/// <summary>
/// result of a request to store the achievements for a game, or an
/// Result of a request to store the achievements for a game, or an
/// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
/// are zero, that means the achievement has been fully unlocked
/// are zero, that means the achievement has been fully unlocked.
/// </summary>
public static event Action<Achievement, int, int> OnAchievementProgress;
@ -67,7 +67,7 @@ internal static void InstallEvents()
public static event Action<SteamId> OnUserStatsUnloaded;
/// <summary>
/// Get the available achievements
/// Get all available achievements.
/// </summary>
public static IEnumerable<Achievement> Achievements
{
@ -99,7 +99,7 @@ public static bool IndicateAchievementProgress( string achName, int curProg, int
/// <summary>
/// Tries to get the number of players currently playing this game.
/// Or -1 if failed.
/// Or <c>-1</c> if failed.
/// </summary>
public static async Task<int> PlayerCountAsync()
{
@ -139,11 +139,11 @@ public static bool RequestCurrentStats()
/// <summary>
/// Asynchronously fetches global stats data, which is available for stats marked as
/// "aggregated" in the App Admin panel of the Steamworks website.
/// You must have called RequestCurrentStats and it needs to return successfully via
/// You must have called <see cref="RequestCurrentStats"/> and it needs to return successfully via
/// its callback prior to calling this.
/// </summary>
/// <param name="days">How many days of day-by-day history to retrieve in addition to the overall totals. The limit is 60.</param>
/// <returns>OK indicates success, InvalidState means you need to call RequestCurrentStats first, Fail means the remote call failed</returns>
/// <param name="days">How many days of day-by-day history to retrieve in addition to the overall totals. The limit is <c>60</c>.</param>
/// <returns><see cref="Result.OK"/> indicates success, <see cref="Result.InvalidState"/> means you need to call <see cref="RequestCurrentStats"/> first, <see cref="Result.Fail"/> means the remote call failed</returns>
public static async Task<Result> RequestGlobalStatsAsync( int days )
{
var result = await SteamUserStats.Internal.RequestGlobalStats( days );
@ -206,8 +206,7 @@ public static bool AddStat( string name, float amount = 1.0f )
}
/// <summary>
/// Set a stat value. This will automatically call StoreStats() after a successful call
/// unless you pass false as the last argument.
/// Set a stat value. This will automatically call <see cref="StoreStats"/> after a successful call.
/// </summary>
public static bool SetStat( string name, int value )
{
@ -215,8 +214,7 @@ public static bool SetStat( string name, int value )
}
/// <summary>
/// Set a stat value. This will automatically call StoreStats() after a successful call
/// unless you pass false as the last argument.
/// Set a stat value. This will automatically call <see cref="StoreStats"/> after a successful call.
/// </summary>
public static bool SetStat( string name, float value )
{
@ -224,7 +222,7 @@ public static bool SetStat( string name, float value )
}
/// <summary>
/// Get a Int stat value
/// Get an <see langword="int"/> stat value.
/// </summary>
public static int GetStatInt( string name )
{
@ -234,7 +232,7 @@ public static int GetStatInt( string name )
}
/// <summary>
/// Get a float stat value
/// Get a <see langword="float"/> stat value.
/// </summary>
public static float GetStatFloat( string name )
{
@ -244,7 +242,7 @@ public static float GetStatFloat( string name )
}
/// <summary>
/// Practically wipes the slate clean for this user. If includeAchievements is true, will wipe
/// Practically wipes the slate clean for this user. If <paramref name="includeAchievements"/> is <see langword="true"/>, will also wipe
/// any achievements too.
/// </summary>
/// <returns></returns>

View File

@ -36,33 +36,33 @@ private static void SteamClosed()
}
/// <summary>
/// The country of the user changed
/// Invoked when the country of the user changed.
/// </summary>
public static event Action OnIpCountryChanged;
/// <summary>
/// Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
/// The parameter is the number of minutes left
/// Invoked when running on a laptop and less than 10 minutes of battery is left, fires then every minute.
/// The parameter is the number of minutes left.
/// </summary>
public static event Action<int> OnLowBatteryPower;
/// <summary>
/// Called when Steam wants to shutdown
/// Invoked when Steam wants to shutdown.
/// </summary>
public static event Action OnSteamShutdown;
/// <summary>
/// Big Picture gamepad text input has been closed. Parameter is true if text was submitted, false if cancelled etc.
/// Invoked when Big Picture gamepad text input has been closed. Parameter is <see langword="true"/> if text was submitted, <see langword="false"/> if cancelled etc.
/// </summary>
public static event Action<bool> OnGamepadTextInputDismissed;
/// <summary>
/// Returns the number of seconds since the application was active
/// Returns the number of seconds since the application was active.
/// </summary>
public static uint SecondsSinceAppActive => Internal.GetSecondsSinceAppActive();
/// <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 and/or provided other input.
/// </summary>
public static uint SecondsSinceComputerActive => Internal.GetSecondsSinceComputerActive();
@ -81,9 +81,9 @@ private static void SteamClosed()
public static string IpCountry => Internal.GetIPCountry();
/// <summary>
/// returns true if the image exists, and the buffer was successfully filled out
/// results are returned in RGBA format
/// the destination buffer size should be 4 * height * width * sizeof(char)
/// Returns true if the image exists, and the buffer was successfully filled out.
/// Results are returned in RGBA format.
/// The destination buffer size should be 4 * height * width * sizeof(char).
/// </summary>
public static bool GetImageSize( int image, out uint width, out uint height )
{
@ -93,7 +93,7 @@ public static bool GetImageSize( int image, out uint width, out uint height )
}
/// <summary>
/// returns the image in RGBA format
/// returns the image in RGBA format.
/// </summary>
public static Data.Image? GetImage( int image )
{
@ -118,12 +118,12 @@ public static bool GetImageSize( int image, out uint width, out uint height )
}
/// <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>
public static bool UsingBatteryPower => Internal.GetCurrentBatteryPower() != 255;
/// <summary>
/// Returns battery power [0-1]
/// Returns battery power [0-1].
/// </summary>
public static float CurrentBatteryPower => Math.Min( Internal.GetCurrentBatteryPower() / 100, 1.0f );
@ -180,7 +180,7 @@ public static async Task<CheckFileSignature> CheckFileSignatureAsync( string fil
}
/// <summary>
/// Activates the Big Picture text input dialog which only supports gamepad input
/// Activates the Big Picture text input dialog which only supports gamepad input.
/// </summary>
public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, GamepadTextInputLineMode lineInputMode, string description, int maxChars, string existingText = "" )
{
@ -188,7 +188,7 @@ public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, Gamepad
}
/// <summary>
/// Returns previously entered text
/// Returns previously entered text.
/// </summary>
public static string GetEnteredGamepadText()
{
@ -202,18 +202,18 @@ public static string GetEnteredGamepadText()
}
/// <summary>
/// returns the language the steam client is running in, you probably want
/// Apps.CurrentGameLanguage instead, this is for very special usage cases
/// Returns the language the steam client is running in. You probably want
/// <see cref="SteamApps.GameLanguage"/> instead, this is for very special usage cases.
/// </summary>
public static string SteamUILanguage => Internal.GetSteamUILanguage();
/// <summary>
/// returns true if Steam itself is running in VR mode
/// Returns <see langword="true"/> if Steam itself is running in VR mode.
/// </summary>
public static bool IsSteamRunningInVR => Internal.IsSteamRunningInVR();
/// <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>
public static void SetOverlayNotificationInset( int x, int y )
{
@ -221,24 +221,26 @@ public static void SetOverlayNotificationInset( int x, int y )
}
/// <summary>
/// returns true if Steam and the Steam Overlay are running in Big Picture mode
/// returns <see langword="true"/> if Steam and the Steam Overlay are running in Big Picture mode
/// 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>
public static bool IsSteamInBigPictureMode => Internal.IsSteamInBigPictureMode();
/// <summary>
/// ask SteamUI to create and render its OpenVR dashboard
/// Ask Steam UI to create and render its OpenVR dashboard.
/// </summary>
public static void StartVRDashboard() => Internal.StartVRDashboard();
/// <summary>
/// Set whether the HMD content will be streamed via Steam In-Home Streaming
/// If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed.
/// If this is set to false, then the application window will be streamed instead, and remote input will be allowed.
/// The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game.
/// (this is useful for games that have asymmetric multiplayer gameplay)
/// Gets or sets whether the HMD content will be streamed via Steam In-Home Streaming.
/// <para>
/// If this is set to <see langword="true"/>, then the scene in the HMD headset will be streamed, and remote input will not be allowed.
/// If this is set to <see langword="false"/>, then the application window will be streamed instead, and remote input will be allowed.
/// The default is <see langword="true"/> unless "VRHeadsetStreaming" "0" is in the extended app info for a game
/// (this is useful for games that have asymmetric multiplayer gameplay).
/// </para>
/// </summary>
public static bool VrHeadsetStreaming
{
@ -258,13 +260,13 @@ internal static bool IsCallComplete( SteamAPICall_t call, out bool failed )
/// <summary>
/// Returns whether this steam client is a Steam China specific client, vs the global client
/// Gets whether this steam client is a Steam China specific client (<see langword="true"/>), or the global client (<see langword="false"/>).
/// </summary>
public static bool IsSteamChinaLauncher => Internal.IsSteamChinaLauncher();
/// <summary>
/// Initializes text filtering, loading dictionaries for the language the game is running in.
/// Users can customize the text filter behavior in their Steam Account preferences
/// Users can customize the text filter behavior in their Steam Account preferences.
/// </summary>
public static bool InitFilterText() => Internal.InitFilterText( 0 );
@ -279,13 +281,13 @@ public static string FilterText( TextFilteringContext context, SteamId sourceSte
}
/// <summary>
/// returns true if Steam itself is running on the Steam Deck
/// Gets whether or not Steam itself is running on the Steam Deck.
/// </summary>
public static bool IsRunningOnSteamDeck => Internal.IsSteamRunningOnSteamDeck();
/// <summary>
/// In game launchers that don't have controller support you can call this to have
/// In game launchers that don't have controller support: You can call this to have
/// Steam Input translate the controller input into mouse/kb to navigate the launcher
/// </summary>
public static void SetGameLauncherMode( bool mode ) => Internal.SetGameLauncherMode( mode );

View File

@ -8,7 +8,7 @@
namespace Steamworks
{
/// <summary>
/// Undocumented Parental Settings
/// Class for utilizing the Steam Video API.
/// </summary>
public class SteamVideo : SteamClientClass<SteamVideo>
{
@ -25,7 +25,7 @@ internal static void InstallEvents()
}
/// <summary>
/// Return true if currently using Steam's live broadcasting
/// Return <see langword="true"/> if currently using Steam's live broadcasting
/// </summary>
public static bool IsBroadcasting
{
@ -37,7 +37,7 @@ public static bool IsBroadcasting
}
/// <summary>
/// If we're broadcasting, will return the number of live viewers
/// Returns the number of viewers that are watching the stream, or <c>0</c> if <see cref="IsBroadcasting"/> is <see langword="false"/>.
/// </summary>
public static int NumViewers
{

View File

@ -6,6 +6,9 @@
namespace Steamworks.Data
{
/// <summary>
/// Represents a Steam Achievement.
/// </summary>
public struct Achievement
{
internal string Value;
@ -18,7 +21,7 @@ public Achievement( string name )
public override string ToString() => Value;
/// <summary>
/// True if unlocked
/// Gets whether or not the achievement has been unlocked.
/// </summary>
public bool State
{
@ -30,15 +33,24 @@ public bool State
}
}
/// <summary>
/// Gets the identifier of the achievement. This is the "API Name" on Steamworks.
/// </summary>
public string Identifier => Value;
/// <summary>
/// Gets the display name of the achievement.
/// </summary>
public string Name => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "name" );
/// <summary>
/// Gets the description of the achievement.
/// </summary>
public string Description => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "desc" );
/// <summary>
/// Should hold the unlock time if State is true
/// If <see cref="State"/> is <see langword="true"/>, this value represents the time that the achievement was unlocked.
/// </summary>
public DateTime? UnlockTime
{
@ -56,7 +68,7 @@ public DateTime? UnlockTime
/// <summary>
/// Gets the icon of the achievement. This can return a null image even though the image exists if the image
/// hasn't been downloaded by Steam yet. You can use GetIconAsync if you want to wait for the image to be downloaded.
/// hasn't been downloaded by Steam yet. You should use <see cref="GetIconAsync(int)"/> if you want to wait for the image to be downloaded.
/// </summary>
public Image? GetIcon()
{
@ -65,8 +77,9 @@ public DateTime? UnlockTime
/// <summary>
/// Gets the icon of the achievement, waits for it to load if we have to
/// Gets the icon of the achievement, yielding until the icon is received or the <paramref name="timeout"/> is reached.
/// </summary>
/// <param name="timeout">The timeout in milliseconds before the request will be canceled. Defaults to <c>5000</c>.</param>
public async Task<Image?> GetIconAsync( int timeout = 5000 )
{
var i = SteamUserStats.Internal.GetAchievementIcon( Value );
@ -107,7 +120,7 @@ void f( string x, int icon )
}
/// <summary>
/// Returns the fraction (0-1) of users who have unlocked the specified achievement, or -1 if no data available.
/// Gets a decimal (0-1) representing the global amount of users who have unlocked the specified achievement, or -1 if no data available.
/// </summary>
public float GlobalUnlocked
{
@ -123,7 +136,7 @@ public float GlobalUnlocked
}
/// <summary>
/// Make this achievement earned
/// Unlock this achievement.
/// </summary>
public bool Trigger( bool apply = true )
{
@ -138,7 +151,7 @@ public bool Trigger( bool apply = true )
}
/// <summary>
/// Reset this achievement to not achieved
/// Reset this achievement to be locked.
/// </summary>
public bool Clear()
{

View File

@ -6,6 +6,9 @@
namespace Steamworks
{
/// <summary>
/// Represents the ID of a Steam application.
/// </summary>
public struct AppId
{
public uint Value;

View File

@ -6,10 +6,24 @@
namespace Steamworks.Data
{
/// <summary>
/// Provides information about a DLC.
/// </summary>
public struct DlcInformation
{
/// <summary>
/// The <see cref="Steamworks.AppId"/> of the DLC.
/// </summary>
public AppId AppId { get; internal set; }
/// <summary>
/// The name of the DLC.
/// </summary>
public string Name { get; internal set; }
/// <summary>
/// Whether or not the DLC is available.
/// </summary>
public bool Available { get; internal set; }
}
}

View File

@ -6,10 +6,29 @@
namespace Steamworks.Data
{
/// <summary>
/// Represents download progress.
/// </summary>
public struct DownloadProgress
{
/// <summary>
/// Whether or not the download is currently active.
/// </summary>
public bool Active;
/// <summary>
/// How many bytes have been downloaded.
/// </summary>
public ulong BytesDownloaded;
/// <summary>
/// How many bytes in total the download is.
/// </summary>
public ulong BytesTotal;
/// <summary>
/// Gets the amount of bytes left that need to be downloaded.
/// </summary>
public ulong BytesRemaining => BytesTotal - BytesDownloaded;
}
}

View File

@ -6,8 +6,14 @@
namespace Steamworks.Data
{
/// <summary>
/// Represents details of a file.
/// </summary>
public struct FileDetails
{
/// <summary>
/// The size of the file in bytes.
/// </summary>
public ulong SizeInBytes;
public string Sha1;
public uint Flags;

View File

@ -7,10 +7,17 @@ public struct Image
public uint Height;
public byte[] Data;
/// <summary>
/// Returns the color of the pixel at the specified position.
/// </summary>
/// <param name="x">X-coordinate</param>
/// <param name="y">Y-coordinate</param>
/// <returns>The color.</returns>
/// <exception cref="System.ArgumentException">If the X and Y or out of bounds.</exception>
public Color GetPixel( int x, int y )
{
if ( x < 0 || x >= Width ) throw new System.Exception( "x out of bounds" );
if ( y < 0 || y >= Height ) throw new System.Exception( "y out of bounds" );
if ( x < 0 || x >= Width ) throw new System.ArgumentException( "x out of bounds" );
if ( y < 0 || y >= Height ) throw new System.ArgumentException( "y out of bounds" );
Color c = new Color();
@ -24,12 +31,19 @@ public Color GetPixel( int x, int y )
return c;
}
/// <summary>
/// Returns "{Width}x{Height} ({length of <see cref="Data"/>}bytes)"
/// </summary>
/// <returns></returns>
public override string ToString()
{
return $"{Width}x{Height} ({Data.Length}bytes)";
}
}
/// <summary>
/// Represents a color.
/// </summary>
public struct Color
{
public byte r, g, b, a;

View File

@ -5,6 +5,9 @@
namespace Steamworks.Data
{
/// <summary>
/// Represents a Steam lobby.
/// </summary>
public struct Lobby
{
public SteamId Id { get; internal set; }
@ -16,8 +19,8 @@ public Lobby( SteamId id )
}
/// <summary>
/// Try to join this room. Will return RoomEnter.Success on success,
/// and anything else is a failure
/// Try to join this room. Will return <see cref="RoomEnter.Success"/> on success,
/// and anything else is a failure.
/// </summary>
public async Task<RoomEnter> Join()
{
@ -37,9 +40,9 @@ public void Leave()
}
/// <summary>
/// Invite another user to the lobby
/// will return true if the invite is successfully sent, whether or not the target responds
/// returns false if the local user is not connected to the Steam servers
/// Invite another user to the lobby.
/// Will return <see langword="true"/> if the invite is successfully sent, whether or not the target responds
/// returns <see langword="false"/> if the local user is not connected to the Steam servers
/// </summary>
public bool InviteFriend( SteamId steamid )
{
@ -47,12 +50,12 @@ public bool InviteFriend( SteamId steamid )
}
/// <summary>
/// returns the number of users in the specified lobby
/// Gets the number of users in this lobby.
/// </summary>
public int MemberCount => SteamMatchmaking.Internal.GetNumLobbyMembers( Id );
/// <summary>
/// Returns current members. Need to be in the lobby to see the users.
/// Returns current members in the lobby. The current user must be in the lobby in order to see the users.
/// </summary>
public IEnumerable<Friend> Members
{
@ -67,7 +70,7 @@ public IEnumerable<Friend> Members
/// <summary>
/// Get data associated with this lobby
/// Get data associated with this lobby.
/// </summary>
public string GetData( string key )
{
@ -75,7 +78,7 @@ public string GetData( string key )
}
/// <summary>
/// Get data associated with this lobby
/// Set data associated with this lobby.
/// </summary>
public bool SetData( string key, string value )
{
@ -86,7 +89,7 @@ public bool SetData( string key, string value )
}
/// <summary>
/// Removes a metadata key from the lobby
/// Removes a metadata key from the lobby.
/// </summary>
public bool DeleteData( string key )
{
@ -94,7 +97,7 @@ public bool DeleteData( string key )
}
/// <summary>
/// Get all data for this lobby
/// Get all data for this lobby.
/// </summary>
public IEnumerable<KeyValuePair<string, string>> Data
{
@ -113,7 +116,7 @@ public IEnumerable<KeyValuePair<string, string>> Data
}
/// <summary>
/// Gets per-user metadata for someone in this lobby
/// Gets per-user metadata for someone in this lobby.
/// </summary>
public string GetMemberData( Friend member, string key )
{
@ -121,7 +124,7 @@ public string GetMemberData( Friend member, string key )
}
/// <summary>
/// Sets per-user metadata (for the local user implicitly)
/// Sets per-user metadata (for the local user implicitly).
/// </summary>
public void SetMemberData( string key, string value )
{
@ -129,7 +132,7 @@ public void SetMemberData( string key, string value )
}
/// <summary>
/// Sends a string to the chat room
/// Sends a string to the chat room.
/// </summary>
public bool SendChatString( string message )
{
@ -139,7 +142,7 @@ public bool SendChatString( string message )
}
/// <summary>
/// Sends bytes to the chat room
/// Sends bytes to the chat room.
/// </summary>
public unsafe bool SendChatBytes( byte[] data )
{
@ -150,7 +153,7 @@ public unsafe bool SendChatBytes( byte[] data )
}
/// <summary>
/// Sends bytes to the chat room from an unsafe buffer
/// Sends bytes to the chat room from an unsafe buffer.
/// </summary>
public unsafe bool SendChatBytesUnsafe( byte* ptr, int length )
{
@ -158,13 +161,15 @@ public unsafe bool SendChatBytesUnsafe( byte* ptr, int length )
}
/// <summary>
/// Refreshes metadata for a lobby you're not necessarily in right now
/// you never do this for lobbies you're a member of, only if your
/// this will send down all the metadata associated with a lobby
/// this is an asynchronous call
/// returns false if the local user is not connected to the Steam servers
/// results will be returned by a LobbyDataUpdate_t callback
/// if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false
/// Refreshes metadata for a lobby you're not necessarily in right now.
/// <para>
/// You never do this for lobbies you're a member of, only if your
/// this will send down all the metadata associated with a lobby.
/// This is an asynchronous call.
/// Returns <see langword="false"/> if the local user is not connected to the Steam servers.
/// Results will be returned by a LobbyDataUpdate_t callback.
/// If the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to <see langword="false"/>.
/// </para>
/// </summary>
public bool Refresh()
{
@ -172,8 +177,8 @@ public bool Refresh()
}
/// <summary>
/// Max members able to join this lobby. Cannot be over 250.
/// Can only be set by the owner
/// Max members able to join this lobby. Cannot be over <c>250</c>.
/// Can only be set by the owner of the lobby.
/// </summary>
public int MaxMembers
{
@ -181,26 +186,42 @@ public int MaxMembers
set => SteamMatchmaking.Internal.SetLobbyMemberLimit( Id, value );
}
/// <summary>
/// Sets the lobby as public.
/// </summary>
public bool SetPublic()
{
return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Public );
}
/// <summary>
/// Sets the lobby as private.
/// </summary>
public bool SetPrivate()
{
return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Private );
}
/// <summary>
/// Sets the lobby as invisible.
/// </summary>
public bool SetInvisible()
{
return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Invisible );
}
/// <summary>
/// Sets the lobby as friends only.
/// </summary>
public bool SetFriendsOnly()
{
return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.FriendsOnly );
}
/// <summary>
/// Set whether or not the lobby can be joined.
/// </summary>
/// <param name="b">Whether or not the lobby can be joined.</param>
public bool SetJoinable( bool b )
{
return SteamMatchmaking.Internal.SetLobbyJoinable( Id, b );
@ -242,7 +263,7 @@ public bool GetGameServer( ref uint ip, ref ushort port, ref SteamId serverId )
}
/// <summary>
/// You must be the lobby owner to set the owner
/// Gets or sets the owner of the lobby. You must be the lobby owner to set the owner
/// </summary>
public Friend Owner
{
@ -251,7 +272,7 @@ public Friend Owner
}
/// <summary>
/// Check if the specified SteamId owns the lobby
/// Check if the specified SteamId owns the lobby.
/// </summary>
public bool IsOwnedBy( SteamId k ) => Owner.Id == k;
}

View File

@ -10,7 +10,7 @@ public struct PartyBeacon
internal PartyBeaconID_t Id;
/// <summary>
/// Creator of the beacon
/// Gets the owner of the beacon.
/// </summary>
public SteamId Owner
{
@ -24,7 +24,7 @@ public SteamId Owner
}
/// <summary>
/// Creator of the beacon
/// Gets metadata related to the beacon.
/// </summary>
public string MetaData
{
@ -39,7 +39,7 @@ public string MetaData
/// <summary>
/// Will attempt to join the party. If successful will return a connection string.
/// If failed, will return null
/// If failed, will return <see langword="null"/>
/// </summary>
public async Task<string> JoinAsync()
{
@ -52,7 +52,7 @@ public async Task<string> JoinAsync()
/// <summary>
/// When a user follows your beacon, Steam will reserve one of the open party slots for them, and send your game a ReservationNotification callback.
/// When that user joins your party, call OnReservationCompleted to notify Steam that the user has joined successfully
/// When that user joins your party, call this method to notify Steam that the user has joined successfully.
/// </summary>
public void OnReservationCompleted( SteamId steamid )
{
@ -70,7 +70,7 @@ public void CancelReservation( SteamId steamid )
}
/// <summary>
/// Turn off the beacon
/// Turn off the beacon.
/// </summary>
public bool Destroy()
{

View File

@ -6,6 +6,9 @@
namespace Steamworks.Data
{
/// <summary>
/// Represents a screenshot that was taken by a user.
/// </summary>
public struct Screenshot
{
internal ScreenshotHandle Value;
@ -19,16 +22,13 @@ public bool TagUser( SteamId user )
}
/// <summary>
/// Tags a user as being visible in the screenshot
/// Sets the location of the screenshot.
/// </summary>
public bool SetLocation( string location )
{
return SteamScreenshots.Internal.SetLocation( Value, location );
}
/// <summary>
/// Tags a user as being visible in the screenshot
/// </summary>
public bool TagPublishedFile( PublishedFileId file )
{
return SteamScreenshots.Internal.TagPublishedFile( Value, file );

View File

@ -6,6 +6,9 @@
namespace Steamworks
{
/// <summary>
/// Represents the ID of a user or steam lobby.
/// </summary>
public struct SteamId
{
public ulong Value;