Packageclass

Represents an asset on Asset Party.

objectPackage
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.Package

Constructors1

Showing 1 constructors

Methods21

Showing 21 methods

public static System.Threading.Tasks.Task`1<Sandbox.Package> Fetch(string identString, bool partial)PUBLICSTATIC

Find package information

ParameterTypeDescription
identStringstring
partialbool
Returns:Task<Package>

public static System.Threading.Tasks.Task`1<System.Collections.Generic.List`1<Sandbox.Package.IRevision>> FetchVersions(string identString, System.Threading.CancellationToken token = null)PUBLICSTATIC

Get package version list

ParameterTypeDescription
identStringstring
token = nullCancellationToken
Returns:Task<List<IRevision>>

public static System.Threading.Tasks.Task`1<Sandbox.Package.FindResult> FindAsync(string query, int take = 200, int skip = 0, System.Threading.CancellationToken token = null)PUBLICSTATIC

Retrieve a list of packages

ParameterTypeDescription
querystring
take = 200int
skip = 0int
token = nullCancellationToken
Returns:Task<FindResult>

public static string FormatIdent(string org, string package, System.Nullable`1<int> version = null, bool local = False)PUBLICSTATIC

ParameterTypeDescription
orgstring
packagestring
version = nullNullable<int>
local = Falsebool
Returns:string

public static string GetCachedTitle(string ident)PUBLICSTATIC

If we have this package information, try to get its name

ParameterTypeDescription
identstring
Returns:string

public System.Threading.Tasks.Task`1<System.Collections.Immutable.ImmutableArray`1<Sandbox.Package.ChangeList>> GetChangeListsAsync(int page = 1)PUBLIC

Fetch the full, paged changelist history for this package - the in-game "what's new" notes, with each entry grouped by category. Returns a single page; call again with an incremented `page` for older entries. Returns empty if the backend is unavailable or the request fails.

ParameterTypeDescription
page = 1int
Returns:Task<ImmutableArray<ChangeList>>

public virtual T GetMeta(string keyName, T defaultValue = null)PUBLICVIRTUAL

Get metadata value from this package for given key. This will be specific to each `Sandbox.Package.Type`.

ParameterTypeDescription
keyNamestringThe name of the key to look up.
defaultValue = nullTDefault value to return when requested key was not present in the package's metadata.
Returns:T

public virtual T GetValue(string name, T defaultValue = null)PUBLICVIRTUAL

Get a data value. These are usually set on the backend, and are package type specific. These are generally values that are used to configure behaviour in the menu system.

ParameterTypeDescription
namestring
defaultValue = nullT
Returns:T

public bool IsMounted()PUBLIC

Check if the package is installed and mounted

Returns:bool

public static System.Threading.Tasks.Task`1<Sandbox.Package.ListResult> ListAsync(string id, System.Threading.CancellationToken token = null)PUBLICSTATIC

Retrieve a list of packages, organised into groups, for discovery

ParameterTypeDescription
idstring
token = nullCancellationToken
Returns:Task<ListResult>

public static bool TryGetCached(string identString, Sandbox.Package package, bool allowPartial = True)PUBLICSTATIC

Find package information

ParameterTypeDescription
identStringstring
packagePackage
allowPartial = Truebool
Returns:bool

public static bool TryParseIdent(string ident, System.ValueTuple`4<string,string,System.Nullable`1<int>,bool> parsed)PUBLICSTATIC

ParameterTypeDescription
identstring
parsedValueTuple<string,string,Nullable<int>,bool>
Returns:bool

Properties46

Showing 46 properties

public int Sandbox.Package.ApiVersion { get; set; }PUBLICGETSET

For game extension compatibility. Game targeting extensions are only compatible with that game if the API Versions match.

Returns:int

public bool Sandbox.Package.Archived { get; set; }PUBLICGETSET

Whether this package is archived or not.

Returns:bool

public string Sandbox.Package.AssetLicense { get; set; }PUBLICGETSET

The license covering this package's art/content assets, identified by name (e.g. "CC0", "CC_BY"). Null when no license is specified. Matches `PackageLicense.Name` in the license catalog, so it can be used to look up the full license details.

Returns:string

public bool Sandbox.Package.CanEdit { get; set; }PUBLICGETSET

True if we're a member of this package's organization.

Returns:bool

public int Sandbox.Package.Collections { get; set; }PUBLICGETSET

How many collections we're in (roughly)

Returns:int

public System.DateTimeOffset Sandbox.Package.Created { get; set; }PUBLICGETSET

When the package was originally created.

Returns:DateTimeOffset

public string Sandbox.Package.Description { get; set; }PUBLICGETSET

Full description of the package.

Returns:string

public string[] Sandbox.Package.EditorReferences { get; set; }PUBLICGETSET

List of packages that this package depended on during editing.

Returns:string[]

public int Sandbox.Package.EngineVersion { get; set; }PUBLICGETSET

Engine version this package was uploaded with. This is useful for when the base game undergoes large API changes.

Returns:int

public float Sandbox.Package.ErrorRate { get; set; }PUBLICGETSET

What fraction of users got errors from this package in the last day

Returns:float

public int Sandbox.Package.Favourited { get; set; }PUBLICGETSET

Number of players who added this package to their favourites.

Returns:int

public float Sandbox.Package.FileSize { get; set; }PUBLICGETSET

The total size of this package in MB. This only applies to packages from Asset Party, the total file size of local packages are not calculated.

Returns:float

public System.Collections.Immutable.ImmutableArray`1<Sandbox.Package.PackageFlair> Sandbox.Package.Flair { get; set; }PUBLICGETSET

Small icon badges shown over the package's thumbnail - workshop-approved, updated-since-you-played, favourited, contest-winner, etc. Computed on the backend when the package is served. Never default; empty when there's no flair.

Returns:ImmutableArray<PackageFlair>

public string Sandbox.Package.FullIdent { get; set; }PUBLICGETSET

Full unique identity of this package.

Returns:string

public string Sandbox.Package.Ident { get; set; }PUBLICGETSET

Unique identity of this package within its organization..

Returns:string

public Sandbox.Package.PackageInteraction Sandbox.Package.Interaction { get; set; }PUBLICGETSET

Describes the authenticated user's interactions with this package. This is only available clientside for specific users in order to show things like play history state, favourite status and whether they have rated the item or not.

public bool Sandbox.Package.IsFavourite { get; set; }PUBLICGETSET

True if this asset is in our favourite list.

Returns:bool

public virtual bool Sandbox.Package.IsRemote { get; set; }PUBLICVIRTUALGETSET

Whether this is a remote or a locally installed package.

Returns:bool

public System.Collections.Immutable.ImmutableArray`1<Sandbox.Package.ChangeListSummary> Sandbox.Package.LatestChangeLists { get; set; }PUBLICGETSET

The most recent visible changelists for this package (summary only - id/title/version/date). Full detail is available via `Sandbox.Package.GetChangeListsAsync(System.Int32)`. Never default; empty when there are none.

Returns:ImmutableArray<ChangeListSummary>

public Sandbox.Services.News Sandbox.Package.LatestNewsPost { get; set; }PUBLICGETSET

The latest news post created by this package

Returns:News

public Sandbox.Package.AssetMetaData Sandbox.Package.Metadata { get; set; }PUBLICGETSET

Server-extracted metadata for the current version's compiled asset (model stats, material flags, clothing info, ...). Null if the version hasn't been processed or its type isn't recognised. Pattern-match the concrete type, e.g. `if ( package.Metadata is Package.ModelMetaData m )`.

Returns:AssetMetaData

public Sandbox.Package.Organization Sandbox.Package.Org { get; set; }PUBLICGETSET

The owner of this package.

Returns:Organization

public string[] Sandbox.Package.PackageReferences { get; set; }PUBLICGETSET

List of packages that this package depends on. These will be downloaded and installed when installing this package.

Returns:string[]

public Sandbox.Package.Type Sandbox.Package.PackageType { get; set; }PUBLICGETSETOBSOLETE

What kind of package it is.

Obsolete: Use TypeName to determine the type

Returns:Type

public string Sandbox.Package.PrimaryAsset { get; set; }PUBLICGETSET

Gets the name of the primary asset path stored in the package metadata. This could be null or empty.

Returns:string

public bool Sandbox.Package.Public { get; set; }PUBLICGETSET

Whether this package is public or hidden.

Returns:bool

public int Sandbox.Package.Referenced { get; set; }PUBLICGETSET

How many packages we're referenced by (roughly)

Returns:int

public int Sandbox.Package.Referencing { get; set; }PUBLICGETSET

How many packages we're referencing (roughly)

Returns:int

public Sandbox.Package.ReviewStats Sandbox.Package.Reviews { get; set; }PUBLICGETSET

Stats for the reviews. Gives the number of reviews, and the fraction of the total score.

Returns:ReviewStats

public virtual Sandbox.Package.IRevision Sandbox.Package.Revision { get; set; }PUBLICVIRTUALGETSET

Information about the current package revision/version.

Returns:IRevision

public string Sandbox.Package.Source { get; set; }PUBLICGETSETOBSOLETE

Link to this package's sources, if set.

Obsolete: This API member is obsolete.

Returns:string

public string Sandbox.Package.Summary { get; set; }PUBLICGETSET

A short summary of the package.

Returns:string

public virtual string[] Sandbox.Package.Tags { get; set; }PUBLICVIRTUALGETSET

List of tags for this package.

Returns:string[]

public string Sandbox.Package.Thumb { get; set; }PUBLICGETSET

Link to the thumbnail image of this package.

Returns:string

public string Sandbox.Package.ThumbTall { get; set; }PUBLICGETSET

Link to the thumbnail image of this package.

Returns:string

public string Sandbox.Package.ThumbWide { get; set; }PUBLICGETSET

Link to the thumbnail image of this package.

Returns:string

public string Sandbox.Package.Title { get; set; }PUBLICGETSET

A "nice" name of this package, which will be shown to players in UI.

Returns:string

public string Sandbox.Package.TypeName { get; set; }PUBLICGETSET

What kind of package it is.

Returns:string

public System.DateTimeOffset Sandbox.Package.Updated { get; set; }PUBLICGETSETPER-FRAME

When the entry was last updated. If these are different between packages then something updated on the backend.

Returns:DateTimeOffset

public string Sandbox.Package.Url { get; set; }PUBLICGETSET

A link to this asset on our backend

Returns:string

public string Sandbox.Package.VideoThumb { get; set; }PUBLICGETSET

Link to the thumbnail video of this package.

Returns:string

public int Sandbox.Package.VotesDown { get; set; }PUBLICGETSET

Number of players who voted this package down.

Returns:int

public int Sandbox.Package.VotesUp { get; set; }PUBLICGETSET

Number of players who voted this package up.

Returns:int

On this page

Constructorspublic Package()Methodspublic static System.Threading.Tasks.Task`1<Sandbox.Package> Fetch(System.String identString, System.Boolean partial)public static System.Threading.Tasks.Task`1<Sandbox.Package> FetchAsync(System.String identString, System.Boolean partial, System.Boolean useCache)public static System.Threading.Tasks.Task`1<Sandbox.Package> FetchAsync(System.String identString, System.Boolean partial)public static System.Threading.Tasks.Task`1<System.Collections.Generic.List`1<Sandbox.Package.IRevision>> FetchVersions(System.String identString, System.Threading.CancellationToken token = null)public static System.Threading.Tasks.Task`1<Sandbox.Package.FindResult> FindAsync(System.String query, System.Int32 take = 200, System.Int32 skip = 0, System.Threading.CancellationToken token = null)public static System.String FormatIdent(System.String org, System.String package, System.Nullable`1<System.Int32> version = null, System.Boolean local = False)public System.Threading.Tasks.ValueTask`1<Sandbox.AchievementCollection> GetAchievements()public T GetCachedMeta(System.String keyName, T defaultValue = null)public T GetCachedMeta(System.String keyName, System.Func`1<T> defaultValue)public static System.String GetCachedTitle(System.String ident)public System.Threading.Tasks.Task`1<System.Collections.Immutable.ImmutableArray`1<Sandbox.Package.ChangeList>> GetChangeListsAsync(System.Int32 page = 1)public virtual T GetMeta(System.String keyName, T defaultValue = null)public virtual T GetValue(System.String name, T defaultValue = null)public System.Boolean IsMounted()public static System.Threading.Tasks.Task`1<Sandbox.Package.ListResult> ListAsync(System.String id, System.Threading.CancellationToken token = null)public System.Threading.Tasks.Task`1<Sandbox.BaseFileSystem> MountAsync(System.Boolean withCode = False)public static System.Threading.Tasks.Task`1<Sandbox.Package> MountAsync(System.String identString, System.Boolean partial)public static System.Collections.Generic.IEnumerable`1<Sandbox.Package> SortByReferences(System.Collections.Generic.IEnumerable`1<Sandbox.Package> unordered)public static System.Collections.Generic.IEnumerable`1<T> SortByReferences(System.Collections.Generic.IEnumerable`1<T> unordered, System.Func`2<T,Sandbox.Package> getPackageFunc)public static System.Boolean TryGetCached(System.String identString, Sandbox.Package package, System.Boolean allowPartial = True)public static System.Boolean TryParseIdent(System.String ident, System.ValueTuple`4<System.String,System.String,System.Nullable`1<System.Int32>,System.Boolean> parsed)Propertiespublic System.Int32 Sandbox.Package.ApiVersion { get; set; }public System.Boolean Sandbox.Package.Archived { get; set; }public System.String Sandbox.Package.AssetLicense { get; set; }public System.Boolean Sandbox.Package.CanEdit { get; set; }public System.Int32 Sandbox.Package.Collections { get; set; }public System.DateTimeOffset Sandbox.Package.Created { get; set; }public System.String Sandbox.Package.Description { get; set; }public System.String[] Sandbox.Package.EditorReferences { get; set; }public System.Int32 Sandbox.Package.EngineVersion { get; set; }public System.Single Sandbox.Package.ErrorRate { get; set; }public System.Int32 Sandbox.Package.Favourited { get; set; }public System.Single Sandbox.Package.FileSize { get; set; }public System.Collections.Immutable.ImmutableArray`1<Sandbox.Package.PackageFlair> Sandbox.Package.Flair { get; set; }public System.String Sandbox.Package.FullIdent { get; set; }public System.String Sandbox.Package.Ident { get; set; }public Sandbox.Package.PackageInteraction Sandbox.Package.Interaction { get; set; }public System.Boolean Sandbox.Package.IsFavourite { get; set; }public virtual System.Boolean Sandbox.Package.IsRemote { get; set; }public System.Collections.Immutable.ImmutableArray`1<Sandbox.Package.ChangeListSummary> Sandbox.Package.LatestChangeLists { get; set; }public Sandbox.Services.News Sandbox.Package.LatestNewsPost { get; set; }public Sandbox.Package.LoadingScreenSetup Sandbox.Package.LoadingScreen { get; set; }public Sandbox.Package.AssetMetaData Sandbox.Package.Metadata { get; set; }public Sandbox.Package.Organization Sandbox.Package.Org { get; set; }public System.String[] Sandbox.Package.PackageReferences { get; set; }public Sandbox.Package.Type Sandbox.Package.PackageType { get; set; }public System.String Sandbox.Package.PrimaryAsset { get; set; }public System.Boolean Sandbox.Package.Public { get; set; }public System.Int32 Sandbox.Package.Referenced { get; set; }public System.Int32 Sandbox.Package.Referencing { get; set; }public Sandbox.Package.ReviewStats Sandbox.Package.Reviews { get; set; }public virtual Sandbox.Package.IRevision Sandbox.Package.Revision { get; set; }public Sandbox.Package.Screenshot[] Sandbox.Package.Screenshots { get; set; }public System.String Sandbox.Package.Source { get; set; }public System.String Sandbox.Package.Summary { get; set; }public virtual System.String[] Sandbox.Package.Tags { get; set; }public System.String Sandbox.Package.Thumb { get; set; }public System.String Sandbox.Package.ThumbTall { get; set; }public System.String Sandbox.Package.ThumbWide { get; set; }public System.String Sandbox.Package.Title { get; set; }public System.String Sandbox.Package.TypeName { get; set; }public System.DateTimeOffset Sandbox.Package.Updated { get; set; }public System.String Sandbox.Package.Url { get; set; }public Sandbox.Package.PackageUsageStats Sandbox.Package.Usage { get; set; }public System.String Sandbox.Package.VideoThumb { get; set; }public System.Int32 Sandbox.Package.VotesDown { get; set; }public System.Int32 Sandbox.Package.VotesUp { get; set; }Metadata