License Manager for Combu

DEPRECATED: this product is currently NOT AVAILABLE for new purchases, though the support to the users who previously purchased it will be guaranteed until December 31st 2024.

License Manager is an add-on for Combu that allows you to easily manage your awesome game/app with subscription plans. You can set the licenses of your players directly in the interface of the administration console and set a default type of license for new registrations (usually X-days or X-launches trial).

In Unity you can check if the license of the local user is still valid or expired, there’s also a check for off-line mode but this system is mainly implemented for online games/apps so it is not meant to replace or work as a full featured DRM manager but it adds a similar functionality to your Combu applications.

Install the add-on

To install this add-on, just uncompress the file license-manager_web.zip in the folder /addons of your Combu server installation (you will have a new folder called license-manager).

In the expanded folder license-manager you will find the file config.php that you should edit to assign the following values to the constants:

  • LICENSE_AUTOGENERATE: if TRUE then it will auto-generate license numbers on user creation (and it’ll be denied to update the number from clients)
  • LICENSE_DEFAULT_TYPE: the default license that is granted to any new account registered, it can be one of the constants defined in addon.php (LICENSE_TYPE_* after the comment “Valid License types“)
  • LICENSE_DEFAULT_TIME: if LICENSE_DEFAULT_TYPE is set as LICENSE_TYPE_TIME then this constant is the number of days available to try your software
  • LICENSE_DEFAULT_LAUNCHES: if LICENSE_DEFAULT_TYPE is set as LICENSE_TYPE_LAUNCH then this constant is the number of launches to try your software

If LICENSE_DEFAULT_TYPE is set as LICENSE_TYPE_MONTHLY then the default expiration for new accounts is next month from account registration.
If LICENSE_DEFAULT_TYPE is set as LICENSE_TYPE_YEARLY then the default expiration for new accounts is next year from account registration.

Once you’ve done, in your Combu Administration you will find a new section License Manager (see screenshots at the bottom of this page).

How to use in Unity

To add the functionality in your game/app on Unity, just create a new empty object and attach the script LicenseManager (or use the prefab that is in the folder Prefabs).

You can set the following properties in the inspector:

  • Addon Relative Url: it should be fine addons/license-manager for everyone, it’s the relative path to the add-on folder and you have to change this only if you renamed it (in the next releases this will be turned into a const)

How to handle the licenses

This product does not handle online payments at this moment, so you have two ways to handle the payments of the licenses:

  • handle the payment in your website
  • use the administration area to manually assign the licenses to the users

Handling the payment in your website

Use your favorite e-commerce framework or custom developed solution to handle the payment, and after the user has paid then you can change the license through a PHP script: just include lib/api.php from Combu folder in your PHP file and call LicenseManager::SaveLicense($idAccount, $licenseType, $licenseValue, $licenseNumber), where:

  • $idAccount is the account Id
  • $licenseType can be: LICENSE_TYPE_TIME (1), LICENSE_TYPE_LAUNCH (2), LICENSE_TYPE_MONTHLY (3), LICENSE_TYPE_YEARLY (4), LICENSE_TYPE_PERPETUAL (5)
  • $licenseValue can be:
    • if $licenseType is LICENSE_TYPE_TIME: expiration date as YYYY-MM-DD (e.g.: 2015-09-23)
    • if $licenseType is LICENSE_TYPE_LAUNCH: remaining launches count (e.g.: 5)
    • if $licenseType is LICENSE_TYPE_MONTHLY: expire period as MM-YYYY (e.g.: 09-2015)
    • if $licenseType is LICENSE_TYPE_YEARLY: expiration year (e.g.: 2015)
    • if $licenseType is LICENSE_TYPE_PERPETUAL: NULL or empty string
  • $licenseNumber is the license serial number (you can set it to what ever you want, if you don’t want to change then pass NULL)

Manually managing the licenses

You can manage the licenses manually in the administration website, just access the Licenses page from the menu section License Manager and click CHANGE on the user row to change his/her license number, type and value.

Screenshots