Updates Readme with basic Lobby Info

This commit is contained in:
Kyle Kukshtel 2017-07-31 23:54:32 -07:00
parent a1f24c5f24
commit 6aa5bcf1ac

View File

@ -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. 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 # Unity
Yeah this works under Unity. That's half the point of it. Yeah this works under Unity. That's half the point of it.