Table of Contents

SetUsername

Methods
public PlayerAccountOperation SetUsername(string username, string password = "", bool force = false, CancellationToken cancellationToken = default)

Assign a unique username and an optional password to the current player account.

Parameters
Type Name Description
string username

Username for the current account.

string password

(Optional) Password for the account. If no password is provided, then the option to login with password will not be available. This might still be useful if the username is used for game purposes only and not as an authentication method.

bool force

If the username is already taken by another player account, and a force value of false is passed, then an error will be returned.

If the username is already linked to another player account, and a force value of true is passed, then the username will be unlinked from the other player account, and linked to this one.

WARNING: If the username is unlinked from another player account, and that other player account has no other authentication methods set up besides said username and its associated password, then access to that player account will be lost.

CancellationToken cancellationToken

Can be used to cancel the operation.

Returns
Type Description
PlayerAccountOperation

Result of the operation.