|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Classes | |
| class | State |
| class | HttpHandler |
| class | HttpServer |
| class | WsHandler |
| class | WsServer |
| class | Pinger |
Functions | |
| ws_frame (opcode, payload, fin=True) | |
| make_certs (folder) | |
| tls_context (folder, name, max_version=None) | |
| start (server) | |
| wait_line (path, pattern, seconds) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| str | MOD = 'httptest' |
| str | CALLBACKS = 'maps/mp/gametypes/_callbacksetup.gsc' |
| str | MARKER = '[[level.callbackStartGameType]]();' |
| str | HOOK = 'thread maps\\mp\\gametypes\\_httptest::main();' |
| str | WS_GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
| str | ERROR_CALLBACK |
| str | TEST_SCRIPT |
| STATE = State() | |
| dict | RAW_RESPONSES |
Tests httpFetch and webSocket* against local HTTP, HTTPS, WS and WSS servers.
python3 scripts/http_test.py /path/to/CoD2 [--binary bin/cod2rev_lnxded]
The servers run in this process (Python standard library only; the HTTPS and
WSS certificates are made with the openssl command). A test script is
installed as a mod in a temporary folder, next to the game's own
_callbacksetup.gsc with one line added; it writes HTTPTEST lines to
games_mp.log, which are checked here. While a slow request is in progress the
server must keep answering queries, and after a map change the old map's
requests and connections must be dropped. Exits with 0 when every check passes.
| http_test.main | ( | ) |
| http_test.make_certs | ( | folder | ) |
A CA (RSA) and two server certificates it signs: ECDSA for HTTPS, RSA for WSS.
| http_test.start | ( | server | ) |
| http_test.tls_context | ( | folder, | |
| name, | |||
| max_version = None ) |
| http_test.wait_line | ( | path, | |
| pattern, | |||
| seconds ) |
| http_test.ws_frame | ( | opcode, | |
| payload, | |||
| fin = True ) |
| str http_test.CALLBACKS = 'maps/mp/gametypes/_callbacksetup.gsc' |
| str http_test.ERROR_CALLBACK |
| str http_test.HOOK = 'thread maps\\mp\\gametypes\\_httptest::main();' |
| str http_test.MARKER = '[[level.callbackStartGameType]]();' |
| str http_test.MOD = 'httptest' |
| dict http_test.RAW_RESPONSES |
| http_test.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| http_test.STATE = State() |
| str http_test.TEST_SCRIPT |
| str http_test.WS_GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |