DWC_GetLastError

Syntax

#include <dwc.h>

DWCError DWC_GetLastError(int *errorCode);

Arguments

errorCode Pointer to the error code storage location. Pass NULL if not needed.

Return Values

Error type.

Description

If the DWC library goes into an error state, it stops accepting most functions. In order to recover from an error state, call the DWC_ClearError function after executing the appropriate error handling process.

The error code that should be displayed when the application generates an error is returned to the buffer indicated by the pointer to the error code storage destination. Because the error code is returned as a negative value, invert the sign to make it positive before displaying it onscreen. However, if the error code is 0 or the error process type is DWC_ETYPE_LIGHT, only the game-specific display is required and the error code does not need to be displayed.

We recommend the use of DWC_GetLastErrorEx function, which simultaneously obtains the error type (errorType).

Error Codes (errorCode)

Error Codes related to the GameSpy SDK (-60000 to -99999)

Error codes related to the GameSpy SDK (the library that uses the GameSpy server features) are expressed by adding the following three values:

(sequence in which error processing has occurred) + (the type of GameSpy SDK that generated the error) + (detailed error information)

GameSpy SDK-related errors will not occur when the FriendsMatch library is not used.

Sequence in which error processing has occurred


DWC_ECODE_SEQ_LOGIN

-60000

Error during login processing.

DWC_ECODE_SEQ_FRIEND

-70000

Error during friend management processing.

DWC_ECODE_SEQ_MATCH

-80000

Error during the matchmaking process.

DWC_ECODE_SEQ_ETC

-90000

Error during processing other than that listed above.

Type of GameSpy SDK that generated the error


DWC_ECODE_GS_GP

-1000

GameSpy

GP error.

DWC_ECODE_GS_PERS

-2000

GameSpy

Persistent error.

DWC_ECODE_GS_STATS

-3000

GameSpy

Stats error.

DWC_ECODE_GS_QR2

-4000

GameSpy

QR2 error.

DWC_ECODE_GS_SB

-5000

GameSpy

ServerBrowsing error.

DWC_ECODE_GS_NN

-6000

GameSpy

NatNegotiation error.

DWC_ECODE_GS_GT2

-7000

GameSpy

gt2 error.

DWC_ECODE_GS_HTTP

-8000

GameSpy

HTTP error.

DWC_ECODE_GS_ETC

-9000

GameSpy

Other SDK error.

Detailed error information


DWC_ECODE_TYPE_NETWORK

-10

Network failure.

DWC_ECODE_TYPE_SERVER

-20

GameSpy server failure.

DWC_ECODE_TYPE_DNS

-30

DNS failure.

DWC_ECODE_TYPE_DATA

-40

Received invalid data.

DWC_ECODE_TYPE_SOCKET

-50

Socket communication error.

DWC_ECODE_TYPE_BIND

-60

Socket bind error.

DWC_ECODE_TYPE_TIMEOUT

-70

Timeout has occurred.

DWC_ECODE_TYPE_PEER

-80

Problem with one-on-one communication.

DWC_ECODE_TYPE_CONN_OVER

-100

Exceeded the number of connections.

DWC_ECODE_TYPE_STATS_AUTH

-200

STATS server login error.

DWC_ECODE_TYPE_STATS_LOAD

-210

STATS server data load error.

DWC_ECODE_TYPE_STATS_SAVE

-220

STATS server data save error.

DWC_ECODE_TYPE_NOT_FRIEND

-400

The specified partner is not a mutually registered friend.

DWC_ECODE_TYPE_OTHER

-410

The partner disconnected communications (usually occurs during server-client matchmaking).

DWC_ECODE_TYPE_MUCH_FAILURE

-420

Failed NAT negotiations for the specified number of times.

DWC_ECODE_TYPE_SC_CL_FAIL

-430

The server-client matchmaking client DS failed to connect.

DWC_ECODE_TYPE_CLOSE

-600

Error while closing connections.

DWC_ECODE_TYPE_TRANS_HEADER

-610

Error that occurred when Reliable data was received in an impossible reception state.

DWC_ECODE_TYPE_TRANS_BODY

-620

Error related to the reception buffer overflow.

DWC_ECODE_TYPE_TRANS_SEND

-630

Error that occurs when Reliable transmission fails.

DWC_ECODE_TYPE_AC_FATAL

-700

The error group at access points during the auto-connect process. In this case, the lower-order digit is a dedicated state value.

DWC_ECODE_TYPE_OPEN_FILE

-800

Failed to open GHTTP file.

DWC_ECODE_TYPE_INVALID_POST

-810

Invalid GHTTP transmission.

DWC_ECODE_TYPE_REQ_INVALID

-820

GHTTP file name or similar data is invalid.

DWC_ECODE_TYPE_UNSPECIFIED

-830

Unspecified GHTTP error.

DWC_ECODE_TYPE_BUFF_OVER

-840

GHTTP buffer overflow.

DWC_ECODE_TYPE_PARSE_URL

-850

GHTTPURL analysis error.

DWC_ECODE_TYPE_BAD_RESPONSE

-860

Error analyzing the response from the GHTTP server.

DWC_ECODE_TYPE_REJECTED

-870

Rejection of requests or other messages from a GHTTP server.

DWC_ECODE_TYPE_FILE_RW

-880

GHTTP local file read/write error.

DWC_ECODE_TYPE_INCOMPLETE

-890

GHTTP download aborted.

DWC_ECODE_TYPE_TO_BIG

-900

Download not permitted because the GHTTP file is too large.

DWC_ECODE_TYPE_ENCRYPTION

-910

GHTTP encryption error.

DWC_ECODE_TYPE_ALLOC

-1

Failed to allocate memory.

DWC_ECODE_TYPE_PARAM

-2

Parameter error.

DWC_ECODE_TYPE_SO_SOCKET

-3

A GameSpy gt2 socket error was caused by an SO error.

DWC_ECODE_TYPE_NOT_INIT

-4

Internet connection has not been initialized.

DWC_ECODE_TYPE_DUP_INIT

-5

The library has been initialized twice.

DWC_ECODE_TYPE_WM_INIT

-6

Failure to initialize WM.

DWC_ECODE_TYPE_UNEXPECTED

-9

An unexpected state or an unknown GameSpy error has occurred.

Error codes related to the Download feature (-31000 to -31999)

Error codes related to the Download features are expressed by summing the following three values:
DWC_ECODE_SEQ_ADDINS(-30000) + DWC_ECODE_FUNC_ND(-1000) + (detailed error information)

Detailed error information


DWC_ECODE_TYPE_ND_ALLOC

-1

Failed to allocate memory.

DWC_ECODE_TYPE_ND_FATAL

-9

Some other fatal error (not defined above) has occurred.

DWC_ECODE_TYPE_ND_STATE

-10

A function was called in a state in which it cannot be called.

DWC_ECODE_TYPE_ND_HTTP

-20

HTTP communication failure.

DWC_ECODE_TYPE_ND_PARAM

-30

Invalid parameter was passed to the function.

DWC_ECODE_TYPE_ND_CANCEL

-40

Asynchronous processing has been canceled.

DWC_ECODE_TYPE_ND_SERVER_PARAM

-101

Invalid parameter has been sent to the server.

DWC_ECODE_TYPE_ND_SERVER_SERVICE

-102

Unregistered service.

DWC_ECODE_TYPE_ND_SERVER_INVALIDTOKEN

-103

Illegal token (service locator information).

DWC_ECODE_TYPE_ND_SERVER_TOKENEXPIRED

-104

Expired token (service locator information).

DWC_ECODE_TYPE_ND_SERVER_NOCONTENTS

-105

No content present.

DWC_ECODE_TYPE_ND_SERVER_ATTR

-106

Attribute does not match.

DWC_ECODE_TYPE_ND_SERVER_CONTENTSEXPIRED

-107

Expired content.

DWC_ECODE_TYPE_ND_SERVER_INVALIDAP

-108

Access from an access point that is not a service target.

DWC_ECODE_TYPE_ND_SERVER_DATABASE

-109

Cannot connect to database (problem with the download server).

DWC_ECODE_TYPE_ND_SERVER_PASSWORD

-110

Password does not match.

Error codes related to the Check for Illegal Character Strings feature (-33000 to -33999)

Error codes related to the illegal string checks are expressed by summing the following three values.
DWC_ECODE_SEQ_ADDINS(-30000) + DWC_ECODE_FUNC_PROF(-3000) + (detailed error information)

Detailed error information


DWC_ECODE_TYPE_PROF_CONNERR

-10

A problem with connecting to the Authentication server.

DWC_ECODE_TYPE_PROF_PARSEERR

-20

A problem with the response from the Authentication server.

DWC_ECODE_TYPE_PROF_OTHERERR

-30

An error has occurred for some other reason.

Error codes relating to the Authentication server (-20000 to -29999)

These error codes are related to logging on to the Authentication server and getting the service locator information.

Error codes related to the Internet connection process (-50000 to -59999)

The error codes related to the Internet connection process are expressed by summing the following two values:
(detailed error information) + (connection target type)

For details, see the RevoEx manual.

Error Process Type (errorType)

When an error occurs, the error process type (DWCErrorType) returns a value that indicates until what point in time the library should be initialized.


DWC_ETYPE_NO_ERROR

No error.

DWC_ETYPE_LIGHT

Only a game-specific display: the error code display is not necessary. To recover, call the DWC_ClearError function.

DWC_ETYPE_SHOW_ERROR

Display the error code. To recover, call the DWC_ClearError function.

DWC_ETYPE_SHUTDOWN_FM
The FriendsMatch library must be shut down by calling the DWC_ShutdownFriendsMatch function. Display the error code.

DWC_ETYPE_SHUTDOWN_GHTTP

Call the following library release functions as needed:
DWC_RnkShutdown function (General-Purpose Ranking library).
*See Note below. Display the error code.

DWC_ETYPE_SHUTDOWN_ND
You must call the DWC_NdCleanupAsync function and close the download library. Display the error code.

DWC_ETYPE_DISCONNECT

Call the following library release functions as needed:
DWC_ShutdownFriendsMatch function (FriendsMatch library)
DWC_NdCleanupAsync function (Download library)
DWC_RnkShutdown function (General-Purpose Ranking library) *See Note below.
After this, communication must be terminated using SOCleanup. To use DWC again, it is necessary to call DWC_Shutdown and close DWC once. Display the error code.

DWC_ETYPE_FATAL

Because this is equivalent to FatalError, prompt the user to turn the power off. Display the error code.


Note: Because the General-Purpose Ranking library uses the HTTP Communications library, DWC_InitGHTTP and DWC_ShutdownGHTTP are called from inside the HTTP Communications library's initialize and exit operations.
Note: In the current version, the application cannot use DWC_GHTTP directly.

See Also

DWC_GetLastErrorEx

Revision History

1.4.12
Added detailed description of the error codes.
1.4.15
To reflect privatization of DWC_GHTTP, deleted the description of DWC_ShutdownGHTTP. Corrected an omission in download-related error codes. Added DWC_ECODE_TYPE_TRANS_SEND.
1.4.16
Corrected a NitroDWC reference that was present.
1.4.21
Added a note about the fact that it is necessary to call DWC_Shutdown when DWC_ETYPE_DISCONNECT has been generated.
2.0.0
Specifications have changed so that SOFinish does not need to be called when a DWC_ETYPE_DISCONNECT error has been generated.

CONFIDENTIAL