chatConnectSpecial

GameSpy SDK

chatConnectSpecial

Initializes the Chat SDK and initiates a connection to the chat server. The chatConnectSpecial function provides ability to fill in the user field after the local machine’s IP address is known.

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

Return Value

This function 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.
callbacks
[in] Structure for specifying global handlers.
nickErrorCallback
[in] Callback that is triggered if nick 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 connection attempt 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
chatConnectSpecialchatConnectSpecialAchatConnectSpecialW

chatConnectSpecialW and chatConnectSpecialA are UNICODE and ANSI mapped versions of chatConnectSpecial. The arguments of chatConnectSpecialA are ANSI strings; those of chatConnectSpecialW are wide-character strings.