PartyRoomclass

A Party. A Party with your friends.

object→PartyRoom
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.PartyRoom

Methods19

Showing 19 methods

public void CancelJoin()PUBLIC

Cancel a download, wait for the leader, or connection attempt while staying in the party. Does nothing in other stages, including after joining. Must be called on the main thread.

Returns:void—

public void ConfigureGame(string gameIdent, Sandbox.Modals.CreateGameResults settings)PUBLIC

Save the setup for the currently selected game. Only the leader can change it.

ParameterTypeDescription
gameIdentstring—
settingsCreateGameResults—
Returns:void—

public static System.Threading.Tasks.Task`1<Sandbox.PartyRoom.Entry[]> Find()PUBLICSTATIC

Find open parties with space for another member.

Returns:Task<Entry[]>—

public static System.Threading.Tasks.Task`1<System.Nullable`1<Sandbox.PartyRoom.Entry>> GetEntryAsync(ulong id)PUBLICSTATIC

Refresh a party's details without joining it. Returns null if it is no longer available.

ParameterTypeDescription
idulong—
Returns:Task<Nullable<Entry>>—

public Sandbox.PartyRoom.MemberStatus GetMemberStatus(Sandbox.Friend member)PUBLIC

What this party member is doing - downloading the game, waiting, in it. Each member shares their own through the lobby, so this is at most half a second old.

ParameterTypeDescription
memberFriend—
Returns:MemberStatus—

public bool IsGameSelected(Sandbox.Package package)PUBLIC

Whether this package matches the chosen game, including its revision when one was selected.

ParameterTypeDescription
packagePackage—
Returns:bool—

public bool IsMemberReady(Sandbox.Friend member)PUBLIC

Whether this member is ready for the current game setup. The leader starts the game instead.

ParameterTypeDescription
memberFriend—
Returns:bool—

public static System.Threading.Tasks.Task`1<bool> Join(ulong id)PUBLICSTATIC

Join a party by its identifier, checking that it still exists and is a party.

ParameterTypeDescription
idulong—
Returns:Task<bool>—

public void Kick(Sandbox.SteamId friend)PUBLIC

Kick a member from the party. Only the owner can kick members.

ParameterTypeDescription
friendSteamId—
Returns:void—

public void Leave()PUBLIC

Leave this party and stop following its leader.

Returns:void—

public void MakePublic()PUBLIC

Make this party discoverable and joinable by everyone. Only the leader can do this.

Returns:void—

public void RetryJoin()PUBLIC

Retry a failed or cancelled join on the next party update. Does nothing in other stages. Must be called on the main thread.

Returns:void—

public void SelectGame(Sandbox.Package package)PUBLIC

Publish the leader's choice of game. Pass null to clear the choice.

ParameterTypeDescription
packagePackage—
Returns:void—

public void SendChatMessage(string text)PUBLIC

ParameterTypeDescription
textstring—
Returns:void—

public bool SetOwner(Sandbox.SteamId friend)PUBLIC

Set the owner to someone else. You need to be the owner

ParameterTypeDescription
friendSteamId—
Returns:bool—

public void SetPublic(bool isPublic)PUBLIC

Switch between a public party and an invitation-only party. Only the leader can do this.

ParameterTypeDescription
isPublicbool—
Returns:void—

public void SetReady(bool ready)PUBLIC

Share whether the local member is ready for the selected game and its saved settings. Changing the setup clears everyone's readiness.

ParameterTypeDescription
readybool—
Returns:void—

Properties24

Showing 24 properties

public static Sandbox.PartyRoom Sandbox.PartyRoom.Current { get; set; }PUBLICSTATICGETSET

The party we currently belong to, if any.

Returns:PartyRoom—

public System.Nullable`1<Sandbox.Menu.LoadingProgress> Sandbox.PartyRoom.DownloadProgress { get; set; }PUBLICGETSET

A snapshot of this player's current download progress, or null when unavailable.

Returns:Nullable<LoadingProgress>—

public System.Nullable`1<Sandbox.Menu.LoadingProgress> Sandbox.PartyRoom.HostDownloadProgress { get; set; }PUBLICGETSET

A snapshot of the leader's download progress, separate from this player's download. Null when the leader is not loading or has not reported valid progress.

Returns:Nullable<LoadingProgress>—

public Sandbox.SteamId Sandbox.PartyRoom.Id { get; set; }PUBLICGETSET

The unique identifier of this party.

Returns:SteamId—

public bool Sandbox.PartyRoom.IsPublic { get; set; }PUBLICGETSET

Whether this party is discoverable and joinable by everyone.

Returns:bool—

public string Sandbox.PartyRoom.JoinError { get; set; }PUBLICGETSET

A human-readable failure message, or null when there is no failure. Do not use it to determine the join stage.

Returns:string—

public Sandbox.PartyRoom.JoinStage Sandbox.PartyRoom.JoiningStage { get; set; }PUBLICGETSET

The local follower's join stage, or `Sandbox.PartyRoom.JoinStage.None` when no attempt exists.

Returns:JoinStage—

public int Sandbox.PartyRoom.MaxMembers { get; set; }PUBLICGETSET

The maximum number of members allowed in this party.

Returns:int—

public int Sandbox.PartyRoom.MemberCount { get; set; }PUBLICGETSET

The current number of members in this party.

Returns:int—

public System.Collections.Generic.IEnumerable`1<Sandbox.Friend> Sandbox.PartyRoom.Members { get; set; }PUBLICGETSET

A list of members in this party.

Returns:IEnumerable<Friend>—

public string Sandbox.PartyRoom.Name { get; set; }PUBLICGETSET

The party name, filtered using the local player's chat filter settings. Only the leader can change it.

Returns:string—

public System.Action`2<Sandbox.Friend,string> Sandbox.PartyRoom.OnChatMessage { get; set; }PUBLICGETSET

Returns:Action<Friend,string>—

public System.Action`1<Sandbox.Friend> Sandbox.PartyRoom.OnJoin { get; set; }PUBLICGETSET

Returns:Action<Friend>—

public System.Action`1<Sandbox.Friend> Sandbox.PartyRoom.OnLeave { get; set; }PUBLICGETSET

Returns:Action<Friend>—

public System.Action`2<Sandbox.Friend,byte[]> Sandbox.PartyRoom.OnVoiceData { get; set; }PUBLICGETSET

Returns:Action<Friend,byte[]>—

public Sandbox.Friend Sandbox.PartyRoom.Owner { get; set; }PUBLICGETSET

The current party leader.

Returns:Friend—

public string Sandbox.PartyRoom.PackageIdent { get; set; }PUBLICGETSET

What package is this party's owner playing?

Returns:string—

public string Sandbox.PartyRoom.PackageTitle { get; set; }PUBLICGETSET

The game title advertised by the party leader, which may be empty.

Returns:string—

public string Sandbox.PartyRoom.SelectedGameIdent { get; set; }PUBLICGETSET

The game the party intends to play, without starting downloads or following the leader.

Returns:string—

public System.Nullable`1<Sandbox.Modals.CreateGameResults> Sandbox.PartyRoom.SelectedGameSettings { get; set; }PUBLICGETSET

A copy of the leader's saved setup for the selected game, or null if it has not been configured.

Returns:Nullable<CreateGameResults>—

public string Sandbox.PartyRoom.SelectedGameTitle { get; set; }PUBLICGETSET

The title of the game the party intends to play.

Returns:string—

public bool Sandbox.PartyRoom.VoiceCommunicationAllowed { get; set; }PUBLICGETSET

Allow communication via voice when in the main menu.

Returns:bool—

public bool Sandbox.PartyRoom.VoiceRecording { get; set; }PUBLICGETSET

Whether we are recording voice for the party.

Returns:bool—

On this page

Methodspublic System.Void CancelJoin()public System.Void ConfigureGame(System.String gameIdent, Sandbox.Modals.CreateGameResults settings)public static System.Threading.Tasks.Task`1<Sandbox.PartyRoom> Create(System.Int32 maxMembers, System.String name, System.Boolean ispublic)public static System.Threading.Tasks.Task`1<Sandbox.PartyRoom> Create(System.Int32 maxMembers)public static System.Threading.Tasks.Task`1<Sandbox.PartyRoom.Entry[]> Find()public static System.Threading.Tasks.Task`1<System.Nullable`1<Sandbox.PartyRoom.Entry>> GetEntryAsync(System.UInt64 id)public Sandbox.PartyRoom.MemberStatus GetMemberStatus(Sandbox.Friend member)public System.Boolean IsGameSelected(Sandbox.Package package)public System.Boolean IsMemberReady(Sandbox.Friend member)public static System.Threading.Tasks.Task`1<System.Boolean> Join(System.UInt64 id)public System.Void Kick(Sandbox.SteamId friend)public System.Void Leave()public System.Void MakePublic()public System.Void RetryJoin()public System.Void SelectGame(Sandbox.Package package)public System.Void SendChatMessage(System.String text)public System.Boolean SetOwner(Sandbox.SteamId friend)public System.Void SetPublic(System.Boolean isPublic)public System.Void SetReady(System.Boolean ready)Propertiespublic static Sandbox.PartyRoom Sandbox.PartyRoom.Current { get; set; }public System.Nullable`1<Sandbox.Menu.LoadingProgress> Sandbox.PartyRoom.DownloadProgress { get; set; }public System.Nullable`1<Sandbox.Menu.LoadingProgress> Sandbox.PartyRoom.HostDownloadProgress { get; set; }public Sandbox.SteamId Sandbox.PartyRoom.Id { get; set; }public System.Boolean Sandbox.PartyRoom.IsPublic { get; set; }public System.String Sandbox.PartyRoom.JoinError { get; set; }public Sandbox.PartyRoom.JoinStage Sandbox.PartyRoom.JoiningStage { get; set; }public Sandbox.PartyRoom.OwnerJoinState Sandbox.PartyRoom.JoinState { get; set; }public System.Int32 Sandbox.PartyRoom.MaxMembers { get; set; }public System.Int32 Sandbox.PartyRoom.MemberCount { get; set; }public System.Collections.Generic.IEnumerable`1<Sandbox.Friend> Sandbox.PartyRoom.Members { get; set; }public System.String Sandbox.PartyRoom.Name { get; set; }public System.Action`2<Sandbox.Friend,System.String> Sandbox.PartyRoom.OnChatMessage { get; set; }public System.Action`1<Sandbox.Friend> Sandbox.PartyRoom.OnJoin { get; set; }public System.Action`1<Sandbox.Friend> Sandbox.PartyRoom.OnLeave { get; set; }public System.Action`2<Sandbox.Friend,System.Byte[]> Sandbox.PartyRoom.OnVoiceData { get; set; }public Sandbox.Friend Sandbox.PartyRoom.Owner { get; set; }public System.String Sandbox.PartyRoom.PackageIdent { get; set; }public System.String Sandbox.PartyRoom.PackageTitle { get; set; }public System.String Sandbox.PartyRoom.SelectedGameIdent { get; set; }public System.Nullable`1<Sandbox.Modals.CreateGameResults> Sandbox.PartyRoom.SelectedGameSettings { get; set; }public System.String Sandbox.PartyRoom.SelectedGameTitle { get; set; }public System.Boolean Sandbox.PartyRoom.VoiceCommunicationAllowed { get; set; }public System.Boolean Sandbox.PartyRoom.VoiceRecording { get; set; }Metadata