CoDX 1.0.4 - a quality-of-life patch for Call of Duty (2003) Multiplayer 1.1
============================================================================

CoDX modernizes the CoD1 multiplayer client without touching any game files:
it is a small mss32.dll that loads with the game and patches it in memory.
The CD key, licensing and PunkBuster/anti-cheat are not touched.

Requirements
------------
- Call of Duty Multiplayer, patched to version 1.1 (CoDMP.exe 1.1)
- Windows 10 or 11


INSTALL
-------
1. Close Call of Duty.
2. Extract this zip into your Call of Duty folder (the folder with CoDMP.exe).
   You now have a "CoDX" folder next to CoDMP.exe.
3. Open the CoDX folder and double-click install.bat.
4. Start the game as usual (CoDMP.exe). The main menu shows "1.1 CoDX v1.0.4" in the
   bottom-right corner when CoDX is active.

The installer keeps the game's own mss32.dll as mss32_orig.dll. If the game is
in "Program Files" and the installer says it can't copy, right-click
install.bat and choose "Run as administrator".

Updating: extract the new zip over the old CoDX folder and run install.bat again.


UNINSTALL
---------
1. Close Call of Duty.
2. Double-click uninstall.bat in the CoDX folder.
   It puts the original mss32.dll back and removes CoDX's Windows
   "fullscreen optimizations" setting for CoDMP.exe.
3. Delete the CoDX folder if you like.

Manual uninstall: delete mss32.dll in the game folder and rename
mss32_orig.dll back to mss32.dll.


WHAT CODX DOES
--------------
Mouse and timing
- Raw mouse input: true 1:1 aim, no Windows acceleration, read as late as
  possible each frame (lower input lag); handles high-polling-rate mice
  (4000-8000 Hz); works after vid_restart
- Warns in the console if settings that add input lag are on (m_filter,
  cl_mouseAccel) and suggests r_finish for lower latency
- Exact FPS cap: com_maxfps 250 / 333 gives exactly that, steady frame times
- Lower stutter: CPU core pinning, raised priority, memory locked in RAM

Display
- Borderless fullscreen at your desktop resolution: instant alt-tab
  (also borderless windowed mode via cx_borderless)
- Desktop brightness restored while alt-tabbed
- Crash fix for modern graphics drivers (long OpenGL extension list)
- DPI aware (sharp on scaled displays), cg_fov up to 100
- Big-map support: more memory for large custom maps that fail to load on the
  stock game

HUD
- Clean FPS counter (top right) and a crisp, modern version of the stock
  lagometer (bottom right): timing band, ping bars, dropped packets, loss %
- "Connection Interrupted" text hidden (the lagometer shows it instead)
- ^8 and ^9 colour codes work exactly like in CoD2 in names, chat, the
  scoreboard and menus: ^8 = the map's allied team colour (green, blue or red),
  ^9 = the axis team colour (grey), white when no server sets them. The
  console still shows them as text.
- Chat lines with a colour code before ^7 (e.g. "^5Message: ^7Hello") no
  longer get a gap in the middle (fixes a bug in the original game)
- Player names keep ^0 (black) and ^8 when the server runs CoDX: just type
  ^0Name, no more "^^00" trick (the original server deleted ^0 and ^8 from
  names). On servers without CoDX those two codes are still removed from names.
- Chat you are typing is kept when you die, a new round starts, a menu opens
  or you reconnect - it only goes away when you send it or cancel it (fixes a
  bug in the original game where the message was lost)

Downloads and servers
- Fast HTTP downloads from servers that set sv_wwwBaseURL, with a download
  screen showing file, progress, speed and time left
- Faster normal (non-HTTP) downloads
- Always connects after downloading (automatic reconnect if the server stalls)
- Server browser: sorted by ping, clean server names, backup master server
  (master.cod.pm) when the official one does not answer
- cl_maxpackets up to 125

Security and stability
- Blocks downloads with unsafe file names and malformed download data from
  malicious servers (fixes a crash bug in the original game)
- Downloaded files are checked to be real .pk3 archives
- Crash reports: cx_crash_<date>.dmp next to CoDMP.exe
- Console never goes blank after a disconnect or reconnect (fixes a bug in
  the original game where you had to type /clear to see it again)
- Player HWID: a hardware-based player ID (cl_guid) sent to servers, so server
  admins can identify and ban players. It is derived from your PC's hardware
  and recomputed each launch (nothing is stored), so it cannot be reset by
  deleting a file. Only an opaque number is sent, never your actual hardware
  details. See "For server operators" below.

First launch
- On the first start CoDX sets recommended values for settings you have never
  changed yourself: r_fullscreen 1 at your desktop resolution, rate 25000,
  cl_maxpackets 125, snaps 40, com_maxfps 333, cg_lagometer 1, cg_drawfps 1.
  Anything you already set is kept, and you can change all of them later.


SETTINGS (console cvars, saved in your config)
-----------------------------------------------
cx_rawInput 1          raw mouse input (0 = stock mouse)
cx_fullscreenMode 1    borderless fullscreen at desktop resolution (0 = stock)
cx_borderless 0        borderless window when running windowed (r_fullscreen 0)
cx_dpiAware 1          mark the game DPI-aware (sharp on scaled displays)
cx_fps 1               FPS counter (2 = also 1% low and frame time, 0 = stock)
cx_fpsScale 1          FPS counter size; cx_fpsX / cx_fpsY move it
cx_lagometer 1         modern lagometer (0 = stock look); needs cg_lagometer 1
cx_lagometerScale 1    lagometer size; cx_lagometerX / cx_lagometerY move it
cx_lagometerText 1     show "n% loss" on the lagometer when there is loss
cx_hudFontName "Segoe UI"  font used for the FPS counter
cx_hideInterrupted 1   hide the "Connection Interrupted" text and icon
cx_keepChat 1          keep unsent chat through death / new round / menus
cx_color8 ""           ^8 colour as "r g b" (0-1); empty = map's allied colour
cx_color9 ""           ^9 colour as "r g b" (0-1); empty = axis colour (grey)
cx_wwwDownload 1       HTTP downloads when the server offers them
cx_fastUdpDownload 1   faster normal downloads
cx_dlScreen 1          new download screen (0 = stock)
cx_master ...          server browser master (default codmaster.activision.com)
cx_masterFallback ...  backup master, default master.cod.pm ("" = off)
cx_versionLabel 1      "1.1 CoDX v1.0.4" in the main menu
cx_cpuAffinity 1       pin the game to one CPU core (cx_cpuCore N to choose)
cx_priority 1          above-normal priority
cx_lockMemory 1        keep the game in RAM
cx_disableFSO 1        disable Windows fullscreen optimizations for CoDMP.exe
cx_logConsole 1        copy the console to cx_patch.log while downloading


FOR SERVER OPERATORS
--------------------
CoDX clients send two extra values in their userinfo on connect:
  cl_guid   the player's HWID - a non-zero unsigned 32-bit number derived
            from the hardware, stable per machine (survives a reinstall),
            recomputed each launch (not stored on disk)
  cx        the CoDX version the client is running (e.g. "1.0.4")
A server-side mod/script reads these from the player's userinfo. Use cl_guid
for identification, stats and bans. Because an unpatched client sends no "cx"
key, a server can optionally REQUIRE CoDX by kicking players without it - that
choice (and whether it is on) lives in your server mod, so it stays fully
toggleable. Note: like any client-side id, cl_guid can be spoofed by advanced
users or VMs; it stops casual ban-evasion, it is not hard anti-cheat.


TROUBLESHOOTING
---------------
- cx_patch.log (next to CoDMP.exe) lists what CoDX did on the last start.
- If the game crashes, please send cx_patch.log and the newest
  cx_crash_*.dmp file.
- The menu shows plain "1.1": CoDX is not loaded, or CoDMP.exe is not the
  official 1.1 version (CoDX then stays inactive and changes nothing).
- Mouse feels different: cx_rawInput 0 switches back to the stock mouse.


CHANGES
-------
1.0.4  ^8 and ^9 colour codes (as in CoD2). No more gap in chat lines that
       have a colour code before ^7. ^0 and ^8 allowed in player names on
       servers running CoDX.
1.0.3  Chat you are typing is kept through death, new rounds, menus and
       reconnects.
1.0.2  HWID player id (cl_guid) + CoDX version tag (cx) in userinfo.
       Darker FPS/lagometer backgrounds.
1.0.1  Console no longer goes blank after a disconnect/reconnect.
1.0    First release.
