Lobby Member

Definition

1
public struct LobbyManager
Copied!
Represents a user in a given lobby.
This structure does not store any data locally, it is simply a means by which you can simplify the reading and writing of data to and from a LobbyMember ...
For example to read the metadata of a field on a user you typically need to know the Lobby's ID and the User's ID and then call the API such as
1
var value = API.Matchmaking.Client.GetLobbyMemberData(lobby, user, metadataKey);
Copied!
As you can see this is long and easily make a mistake with and so by using this tool we can simplify that as.
1
var value = lobbyMember[metadataKey];
Copied!
You can get a list of the LobbyMember's in a Lobby or you can create the LobbyMember assuming you know the Lobby ID and the User's ID i.e.
1
var myMember = new LobbyMember { lobby = thisLobby, user = UserData.Me };
Copied!
Is the exsact same data as
1
var myMember = thisLobby.User;
Copied!
which is the same data as
1
var myMember = thisLobby.Members.First(p => p.user = UserData.Me);
Copied!

Fields and Attributes

lobby

The ID of the lobby this member is a member of
1
public Lobby lobby;
Copied!

user

The ID of the user this represents
1
public UserData user;
Copied!

IsReady

A shortcut to read or write the user's lobby member metadata for the field z_heathenReady
1
public bool IsReady { get; set; }
Copied!
This is the same as calling
1
lobbyMember["z_heathenReady"] = value.ToString();
Copied!
to set a value or
1
var valueAsBool = bool.Parse(lobbyMember["z_heathenReady"]);
Copied!
The read the value as a bool

GameVersion

A shortcut to read or write the user's lobby member metadata for the field z_heathenGameVersion
This is the same as calling
1
lobbyMember["z_heathenGameVersion"] = versionAsString;
Copied!
to set a value or
1
var versionAsString = bool.Parse(lobbyMember["z_heathenGameVersion"]);
Copied!
The read the value as a bool

Methods

1
public string this[string key];
Copied!
Can be used to get or set metadata values on this user. Only the user its self can set metadata values.
1
public void Kick();
Copied!
Kick this user from this lobby using the Heathen Kick list