gpConnectNewUser
This function is used to create a new user account and profile and to then establish a connection using the profile.
- GPResult gpConnectNewUser(
- GPConnection * connection,
- const gsi_char nick[GP_NICK_LEN],
- const gsi_char uniquenick[GP_UNIQUENICK_LEN],
- const gsi_char email[GP_EMAIL_LEN],
- const gsi_char password[GP_PASSWORD_LEN],
- const gsi_char cdkey[GP_CDKEY_LEN],
- GPEnum firewall,
- GPEnum blocking,
- GPCallback callback,
- void * param );
Routine | Required Header | Distribution |
---|---|---|
gpConnectNewUser | <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 desired nickname for the initial profile. The nickname can be up to GP_NICK_LEN characters long, including the NULL.
- uniquenick
- [in] The desired unique nickname for the profile.
- [in] The desired e-mail address for the user. Can be up to GP_EMAIL_LEN characters long, including the NUL terminator.
- password
- [in] The desired password for the profile. The password can be up to GP_PASSWORD_LEN characters long, including the NUL.
- cdkey
- [in] An optional cdkey to associate with the unique nick. Normally left blank.
- firewall
- [in] GP_FIREWALL or GO_NO_FIREWALL. This option may limit the users ability to send 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 is identical to gpConnect (see above), except that it first creates a new user and profile, and then connects the profile. If this function is used to try to connect a profile that already exists, the operation will fail. If the e-mail and password identify an existing user, but the nick does not match any of that user’s profiles, a new profile will be created and logged in.
If using uniquenicks, then you will normally want to use the same string for both the nick and uniquenick parameters. If namespaceID is 0 then the uniquenick and cdkey parameters should be NULL.
Unicode Mappings
Routine | GSI_UNICODE Not Defined | GSI_UNICODE Defined |
---|---|---|
gpConnectNewUser | gpConnectNewUserA | gpConnectNewUserW |
gpConnectNewUserW and gpConnectNewUserA are UNICODE and ANSI mapped versions of gpConnectNewUser. The arguments of gpConnectNewUserA are ANSI strings; those of gpConnectNewUserW are wide-character strings.
Section Reference: Gamespy Presence SDK
See Also: GPConnectResponseArg