chatConnectSecure

GameSpy SDK

chatConnectSecure

Initializes the Chat SDK and initiates a connection to the chat server. The chatConnectSecure function encrypts the connection.

CHAT chatConnectSecure(
const gsi_char * serverAddress,
int port,
const gsi_char * nick,
const gsi_char * name,
const gsi_char * gamename,
const gsi_char * secretKey,
chatGlobalCallbacks * callbacks,
chatNickErrorCallback nickErrorCallback,
chatFillInUserCallback fillInUserCallback,
chatConnectCallback connectCallback,
void * param,
CHATBool blocking );
RoutineRequired HeaderDistribution
chatConnectSecure<chat.h>SDKZIP

Return Value

Returns the initialized Chat SDK interface. A return value of NULL indicates an error.

Parameters

serverAddress
[in] Address of the chat server to connect to; usually "peerchat.gamespy.com".
port
[in] Port of the chat server; usually 6667.
nick
[in] Nickname in use while chatting. Not associated with a user account in any way.
name
[in] User’s real name, or any other optional info.
gamename
[in] GameName of the title this client is connecting from.
secretKey
[in] Assigned secret key for the specified gamename.
callbacks
[in] Structure for specifying global handlers.
nickErrorCallback
[in] Optional user-supplied function to be called if nickname is invalid or in use.
fillInUserCallback
[in] Optional user-supplied function to be called when the SDK requires the user name.
connectCallback
[in] Optional user-supplied function to be called when the operation has completed.
param
[in] Optional pointer to user data; will be passed unmodified to the callback function.
blocking
[in] If CHATTrue, return only after the operation has completed; otherwise, return immediately.

Remarks

The server address and port for the connect functions can be left empty. In other words, serverAddress can be NULL, and the port can be specified to be 0. The SDK will automatically take care of using the default address and port.

Unicode Mappings

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
chatConnectSecurechatConnectSecureAchatConnectSecureW

chatConnectSecureW and chatConnectSecureA are UNICODE and ANSI mapped versions of chatConnectSecure. The arguments of chatConnectSecureA are ANSI strings; those of chatConnectSecureW are wide-character strings.