mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
Updates Readme with basic Lobby Info
This commit is contained in:
parent
a1f24c5f24
commit
6aa5bcf1ac
27
README.md
27
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.
|
||||
|
Loading…
Reference in New Issue
Block a user