GameShield V5 SDK Programming Guide
v5.2
|
Base class of Dynamic License Model. More...
Public Member Functions | |
TGSLicense * | license () |
Gets the proxy TGSLicense object pointer. More... | |
Protected Member Functions | |
virtual void | init () |
Define License Model Parameters | |
void | defineParamStr (const char *paramName, const char *paramInitValue, unsigned int permission) |
void | defineParamInt (const char *paramName, int paramInitValue, unsigned int permission) |
void | defineParamInt64 (const char *paramName, int64_t paramInitValue, unsigned int permission) |
void | defineParamBool (const char *paramName, bool paramInitValue, unsigned int permission) |
void | defineParamFloat (const char *paramName, float paramInitValue, unsigned int permission) |
void | defineParamDouble (const char *paramName, double paramInitValue, unsigned int permission) |
void | defineParamTime (const char *paramName, time_t paramInitValue, unsigned int permission) |
LM Event handlers | |
Sub-class overrides these handlers to handle licensing logic events | |
virtual bool | isValid () |
Is License Valid? More... | |
virtual void | startAccess () |
License starts to work. More... | |
virtual void | finishAccess () |
License stops working. More... | |
virtual void | onAction (TGSAction *act) |
Action Processing. More... | |
Constructor and Destructor | |
Must be protected to stop developer from creating /destroying LM instance directly DLM can only be created and initialized internally by SDK framework. | |
TGSDynamicLM () | |
construcotr | |
virtual | ~TGSDynamicLM () |
destructor | |
Detailed Description
Base class of Dynamic License Model.
Privodes all built-in facilities for DLM development
All dynamic license model should subclass this class.
Subclass of TGSDynamicLM should use DECLARE_LM to define its unique identifier in class declaration, and IMPLEMENT_LM in cpp file to register the DLM class to GS5 kernel.
Example:
Ref: DLM
Member Function Documentation
|
protected |
Defines Boolean Parameter
- Parameters
-
paramName the name of parameter paramInitValue the initial parameter value permission the the parameter access control mask (Ref: LMParamAccessCtl)
|
protected |
Defines Double Parameter
- Parameters
-
paramName the name of parameter paramInitValue the initial parameter value permission the the parameter access control mask (Ref: LMParamAccessCtl)
|
protected |
Defines Float Parameter
- Parameters
-
paramName the name of parameter paramInitValue the initial parameter value permission the the parameter access control mask (Ref: LMParamAccessCtl)
|
protected |
Defines 32bit Integer Parameter
- Parameters
-
paramName the name of parameter paramInitValue the initial parameter value permission the the parameter access control mask (Ref: LMParamAccessCtl)
|
protected |
Defines 64bit Integer Parameter
- Parameters
-
paramName the name of parameter paramInitValue the initial parameter value permission the the parameter access control mask (Ref: LMParamAccessCtl)
|
protected |
Defines String Parameter
- Parameters
-
paramName the name of parameter paramInitValue the initial parameter value permission the the parameter access control mask (Ref: LMParamAccessCtl)
|
protected |
Defines Time Parameter
- Parameters
-
paramName the name of parameter paramInitValue the initial parameter value It is the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC (i.e., a unix timestamp).
permission the the parameter access control mask (Ref: LMParamAccessCtl)
|
protectedvirtual |
License stops working.
Called when the entity the license attached to enters In-Active status; the gsEndAccess() triggers this event
It is a great chance to release any local resources used in licensing logic.
|
protectedvirtual |
Initialize the DLM instance
Subclass should override this method to initialize itself (defines LM parameters, etc.)
|
protectedvirtual |
Is License Valid?
- Returns
- true if the license is still valid.
This function is called periodically by GS5 kernel to query the current license status.
The entity might not be active, i.e., the startAccess() might not have been called, so please make sure the function implementation should not assume that the startAccess() was called before.
|
inline |
Gets the proxy TGSLicense object pointer.
The returned TGSLicense object is created automatically when the LM instance is created, it acts as proxy to access LM's parameters.
|
protectedvirtual |
Action Processing.
- Parameters
-
act action being applied
Called when an action is applied to this license. GS5 has processed all commonly used actions (ACT_UNLOCK, ACT_LOCK, ACT_CLEAN, etc.) before this method is called so you will not see these actions passed in, you only need to deal with LM-specific actions that other action processors do not understand.
|
protectedvirtual |
License starts to work.
Called when the entity the license attached to enters Active status. that is, the gsBeginAccess() is called and the entity accessing is approved by its attached license(s).
It is a great chance to start any internal timing logic, or initialize local data resources.
Generated on Mon Feb 3 2014 13:15:30 for GameShield V5 SDK Programming Guide by 1.8.5