Overview
The LAN Zoo supports 3rd party plugins. The Rhino C/C++ SDK allows developers to write plugins for Rhino that use the Rhino license manager and obtain licenses from LAN Zoo servers.
When a customer attempts to add a product license to the LAN Zoo, the product’s plugin is called to validate the user’s request. Upon validation, the plugin will return the product’s licensing information back to the LAN Zoo. In turn, the LAN Zoo will serialize, maintain, and distribute this license.
Prerequisites
It is presumed you already have the necessary tools installed and are ready to go. If you are not there yet, see Installing Tools (Windows).
Also, all plugins that use the LAN Zoo license system must be signed with an Authenticode certificate issued by McNeel Plugin Security. These certificates are free, but must be requested by each developer. Developers must agree to the Terms of Use before a certificate is issued. For more information on plugin signing, see Digitally Signing Plugins for LAN Zoo.
It is also presumed you have a C/C++ plugin you wish to add license support to. See the Your First Plugin (Windows) guide for instructions.
Adding Licensing Support
After you have built and tested your basic plugin, you can add licensing support as follows:
Step-by-Step
- Add a new .cpp file to your project.
- In this .cpp file, declare a new class that is derived from
CRhinoLicenseValidator
. - Override the
CRhinoLicenseValidator::ProductBuildType
virtual function and return the build type of the license that your product requires. - Override and implement the
CRhinoLicenseValidator::VerifyLicenseKey
virtual function. Rhino will call into this function whenever it needs your plugin to validate a license that is entered by a user, returned by the Rhino license manager (standalone node), or returned from a LAN Zoo server (network node). - Override and implement the
CRhinoLicenseValidator::VerifyPreviousVersionLicense
virtual function. Rhino will call into this function if a license key from a previous version of your product is required to validate the license key being verified. - Override and implement the
CRhinoLicenseValidator::OnLeaseChanged
virtual function. Rhino will call into this function if your product supports Rhino Accounts. When Rhino Accounts gets a new lease, this function is called. - Create one (and only one) static instance of your
CRhinoLicenseValidator
-derived object. - In your plugin’s
CRhinoPlugIn::OnLoadPlugIn
member, callCRhinoPlugIn::SetLicenseCapabilities
and pass it the required user interface parameters. - In your plugin’s
CRhinoPlugIn::OnLoadPlugIn
member,CRhinoPlugIn::GetLicense
to get a license. - Build your plugin.
- Digitally sign your plugin.
- Launch Rhino and test your plugin. When your plugin is loaded for the first time, you will be prompted to enter a license.