From 6aa5bcf1acef0a5c9be3b0323b337b561bdc7843 Mon Sep 17 00:00:00 2001 From: Kyle Kukshtel Date: Mon, 31 Jul 2017 23:54:32 -0700 Subject: [PATCH] Updates Readme with basic Lobby Info --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index ee7bc17..8b170ac 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,33 @@ var server = new Facepunch.Steamworks.Server( 252490, 0, 28015, true, "MyGame453 This will register a secure server for game 252490, any ip, port 28015. Again, more usage in the Facepunch.Steamworks.Test project. +## Lobby + +To create a Lobby do this. +```csharp +var client = new Facepunch.Steamworks.Client( 252490 ); +client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); +``` + +Created lobbies are auto-joined, but if you want to find a friend's lobby, you'd call +```csharp +client.LobbyList.Refresh(); +//wait for the callback +client.LobbyList.OnLobbiesUpdated = () => +{ + if (client.LobbyList.Finished) + { + foreach (LobbyList.Lobby lobby in client.LobbyList.Lobbies) + { + Console.WriteLine($"Found Lobby: {lobby.Name}"); + } + } +}; +//join a lobby you found +client.Lobby.Join(LobbyList.Lobbies[0]); +``` + + # Unity Yeah this works under Unity. That's half the point of it.