NodeWorld

CreatorKeyStore

La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.

csharp
public sealed class CreatorKeyStore

Namespace NodeWorld.SDK.Editor.

Where the creator's key lives on this computer: one plain PEM file in the user's profile, outside every project, so that it never goes into a git repository. Made at the first world build. There is no spare key: whoever loses this file and its exports becomes another creator in the players' eyes.

Constants

FileName

csharp
public const string FileName = "creator-key.pem"

Name of the key's file.

Constructors

CreatorKeyStore

csharp
public CreatorKeyStore(string folder)

The store of the folder folder (tests use their own; the SDK uses ForThisComputer).

Properties

Folder

csharp
public string Folder { get; }

The folder of the key.

KeyPath

csharp
public string KeyPath { get; }

The key's file.

Exists

csharp
public bool Exists { get; }

This computer has a key.

Methods

ForThisComputer

csharp
public static CreatorKeyStore ForThisComputer()

The key's store of this computer's user: %APPDATA%\NodeWorld\creator on Windows, ~/.config/nodeworld/creator on Linux.

Load

csharp
public CreatorKey Load()

The key of this computer, or null when there is none yet. Throws FormatException when its file is not a key.

LoadOrCreate

csharp
public CreatorKey LoadOrCreate()

The key of this computer, made and saved first when there is none (the first build).

Export

csharp
public void Export(string destination)

Copies the key's file to destination (a plain file, not encrypted, like the original).

Read

csharp
public static CreatorKey Read(string source)

The key in source, without saving it. Throws FormatException when the file is not a key.

Write

csharp
public void Write(CreatorKey key)

Makes key this computer's key (an import from another computer), in place of the one it had.