wavelength 1.0.0
Loading...
Searching...
No Matches
FileDownloadTask Class Reference

Step that downloads a file of the server into a buffer. More...

#include <filedownloadtask.h>

Inheritance diagram for FileDownloadTask:
Collaboration diagram for FileDownloadTask:

Public Member Functions

 FileDownloadTask (String *pName, char **ppBuffer, int *pnSize)
 Construct a step.
Public Member Functions inherited from NetTask
 NetTask ()
 Construct a task outside any NetMultiTask.
void Finish (bool bSucceeded, int nResult)
 End the task, and record a failure in the result of the NetMultiTask that runs it.
NetMultiTask * GetParent () const
void SetParent (NetMultiTask *pParent)
 Set the NetMultiTask that runs the task.
Public Member Functions inherited from Task
 Task ()
 Construct an idle task.
virtual ~Task ()
 Release the task.
int Poll ()
 Report the state after giving a running task one poll.
void Start ()
 Enter the running state and call OnStart(), unless the task is already running.
void Stop ()
 Call OnStop() when the task is running, and return to the idle state.
void Finish (bool bSucceeded)
 End the task from outside its poll, and call OnStop() when it was running.
int GetState () const
 Report mState.

Static Public Member Functions

static void OnResponse (int nConnection, int nType, int nSize, const rtMediusFileTransferResponse *pResponse)
 Copy a part of the file, and mark the step done after the last part.
Static Public Member Functions inherited from NetTask
static void MakeTag (NetTask *pTask, char *pszTag)
 Create the next tag of a task and copy its text.
static void RemoveTag (NetTask *pTask)
 Remove the first tag of a task.
static NetTask * FindTag (const char *pszTag)
 Find the task of a tag.

Protected Member Functions

void OnStart () override
 Send the request.
void OnPoll () override
 Report the estimated progress, and finish once the last part arrived and the estimate passes 99 percent.
Protected Member Functions inherited from NetTask
void OnStop () override
 Remove the tag of the task.

Additional Inherited Members

Public Types inherited from Task
enum  State { kStateIdle = 0 , kStateRunning = 1 , kStateDone = 2 , kStateFailed = 3 }
 Values of mState. More...
Static Public Attributes inherited from NetTask
static std::list< NetTaskTag > sTags
 The tags MakeTag() created and RemoveTag() has not removed.
static int sNextTag
 The number the next tag takes.

Detailed Description

Step that downloads a file of the server into a buffer.

The RTTI includes the name and records NetTask as the base. The vtable is at 0x003d5128 and the object is 0x2c bytes. The step reports its progress through LobbyRT::ReportProgress(), from an estimate of the bytes each poll receives, and fails with RepoRemixStatusMsg::kStatusFailed.

Constructor & Destructor Documentation

◆ FileDownloadTask()

FileDownloadTask::FileDownloadTask ( String * pName,
char ** ppBuffer,
int * pnSize )
inline

Construct a step.

Inline.

Parameters
pNameThe file.
ppBufferThe buffer.
pnSizeThe size of the buffer in bytes.

Member Function Documentation

◆ OnResponse()

void FileDownloadTask::OnResponse ( int nConnection,
int nType,
int nSize,
const rtMediusFileTransferResponse * pResponse )
static

Copy a part of the file, and mark the step done after the last part.

The name is inferred.

Parameters
nConnectionThe connection.
nTypeThe kind of response.
nSizeThe size of the response.
pResponseThe response.
Ghidra address:
NTSC-U/C: 0x00266a70
Ghidra address:
PAL: 0x00270598

◆ OnStart()

void FileDownloadTask::OnStart ( )
overrideprotectedvirtual

Send the request.

Ghidra address:
NTSC-U/C: 0x00266900
Ghidra address:
PAL: 0x00270428

Reimplemented from Task.

◆ OnPoll()

void FileDownloadTask::OnPoll ( )
overrideprotectedvirtual

Report the estimated progress, and finish once the last part arrived and the estimate passes 99 percent.

Ghidra address:
NTSC-U/C: 0x002669b0
Ghidra address:
PAL: 0x002704d8

Reimplemented from Task.


The documentation for this class was generated from the following file: