A client joins a 1.3 server whose mod it lacks and downloads it over HTTP.
python3 scripts/www_download_test.py /path/to/CoD2 [--binary PATH] [--server PATH | --plus-server PATH] [--wine WINE] [--disconnect]
Serves a mod (one 3 MB .iwd) from a temporary home: the dedicated server runs
it with sv_wwwDownload 1 and sv_wwwBaseURL pointing at an HTTP server this
script runs on 127.0.0.1. A client with cl_allowDownload 1 connects: it must
fetch the .iwd over HTTP (a GET answered 200), keep it byte for byte, and then
join the game. --disconnect sets sv_wwwDlDisconnected 1 (the client leaves,
downloads and reconnects, as most public servers ask). With --wine the client
is a Windows one (cod2_win32.exe, which downloads through WinINet) run by the
given wine command. --http-404 answers 404 and --truncate cuts the transfer
at half of its Content-Length: the client must leave HTTP and fetch the .iwd
from the server itself, whole. --plus-server runs the given CoD2 1.3 Plus
server (OpenCoD2-Plus Server's make PLUS=1) with sv_wwwBaseURL auto and no
HTTP server here: the client must fetch the .iwd over HTTP from that server's
game port (the server logs the finished transfer). The client needs a CD key in ~/.cod2/preferences: without
one the test is skipped (exit 0). It opens a window. Only 1.3 (protocol 118)
has redirected downloads. Exits with 0 when all of that holds.