VRRSS vrenaissance

VRRSS // DEVELOPER DOCUMENTATION

API, Unity SDK и интеграция проверки лицензий

VRRSSHubAPI.dll #

Library implementing the API for VRenaissance Hub.


Enumerations #

LicenseStatus #

Description: License verification status.

enum LicenseStatus
{
  Success,
  NotFound,
  SignNotFound,
  InvalidKey,
  DecryptFailed,
  SignMismatch,
  ParsingFailed,
  DataMismatch,
  Expired,
  FileExpired,
  UnhandledError,
  Canceled,
};

Values #

Name Value
Success License is valid
NotFound License file not found
SignNotFound Signature file not found
InvalidKey Public key is invalid
DecryptFailed Failed to decrypt the license file
SignMismatch Signature does not match the license
ParsingFailed Failed to parse the license file
DataMismatch License registration data does not match
Expired License has expired
FileExpired License file has expired
UnhandledError Unhandled error during license verification
Canceled License verification was canceled

MessageType #

Description: Type of message box.

enum MessageType
{
  None,
  Error,
  Question,
  Warning,
  Information
};

Values #

Name Description
None Undefined message type
Error Error message
Question Question message
Warning Warning message
Information Information message


Types #

LICENSE_CALLBACK #

Description: Represents a delegate for handling the license verification result.

typedef void(__stdcall* LICENSE_CALLBACK)(LicenseStatus status);

Parameters #

status #

Type: LicenseStatus
Description: The status with which the license verification completed.

Functions #

SendHUBCommand #

Description: Sends a custom command to VRenaissance Hub.

extern "C" HUBAPI_API void SendHUBCommand(const wchar_t* command);

Parameters #

command #

Type: const wchar_t*
Description: Command.

Usage Example #

SendHUBCommand(L"window?command=maximize");

InitGame #

Description: Initializes the game in VRenaissance Hub by its identifier.

extern "C" HUBAPI_API bool InitGame(const wchar_t* gameId);

Parameters #

gameId #

Type: const wchar_t*
Description: Game identifier.

Result #

Type: bool Description: Success of game initialization.

Usage Example #

bool isGameInitialized = InitGame(L"com.stvdev.netoa");

InitGameWithLicense #

Description: Initializes the game in VRenaissance Hub by its identifier and starts the license verification cycle. The license verification will be performed every 5 minutes until the game process is completed.

extern "C" HUBAPI_API void InitGameWithLicense(const wchar_t* gameId, LICENSE_CALLBACK callback);

Parameters #

gameId #

Type: const wchar_t*
Description: Game identifier.

callback #

Type: LICENSE_CALLBACK
Description: Called after the license verification is completed. Passes the verification results as LicenseStatus. Called every 5 minutes after the function is called.

Note

The callback call occurs not in the same thread in which the InitGameWithLicense function was called.

Usage Example #

void OnLicenseVerificationCompleted(LicenseStatus status)
{
    if (status != LicenseStatus::Success && status != LicenseStatus::Canceled)
    {
        // Invalid license processing...
    }
}

void RunLicenseCheck()
{
    InitGameWithLicense(L"com.stvdev.netoa", OnLicenseVerificationCompleted);
}

CancelLicenseVerification #

Description: Stops the license verification cycle if it is running. After stopping, callback will be called with the status LicenseStatus::Canceled.

extern "C" HUBAPI_API void CancelLicenseVerification();

Usage Example #

CancelLicenseVerification();

ShowHUBMessage #

Description: Displays a dialog box with a message in VRenaissance Hub.

extern "C" HUBAPI_API void ShowHUBMessage(const wchar_t* body, const wchar_t* header, MessageType type);

Parameters #

body #

Type: const wchar_t*
Description: Message text.

Type: const wchar_t*
Description: Message header.

type #

Type: MessageType
Description: Message type.

Usage Example #

ShowHUBMessage(L"Something went wrong.", L"Oops...", MessageType::Error);