Skip to main content

Description

Result<T> is the standard return type for all LckCore operations. Instead of throwing exceptions, methods like Initialize(), HasUserConfiguredStreaming(), IsUserSubscribed(), and StartLoginAttemptAsync() return a Result<T> that wraps either a success value or an error with a message. This gives you consistent, predictable error handling across the entire SDK without try/catch blocks.

Usage

Use Result<T> whenever you call an LckCore method. Always check IsOk before accessing the value.
Result<bool> initResult = LckCore.Initialize("trackingId", gameInfo);

if (initResult.IsOk)
{
    Debug.Log("Initialization successful!");
}
else
{
    Debug.LogError($"Init failed: {initResult.Err} - {initResult.Message}");
}

References

Properties

PropertyTypeDescription
IsOkboolIndicates whether the operation was successful. Always check this first.
MessagestringError message when the operation fails. null if successful.
ErrCoreError ?High-level error category (e.g., InternalError, InvalidArgument). null if successful.
OkTThe result value on success. Returns default(T) (e.g., null, 0, or false) if IsOk == false.

Methods

MethodReturnsDescription
static Result<T> NewSuccess(T result)Result<T>Creates a result representing a successful operation and wraps the returned value.
static Result<T> NewError(CoreError error, string message)Result<T>Creates a result representing a failed operation, with an error type and descriptive message.

See Also

  • LckCore — Primary class whose methods return Result<T>
  • CoreError — Error category enum used in the Err property