GPTransferCallbackArg

GameSpy SDK

GPTransferCallbackArg

The arg parameter passed to a Transfer Callback .

typedef struct 
{
GPTransfer transfer;
GPEnum type;
int index;
int num;
gsi_char * message;
} GPTransferCallbackArg;

Members

transfer
The transfer object this callback is for.
type
The type of information being passed to the application. See the "Transfer callback type" section of GPEnum.
index
If this callback is related to a specific file being transferred, this is that file’s index.
num
An integer used in conjunction with certain "type" values to pass supplementary information to the program.
message
If the type is GP_TRANSFER_SEND_REQUEST, GP_TRANSFER_ACCEPTED, or GP_TRANSFER_REJECTED, then this may point to a user-readable text message sent with the request or reply. The message will be invalid once this callback returns.

Remarks

The possible values for type are:
GP_TRANSFER_SEND_REQUEST
A remote profile wants to send files to the local profile. The transfer object for this callback is a new transfer object. The application must call either gpAcceptTransfer or gpRejectTransfer in response to this message. If gpAcceptTransfer is called the transfer will start, and the object will exist until gpFreeTransfer is called on it. If gpRejectTransfer is called, the object will be freed and should not be referenced again.
Only the receiver gets this callback.
num is set to the number of files in the transfer.
message is set to the message passed to gpSendFiles.
GP_TRANSFER_ACCEPTED
A transfer request has been accepted. The files will now be sent.
Only the sender gets this callback.
message is set to the message passed to gpAcceptTransfer.
GP_TRANSFER_REJECTED
A transfer request has been rejected. Call gpFreeTransfer to free the transfer object.
Only the sender gets this callback.
message is set to the message passed to gpAcceptTransfer.
GP_TRANSFER_NOT_ACCEPTING
The remote profile is not accepting file transfers. Call gpFreeTransfer to free the transfer object.
Only the sender gets this callback.
GP_TRANSFER_NO_CONNECTION
A direct connection with the remote profile could not be established, and the transfer has been terminated. Call gpFreeTransfer to free the transfer object.
Only the sender gets this callback.
GP_TRANSFER_DONE
The file transfer has finished successfully. Call gpFreeTransfer to free the transfer object.
Both the sender and receiver get this callback.
GP_TRANSFER_CANCELLED
The file transfer has been cancelled before completing. Call gpFreeTransfer to free the transfer object.
Both the sender and receiver get this callback.
GP_TRANSFER_LOST_CONNECTION
The direct connection with the remote profile has been lost, and the transfer has been terminated. Call gpFreeTransfer to free the transfer object.
Both the sender and receiver get this callback.
GP_TRANSFER_ERROR
There was an error during the transfer process, and the transfer has been terminated. Call gpFreeTransfer to free the transfer object.
Both the sender and receiver get this callback.
GP_TRANSFER_THROTTLE
NOTE: Throttling is not currently implemented.
Either the local profile or the remote profile has set the throttle.
Both the sender and receiver get this callback.
If positive, num is the throttle setting in bytes-per-second (Bps). A throttle of zero means a paused connection, and a throttle of –1 means there is no throttling.
GP_FILE_BEGIN
A file is about to be transferred.
Both the sender and receiver get this callback.
GP_FILE_PROGRESS
File data has been either sent or received.
Both the sender and receiver get this callback.
num is set to the number of bytes of this file that have been transferred so far.
GP_FILE_END
A file has finished transferring successfully. Always called after a GP_FILE_BEGIN (with zero or more GP_FILE_PROGRESS calls in between).
Both the sender and receiver get this callback.
GP_FILE_DIRECTORY
The current "file" being transferred is a directory name. This is the only callback called for directories (i.e., no GP_FILE_BEGIN or GP_FILE_END).
Both the sender and receiver get this callback.
GP_FILE_SKIP
The current file is being skipped. This may arrive instead of a GP_FILE_BEGIN, or while a file is being transferred (after GP_FILE_BEGIN, but before GP_FILE_END).
Both the sender and receiver get this callback.
GP_FILE_FAILED
The current file being transferred has failed. This may arrive instead of a GP_FILE_BEGIN, or while a file is being transferred (after GP_FILE_BEGIN, but before GP_FILE_END).
Both the sender and receiver get this callback.
num indicates the cause of the error. The possible values are:
GP_FILE_READ_ERROR
The sender had an error reading the file.
GP_FILE_WRITE_ERROR
The receiver had an error writing the file.
GP_FILE_DATA_ERROR
The MD5 check of the data being transferred failed. Because the MD5 check happens after the files has finished transferring, only the receiver will get this callback. The sender will simply get a GP_FILE_END callback.

Section Reference: Gamespy Presence SDK

See Also: gpSetCallback