From 5067c32eedc7791d58eab610401ff48110821758 Mon Sep 17 00:00:00 2001 From: Kyle Kukshtel Date: Mon, 7 Aug 2017 09:24:28 -0700 Subject: [PATCH] Small README update and adjusts doc tags for Lobby functions. --- Facepunch.Steamworks/Client/Lobby.cs | 39 +++++++++++++++++++++++++--- README.md | 5 ++-- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs index fb11536..1d20130 100644 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ b/Facepunch.Steamworks/Client/Lobby.cs @@ -49,6 +49,9 @@ public Lobby(Client c) /// public ulong CurrentLobby { get; private set; } + /// + /// The LobbyData of the CurrentLobby. Note this is the global data for the lobby. Use SetMemberData to set specific member data. + /// public LobbyData CurrentLobbyData { get; private set; } /// @@ -139,6 +142,11 @@ public LobbyData(Client c, ulong l) data = new Dictionary(); } + /// + /// Get the lobby value for the specific key + /// + /// The key to find + /// The value at key public string GetData(string k) { if (data.ContainsKey(k)) @@ -149,16 +157,26 @@ public string GetData(string k) return "ERROR: key not found"; } - public List> GetAllData() + /// + /// Get a list of all the data in the Lobby + /// + /// Dictionary of all the key/value pairs in the data + public Dictionary GetAllData() { - List> returnData = new List>(); + Dictionary returnData = new Dictionary(); foreach(KeyValuePair item in data) { - returnData.Add(new KeyValuePair(item.Key, item.Value)); + returnData.Add(item.Key, item.Value); } return returnData; } + /// + /// Set the value for specified Key. Note that the keys "joinable", "appid", "name", and "lobbytype" are reserved for internal library use. + /// + /// The key to set the value for + /// The value of the Key + /// True if data successfully set public bool SetData(string k, string v) { if (data.ContainsKey(k)) @@ -182,6 +200,11 @@ public bool SetData(string k, string v) return false; } + /// + /// Remove the key from the LobbyData. Note that the keys "joinable", "appid", "name", and "lobbytype" are reserved for internal library use. + /// + /// The key to remove + /// True if Key successfully removed public bool RemoveData(string k) { if (data.ContainsKey(k)) @@ -339,6 +362,9 @@ public unsafe bool SendChatMessage(string message) } } + /// + /// Enums to catch the state of a user when their state has changed + /// public enum MemberStateChange { Entered = ChatMemberStateChange.Entered, @@ -490,6 +516,11 @@ public ulong[] GetMemberIDs() return memIDs; } + /// + /// Check to see if a user is in your CurrentLobby + /// + /// SteamID of the user to check for + /// public bool UserIsInCurrentLobby(ulong steamID) { if(CurrentLobby == 0) { return false; } @@ -527,7 +558,7 @@ internal void OnUserInvitedToLobbyAPI(LobbyInvite_t callback, bool error) public Action OnUserInvitedToLobby; /// - /// Joins a lobby is a request was made to join the lobby through the friends list or an invite + /// Joins a lobby if a request was made to join the lobby through the friends list or an invite /// internal void OnLobbyJoinRequestedAPI(GameLobbyJoinRequested_t callback, bool error) { diff --git a/README.md b/README.md index 8b170ac..30d4f9e 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ You can view examples of everything in the Facepunch.Steamworks.Test project. ## Client -Compile and add the library to your project. To create a client you can do this. +Compile the Facepunch.Steamworks project and add the library to your Unity project. To create a client you can do this. ```csharp var client = new Facepunch.Steamworks.Client( 252490 ); @@ -72,7 +72,6 @@ This will register a secure server for game 252490, any ip, port 28015. Again, m To create a Lobby do this. ```csharp -var client = new Facepunch.Steamworks.Client( 252490 ); client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); ``` @@ -94,6 +93,8 @@ client.LobbyList.OnLobbiesUpdated = () => client.Lobby.Join(LobbyList.Lobbies[0]); ``` +Your can find more examples of Lobby functionality in the Lobby.cs file in the test project. Sending chat messages, assinging lobby data and member data, etc. + # Unity