OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
www_download_test Namespace Reference

Classes

class  Handler

Functions

 main ()

Variables

 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
str DEFAULT_BINARY = 'build/check-linux/cod2_linux'
str DEFAULT_SERVER = 'build/check-linux/cod2_lnxded'
str MOD = 'mods/dltest'
str IWD = 'zz_dltest.iwd'

Detailed Description

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.

Function Documentation

◆ main()

www_download_test.main ( )

Variable Documentation

◆ DEFAULT_BINARY

str www_download_test.DEFAULT_BINARY = 'build/check-linux/cod2_linux'

◆ DEFAULT_SERVER

str www_download_test.DEFAULT_SERVER = 'build/check-linux/cod2_lnxded'

◆ IWD

str www_download_test.IWD = 'zz_dltest.iwd'

◆ MOD

str www_download_test.MOD = 'mods/dltest'

◆ ROOT

www_download_test.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))