eb048e8611
This looks easy, but is rather hacky... Downloading is implemented through the precacher. The server sends an asset list, while loading the map another one is generated. CL_RequestNextDownload() goes through this list, in the order models / maps -> sounds -> images, calls CL_CheckOrDownloadFile() for each file. CL_CheckOrDownloadFile() checks if the file is already there, return true if it is and false if not. If the return code is false CL_RequestNextDownload() itself returns, it's called again by CL_ParseDownload() as soon as the just queued file finished downloading. This way all missing files are downloaded one after the other, when CL_RequestNextDownload() finally reaches it's end (all files are there) it send 'begin' to the server, thus putting the client into the game. HTTP downloads are parallel, so CL_RequestNextDownload() cannot track which files are there and which are missing. The work around for that is to queue the file but have CL_CheckOrDownloadFile() return true. So CL_RequestNextDownload() thinks the file is already there, continues with the next one, until all missing files are queued. After that it polls CL_PendingHTTPDownloads() and sends the 'begin' as soon as all HTTP downloads are finished. If a HTTP download fails we cannot just queue it as UDP download, because the precacher things that the file is already there. And we can't tell the precacher that it's not because the precacher tracks files only by the number of downloaded files per asste type and not their name. Just decreasing the number of downloaded files isn't possible since the precacher may have progressed to the next asset type. So: On the HTTP side it's tracked if there was an error or not. After CL_RequestNextDownload() has queued all files and waited for all HTTP downloads to finish it checks the HTTP error status. If there was an error the precacher state is reset and CL_RequestNextDownload() recurses into itself to take another run. All files that couldn't be downloaded are queued again, this time as UDP downloads. |
||
---|---|---|
doc | ||
src | ||
stuff | ||
.gitignore | ||
CHANGELOG | ||
CMakeLists.txt | ||
LICENSE | ||
Makefile | ||
README.md |
Yamagi Quake II
This is the Yamagi Quake II Client, an enhanced version of id Software's Quake II with focus on offline and coop gameplay. Both the gameplay and the graphics are unchanged, but many bugs if the last official release were fixed and some nice to have features like widescreen support and a modern OpenGL 3.2 renderer were added. Unlike most other Quake II source ports Yamagi Quake II is fully 64 bit clean. It works perfectly on modern processors and operating systems. Yamagi Quake II runs on nearly all common platforms; including FreeBSD, Linux, OpenBSD, Windows and OS X (experimental).
This code is build upon Icculus Quake II, which itself is based on Quake II 3.21. Yamagi Quake II is released under the terms of the GPL version 2. See the LICENSE file for further information.
Documentation
Before asking any questions read through the documentation! The current version can be found here: doc/01_index.md
Releases
The official releases (including Windows binaries) can be found at our homepage: https://www.yamagi.org/quake2