gpConnect

GameSpy SDK

gpConnect

This function is used to establish a connection to the server. It establishes a connection with an existing profile, which is identified based on the nick and email and is validated by the password.

GPResult gpConnect(
GPConnection * connection,
const gsi_char nick[GP_NICK_LEN],
const gsi_char email[GP_EMAIL_LEN],
const gsi_char password[GP_PASSWORD_LEN],
GPEnum firewall,
GPEnum blocking,
GPCallback callback,
void * param );
RoutineRequired HeaderDistribution
gpConnect<gp.h>SDKZIP

Return Value

This function returns GP_NO_ERROR upon success. Otherwise a valid GPResult is returned.

Parameters

connection
[in] A GP interface object initialized with gpInitialize.
nick
[in] The profile nickname.
email
[in] The profile email address.
password
[in] The profile password.
firewall
[in] GP_FIREWALL or GP_NO_FIREWALL. This option may limit the users ability to transfer files.
blocking
[in] GP_BLOCKING or GP_NON_BLOCKING
callback
[in] A user-supplied callback with an arg type of GPConnectResponseArg
param
[in] Pointer to user-defined data. This value will be passed unmodified to the callback function.

Remarks

This function establishes a connection with the server. If the local machine is behind a firewall, the firewall parameter should be set to GP_FIREWALL so that buddy messages can be sent through the server.
gpDisconnect should be called when this connection is ready to be disconnected..
When the connection is complete, the callback will be called.

Unicode Mappings

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
gpConnectgpConnectAgpConnectW

gpConnectW and gpConnectA are UNICODE and ANSI mapped versions of gpConnect. The arguments of gpConnectA are ANSI strings; those of gpConnectW are wide-character strings.

Section Reference: Gamespy Presence SDK

See Also: GPConnectResponseArg