Class SteamManager
The core of Multiplayer Engine for Steam handling initialization, networking, matchmaking, and events. This class is a singleton with all functions and callbacks being static for ease of referencing and binding. The singleton will ensure there is only one instance by destroying any additional instances, so you can safely add one to all of your scenes.
Inheritance
Namespace: KaijuSolutions.SteamMultiplayerEngine
Syntax
public sealed class SteamManager : MonoBehaviour
Fields
BannedKeyStart
Special key to use which starts banned lists. Unlike other keys which cannot be an exact match, you cannot start any lobby data with this prefix.
Declaration
public const string BannedKeyStart = "_b_"
Field Value
Type | Description |
---|---|
System.String |
ChatEncoding
The encoding to use for chat messages.
Declaration
public static readonly Encoding ChatEncoding
Field Value
Type | Description |
---|---|
Encoding |
FollowKey
Special key to use for lobby data which allows for a lobby of users to matchmake together into another lobby.
Declaration
public const string FollowKey = "_f"
Field Value
Type | Description |
---|---|
System.String |
GameServerIpKey
Default Steam key for the game server IP, which is not used directly with Multiplayer Engine for Steam.
Declaration
public const string GameServerIpKey = "__gameserverIP"
Field Value
Type | Description |
---|---|
System.String |
GameServerPortKey
Default Steam key for the game server port, which is not used directly with Multiplayer Engine for Steam.
Declaration
public const string GameServerPortKey = "__gameserverPort"
Field Value
Type | Description |
---|---|
System.String |
GameServerSteamIdKey
Default Steam key for the game Steam ID of the owner.
Declaration
public const string GameServerSteamIdKey = "__gameserverSteamID"
Field Value
Type | Description |
---|---|
System.String |
MessageCapacity
Chat message capacity in bytes.
Declaration
public const int MessageCapacity = 4096
Field Value
Type | Description |
---|---|
System.Int32 |
ModeKey
Special key to use for lobby data which allows for getting the lobby mode of the lobby. Do not manually set this key in the metadata.
Declaration
public const string ModeKey = "_m"
Field Value
Type | Description |
---|---|
System.String |
OpenKey
Special key to use for lobby data which allows for getting if the lobby is open. Do not manually set this key in the metadata.
Declaration
public const string OpenKey = "_o"
Field Value
Type | Description |
---|---|
System.String |
ReliableCapacity
The maximum size a reliable packet can be.
Declaration
public const int ReliableCapacity = default(int)
Field Value
Type | Description |
---|---|
System.Int32 |
RichPresenceConnect
The built-in Steam rich presence key for connecting.
Declaration
public const string RichPresenceConnect = "connect"
Field Value
Type | Description |
---|---|
System.String |
RichPresenceDisplay
The built-in Steam rich presence key that will be displayed in the viewing user's selected language in the Steam client UI.
Declaration
public const string RichPresenceDisplay = "steam_display"
Field Value
Type | Description |
---|---|
System.String |
RichPresencePlayerGroup
The built-in Steam rich presence key for player grouping.
Declaration
public const string RichPresencePlayerGroup = "steam_player_group"
Field Value
Type | Description |
---|---|
System.String |
RichPresencePlayerGroupSize
The built-in Steam rich presence key for player group size.
Declaration
public const string RichPresencePlayerGroupSize = "steam_player_group_size"
Field Value
Type | Description |
---|---|
System.String |
RichPresenceStatus
The built-in Steam rich presence key to display when someone views your game's info.
Declaration
public const string RichPresenceStatus = "status"
Field Value
Type | Description |
---|---|
System.String |
VersionKey
Special key to use for lobby data which ensures we only match lobbies of the current game version. Do not manually set this key in the metadata.
Declaration
public const string VersionKey = "_v"
Field Value
Type | Description |
---|---|
System.String |
Properties
App
The Steam app ID.
Declaration
public static uint App { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
AutoGroup
If all members of the lobby should automatically be grouped in Steam friends. If you have teams for instance, you may want to disable this and implement a custom behaviour.
Declaration
public static bool AutoGroup { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoMaximum
How many lobbies at most to search for when automatically trying to find a match. This is a separate field as you may want it higher given you're not interested in displaying auto matchmaking in a UI. If set to zero, will only try to join friends before trying to host a lobby. If looking for matches for a group, at minimum at least one public match will be searched for regardless of this value, as friend matches are excluded since they may not be joinable by everyone in thr group.
Declaration
public static int AutoMaximum { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
AutoPreferFriends
When automatically finding a lobby to join, should joining friends be prioritized over public lobbies? If enabled and a friend can be joined, this will join them. Otherwise, the games friends are in will still be considered alongside public matches. This is ignored if automatically matchmaking as a group, as there would otherwise be no guarantees all members of the party are friends with the owner of this lobby which could prevent them from joining.
Declaration
public static bool AutoPreferFriends { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ControlSteamFriendsVoice
If enabled, when talking in game, any voice chat the user is doing through the Steam friends UI will be muted so they can focus on the game voice chat.
Declaration
public static bool ControlSteamFriendsVoice { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
CurrentMembers
The number of players currently in the lobby.
Declaration
public static int CurrentMembers { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Data
Get the data for the current lobby we are in.
Declaration
public static Dictionary<string, string> Data { get; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, System.String> |
Display
Our rich presence localization token that will be displayed in a user's selected language in the Steam client UI.
Declaration
public static string Display { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Distance
How far to search for lobbies.
Close - Only lobbies in the same immediate region will be returned.
Default - Only lobbies in the same region or nearby regions will be returned.
Far - For games that don't have many latency requirements, will return lobbies about half-way around the globe.
Worldwide - No filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients).
Declaration
public static SteamDistance Distance { get; set; }
Property Value
Type | Description |
---|---|
SteamDistance |
Group
Our rich presence group.
Declaration
public static string Group { get; set; }
Property Value
Type | Description |
---|---|
System.String |
GroupSize
Our your rich presence group size.
Declaration
public static int GroupSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Id
The ID of the local user.
Declaration
public static ulong Id { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
IdValid
Check if the local ID is valid.
Declaration
public static bool IdValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Initialized
If Steam has been initialized or not. Accessing will attempt to initialize if needed.
Declaration
public static bool Initialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
InitializedCached
Cached initialized instance. Accessing will not attempt to initialize.
Declaration
public static bool InitializedCached { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
InLobby
If we are currently in a lobby.
Declaration
public static bool InLobby { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Instance
The singleton instance. Accessing will attempt to connect to Steam if needed.
Declaration
public static SteamManager Instance { get; }
Property Value
Type | Description |
---|---|
SteamManager |
IsOwner
If the local user owns the lobby.
Declaration
public static bool IsOwner { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Level
Get your level.
Declaration
public static int Level { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
LobbyId
The connected lobby ID.
Declaration
public static ulong LobbyId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Maximum
How many lobbies at most to search for. Unless your game has a lot of users, you likely don't need to set this for performance reasons. However, you likely want to limit it for your UI, whether through here or other handling of the results. If set to zero, searching for all lobbies is the same as just getting friends lobbies. If looking for matches for a group, at minimum at least one public match will be searched for regardless of this value, as friend matches are excluded since they may not be joinable by everyone in thr group.
Declaration
public static int Maximum { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxMembers
The max members that can join the lobby. If in a game, only the owner can set this.
Declaration
public static int MaxMembers { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MemberIds
Get the IDs of the users in the lobby.
Declaration
public static IEnumerable<ulong> MemberIds { get; }
Property Value
Type | Description |
---|---|
IEnumerable<System.UInt64> |
MicEnabled
If our microphone is currently enabled.
Declaration
public static bool MicEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Migrating
Check if we are currently migrating to a different lobby.
Declaration
public static bool Migrating { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MigrationDestination
Get the lobby we are migrating to. Zero indicates there is no lobby to migrate to.
Declaration
public static ulong MigrationDestination { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Mode
The mode of the lobby which controls what players can join. Regardless of the mode set, no players can join if there is no space left or the lobby is not set to be open.
Invite Only - Only players invited by current lobby members can join. Does not show up in searches.
Invite and Friends - Friends of lobby members or players invited by current lobby members can join. Does not show up in searches.
Public - Anyone may join, and your friends can see you are in a lobby. Shows up in searches.
Invisible - Anyone can join, but not visible to your friends. Shows up in searches.
Declaration
public static SteamLobbyMode Mode { get; set; }
Property Value
Type | Description |
---|---|
SteamLobbyMode |
Name
Get your name.
Declaration
public static string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Open
If players can join the lobby or not. If in a game, only the owner can set this.
Declaration
public static bool Open { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
OwnerId
Get the ID of the lobby owner.
Declaration
public static ulong OwnerId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Parameters
What parameters we want to use to search for lobbies with. If we create a lobby, these will be applied.
Declaration
public static SteamSearchParameters Parameters { get; set; }
Property Value
Type | Description |
---|---|
SteamSearchParameters |
ParametersKeys
Get the search parameter keys.
Declaration
public static string[] ParametersKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
ParametersNearKeys
Get the search parameter near keys.
Declaration
public static string[] ParametersNearKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
ParametersNumberKeys
Get the search parameter number keys.
Declaration
public static string[] ParametersNumberKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
ParametersStringKeys
Get the search parameter string keys.
Declaration
public static string[] ParametersStringKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Players
How to handle sorting lobbies based on player counts.
Most Players - Sort by highest current player count and then by highest capacity.
None - Don't sort by player count.
Least Players - Sort by lowest current player count and then by lowest capacity.
Declaration
public static SteamPopulationMode Players { get; set; }
Property Value
Type | Description |
---|---|
SteamPopulationMode |
RichPresence
Get all your rich presence.
Declaration
public static Dictionary<string, string> RichPresence { get; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, System.String> |
ServerValid
Get if the server is properly configured to match the host.
Declaration
public static bool ServerValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
State
Get your state.
Offline - Not currently logged on.
Online - Logged on.
Busy - Logged on, but set to "Do not disturb."
Away - Auto-away feature.
Snooze - Auto-away for a long time.
Trading - Online, trading.
Looking to Play - Online, wanting to play.
Declaration
public static SteamState State { get; }
Property Value
Type | Description |
---|---|
SteamState |
Status
Our rich presence status to display when someone views your game info.
Declaration
public static string Status { get; set; }
Property Value
Type | Description |
---|---|
System.String |
UseVoice
If you want to use the Multiplayer Engine for Steam voice system. No other voice settings will have any impact if this is disabled. If you are using a custom or third-party voice system, you can disable this.
Declaration
public static bool UseVoice { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Version
The version string to match for lobby data.
Declaration
public static string Version { get; }
Property Value
Type | Description |
---|---|
System.String |
VoiceChannel
The channel to send voice data over. Note that it is your responsibility to ensure you do not send any other data manually over this channel. It is recommended to not dynamically modify this as all users need the same channel to send and receive voice data.
Declaration
public static int VoiceChannel { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
VoiceMode
How to handle automatically enabling voices for users when their ID is set. This does not stop you from manually assigning other voice recipients manually.
None - Do not automatically enable any voices.
Others - Automatically enable voices for other players.
Self - Automatically enable voice for yourself.
All - Automatically enable voices for other players and yourself.
Declaration
public static SteamVoiceAssignment VoiceMode { get; set; }
Property Value
Type | Description |
---|---|
SteamVoiceAssignment |
VoiceRate
The rate at which to decompress voice audio at from 11,025 to 48,000. If lower than 11,025, Steam will automatically get an optimal sample rate for performance but audio quality may be poorer. If greater than 48,000, the sample rate will be that of which the application is currently outputting at.
Declaration
public static uint VoiceRate { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
VoiceRecipients
Who we have configured to get our voice, with NULL being everyone.
Declaration
public static IEnumerable<ulong> VoiceRecipients { get; }
Property Value
Type | Description |
---|---|
IEnumerable<System.UInt64> |
Methods
AutoGroupCallback(ChangeEvent<Boolean>)
Callback to set if auto grouping is enabled.
Declaration
public static void AutoGroupCallback(ChangeEvent<bool> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Boolean> | evt | The change event. |
AutoMaximumCallback(ChangeEvent<Int32>)
Callback to set the maximum lobbies to search for when automatically finding a match.
Declaration
public static void AutoMaximumCallback(ChangeEvent<int> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Int32> | evt | The change event. |
AutoPreferFriendsCallback(ChangeEvent<Boolean>)
Callback to set if we prefer joining friends when automatically finding a match.
Declaration
public static void AutoPreferFriendsCallback(ChangeEvent<bool> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Boolean> | evt | The change event. |
Ban(UInt64)
Ban a player from the lobby if we are the owner. Note this applies to the lobby, not your Steam account bans.
Declaration
public static bool Ban(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the player to ban. |
Returns
Type | Description |
---|---|
System.Boolean | If the request to ban was sent. |
Banned(Boolean)
All users banned from our current lobby.
Declaration
public static IEnumerable<ulong> Banned(bool sort = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | sort | If the users should be sorted as given in SortUsers(IEnumerable<UInt64>). |
Returns
Type | Description |
---|---|
IEnumerable<System.UInt64> | The users banned from our current lobby. |
Banned(UInt64)
Get if a user is banned from our lobby.
Declaration
public static bool Banned(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the player. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is banned from our lobby. |
Banned(UInt64, UInt64)
Get if a user is banned from a lobby. This assumes we have the metadata for this lobby already.
Declaration
public static bool Banned(ulong user, ulong lobby)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | user | The ID of the user. |
System.UInt64 | lobby | The ID of the lobby. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is banned from the lobby. |
BannedFrom(UInt64)
Get if we are banned from a lobby. This assumes we have the metadata for this lobby already.
Declaration
public static bool BannedFrom(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the lobby to check. |
Returns
Type | Description |
---|---|
System.Boolean | If we are banned from the lobby. |
ChangedTextFilter(SteamTextFilter)
Indicate a text filter has changed.
Declaration
public static void ChangedTextFilter(SteamTextFilter filter)
Parameters
Type | Name | Description |
---|---|---|
SteamTextFilter | filter | The text filter. |
ChangedVoiceFilter(SteamVoiceFilter)
Indicate a voice filter has changed.
Declaration
public static void ChangedVoiceFilter(SteamVoiceFilter filter)
Parameters
Type | Name | Description |
---|---|---|
SteamVoiceFilter | filter | The voice filter. |
Chat(String)
Send a chat message to all members in the lobby.
Declaration
public static bool Chat(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to send. |
Returns
Type | Description |
---|---|
System.Boolean | If the chat message was sent. |
ClearData()
Delete all lobby data if we are the owner. This automatically skips special keys required by this framework. Note that this will clear any searching parameters from the lobby, but not the values in the local field.
Declaration
public static bool ClearData()
Returns
Type | Description |
---|---|
System.Boolean | If all data was successfully deleted. |
ClearDataBindable()
Delete all lobby data if we are the owner. This automatically skips special keys required by this framework. Note that this will clear any searching parameters from the lobby, but not the values in the local field.
Declaration
public static void ClearDataBindable()
ClearNearParameters()
Clear all near values from the assigned search parameters. See SteamSearchParameters.
Declaration
public static void ClearNearParameters()
ClearNumberParameters()
Clear all number values from the assigned search parameters. See SteamSearchParameters.
Declaration
public static void ClearNumberParameters()
ClearParameters()
Clear all values from the assigned search parameters. See SteamSearchParameters.
Declaration
public static void ClearParameters()
ClearRichPresence()
Clear all rich presence.
Declaration
public static bool ClearRichPresence()
Returns
Type | Description |
---|---|
System.Boolean | If the rich presence was cleared or not. |
ClearRichPresenceBindable()
Clear all rich presence.
Declaration
public static void ClearRichPresenceBindable()
ClearStringParameters()
Clear all string values from the assigned search parameters. See SteamSearchParameters.
Declaration
public static void ClearStringParameters()
Connect(UInt64)
Connect to a lobby or friend.
Declaration
public static bool Connect(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The lobby or friend ID to connect to. |
Returns
Type | Description |
---|---|
System.Boolean | If successfully started the connection. |
ControlSteamFriendsVoiceCallback(ChangeEvent<Boolean>)
Callback to set if the Steam friends UI voice is controlled from the game.
Declaration
public static void ControlSteamFriendsVoiceCallback(ChangeEvent<bool> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Boolean> | evt | The change event. |
DeleteNearParameter(String)
Delete a near value from the assigned search parameters. See SteamSearchParameters.
Declaration
public static bool DeleteNearParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
DeleteNumberParameter(String)
Delete a number value from the assigned search parameters. See SteamSearchParameters.
Declaration
public static bool DeleteNumberParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
DeleteParameter(String)
Delete a value from the assigned search parameters. See SteamSearchParameters.
Declaration
public static bool DeleteParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
DeleteStringParameter(String)
Delete a string value from the assigned search parameters. See SteamSearchParameters.
Declaration
public static bool DeleteStringParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it was deleted. |
DisableAutoGroup()
Disable auto grouping.
Declaration
public static void DisableAutoGroup()
DisableAutoPreferFriends()
Disable that we prefer joining friends when automatically finding a match.
Declaration
public static void DisableAutoPreferFriends()
DisableControlSteamFriendsVoice()
Disable controlling the Steam friends UI voice from the game.
Declaration
public static void DisableControlSteamFriendsVoice()
DisableMic()
Disable the mic.
Declaration
public static void DisableMic()
DistanceCallback(ChangeEvent<Enum>)
Callback to set the search distance.
Declaration
public static void DistanceCallback(ChangeEvent<Enum> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<Enum> | evt | The change event. Must be a SteamDistance. |
EnableAutoGroup()
Enable auto grouping.
Declaration
public static void EnableAutoGroup()
EnableAutoPreferFriends()
Enable that we prefer joining friends when automatically finding a match.
Declaration
public static void EnableAutoPreferFriends()
EnableControlSteamFriendsVoice()
Enable controlling the Steam friends UI voice from the game.
Declaration
public static void EnableControlSteamFriendsVoice()
EnableMic()
Enable the mic.
Declaration
public static void EnableMic()
EnsureExists()
Ensure an instance exists and attempt to connect to Steam if needed.
Declaration
public static SteamManager EnsureExists()
Returns
Type | Description |
---|---|
SteamManager | The Steam manager instance. |
EnsureExistsBindable()
Ensure an instance exists and attempt to connect to Steam if needed.
Declaration
public static void EnsureExistsBindable()
FindLobby()
Start a search to automatically join or create a lobby.
Declaration
public static bool FindLobby()
Returns
Type | Description |
---|---|
System.Boolean | If the search to join a lobby was successfully initialized. |
FindLobbyBindable()
Start a search to automatically join or create a lobby.
Declaration
public static void FindLobbyBindable()
Flush()
Flush all connections in the lobby.
Declaration
public static void Flush()
Flush(Int32)
Flush all connections in the lobby on a given channel.
Declaration
public static void Flush(int channel)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | channel | The channel to flush. |
Flush(UInt64)
Manually close a connection with another user.
Declaration
public static void Flush(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to close the connection with. |
Flush(UInt64, Int32)
Manually close a connection with another user on a channel.
Declaration
public static void Flush(ulong id, int channel)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to close the connection with. |
System.Int32 | channel | The channel to flush. |
FriendsLobbies()
Starts to request data for friends lobbies. Follows the search parameters assigned to the manager. Excludes our own lobby if we are in one with friends. You should listen for the OnSearchResults callback to get the results of this.
Declaration
public static bool FriendsLobbies()
Returns
Type | Description |
---|---|
System.Boolean | If the search was started. |
FriendsLobbiesBindable()
Starts to request data for friends lobbies. Follows the search parameters assigned to the manager. Excludes our own lobby if we are in one with friends. You should listen for the OnSearchResults callback to get the results of this.
Declaration
public static void FriendsLobbiesBindable()
GetData(String)
Get the data value from our lobby.
Declaration
public static string GetData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The value to get. |
Returns
Type | Description |
---|---|
System.String | The given value. Will return an empty string if we are not in a lobby, the data did not exist, or there was an error. |
GetData(UInt64)
Get all the data for a lobby. This automatically handles Multiplayer Engine for Steam specific values. This assumes you are in this lobby, or you have retrieved this lobby ID via a search request, as otherwise you cannot see the data.
Declaration
public static Dictionary<string, string> GetData(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the lobby. |
Returns
Type | Description |
---|---|
Dictionary<System.String, System.String> | The retrieved data or an empty dictionary if there was an error. |
GetData(UInt64, String)
Get a data value from a lobby. This assumes you are in this lobby, or you have retrieved this lobby ID via a search request, as otherwise you cannot see the data.
Declaration
public static string GetData(ulong id, string key)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the lobby. |
System.String | key | The value to get. |
Returns
Type | Description |
---|---|
System.String | The given value. Will return an empty string if the data did not exist or there was an error. |
GetDisplay(UInt64)
Get the rich presence localization token that will be displayed in a user's selected language in the Steam client UI of a user.
Declaration
public static string GetDisplay(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.String | The user's display rich presence or an empty string if it was not set. |
GetFriends(Boolean)
Get all your friends.
Declaration
public static List<ulong> GetFriends(bool sort = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | sort | If your friends should be sorted as given in SortUsers(IEnumerable<UInt64>). |
Returns
Type | Description |
---|---|
List<System.UInt64> | The IDs of your friends. |
GetGroup(UInt64)
Get the rich presence group of a user.
Declaration
public static string GetGroup(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.String | The user's group or an empty string if it was not set. |
GetGroupSize(UInt64)
Get the rich presence group size of a user.
Declaration
public static int GetGroupSize(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.Int32 | The user's group size or zero if it was not set. |
GetIcon(UInt64, ref Texture2D, SteamIconSize)
Get an icon for a user.
Declaration
public static SteamIconStatus GetIcon(ulong id, ref Texture2D texture, SteamIconSize size = SteamIconSize.Large)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of user. |
Texture2D | texture | The texture to load the icon into. |
SteamIconSize | size | The size of the icon to get. |
Returns
Type | Description |
---|---|
SteamIconStatus | The status of loading the icon. If "Requested", you need to wait for an OnIcon callback. |
GetIcon(ref Texture2D, SteamIconSize)
Get your icon.
Declaration
public static SteamIconStatus GetIcon(ref Texture2D texture, SteamIconSize size = SteamIconSize.Large)
Parameters
Type | Name | Description |
---|---|---|
Texture2D | texture | The texture to load the icon into. |
SteamIconSize | size | The size of the icon to get. |
Returns
Type | Description |
---|---|
SteamIconStatus | The status of loading the icon. If "Requested", you need to wait for an OnIcon callback. |
GetKeyType(String)
Get the type of data a key is for from the assigned search parameters. See SteamSearchParameters.
Declaration
public SteamSearchKey GetKeyType(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamSearchKey | The type of data the key is for. |
GetLevel(UInt64)
Get the Steam level of a user.
Declaration
public static int GetLevel(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.Int32 | The Steam level of the user. |
GetMaxLobbyMembers(UInt64)
Get the maximum number of members for a lobby.
Declaration
public static int GetMaxLobbyMembers(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The lobby ID. |
Returns
Type | Description |
---|---|
System.Int32 | The maximum number of members for the lobby. |
GetMemberData(String)
Get a data value for yourself.
Declaration
public static string GetMemberData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The value to get. |
Returns
Type | Description |
---|---|
System.String | The given value. Will return an empty string if we are not in a lobby, the data did not exist, or there was an error. |
GetMemberData(UInt64, String)
Get a data value for a user in our lobby.
Declaration
public static string GetMemberData(ulong id, string key)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user. |
System.String | key | The value to get. |
Returns
Type | Description |
---|---|
System.String | The given value. Will return an empty string if we are not in a lobby, the data did not exist, or there was an error. |
GetName(UInt64)
Get the name of a user.
Declaration
public static string GetName(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user. |
Returns
Type | Description |
---|---|
System.String | The name of the user or an empty string if it fails. |
GetNearParameter(String)
Get a near value from the assigned search parameters. See SteamSearchParameters.
Declaration
public static SteamNearData GetNearParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamNearData | The value or a new struct if it does not exist. |
GetNumberLobbyMembers(UInt64)
Get the current number of members in a lobby.
Declaration
public static int GetNumberLobbyMembers(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The lobby ID. |
Returns
Type | Description |
---|---|
System.Int32 | The number of members in the lobby. |
GetNumberParameter(String)
Get a number value from the assigned search parameters. See SteamSearchParameters.
Declaration
public static SteamNumberData GetNumberParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamNumberData | The value or a new struct if it does not exist. |
GetRelationship(UInt64)
Get the relationship with a user.
Declaration
public static SteamRelationship GetRelationship(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user. |
Returns
Type | Description |
---|---|
SteamRelationship | The relationship the user. |
GetRichPresence(String)
Get a rich presence of us.
Declaration
public static string GetRichPresence(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.String | The rich presence value or an empty string if it was not set. |
GetRichPresence(UInt64)
Get all rich presence for a user.
Declaration
public static Dictionary<string, string> GetRichPresence(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user's ID. |
Returns
Type | Description |
---|---|
Dictionary<System.String, System.String> | All found rich presence. |
GetRichPresence(UInt64, String)
Get a rich presence of a user.
Declaration
public static string GetRichPresence(ulong id, string key)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user's ID. |
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.String | The rich presence value or an empty string if it was not set. |
GetState(UInt64)
Get the state of a user.
Declaration
public static SteamState GetState(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user. |
Returns
Type | Description |
---|---|
SteamState | The state of the user or offline if it fails. |
GetStatus(UInt64)
Get the rich presence status to display when someone views the user's game info.
Declaration
public static string GetStatus(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.String | The user's status or an empty string if it was not set. |
GetStringParameter(String)
Get a string value from the assigned search parameters. See SteamSearchParameters.
Declaration
public static SteamStringData GetStringParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
SteamStringData | The value or a new struct if it does not exist. |
HasNearParameter(String)
See if a given near key exists in the search parameters. See SteamSearchParameters.
Declaration
public static bool HasNearParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
HasNumberParameter(String)
See if a given number key exists in the search parameters. See SteamSearchParameters.
Declaration
public static bool HasNumberParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
HasParameter(String)
See if a given key exists in the search parameters. See SteamSearchParameters.
Declaration
public static bool HasParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
HasStringParameter(String)
See if a given string key exists in the search parameters. See SteamSearchParameters.
Declaration
public static bool HasStringParameter(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
Returns
Type | Description |
---|---|
System.Boolean | If it exists. |
Host()
Start the hosting process for a game as the owner.
Declaration
public static bool Host()
Returns
Type | Description |
---|---|
System.Boolean | If successfully started creating a lobby. Note this only indicates if we have successfully requested to create a lobby, and we will not know the result is truly successful until the OnStartOwner method is fired. |
HostBindable()
Start the hosting process for a game as the owner.
Declaration
public static void HostBindable()
Invite(UInt64)
Invite a user to your lobby.
Declaration
public static bool Invite(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to invite. |
Returns
Type | Description |
---|---|
System.Boolean | If they were invited or were already in the lobby. |
InviteOverlay()
Open the invite overlay. Only works if currently in a lobby that has open space.
Declaration
public static bool InviteOverlay()
Returns
Type | Description |
---|---|
System.Boolean | If the overlay was opened or not. |
InviteOverlayBindable()
Open the invite overlay. Only works if currently in a lobby that has open space.
Declaration
public static void InviteOverlayBindable()
Joinable(UInt64)
If a friend or lobby can be joined.
Declaration
public static bool Joinable(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the friend or lobby. |
Returns
Type | Description |
---|---|
System.Boolean | If the friend or lobby can be joined. |
Kick(UInt64)
Kick a player from the lobby if we are the owner.
Declaration
public static bool Kick(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the player to kick. |
Returns
Type | Description |
---|---|
System.Boolean | If the request to kick was sent. |
MaximumCallback(ChangeEvent<Int32>)
Callback to set the maximum lobbies to search for.
Declaration
public static void MaximumCallback(ChangeEvent<int> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Int32> | evt | The change event. |
MaxMembersCallback(ChangeEvent<Int32>)
Callback to set the max members.
Declaration
public static void MaxMembersCallback(ChangeEvent<int> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Int32> | evt | The change event. |
MicEnabledCallback(ChangeEvent<Boolean>)
Callback to set if the mic is enabled.
Declaration
public static void MicEnabledCallback(ChangeEvent<bool> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Boolean> | evt | The change event. |
ModeCallback(ChangeEvent<Enum>)
Callback to set the mode of the lobby.
Declaration
public static void ModeCallback(ChangeEvent<Enum> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<Enum> | evt | The change event. Must be a SteamLobbyMode. |
OpenCallback(ChangeEvent<Boolean>)
Callback to set if the lobby is open or not.
Declaration
public static void OpenCallback(ChangeEvent<bool> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Boolean> | evt | The change event. |
PlayersCallback(ChangeEvent<Enum>)
Callback to set how players are sorted by.
Declaration
public static void PlayersCallback(ChangeEvent<Enum> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<Enum> | evt | The change event. Must be a SteamPopulationMode. |
Receive(ref Byte[], out UInt64, out Int32, out Boolean, Int32)
Receive a packet from the network.
Declaration
public static bool Receive(ref byte[] data, out ulong id, out int size, out bool reliable, int channel = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Where to store the raw packet. |
System.UInt64 | id | The ID of the packet's sender. |
System.Int32 | size | The size of the packet. |
System.Boolean | reliable | If the packet was reliable or not. |
System.Int32 | channel | The channel to get the packet from which defaults to zero. |
Returns
Type | Description |
---|---|
System.Boolean | If a packet was retrieved. |
RegisterTextFilter(SteamTextFilter)
Register a text filter.
Declaration
public static void RegisterTextFilter(SteamTextFilter filter)
Parameters
Type | Name | Description |
---|---|---|
SteamTextFilter | filter | The text filter. |
RegisterVoice(UInt64, ISteamVoice)
Register a voice listener.
Declaration
public static void RegisterVoice(ulong id, ISteamVoice listener)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to receive the voice of. |
ISteamVoice | listener | The listener to register. |
RegisterVoiceFilter(SteamVoiceFilter)
Register a voice filter.
Declaration
public static void RegisterVoiceFilter(SteamVoiceFilter filter)
Parameters
Type | Name | Description |
---|---|---|
SteamVoiceFilter | filter | The voice filter. |
RequestRichPresence(UInt64)
Request the rich presence for a user. If successful, wait for an "OnRichPresence" callback with the given ID.
Declaration
public static bool RequestRichPresence(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to request. |
Returns
Type | Description |
---|---|
System.Boolean | If the rich presence was requested or not. |
RequestUserInformation(UInt64, Boolean)
Request the information about a user.
Declaration
public static bool RequestUserInformation(ulong id, bool nameOnly = true)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user. |
System.Boolean | nameOnly | If we only want the name, or we also need their avatar. |
Returns
Type | Description |
---|---|
System.Boolean |
|
RunTextFilters(ref String, UInt64)
Run all text filters.
Declaration
public static void RunTextFilters(ref string message, ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to run them on. |
System.UInt64 | id | The user the message is associated with. |
SearchLobbies()
Start a search for lobbies. This will ignore your own lobby if you are in one. You should listen for the OnSearchResults callback to get the results of this.
Declaration
public static bool SearchLobbies()
Returns
Type | Description |
---|---|
System.Boolean | If the search was successfully initialized. |
SearchLobbiesBindable()
Start a search for lobbies. This will ignore your own lobby if you are in one. You should listen for the OnSearchResults callback to get the results of this.
Declaration
public static void SearchLobbiesBindable()
Send(IList<Byte[]>, Int32[], Int32, Boolean, Boolean, Boolean, Boolean, UInt64[], ISet<UInt64>)
Send packets to multiple members.
Declaration
public static bool Send(IList<byte[]> data, int[] sizes = null, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true, bool sendSelf = false, ulong[] ids = null, ISet<ulong> failures = null)
Parameters
Type | Name | Description |
---|---|---|
IList<System.Byte[]> | data | The data to send. |
System.Int32[] | sizes | The sizes of the data to send. Index corresponds to the data index. Will send the entire data if that index is negative or zero. If NULL, will send the entire data for each element. If sending reliably, ensure each index is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
System.Boolean | sendSelf | If we also want to send the message to ourselves which defaults to false. |
System.UInt64[] | ids | The IDs to send the packet to. NULL will send to everyone. |
ISet<System.UInt64> | failures | Optionally store the IDs that failed. |
Returns
Type | Description |
---|---|
System.Boolean | If all data was sent to all users successfully. |
Send(Byte[], Int32, Int32, Boolean, Boolean, Boolean, Boolean, UInt64[], ISet<UInt64>)
Send a packet to multiple members.
Declaration
public static bool Send(byte[] data, int size = 0, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true, bool sendSelf = false, ulong[] ids = null, ISet<ulong> failures = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data to send. |
System.Int32 | size | The size of the data to send. Will send the entire array if negative or zero. If sending reliably, ensure it is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
System.Boolean | sendSelf | If we also want to send the message to ourselves which defaults to false. |
System.UInt64[] | ids | The IDs to send the packet to. NULL will send to everyone. |
ISet<System.UInt64> | failures | Optionally store the IDs that failed. |
Returns
Type | Description |
---|---|
System.Boolean | If the data was sent to all users successfully. |
Send(UInt64, IList<Byte[]>, Int32[], Int32, Boolean, Boolean, Boolean)
Send multiple packets to a user. Stops sending at the first error encountered.
Declaration
public static bool Send(ulong id, IList<byte[]> data, int[] sizes = null, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user to send the packet to. |
IList<System.Byte[]> | data | The data to send. |
System.Int32[] | sizes | The sizes of the data to send. Index corresponds to the data index. Will send the entire data if that index is negative or zero. If NULL, will send the entire data for each element. If sending reliably, ensure each index is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
Returns
Type | Description |
---|---|
System.Boolean | If all packets were successfully sent. |
Send(UInt64, Byte[], Int32, Int32, Boolean, Boolean, Boolean)
Send a packet to a user.
Declaration
public static bool Send(ulong id, byte[] data, int size = 0, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user to send the packet to. |
System.Byte[] | data | The data to send. |
System.Int32 | size | The size of the data to send. Will send the entire array if negative or zero. If sending reliably, ensure it is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
Returns
Type | Description |
---|---|
System.Boolean | If the packet was successfully sent. |
SendOwner(IList<Byte[]>, Int32[], Int32, Boolean, Boolean, Boolean)
Send multiple packets to the owner. Stops sending at the first error encountered.
Declaration
public static bool SendOwner(IList<byte[]> data, int[] sizes = null, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true)
Parameters
Type | Name | Description |
---|---|---|
IList<System.Byte[]> | data | The data to send. |
System.Int32[] | sizes | The sizes of the data to send. Index corresponds to the data index. Will send the entire data if that index is negative or zero. If NULL, will send the entire data for each element. If sending reliably, ensure each index is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
Returns
Type | Description |
---|---|
System.Boolean | If all packets were successfully sent. |
SendOwner(Byte[], Int32, Int32, Boolean, Boolean, Boolean)
Send a packet to the owner.
Declaration
public static bool SendOwner(byte[] data, int size = 0, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data to send. |
System.Int32 | size | The size of the data to send. Will send the entire array if negative or zero. If sending reliably, ensure it is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
Returns
Type | Description |
---|---|
System.Boolean | If the packet was successfully sent. |
SendSelf(IList<Byte[]>, Int32[], Int32, Boolean, Boolean, Boolean)
Send multiple packets to ourselves. Stops sending at the first error encountered.
Declaration
public static bool SendSelf(IList<byte[]> data, int[] sizes = null, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true)
Parameters
Type | Name | Description |
---|---|---|
IList<System.Byte[]> | data | The data to send. |
System.Int32[] | sizes | The sizes of the data to send. Index corresponds to the data index. Will send the entire data if that index is negative or zero. If NULL, will send the entire data for each element. If sending reliably, ensure each index is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
Returns
Type | Description |
---|---|
System.Boolean | If all packets were successfully sent. |
SendSelf(Byte[], Int32, Int32, Boolean, Boolean, Boolean)
Send a packet to ourselves.
Declaration
public static bool SendSelf(byte[] data, int size = 0, int channel = 0, bool reliable = true, bool nagle = true, bool delay = true)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data to send. |
System.Int32 | size | The size of the data to send. Will send the entire array if negative or zero. If sending reliably, ensure it is not greater than "ReliableCapacity". |
System.Int32 | channel | The channel to send the data on. Defaults to zero. |
System.Boolean | reliable | If this is a reliable message or not. Defaults to reliable. |
System.Boolean | nagle | If Nagle's algorithm should be used. Defaults to true. |
System.Boolean | delay | If delays in the case of events such as handshaking are allowed. Disabling only impacts unreliable messages. |
Returns
Type | Description |
---|---|
System.Boolean | If the packet was successfully sent. |
SetClose()
Set the lobby to closed.
Declaration
public static void SetClose()
SetData(IEnumerable<KeyValuePair<String, String>>)
Add lobby data if we are the owner. Note that if any are a search parameter, it will not override the cached searching value, only the value in the current lobby.
Declaration
public static bool SetData(IEnumerable<KeyValuePair<string, string>> data)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<System.String, System.String>> | data | The lobby data. |
Returns
Type | Description |
---|---|
System.Boolean | If all data was successfully set. |
SetData(String, String)
Add lobby data if we are the owner. Note that if this is a search parameter, it will not override the cached searching value, only the value in the current lobby.
Declaration
public static bool SetData(string key, string value = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The data key. |
System.String | value | The data value. NULL will delete the data. |
Returns
Type | Description |
---|---|
System.Boolean | If the data was successfully set. |
SetDistanceClose()
Set the search distance to close. See SteamDistance.
Declaration
public static void SetDistanceClose()
SetDistanceDefault()
Set the search distance to the default. See SteamDistance.
Declaration
public static void SetDistanceDefault()
SetDistanceFar()
Set the search distance to far. See SteamDistance.
Declaration
public static void SetDistanceFar()
SetDistanceWorldwide()
Set the search distance to worldwide. See SteamDistance.
Declaration
public static void SetDistanceWorldwide()
SetMemberData(IEnumerable<KeyValuePair<String, String>>)
Add local user data.
Declaration
public static bool SetMemberData(IEnumerable<KeyValuePair<string, string>> data)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<System.String, System.String>> | data | The user data. |
Returns
Type | Description |
---|---|
System.Boolean | If all data was successfully set. |
SetMemberData(String, String)
Add local user data.
Declaration
public static bool SetMemberData(string key, string value = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The data key. |
System.String | value | The data value. NULL will delete the data. |
Returns
Type | Description |
---|---|
System.Boolean | If the data was successfully set. |
SetModeInvisible()
Set the lobby to invisible. See SteamLobbyMode.
Declaration
public static void SetModeInvisible()
SetModeInviteAndFriends()
Set the lobby to friends and invites only. See SteamLobbyMode.
Declaration
public static void SetModeInviteAndFriends()
SetModeInviteOnly()
Set the lobby to invite only. See SteamLobbyMode.
Declaration
public static void SetModeInviteOnly()
SetModePublic()
Set the lobby to public. See SteamLobbyMode.
Declaration
public static void SetModePublic()
SetNearParameter(String, Int32, Int32)
Set a near value for the search parameters. See SteamSearchParameters.
Declaration
public static void SetNearParameter(string key, int value = 0, int order = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Int32 | value | The value. |
System.Int32 | order | The sorting order. |
SetNumberParameter(String, Int32, Int32, SteamSearchType)
Set a number value for the search parameters. See SteamSearchParameters.
Declaration
public static void SetNumberParameter(string key, int value = 0, int order = 0, SteamSearchType searchType = SteamSearchType.Equal)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.Int32 | value | The value. |
System.Int32 | order | The sorting order. |
SteamSearchType | searchType | How to handle this value. |
SetOpen()
Set the lobby to open.
Declaration
public static void SetOpen()
SetParameters()
Set the lobby data to our search parameters. This is done automatically when we create a lobby. However, this is not automatically run if we become a lobby owner, as potentially some desired state data has changed since we joined. See SteamSearchParameters.
Declaration
public static bool SetParameters()
Returns
Type | Description |
---|---|
System.Boolean | If all the data set was. |
SetParametersBindable()
Set the lobby data to our search parameters. This is done automatically when we create a lobby. However, this is not automatically run if we become a lobby owner, as potentially some desired state data has changed since we joined. See SteamSearchParameters.
Declaration
public static void SetParametersBindable()
SetPlayersLeast()
Set how players are sorted to be from the least populated to most. See SteamPopulationMode.
Declaration
public static void SetPlayersLeast()
SetPlayersMost()
Set how players are sorted to be from the most populated to least. See SteamPopulationMode.
Declaration
public static void SetPlayersMost()
SetPlayersNone()
Set for there to be no sorting based on how populated lobbies are. See SteamPopulationMode.
Declaration
public static void SetPlayersNone()
SetRichPresence(IEnumerable<KeyValuePair<String, String>>)
Set multiple rich presence values.
Declaration
public static bool SetRichPresence(IEnumerable<KeyValuePair<string, string>> data)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<KeyValuePair<System.String, System.String>> | data | The key-value pairs to set. |
Returns
Type | Description |
---|---|
System.Boolean | If all keys were successfully set. |
SetRichPresence(String, String)
Common method for setting a rich presence value.
Declaration
public static bool SetRichPresence(string key, string value = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | value | The value. NULL or empty will unset the rich presence. |
Returns
Type | Description |
---|---|
System.Boolean | If the key was set or not. |
SetStringParameter(String, String, Int32, SteamSearchType)
Set a string value for the search parameters. See SteamSearchParameters.
Declaration
public static void SetStringParameter(string key, string value = null, int order = 0, SteamSearchType searchType = SteamSearchType.Equal)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key. |
System.String | value | The value. |
System.Int32 | order | The sorting order. |
SteamSearchType | searchType | How to handle this value. |
SetVoiceRateMaximum()
Set the voice rate to the maximum value of 48,000.
Declaration
public static void SetVoiceRateMaximum()
SetVoiceRateMinimum()
Set the voice rate to the minimum value of 11,025.
Declaration
public static void SetVoiceRateMinimum()
SetVoiceRateOptimal()
Set the voice rate to be automatically determined by Steam.
Declaration
public static void SetVoiceRateOptimal()
Shutdown()
Shutdown all Steam networking.
Declaration
public static void Shutdown()
SortLobbies(ref List<UInt64>)
Sort lobbies by the search parameters. If there are none, sorts by the most connected players and then by those which have the most spaces.
Declaration
public static bool SortLobbies(ref List<ulong> ids)
Parameters
Type | Name | Description |
---|---|---|
List<System.UInt64> | ids | The lobby IDs to sort. |
Returns
Type | Description |
---|---|
System.Boolean | If the sorting was successful. |
SortUsers(IEnumerable<UInt64>)
Sort users based on relevance for playing with you. This lists yourself first, followed by sorting on relationship. Users of the same relationship are sorted on state. Further ties are then sorted by name, Steam level, and lastly ID. Invalid users are removed.
Relationship order, see SteamRelationship:
1 - Friend.
2 - Initiated.
3 - Requested.
4 - None or they ignored your friend request.
5 - Blocked.
State order, see SteamState:
1 - In the same lobby as you and are the owner of it.
2 - In the same lobby as you.
3 - In the same game but in a different lobby than you that can be joined. Note this is lower than in the same game and not in a lobby if we are in a lobby, as those players are more likely to be open to joining us.
4 - In the same game but in a different lobby than you, but it can't be joined. Note this is lower than in the same game and not in a lobby if we are in a lobby, as those players are more likely to be open to joining us.
5 - In the same game but not yet in a lobby. Note this is higher than in a different lobby than us if we are in a lobby, as these players are more likely to be open to joining us.
6 - Looking to play a game.
7 - Playing a different game.
8 - Online.
9 - Trading.
10 - Busy.
11 - Away.
12 - Snooze.
13 - Offline.
Declaration
public static List<ulong> SortUsers(IEnumerable<ulong> ids)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.UInt64> | ids | The IDs of the users to sort. |
Returns
Type | Description |
---|---|
List<System.UInt64> | The users sorted based on relevance for playing with you. |
ToggleAutoGroup()
Toggle auto grouping.
Declaration
public static void ToggleAutoGroup()
ToggleAutoPreferFriends()
Toggle that we prefer joining friends when automatically finding a match.
Declaration
public static void ToggleAutoPreferFriends()
ToggleControlSteamFriendsVoice()
Toggle controlling the Steam friends UI voice from the game.
Declaration
public static void ToggleControlSteamFriendsVoice()
ToggleMic()
Toggle the mic.
Declaration
public static void ToggleMic()
TransferOwner()
Transfer ownership to someone else in the lobby. This will sort the users based on SortUsers(IEnumerable<UInt64>), transferring to the first user.
Declaration
public static ulong TransferOwner()
Returns
Type | Description |
---|---|
System.UInt64 | The ID of who ownership was transferred to or zero if there was nobody to transfer to. |
TransferOwner(UInt64)
Transfer ownership to a user.
Declaration
public static bool TransferOwner(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to transfer ownership to. |
Returns
Type | Description |
---|---|
System.Boolean | True if ownership was transferred, false otherwise. |
Unban(UInt64)
Unban a player from the lobby if we are the owner. Note this applies to the lobby, not your Steam account bans.
Declaration
public static bool Unban(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the player to unban. |
Returns
Type | Description |
---|---|
System.Boolean | If the request to unban was sent. |
UnregisterTextFilter(SteamTextFilter)
Unregister a text filter.
Declaration
public static void UnregisterTextFilter(SteamTextFilter filter)
Parameters
Type | Name | Description |
---|---|---|
SteamTextFilter | filter | The text filter. |
UnregisterVoice(UInt64, ISteamVoice)
Unregister a voice listener.
Declaration
public static void UnregisterVoice(ulong id, ISteamVoice listener)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to stop receiving the voice of. |
ISteamVoice | listener | The listener to unregister. |
UnregisterVoiceFilter(SteamVoiceFilter)
Unregister a voice filter.
Declaration
public static void UnregisterVoiceFilter(SteamVoiceFilter filter)
Parameters
Type | Name | Description |
---|---|---|
SteamVoiceFilter | filter | The voice filter. |
UserGame(UInt64)
Get the ID of the game a user is playing.
Declaration
public static uint UserGame(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.UInt32 | The ID of the game a user is playing. |
UserInAnyGame(UInt64)
Get if a user is in any game.
Declaration
public static bool UserInAnyGame(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is in any game. |
UserInAnyLobby(UInt64)
Get if a user is in a lobby in this game.
Declaration
public static bool UserInAnyLobby(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | If the user is currently in our lobby or not. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is currently in a lobby in this game. |
UserInCurrentGame(UInt64)
Get if a user is in the same game as us.
Declaration
public static bool UserInCurrentGame(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is in the same game as us. |
UserInCurrentLobby(UInt64)
Get if a user is currently in your lobby.
Declaration
public static bool UserInCurrentLobby(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | If the user is currently in our lobby or not. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is currently in your lobby. |
UserInLobby(UInt64, UInt64)
Get if a user is in a given lobby in this game.
Declaration
public static bool UserInLobby(ulong id, ulong lobby)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | If the user is currently in our lobby or not. |
System.UInt64 | lobby | The ID of the lobby. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is currently in a lobby in this game. |
UserInOtherGame(UInt64)
Get if a user is in a different game then us.
Declaration
public static bool UserInOtherGame(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is in a different game then us. |
UserInOtherLobby(UInt64)
Get if a user is in another lobby in this game.
Declaration
public static bool UserInOtherLobby(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | If the user is currently in our lobby or not. |
Returns
Type | Description |
---|---|
System.Boolean | If the user is currently in another lobby in this game. |
UserLobby(UInt64)
Get the lobby a user is in.
Declaration
public static ulong UserLobby(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The user ID. |
Returns
Type | Description |
---|---|
System.UInt64 | The lobby they are in. |
UserValid(UInt64)
Check if a user is valid or not.
Declaration
public static bool UserValid(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to check. |
Returns
Type | Description |
---|---|
System.Boolean | If they are valid. |
VoiceChannelCallback(ChangeEvent<Int32>)
Callback to set the voice channel.
Declaration
public static void VoiceChannelCallback(ChangeEvent<int> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.Int32> | evt | The change event. |
VoiceRateCallback(ChangeEvent<UInt32>)
Callback to set the voice rate.
Declaration
public static void VoiceRateCallback(ChangeEvent<uint> evt)
Parameters
Type | Name | Description |
---|---|---|
ChangeEvent<System.UInt32> | evt | The change event. |
VoiceRecipientsAdd(IEnumerable<UInt64>)
Add voice recipients. The users must be in the lobby.
Declaration
public static bool VoiceRecipientsAdd(IEnumerable<ulong> ids)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.UInt64> | ids | The IDs of the users to add. |
Returns
Type | Description |
---|---|
System.Boolean | If all the recipients were added. |
VoiceRecipientsAdd(UInt64)
Add a voice recipient. The user must be in the lobby.
Declaration
public static bool VoiceRecipientsAdd(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to add. |
Returns
Type | Description |
---|---|
System.Boolean | If the recipient was added. |
VoiceRecipientsAll()
Set to have everyone receive our voice. This will ensure new players which join automatically receive our voice.
Declaration
public static void VoiceRecipientsAll()
VoiceRecipientsNobody()
Set to have nobody receive our voice.
Declaration
public static void VoiceRecipientsNobody()
VoiceRecipientsRemove(List<UInt64>)
Remove voice recipients.
Declaration
public static bool VoiceRecipientsRemove(List<ulong> ids)
Parameters
Type | Name | Description |
---|---|---|
List<System.UInt64> | ids | The IDs of the user to remove. |
Returns
Type | Description |
---|---|
System.Boolean | If all the users were listening and have now been removed. |
VoiceRecipientsRemove(UInt64)
Remove a voice recipient.
Declaration
public static bool VoiceRecipientsRemove(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to remove. |
Returns
Type | Description |
---|---|
System.Boolean | If the user was listening and now has been removed. |
VoiceRecipientsSet(IEnumerable<UInt64>)
Set the voice recipient to be a set of particular users. Users not in the lobby will be removed from the IDs.
Declaration
public static bool VoiceRecipientsSet(IEnumerable<ulong> ids)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.UInt64> | ids | The IDs of the user to set. |
Returns
Type | Description |
---|---|
System.Boolean | If the voice was set to all of them. |
VoiceRecipientsSet(UInt64)
Set the voice recipient to be a particular user. The user must be in the lobby, and if they are not it will make a new empty recipients lis instead.
Declaration
public static bool VoiceRecipientsSet(ulong id)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | id | The ID of the user to set. |
Returns
Type | Description |
---|---|
System.Boolean | If the voice was set to them. |
Events
OnChat
Called when a chat message has been sent or received.
Declaration
public static event SteamManager.ChatEventHandler OnChat
Event Type
Type | Description |
---|---|
SteamManager.ChatEventHandler |
OnDisconnect
Called when a user has left our lobby.
Declaration
public static event SteamManager.IdEventHandler OnDisconnect
Event Type
Type | Description |
---|---|
SteamManager.IdEventHandler |
OnIcon
Called when an icon has been loaded.
Declaration
public static event SteamManager.IdEventHandler OnIcon
Event Type
Type | Description |
---|---|
SteamManager.IdEventHandler |
OnInitialized
Called when Steam is initialized.
Declaration
public static event SteamManager.EmptyEventHandler OnInitialized
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |
OnJoin
Called when a user has joined our lobby.
Declaration
public static event SteamManager.IdEventHandler OnJoin
Event Type
Type | Description |
---|---|
SteamManager.IdEventHandler |
OnLobbyDataUpdate
Called when some lobby data has updated.
Declaration
public static event SteamManager.EmptyEventHandler OnLobbyDataUpdate
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |
OnOwnerChange
Called when the owner has changed to the given ID.
Declaration
public static event SteamManager.IdEventHandler OnOwnerChange
Event Type
Type | Description |
---|---|
SteamManager.IdEventHandler |
OnQuit
Called when quitting or Steam has externally quit.
Declaration
public static event SteamManager.EmptyEventHandler OnQuit
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |
OnRichPresence
Callback for when a rich presence for a user has been updated.
Declaration
public static event SteamManager.RichPresenceEventHandler OnRichPresence
Event Type
Type | Description |
---|---|
SteamManager.RichPresenceEventHandler |
OnSearchParametersChange
Called when the search parameters have changed.
Declaration
public static event SteamManager.EmptyEventHandler OnSearchParametersChange
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |
OnSearchResults
Callback for when search results arriving. The first field is lobbies of friends, and the second is public lobbies. There are no duplicates between the two lists. If currently in a lobby, it is excluded from both.
Declaration
public static event SteamManager.LobbiesEventHandler OnSearchResults
Event Type
Type | Description |
---|---|
SteamManager.LobbiesEventHandler |
OnShutdown
Called when our networking is shutting down such as leaving a lobby.
Declaration
public static event SteamManager.EmptyEventHandler OnShutdown
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |
OnStartFail
Callback for when failing to start or connect to a lobby. The ID is the lobby or friend that we failed to join. If hosting failed, this will be our ID.
Declaration
public static event SteamManager.IdEventHandler OnStartFail
Event Type
Type | Description |
---|---|
SteamManager.IdEventHandler |
OnStartMember
Called when we have connected to a lobby as a member
Declaration
public static event SteamManager.EmptyEventHandler OnStartMember
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |
OnStartOwner
Called when we have connected to a lobby as the owner.
Declaration
public static event SteamManager.EmptyEventHandler OnStartOwner
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |
OnUser
Called when information about a user has updated.
Declaration
public static event SteamManager.IdEventHandler OnUser
Event Type
Type | Description |
---|---|
SteamManager.IdEventHandler |
OnUserDataUpdate
Called when some data about the given user has updated.
Declaration
public static event SteamManager.IdEventHandler OnUserDataUpdate
Event Type
Type | Description |
---|---|
SteamManager.IdEventHandler |
OnVoiceRecipients
Callback for when our voice recipients have changed.
Declaration
public static event SteamManager.EmptyEventHandler OnVoiceRecipients
Event Type
Type | Description |
---|---|
SteamManager.EmptyEventHandler |