Wadseeker Class Reference
Main controlling class.
More...
List of all members.
Detailed Description
Main controlling class.
The Wadseeker class provides an interface for searching for and downloading modifications for Doom engine games. Wadseeker will search for mods in a list of locations provided by setPrimarySites.
Wadseeker will ignore a predefined set of file names which it suspects to be attempts to illegally download commercial game data, so passing in any name which is found in iwadNames will result in the file being ignored.
Using Wadseeker is quite simple, there are three steps required for use:
- Initialize an instance of Wadseeker
- Configure some values such as the sites to search in and target directory.
- Create a list of wads to search for and pass it into seekWads.
Observe the following example on how to do these things.
Member Enumeration Documentation
Wadseeker library uses a message system that contains a type of message together with a string representing it's content. Types should be treated as follows:
- Notice - this is just an information of what Wadseeker is currently doing
- NoticeImportant - an information on an important event
- Error - something bad happened but Wadseeker is able to continue by itself.
- CriticalError - Wadseeker stops working after such error. Programmer should return control to the main application.
Constructor & Destructor Documentation
Wadseeker::~Wadseeker |
( |
|
) |
|
Member Function Documentation
void Wadseeker::abort |
( |
|
) |
[slot] |
Issues abort commands throughout entire library. aborted() signal is emitted when Wadseeker finishes aborting.
void Wadseeker::aborted |
( |
|
) |
[signal] |
Emitted after abort() method is used and when it's safe to assume that Wadseeker finished all its jobs.
void Wadseeker::allDone |
( |
|
) |
[signal] |
Emitted when Wadseeker finishes iterating through all files passed to seekWads() method. This signal is emitted regardless if all files were found or not. To check this use areAllFilesFound() method.
bool Wadseeker::areAllFilesFound |
( |
|
) |
const |
- Returns:
- true if all files that were passed to seekWads() method were found.
const QString Wadseeker::defaultIdgamesUrl |
( |
|
) |
[static] |
- Returns:
- Default URL of Idgames archive, hardcoded into the library.
QStringList Wadseeker::defaultSitesListEncoded |
( |
|
) |
[static] |
Runs content of defaultSites array through QUrl::toPercentEncoding() and returns a list of so encoded strings.
void Wadseeker::downloadProgress |
( |
int |
done, |
|
|
int |
total | |
|
) |
| | [signal] |
Emits download progress. Programmer may use this to update a progress bar, for example.
- Parameters:
-
| done | - bytes downloaded |
| total | - size of file |
float Wadseeker::downloadSpeed |
( |
|
) |
const |
Retrieves speed of current download in bytes per second.
- Returns:
- If it is impossible to calculate time due to insufficient data being present returned value is 0.
float Wadseeker::estimatedTimeUntilArrivalOfCurrentFile |
( |
|
) |
const |
Retrieves amount of seconds REMAINING till current download is finished.
- Returns:
- If it is impossible to calculate time due to speed being equal to zero or insufficient data being present returned value is negative.
const QStringList & Wadseeker::filesNotFound |
( |
|
) |
const |
- Returns:
- list of files that weren't found
bool Wadseeker::isForbiddenWad |
( |
const QString & |
wad |
) |
[static] |
Attempts to detect if the input is on a list of forbidden wads.
- Parameters:
-
| wad | Name of wad trying to be searched for. |
- Returns:
- True if Wadseeker will refuse to download the wad specified.
- See also:
- iwadNames
Emitted when Wadseeker wants to communicate about its progress with outside world.
- Parameters:
-
void Wadseeker::messageSlot |
( |
const QString & |
msg, |
|
|
int |
type | |
|
) |
| | [protected, slot] |
This slot acts as a pipe to the message signal.
- See also:
- message
void Wadseeker::seekWads |
( |
const QStringList & |
wads |
) |
|
Library's "entry" method. This is where Wadseeker begins to iterate through WWW sites to find all files specified on the list.
- Parameters:
-
| wads | - list of files that will be searched for |
void Wadseeker::setCustomSite |
( |
const QUrl & |
url |
) |
|
Sets a custom site. This site has priority over all other sites and will be searched first. For example a link provided by the server can be passed here.
- Parameters:
-
| url | - a valid, absolute URL |
void Wadseeker::setPrimarySites |
( |
const QStringList & |
lst |
) |
|
Sets a list of primary sites. This is where Wadseeker begins it's search and where it returns to if nothing of interest was found on other pages.
- Parameters:
-
| lst | - list of valid, absolute URLs |
void Wadseeker::setPrimarySitesToDefault |
( |
|
) |
|
Convenience method. Sets list of primary sites to sites hardcoded into library itself.
- See also:
- defaultSites
void Wadseeker::setTargetDirectory |
( |
const QString & |
dir |
) |
|
Target directory is a directory where all seeked files will be saved.
void Wadseeker::setTimeConnectTimeout |
( |
int |
seconds |
) |
[static] |
Sets time after which to abort connecting if no response is received.
- Parameters:
-
| seconds | - time in seconds |
void Wadseeker::setTimeDownloadTimeout |
( |
int |
seconds |
) |
[static] |
Sets time after which to abort downloading if data stops coming.
- Parameters:
-
| seconds | - time in seconds |
void Wadseeker::setUseIdgames |
( |
bool |
use, |
|
|
bool |
highPriority = false , |
|
|
QString |
archiveURL = defaultIdgamesUrl() | |
|
) |
| | |
Sets parameters for Idgames protocol.
- Parameters:
-
| use | - If true, idgames search will be performed. If false, idgames archive will be skipped. |
| highPriority | - If true, idgames archive will be searched right after the custom site. If false, idgames archive will be searched after all other sites fail. |
| archiveURL | - URL to Idgames search page |
void Wadseeker::skipSite |
( |
|
) |
[slot] |
Skips current site and proceeds to the next one in the queue.
QString Wadseeker::targetDirectory |
( |
|
) |
const |
Target directory is a directory where all seeked files will be saved.
QStringList Wadseeker::wantedFilenames |
( |
const QString & |
wad, |
|
|
QString & |
zip | |
|
) |
| | [static, protected] |
Returns the name of the actual files that will be searched for. For example, if somemod.wad was searched for, this would return somemod.wad and somemod.zip
- Parameters:
-
| wad | Absolute file being searched for. (ex: somemod.wad) |
[out] | zip | - returns name of according zip file |
void Wadseeker::wwwAborted |
( |
|
) |
[protected, slot] |
Member Data Documentation
Initial value:
{
QString("http://doom.dogsoft.net/getwad.php?search=%WADNAME%"),
QString("http://www.wadhost.fathax.com/files/"),
QString("http://hs.keystone.gr/lap/"),
QString("http://www.rarefiles.com/download/"),
QString("http://supergod.servegame.com/"),
QString("http://wads.coffeenet.org/zips/"),
QString("http://wads.interdoom.com/"),
QString("")
}
List of default sites to search for files.
- See also:
- setPrimarySitesToDefault
Initial value:
{
"attack", "blacktwr", "bloodsea", "canyon", "catwalk", "combine", "doom",
"doom2", "fistula", "garrison", "geryon", "heretic", "hexen", "hexdd",
"manor", "mephisto", "minos", "nessus", "paradox", "plutonia", "subspace",
"subterra", "teeth", "tnt", "ttrap", "strife1", "vesperas", "virgil",
"voices", ""
}
List of file names that will be ignored as they are part of a commercial product. Empty string at the end of the array is required and indicates the end of the array.
- See also:
- isForbiddenWad
The documentation for this class was generated from the following files: