Skip to main content

Builder

Modio.Mods.Builder​

TypeDescription
ModBuilderA programmatic interface for Creating a new Mod. This class will handle all the publishing tasks that need to be performed intelligently, minimizing the amount of requests made.
ModfileBuilder

ModBuilder​

public class ModBuilder

A programmatic interface for Creating a new Mod. This class will handle all the publishing tasks that need to be performed intelligently, minimizing the amount of requests made.

Remarks​

When editing a mod these properties will not be populated: LogoFilePath, GalleryFilePaths, LogoFilePath

Property​

List Results​

public List<(ChangeFlags, Error)> Results

Produces a list of Tuples with each published change & their corresponding result.

string Name​

public string Name

get

string Summary​

public string Summary

get

string Description​

public string Description

get

string LogoFilePath​

public string LogoFilePath

get

string GalleryFilePaths​

public string[] GalleryFilePaths

get

int GalleryByteArraysCount​

public int GalleryByteArraysCount

string Tags​

public string[] Tags

get

string MetadataBlob​

public string MetadataBlob

get

Dictionary MetadataKvps​

public Dictionary<string, string> MetadataKvps

get

List Dependencies​

public List<long> Dependencies

get

bool Visible​

public bool Visible

get

ModMaturityOptions MaturityOptions​

public ModMaturityOptions MaturityOptions

get

ModCommunityOptions CommunityOptions​

public ModCommunityOptions CommunityOptions

get

bool IsMonetized​

public bool IsMonetized

get

List MonetizationTeam​

public List<(long userId, int split)> MonetizationTeam

bool IsLimitedStock​

public bool IsLimitedStock

get

int Price​

public int Price

get

int Stock​

public int Stock

get

bool IsEditMode​

public bool IsEditMode

Mod EditTarget​

public Mod EditTarget

get

Method​

SetName​

public ModBuilder SetName(string name)

SetNameId​

public ModBuilder SetNameId(string nameId)

SetSummary​

public ModBuilder SetSummary(string summary)

SetDescription​

public ModBuilder SetDescription(string description)

SetTags​

public ModBuilder SetTags(ICollection<string> tags)
Remarks​

This will overwrite all tags on the mod.

SetTags​

public ModBuilder SetTags(string tag)
Remarks​

This will overwrite all tags on the mod.

AppendTags​

public ModBuilder AppendTags(ICollection<string> tags)

AppendTags​

public ModBuilder AppendTags(string tag)

SetMetadataBlob​

public ModBuilder SetMetadataBlob(string data)

AppendMetadataBlob​

public ModBuilder AppendMetadataBlob(string data)

SetMetadataKvps​

public ModBuilder SetMetadataKvps(Dictionary<string, string> kvps)
Remarks​

This will overwrite any Key entered with the corresponding value.

public ModBuilder SetLogo(string logoFilePath)
public ModBuilder SetLogo(byte[] imageData, ImageFormat format)

SetGallery​

public ModBuilder SetGallery(ICollection<string> galleryImageFilePaths)

Set the gallery images for this mod, overwriting existing gallery images on the mod.io API to just what's uploaded.

Parameters​

galleryImageFilePaths A collection of file paths to upload the images from.

Remarks​

Can be used alongside SetGallery(byte[]) with images from both sources uploaded.

SetGallery​

public ModBuilder SetGallery(string galleryImageFilePath)

Set the gallery image for this mod, overwriting existing gallery images on the mod.io API to just what's uploaded.

Parameters​

galleryImageFilePath A file path to upload the image from.

Remarks​

Can be used alongside SetGallery(byte[]) with images from both sources uploaded.

AppendGallery​

public ModBuilder AppendGallery(ICollection<string> galleryImageFilePaths)

Upload the provided gallery images to this mod, preserving images already previously uploaded to the mod.io API.

Parameters​

galleryImageFilePaths A file path to upload the image from.

Remarks​

Can be used alongside AppendGallery(byte[]) with images from both sources uploaded.

AppendGallery​

public ModBuilder AppendGallery(string galleryImageFilePath)

Upload the provided gallery images to this mod, preserving images already previously uploaded to the mod.io API.

Parameters​

galleryImageFilePath A file path to upload the image from.

Remarks​

Can be used alongside AppendGallery(byte[]) with images from both sources uploaded.

SetGallery​

public ModBuilder SetGallery(byte[] galleryImageByteArray, ImageFormat format)

Set the gallery image for this mod, overwriting existing gallery images on the mod.io API to just what's uploaded.

Parameters​

galleryImageByteArray A byte array of the encoded image bytes to upload.

Remarks​

Can be used alongside SetGallery(string) with images from both sources uploaded.

SetGallery​

public ModBuilder SetGallery(ICollection<byte[]> galleryImageByteArrays, ImageFormat format)

Set the gallery images for this mod, overwriting existing gallery images on the mod.io API to just what's uploaded.

Parameters​

galleryImageByteArrays A collection of byte arrays of the encoded image bytes to upload.

Remarks​

Can be used alongside SetGallery(string) with images from both sources uploaded.

AppendGallery​

public ModBuilder AppendGallery(byte[] galleryImageByteArray, ImageFormat format)

Upload the provided gallery images to this mod, preserving images already previously uploaded to the mod.io API.

Parameters​

galleryImageByteArray A byte array of the encoded image bytes to upload.

Remarks​

Can be used alongside AppendGallery(string) with images from both sources uploaded.

AppendGallery​

public ModBuilder AppendGallery(ICollection<byte[]> galleryImageByteArrays, ImageFormat format)

Upload the provided gallery images to this mod, preserving images already previously uploaded to the mod.io API.

Parameters​

galleryImageByteArrays A collection of byte arrays of the encoded image bytes to upload.

Remarks​

Can be used alongside AppendGallery(string) with images from both sources uploaded.

SetDependencies​

public ModBuilder SetDependencies(ICollection<long> dependencies)
Remarks​

Will overwrite existing dependencies.

SetDependencies​

public ModBuilder SetDependencies(long dependency)
Remarks​

Will overwrite existing dependencies.

AppendDependencies​

public ModBuilder AppendDependencies(ICollection<long> dependencies)

AppendDependencies​

public ModBuilder AppendDependencies(long dependency)

EditModfile​

public ModfileBuilder EditModfile()

SetVisible​

public ModBuilder SetVisible(bool isVisible)

SetMaturityOptions​

public ModBuilder SetMaturityOptions(ModMaturityOptions maturityOptions)

OverwriteMaturityOptions​

public ModBuilder OverwriteMaturityOptions(ModMaturityOptions maturityOptions)

SetCommunityOptions​

public ModBuilder SetCommunityOptions(ModCommunityOptions communityOptions)

OverwriteCommunityOptions​

public ModBuilder OverwriteCommunityOptions(ModCommunityOptions communityOptions)

SetMonetized​

public ModBuilder SetMonetized(bool isMonetized)

SetPrice​

public ModBuilder SetPrice(int price)

Setting this to 0 or below will disable monetization completely for this mod

SetStockAmount​

public ModBuilder SetStockAmount(int stockAmount)

Set this to 0 or below to disable limited stock

SetTeamMemberSplit​

public ModBuilder SetTeamMemberSplit(long userId, int split)

Set the earning split for a single team member

Parameters​

split Number between 0 to 1 to represent the propertion of split given to the user

Remarks​

Will overwrite existing split for the user. Total splits cannot exceed 100.

SetTeamMembersSplits​

public ModBuilder SetTeamMembersSplits(IEnumerable<(long userId, int split)> teamMembers)

Set the monetization team and their earning splits

Parameters​

teamMembers.split Number between 0 to 100 to represent the percentage of split given to the user. All values must add up to 100 or the request will fail.

Remarks​

Will override existing splits for all users entered. Total splits cannot exceed 100.

Publish​

public async Task<(Error error, Mod mod)> Publish()

Publishes the changes to the mod.io API.

Remarks​

Will use ModioAPI.Mods.AddMod or ModioAPI.Mods.EditMod to publish changes, then process the remaining data as separate publish tasks.

Returns​

Error.None if the initial request succeeds. Use Results to inspect the results of each publish task.

ArchiveMod​

public async Task<Error> ArchiveMod()

Delete a mod on the mod.io backend. Note that this puts it into an 'archived' state, and mods can only be permanently deleted from the mod.io website


ModfileBuilder​

public class ModfileBuilder
Property​

string FilePath​

public string FilePath

get

string Version​

public string Version

get

string ChangeLog​

public string ChangeLog

get

string MetadataBlob​

public string MetadataBlob

get

Platform Platforms​

public Platform[] Platforms

get

bool IsSource​

public bool IsSource

get

Method​

SetSourceDirectoryPath​

public ModfileBuilder SetSourceDirectoryPath(string filePath)
Remarks​

This should be a directory

SetVersion​

public ModfileBuilder SetVersion(string version)

SetChangelog​

public ModfileBuilder SetChangelog(string changelog)

SetMetadataBlob​

public ModfileBuilder SetMetadataBlob(string metadataBlob)

SetPlatform​

public ModfileBuilder SetPlatform(Platform platform)
Remarks​

This will overwrite all platforms on this modfile.

SetPlatforms​

public ModfileBuilder SetPlatforms(ICollection<Platform> platforms)
Remarks​

This will overwrite all platforms on this modfile.

SetPlatforms​

public ModfileBuilder SetPlatforms(params Platform[] platforms)
Remarks​

This will overwrite all platforms on this modfile.

AppendPlatform​

public ModfileBuilder AppendPlatform(Platform platform)

AppendPlatforms​

public ModfileBuilder AppendPlatforms(ICollection<Platform> platforms)

SetSourceFile​

public ModfileBuilder SetSourceFile(bool isSourceFile)

This will configure the ModfileBuilder to upload the modfile to mod.io's Cloud Cooking solution. Files should be loose in a directory, with files that need to be cooked living in a 'Bundle' directory.

Remarks​

Requires Cloud Cooking to be enabled for the game. Publishing will return an error if Cloud Cooking is not enabled for the game.

FinishModfile​

public ModBuilder FinishModfile()
Enum​
Windows
Mac
Linux
Android
IOS
XboxOne
XboxSeriesX
PlayStation4
PlayStation5
Switch
Oculus

Enums​

ChangeFlags​
None               = 0
Name               = 1 << 0
Summary            = 1 << 1
Description        = 1 << 2
Logo               = 1 << 3
Gallery            = 1 << 4
Tags               = 1 << 5
MetadataBlob       = 1 << 6
MetadataKvps       = 1 << 7
Visibility         = 1 << 8
MaturityOptions    = 1 << 9
CommunityOptions   = 1 << 10
Modfile            = 1 << 11
MonetizationConfig = 1 << 12
Dependencies       = 1 << 13
MonetizationTeam   = 1 << 14
NameId             = 1 << 15
AddFlags = Name
| Summary
| Description
| Logo
| Visibility
| MaturityOptions
| CommunityOptions
| MetadataBlob
| Tags
| NameId
EditFlags = Name
| Summary
| Description
| Logo
| Visibility
| MaturityOptions
| CommunityOptions
| MetadataBlob
| Tags
| MonetizationConfig
| NameId

ImageFormat​
Jpg
Jpeg
Png