ICELib
1
|
interface for sending messages to online services More...
Classes | |
class | iceGameSession |
opaque type for manipulating the session with More... | |
Enumerations | |
enum | iceGameSessionReasonCode |
enum | iceGameSessionEvent |
enum | iceLicenseState |
Reference Counting | |
void | iceGameSession::iceGameSessionAddReference (iceGameSession *pGameSession) |
increment the ref count of the game session | |
void | iceGameSession::iceGameSessionRelease (iceGameSession *pGameSession) |
free up the game session | |
Creation and Initialisation | |
iceGameSession * | iceGameSession::iceGameSessionCreate () |
Set the credentials of the game connecting to IndieCity. | |
IceCoreResult | iceGameSession::iceGameSessionSetUserAccessToken (iceGameSession *pGameSession, iceServiceId serviceId, const char *accessToken, const char *tokenSecret) |
set the user access token for an application | |
IceCoreResult | iceGameSession::iceGameSessionSetGameCredentials (iceGameSession *pGameSession, iceServiceId serviceId, const char *gameId, const char *secret) |
//set the games id and secret for a service | |
Session Starting | |
IceCoreResult | iceGameSession::iceGameSessionRequestStart (iceGameSession *pSession) |
Attempt to connect to IndieCity server. | |
IceCoreResult | iceGameSession::iceGameSessionRequestEnd (iceGameSession *pSession) |
Disconnect from IndieCity server. | |
IceCoreResult | iceGameSession::iceGameSessionUpdate (iceGameSession *pSession) |
Properties | |
iceEvent * | iceGameSession::iceGameSessionGetEvent (iceGameSession *pSession, iceGameSessionEvent eventId) |
get an event interface pointer | |
bool | iceGameSession::iceGameSessionIsSessionStarted (const iceGameSession *pSession) |
test if session is started | |
iceLicenseState | iceGameSession::iceGameSessionGetUserLicenseState (const iceGameSession *pSession) |
Get the license state. |
interface for sending messages to online services
void iceGameSessionAddReference | ( | iceGameSession * | pGameSession | ) |
increment the ref count of the game session
[in] | pSession | pointer to session interface |
Set the credentials of the game connecting to IndieCity.
[in] | pSession | pointer to session interface Store the gameId and secret. The gameId is UUID for the game. The secret is a string that is used to sign requests to the server and helps provide confidence that the game is the game it says it is. It should only be known by the developer and IndieCity server. |
iceEvent * iceGameSessionGetEvent | ( | iceGameSession * | pSession, |
iceGameSessionEvent | eventId | ||
) |
get an event interface pointer
[in] | pSession | pointer to session interface |
iceLicenseState iceGameSessionGetUserLicenseState | ( | const iceGameSession * | pSession | ) |
Get the license state.
[in] | pSession | pointer to session interface |
bool iceGameSessionIsSessionStarted | ( | const iceGameSession * | pSession | ) |
test if session is started
[in] | pSession | pointer to session interface |
void iceGameSessionRelease | ( | iceGameSession * | pGameSession | ) |
free up the game session
[in] | pSession | pointer to session interface |
IceCoreResult iceGameSessionRequestEnd | ( | iceGameSession * | pSession | ) |
Disconnect from IndieCity server.
[in] | pSession | pointer to session interface Inform the IndieCity Server that the user has finished playing the game |
IceCoreResult iceGameSessionRequestStart | ( | iceGameSession * | pSession | ) |
Attempt to connect to IndieCity server.
[in] | pSession | pointer to session interface Attempt to connect to IndieCity server and establish user is now playing the game. Can fail if no connection can be made or if user is already logged into IndieCity from a different machine. UserToken is a string.") |
IceCoreResult iceGameSessionSetGameCredentials | ( | iceGameSession * | pGameSession, |
iceServiceId | serviceId, | ||
const char * | gameId, | ||
const char * | secret | ||
) |
//set the games id and secret for a service
[in] | pSession | pointer to session interface The access token is equivalent to the users credentials for that game. allows game to login to server with that user's access rights Also essentially specifies the user to login. |
IceCoreResult iceGameSessionSetUserAccessToken | ( | iceGameSession * | pGameSession, |
iceServiceId | serviceId, | ||
const char * | accessToken, | ||
const char * | tokenSecret | ||
) |
set the user access token for an application
[in] | pSession | pointer to session interface The access token is equivalent to the users credentials for that game. allows game to login to server with that user's access rights Also essentially specifies the user to login. Setting this should fail if a session is already started |
IceCoreResult iceGameSessionUpdate | ( | iceGameSession * | pSession | ) |
brief send requests and get server events
[in] | pSession | pointer to session interface |
Send all batched requests from modules to Server and handle response. Even if no requests are present UpdateSession will still send a KeepAlive message to server to keep the session alive. This function needs to be called more often than timeout period (approx 30 seconds) or the session will end.