GameShield V5 SDK Programming Guide: gs::TGSEntity Class Reference

GameShield v5 SDK

gs::TGSEntity Class Reference

Entity Object. More...

Inheritance diagram for gs::TGSEntity:
Collaboration diagram for gs::TGSEntity:

Public Member Functions

bool isAccessible ()
 Is Entity accessible? (Passed attached license(s) verfication)
 
bool isAccessing ()
 Is Entity being accessed? ( between beginAccess & endAccess )
 
bool isUnlocked ()
 Is Entity unlocked? (Fully Purchased, etc.)
 
bool isLocked ()
 Is Entity locked? (Expired, obsoleted, etc.)
 
bool beginAccess ()
 Try start accessing an entity. More...
 
bool endAccess ()
 Try end accessing an entity. More...
 
std::string getUnlockRequestCode ()
 Get the Unlock request code to unlock all attached license(s)
 
Properties
unsigned int attribute ()
 Entity Attributes (ref: EntityAttr)
 
const char * id ()
 Entity Id.
 
const char * name ()
 Entity Name.
 
const char * description ()
 Entity Description.
 
License
TLicensePolicy licensePolicy ()
 License Policy LicensePolicy.
 
int licenseCount ()
 Total number of licenses currently attached.
 
TGSLicensegetLicenseByIndex (int index)
 Get an attached license by its index.
 
TGSLicensegetLicenseById (license_id_t licenseId)
 Get an attached license by its unique license id.
 
- Public Member Functions inherited from gs::TGSObject
gs_handle_t handle () const
 Gets GS5 object handle.
 

Detailed Description

Entity Object.

Member Function Documentation

bool gs::TGSEntity::beginAccess ( )

Try start accessing an entity.

If an entity is accessible, all of the associated resources (files, keys, codes, etc.) can be legally used, otherwise they cannot be accessed by the application.

This api can be called recursively, and each call must be paired with an endAccess().

When the api is called an event EVENT_ENTITY_TRY_ACCESS is triggered to give the GS5 extension developer a chance to change the entity license status, if after the EVENT_ENTITY_TRY_ACCESS posting the entity is still not accessible, then EVENT_ENTITY_ACCESS_INVALID is posted, otherwise, if the entity is being accessed for the very first time, the EVENT_ENTITY_ACCESS_STARTED is posted. the developer can then initialize needed resources for this entity in the event handler.

Returns
returns true if the entity is accessed successfully. returns false if:
  • Cannot access any entity when your game is wrapped by a DEMO version of GS5/IDE and the its demo license has expired;
  • Entity cannot be accessed due to its negative license feedback;
See Also
gs::gsBeginAccessEntity()
bool gs::TGSEntity::endAccess ( )

Try end accessing an entity.

Returns
true on success, false if there is unexpected error occurs.

This api must be paired with beginAccess(), if it is the last calling then event EVENT_ENTITY_ACCESS_ENDING and EVENT_ENTITY_ACCESS_ENDED will be posted.

See Also
gs::gsEndAccessEntity()
Generated on Mon Feb 3 2014 13:15:29 for GameShield V5 SDK Programming Guide by   doxygen 1.8.5