Main Page | Modules | Class List | File List | Class Members | File Members

# gs-sdk-cdkey

## Introduction

ubi.com cd key validation system interface

## Description

This sdk provides functionalities for a game developper to add a cd key validation mechanism in his project. This system works along the ubi.com validation server.

It includes game server side functionalities:

- Get a player validation status
- Inform the validation server of the player status

and game client side functionalities:

- Request cd key activation (once)
- Request cd key validation

Note for game client side:
The cd key activation is done once before the first cd key athorization request. After requesting for a cd key activation , the user will receive a activation id that should be kept safely to be use in all futur authorization request before joining a game server.

Note for game server side:
The game server will need to ask the validation server for a player validation status (VALID or INVALID) before choosing to disconnect or to keep the player, this is done after the game server has received the authorization id of the game client that want to join.

These are the chronological steps needed to be accomplish in a client validation from a game server and game client point of view. The first step(1) must be accomplish only once, when the game client does not possess his ACTIVATION ID.

1. The game client get his ACTIVATION ID from the validation server using the GSCDKey_RequestActivation() function call. This is done once or if the client does not possess a ACTIVATION ID. The ACTIVATION ID should be kept localy in a file or in the registry for further access.

2. The game client get his AUTHORIZATION ID from the validation server using the GSCDKey_RequestAuthorization() function call. This step will be done every time a client want to join a game server, the client needs a new authorization id each time he want to join a game server. If this call fails the client has 2 choice:

- send the request again using GSCDKey_RequestAuthorization() using a bigger timeout value (if the error was caused by a timeout)
- use the last authorization id received the last time the user joined a game server. (there is a chance that the validation of this old authorization id will fail if the latter has timed-out on the validation server side)

3. After connecting to the game server, the game client send his AUTHORIZATION ID to the game server.

4. After the game server have received a client connection and AUTHORIZATION ID, he validate the client using the GSCDKey_ValidateUser() function call. The status of the player (CDKEY_PLAYER_STATUS) will be returned via the callback CBCDKey_RcvValidationResponse(). If this request does not succeed, and that the error code is ERRORCDKEY_TIMEOUT it is recommended that the request be sent again with a bigger timeout value. If a ERRORCDKEY_TIMEOUT error still occurs after that, the ubi.com network may have problems. It is however recommended that the game server does not let the player connect. Otherwise, it may lead to :

- hacks in the game to force a timeout
- attacks on ubi.com server to have request time out

Recommendations after the game server has receive the player status via the GSCDKey_ValidateUser() callback:

- if the player status is E_PLAYER_UNKNOWN or E_PLAYER_INVALID the game server should disconnect the player.
- if the player status is E_PLAYER_VALID the game server should keep the player.

Ubi.com GameService SDK - ©UbiSoft Entertainment 2002
GameService development team