Everything this fork adds to voron00/CoD2rev_Server, in detail: the functions, variables and fixes behind each milestone that the README summarizes. The script functions marked as coming from zk_libcod keep its names and arguments, so scripts written for it run here.
-
Releases: ready-to-run archives for Linux and Windows, from
v1.0.0-rc1, on the Releases page. -
Windows build with MinGW (32-bit), cross-compiled from Linux or built on Windows itself from
cmdwith MSYS2's MinGW-w64; GitHub Actions checks both. -
Game version selectable at build time: the server can be built as 1.0 or as 1.3.
-
Hardened builds: the stack protector,
_FORTIFY_SOURCEchecks and, on Linux, read-only relocations are on, so many buffer overflows stop the server instead of being exploitable.-fno-strict-aliasingand-fwrapvkeep the reversed code, which casts between types and relies on signed overflow wrapping, correct at higher optimization levels. -
Linux 64-bit by default:
makebuilds a 64-bit server that needs no 32-bit packages (gcc-multilib), andmake ARCH=x86the 32-bit one; it works as the 32-bit one, which stays the default. GitHub Actions publishes both. -
CoD2 1.3 Plus as a build:
make PLUS=1builds the server for the CoD2 1.3 Plus client; every other build is unchanged and takes stock clients. GitHub Actions publishes it ascod2rev_lnxded-1.3-plus. -
Trajectories and view bob in float, as 1.3: grenades, movers and the gravity of every entity with a trajectory, and the view bob that places a player's eye, were computed partly in double, in another order than the 1.3 client that predicts them; they now follow its float math. So do the hip spread added in the air, the side move on ladders, the damage kick, the radius damage box, the angle of a missile's landing, the weapon position's speed cap and the compass angle of teammates, whose constants were doubles where 1.3 loads floats; also the movement's damage timer, the speed while stunned and the animation lengths, which truncate a product to whole milliseconds.
-
Float math on SSE2: every x86 build computed with x87 at 80 bits, while the 1.3 client sets x87 to 24 bits and predicts movement with it; results also changed with how the compiler kept values in registers. The server now computes with SSE2, which rounds each float operation as the client does. 32-bit builds need an SSE2 processor (Pentium 4 or later).
-
Experimental arm64 build:
make ARCH=arm64on a 64-bit ARM host (a Raspberry Pi 3, 4 or 5 with a 64-bit system) builds a native server. It is experimental until a full match with several players has run on it. -
Simpler builds:
makebuilds the Linux binary directly,make windowscross-compiles for Windows, and GitHub Actions builds every variant on each push. -
Example
server.cfg:scripts/server.cfg.examplelists every variable the server registers;scripts/gen_server_cfg.pyregenerates it from the source. -
Launchers:
scripts/windows/iniciar_cod2rev.batandscripts/linux/iniciar_cod2rev.sh, with a LAN mode and an internet mode. Both use port28960, and they setlogfile 2(andsv_cracked 1in LAN mode only) before+exec server.cfg, soserver.cfgcan change them; another config can take its place (CFG=plus.cfgon Linux, a second argument such asiniciar_cod2rev.bat internet 20hz.cfgon Windows); they used to set them after it, overriding the admin's config, and turned onsv_crackedin internet mode too. -
Script errors don't flood the log (
make PLUS=1): outside developer mode a runtime error does not end the script thread, as in the original game, so a broken mod repeats the same error every frame, and withlogErrors 1the console log got one block per frame. A Plus server prints the first one and then a line with how many times it happened, every 10 s, and the count left when the error stops; the scripts run as before. -
Ready config for a Plus server:
scripts/plus.cfgruns yourserver.cfgand then sets what a 60 Hz CoD2 1.3 Plus server with its own downloads needs (sv_fps 60,sv_allowDownload 1,sv_wwwDownload 1,sv_wwwBaseURL auto), with the router and firewall ports in its header.CFG=plus.cfg ./iniciar_cod2rev.sh internetorsystemctl enable --now cod2rev@plusstart it. -
systemd unit:
scripts/linux/cod2rev@.serviceruns one server per instance (cod2rev@publicexecspublic.cfg) with its ownfs_homepathin/var/lib/cod2rev/<instance>, as an unprivileged user, withnet_strictPort 1, a restart after a crash and a clean stop with SIGTERM. The port,dedicatedand the map can be set per instance in/etc/cod2rev/<instance>.env. -
One server for 1.0 and 1.3: the 1.0 build already plays with 1.3 clients, and
net_altPortopens a second port that announces 1.3, with its own heartbeats, so the same game appears in the server lists of both versions. Real 1.0 and 1.3 clients played one match, kills both ways. Run it on the 1.0 game files: withoutiw_15.iwd, whose scripts and menus 1.0 clients lack.
-
Traces into models at the map start: the skeleton memory for animated models was set up by the first server frame, so on the first map after startup a
bulletTracefrom a gametype'smainorCodeCallback_StartGameTypethat reached a script model crashed the server (zPAM Plusreonmp_toujane_fixandmp_burgundy). It is now set up before the game starts. -
Compressed messages bounded: the server Huffman-codes each message to a client into a stack buffer of the largest message size, but a rare byte takes up to 11 bits, so a message full of them (chat text, for one) grew past the buffer on 1.3; on 1.0 the buffer is 16 KB for snapshots of up to 128 KB. Compression now stops at the buffer's end and the client is dropped with
EXE_SERVERMESSAGEOVERFLOW. -
manymaps map names checked: the map name built the paths of the link manymaps creates, so
map ../x(from rcon, or a mod passing player text tomap) linked an.iwdfrom outside the library to outside the game folder. Names with/,\or:are no longer looked up in the library. -
Over-long query challenges ignored: a
getinfoorgetstatuswhose challenge filled the info string made every later key fail and print the whole string, about 16 KB of console and log per request. As in ioquake3, a challenge over 128 characters gets no reply. -
Rate limiter reports throttled: each request the limiter dropped started a script thread (
CodeCallback_CLSpam, orCodeCallback_DPrintfthrough the debug print), so a flood from forged addresses turned into script work. At most 10 drops a second are reported now. -
Rate limiter table keyed: addresses were spread over the table's 1024 chains by a fixed sum of their bytes, so forged packets from chosen addresses could fill one chain and make every lookup walk it. The spread now uses a random seed chosen at startup.
-
Download acks checked:
nextdlfor the block the client was on moved the window even when that block had never been read, so a burst of them made the next frame read many blocks at once. Only blocks already read can be acknowledged. -
Client commands per message capped: flood protection only kept commands from the game, so one message carrying hundreds of
userinfo,cporvdrcommands ran them all in one frame and lagged everybody. A message now runs at most 64 new commands; the client sends the rest again in its next packets.cpwith more checksums than the server has iwds is refused before its duplicate check, which cost the square of their number. -
Authorize replies after the connect: a reply to a challenge whose client had already connected still set the GUID a reconnect with that challenge takes, and one for challenge 0 matched an empty slot; both are ignored now. Replies are only checked by their source IP, so GUIDs should not grant admin rights.
-
Client address kept from others behind its IP: a packet with a client's qport moved the client's address to its sender before the netchan checked it, and voice did it with no check at all, so anyone behind the same IP (a NAT, a CGNAT) who guessed the 16-bit qport could talk as the client or, with a huge sequence number, make every later packet of the client look old until it timed out. A changed port is now taken only from a packet that continues the client's sequence (at most 1024 ahead), and never from voice; a client whose router changes its port keeps playing.
-
Gamestate requests limited: a client that had not entered the game could send
donedlas often as it liked, and each one made the server compress and send the whole gamestate, which froze the map for everybody. Requests from a client are now limited to 5 at once and 1 a second per slot; a refused one is sent as soon as the limit allows it, so a client that waits for it does not time out. -
connectrate limit: eachconnectclears about 500 KB and can run the gametype's connect code, so a flood with one valid challenge slowed the map for everybody. An address gets 10 attempts, then 1 a second, also on LAN, sharing the count withgetchallenge: players behind one NAT who all reconnect at once get in about one a second.127.0.0.1has no limit, because a local proxy's players all come from there.CodeCallback_CLSpamreceivesCONNECT:ADDRESS. -
iplist.txtbehind a local proxy: a proxied client is also checked by the real address the proxy reports, not only by the proxy's own. -
Joining during a
getchallengeflood: made-up addresses used up the global limit, and at 1000 requests a second a player needed 40 seconds to join, at 3000 they could not. A client that asks again now has a limit of its own and joins at its first retry, 3 seconds later. -
Bans checked on every connect:
iplist.txt, the GUID ban list and the temporary kick bans were only read when the authorize server answered, soiplist.txtdid not apply withsv_noAuthorize 1, to LAN addresses or after an authorize timeout, and none of them to a client resending its old challenge after a kick.connectnow checks them too; on those first three paths the GUID is unknown, so onlyiplist.txtcan refuse. -
Signed challenges: a challenge is now an HMAC of the player's address under a key drawn at startup, so a player whose challenge a flood of made-up addresses pushed out of the table still joins, a few seconds later. On LAN and with
sv_noAuthorizegetchallengetakes no slot and has no global limit.sv_challengeStateless 1does the same on the internet for a server under such a flood: the CD key is checked atconnect, and each join waits about 3 seconds more. -
Menu commands limited:
mr(menu responses) skips flood protection so menus keep working, and each one runs the gametype's scripts, so a client could send hundreds a second. A client now gets a burst of 20, then 20 a second. -
Malformed packets logged at most 10 a second: a bad command byte, a wrong user command count, a bad acknowledge, an invalid mute number or voice packet printed a line each, so one client could flood the console and the log.
-
Chat cannot show the game's messages: a chat line starting with byte 0x14 made the rest a localized string, so a player could show "Vote passed", a kick or any other game message after their name. Only 0x15, the mark the client itself puts at the start of chat, is kept.
-
Server lists during a query flood:
getinfoandgetstatusshared one limit of 10 replies a second, so a few addresses querying often hid the server from browsers and from the masters, and a flood also stopped the status this server sends the masters on its own.getinfo, whose replies are short, now has 100 a second of its own,getstatuskeeps its 10, and the masters skip both global limits. -
Votes limited per player: 1.3 checks for three votes called but never counted them, so one player could call vote after vote. A player now calls at most three votes a map (with
g_oldVoting 1, the default). -
Joining during a query flood:
getchallengeshared a limit of 10 replies a second withgetinfoandgetstatus, so a few spoofed queries kept players out. It has its own limit of 100 a second now. -
Rcon lockout after failed attempts: after several wrong passwords, the IP address is ignored by rcon for a while. A correct password resets the counter, and
127.x.x.xaddresses and those insv_rconWhitelistare never locked, so spoofed guesses cannot lock out the admin. The global limit of 10 requests a second runs before the password is compared, because spoofed guesses from a new address each time would otherwise only be limited by bandwidth: during a flood rcon only answers addresses insv_rconWhitelistand, unlesssv_limitLocalRconis on, local tools. Keep your admin addresses insv_rconWhitelist. -
Bounded strings in libcod script functions: the libcod
printfandsprintf, the asynchronous SQLite and exec calls and the player rename no longer write past their buffers when a script passes long strings.findConfigStringIndexandfindConfigStringIndexOriginalcheck that the whole range they search exists instead of only its ends, andtoUpperno longer returns unterminated text for strings of 1024 characters or more (they are cut to 1023). On Windows, manymaps andfile_linkcreate and remove links with the system calls instead ofdelandmklinkcommands built from unquoted paths, which broke on spaces and could run other commands. -
libcod SQLite, exec, JSON and MySQL fixes: an array or struct passed to an async SQLite or exec call is kept until its callback runs, and an async entity query whose entity is deleted meanwhile skips its callback instead of running it on another entity. An exec callback that calls
exec_async_checkdone()no longer runs itself again until the server crashes. A failed async SQLite query is printed to the console instead of raising a script error that repeated on everyasync_sqlite_checkdoneand held back all later results. Async queries no longer reserve 4 MB each or stallsqlite_open/sqlite_closewhile the worker runs, queries longer than 1024 characters are no longer cut, andsqlite_queryreturns NULL columns as""so later columns keep their index.json_stringifyandjson_saveturn an array with gaps in its indexes into a JSON object instead of dropping the indexes, andjson_saverefuses names ending in a dot or a space or containing:, which on Windows could still write a.cfg.mysql_real_connectandmysql_async_initializerno longer crash the server when the connection fails, andbinarybuffer_writeraises an error for a value of the wrong type. -
MySQL on 64-bit Linux:
make WITH_MYSQL=truebuilds the MySQL functions against the system's MariaDB or MySQL client library (no 32-bit one exists in today's distributions). A handle of 0 (a failedmysql_real_connect, ormysql_store_resultafter a statement without rows) passed to another MySQL function raised nothing and crashed the server; it is now a script error. Async queries no longer race with the script reading their results, andmysql_reuse_connectionno longer returns a connection aftermysql_close. In every build, anint64value such as a libcod handle can now be compared with and added to anint:handle == 0gave a type error. -
Network input hardening: a connected player could crash the server or overwrite its memory with an oversized compressed message, a fragmented message, a name containing
%(written to the log by the stock gametypes),callvote clientkickwith a negative number or voice packets. These paths are now bounds-checked, and the file handles of interrupted HTTP downloads are closed. -
libcod proxy address and downloads: the real address that a local proxy passes in the
ipuserinfo key is only trusted from127.0.0.1, must be an IPv4 address and is cleared on every connect. Adonedlfrom a player already in the game no longer makes the server resend the whole gamestate.getIP()returns127.0.0.1for a local client that came without a proxy; it returned an empty string.statusshows that real address, with the proxy's port. -
Downloads and passwords: the check meant to stop clients from downloading the stock
iw_*.iwdfiles never matched, so any client could fetch them (hundreds of MB each); they and the server-only_svr_iwds are now refused, also before an HTTP redirect. Downloads no longer get stuck when the map changes during one, a client message too large to decompress drops the client instead of being cut short, and rcon,g_passwordandsv_privatePasswordare compared in constant time. -
Bans, game log and other fixes found in zk_libcod:
addipandg_banIPskept a list of banned addresses that nothing checked; it is now enforced on connect, also for players behind a local proxy. The last address ing_banIPsis no longer skipped, and a longaddipno longer overflows the stack. Line breaks in chat messages and player names could write fake lines intogames_mp.logand splitgetstatusreplies; they are now removed. A wrong rcon password no longer holds up the right one, auserinfono longer swallows the next chat message, and holding the grenade button without grenades no longer hides the player's shots and footsteps from the others. The effect entities of grenade explosions are now freed instead of piling up until the map ends, a script that deletes a turret in use no longer ends the map, and a long map name passed to a script function no longer stops the server. -
Map names, format strings and script values:
mapfrom the console or rcon with a name of 64 characters or more, andcallvote maportypemapwith exactly 64, overflowed the map name buffer; they are now refused. Errors that put a script, entity or file name into their format string (an unknown weapon ingetWeaponModel, an animtree, atrigger_radius, an impure iwd) printed garbage or crashed when the name contained%, and errors while parsing script data files printed the wrong file and line and could crash. The script runtime error dialog and theCouldn't load fileerror now include the message and the file name, and the compiler checks the format strings of the print and error functions (-Wformat).setcvarandmakeCvarServerInfonow store the value with double quotes turned into single quotes, as their cleaning step intended. The bad rcon message and the netchan statistics keep working after the millisecond counter wraps, and master and authorize ports above 32767 are no longer printed negative. -
Fatal errors in the log: the reason of a fatal error only went to stderr; the console log now has it after
FATAL:, except for errors in the startup configs, before the log opens, and on Linux the log files are flushed before exiting. Both launchers setlogfileRotate 5, so the console log of a crash survives the next start. -
Crash reports: when the server crashes, it writes the signal or exception, the faulting address and the call addresses to the console and to
crash.loginfs_homepath.addr2line -f -e <binary> <address>turns them into source locations. On Linux the process then dies with the same signal as before, so core dumps still work. Every worker thread (SQLite, MySQL, exec, sounds, JSON, HTTP and WebSocket) gets its own alternate signal stack, so a stack overflow there is reported too instead of killing the server silently, and a failed thread creation prints its real error. An async SQLite query whose worker thread can't be started now raises a script error instead of waiting forever. -
Errors raised by an rcon command: rcon output goes to a buffer on the stack of the function that handles the packet, and an error (
error drop, or a drop in a map command) jumped out of it without ending the redirect, so the error message and the cleanup were written over that freed stack: the message was lost and the stack could be corrupted. The redirect is now flushed while the buffer is valid, so the rcon client gets the output up to the error and the console log the error itself. -
Async SQLite queries survive a map restart: queries still queued when a map or round restarted were dropped without a word, so writes made at the end of a round were lost: 498 of 500 in a test. They run now, and only their callback is skipped.
-
json_save_asyncon Windows: only the first save of a file worked; later ones returned 0 and left the old content. -
Big data no longer ends the map: the script string pool holds about 512 KB, and a JSON file with more distinct text than that, or a database cell of 64 KB, stopped the map with a terminal error.
json_parse,json_loadandjson_load_asyncrefuse documents with more than 256 KB of distinct text, andsqlite_queryandmysql_fetch_rowcut a cell to 64999 characters. -
MySQL functions gated, with timeouts: the handles of
mysql_*are raw pointers and they reach any host, so like the other unsafe functions they now need+set sv_libcodUnsafe 1. A connection gives up after 5 s, a read or write after 30 s, where a database that stopped answering used to freeze the server, and the async list holds at most 512 queries, finished ones included untilmysql_async_getresult_and_freecollects them; past that a new query is a script error. Mods that use MySQL need the variable. -
getArrayKeyswith numbers: it dropped integer keys, so an array indexed by numbers gave an empty list with no error. They come back as ints now, among the string keys. Keys that are objects are still left out. It also crashed the server on an array nothing else held, such asgetArrayKeys(strTok("a b", " ")). -
Unsafe libcod functions off by default: a mod could run shell commands, read or replace any file the server user can, read and write raw memory or send packets to any address.
system,execandexec_async_*,memory_*,binarybuffer_*,fopen,fread,fwrite,fclose,fsize,ftime,file_link,file_unlink,file_exists,remove_file/fremove,scandir,fs_loaddir/loadDir,sendPacketandprintOutOfBandnow raise a script error unless the server is started with+set sv_libcodUnsafe 1.sqlite_openopens its file underfs_homepath/<mod>asjson_savedoes (:memory:still works), and refuses paths that leave it and.iwd,.cfg,.gsc,.soand.dllnames.ATTACHandVACUUM INTOare refused, because SQL could otherwise create files anywhere, also through a player name in a mod's query.httpFetchandwebSocketConnectno longer connect to loopback, private, link-local, shared or multicast addresses, also when a public name resolves to one, unless the server is started with+set sv_httpAllowPrivate 1. Both variables can only be set on the command line, and a script'ssetCvardoes not change them. Mods that use these functions need the variable. With it on, a mod must never build their commands, paths or addresses from player text, which would give that player the server's shell or files. -
Too many dvars is no longer fatal: the server holds at most 1280 dvars, and one more stopped it with a fatal error. A script that names a new dvar with
setCvarormakeCvarServerInfowhen there is no room now gets a script error, andset,seta,sets,setu,dvar_bool,dvar_intanddvar_floatfrom the console, rcon or a config print an error. A mod that stores data in one dvar per player or per round could stop a server this way after enough maps. -
Precache limits that warn instead of stopping the map (from zk_libcod, same names): with
g_safePrecache 1, a model or effect past the engine's limits, or a model set without being precached, prints a warning and shows the default model (xmodel/default_static_model) or the missing-effect sprite instead of ending the map; both take index 1, set aside when the map loads.g_reservedModelskeeps that many model slots out of reach of the map's own entities, so the map, gametype andstartGameTypescripts can still precache their models on maps with many of them. Both take effect from the next map. -
Plus ID: the OpenCoD2-Plus client can prove a key-pair identity at connect: it signs the challenge and the server address with ECDSA P-256 and the server gives the player an ID such as
P-ABCD-EFGH-IJKL-MNOPthat no one else can take, with no hardware data. The keys are optional, so every build takes them and other clients join as before, without an ID; an invalid signature or another server's address only leaves the player without one, and is logged.sv_requirePlusId 1refuses players without an ID,sv_publicAddressnames the address players dial (needed behind NAT; a port in it is the one players dial, fordocker -por a NAT remap; on a LAN only the host's own IPs are taken),rcon plusIdStatuslists the IDs and scripts read them withgetPlusId(). The server also counts the playtime of each ID inplusid_seen.txt(sv_plusIdSeenFile, which several servers can share), shown byplusIdStatusand read withgetPlusIdPlaytime()andgetPlusIdFirstSeen().rcon banPlusId <id|clientnum> <minutes> <reason...>andunbanPlusId <id>keep local bans inplusid_bans.json: a banned ID is dropped and refused with the reason, and a new ID that shares the guid or IP of a live ban is only flagged (plusIdStatus,getPlusIdFlags(), log). Shared ban lists:sv_banLists "url|pubhex;..."names up to 8 signed lists of IDs that the server fetches everysv_banListRefreshminutes, verifies with the maintainer's key, caches inplusid_lists/and applies even when the host is down; a bad, oversized or older version keeps the last good one, andrcon banListStatusshows each list's state.scripts/banlist.pymakes keys, signs, verifies and checks lists. See plus-id.md.
- Script VM optimized: the interpreter loop was built without optimization because its state had to survive the jump out of a script error. That state now stays in memory, so the loop is optimized like the rest: a script-heavy loop runs about 11% faster.
- CoD2 Plus handshake: the
make PLUS=1build (CoD2 1.3 Plus) only takes the CoD2 Plus client, and tells any other client to update to CoD2 1.3 Plus. The 1.0 build, bots and local clients are not affected. - CoD2 Plus snapshots: the
make PLUS=1build sends the CoD2 Plus client entity times as a short offset, about 12% less traffic at 40 Hz. Plus version 122 needs the matching client. - CoD2 Plus gameplay rules (Plus version 123): the
make PLUS=1build fixes bugs that zPAM fixed from script, for Plus clients only, which predict the same (plus-protocol.md):- Fast reload: firing a bolt-action or the shotgun, pressing reload and switching weapons twice no longer fires again sooner than the rechamber allows. With those weapons a switch taken back while the weapon still drops raises it again (so does a drop for a ladder or a mantle that ends in time), and a reload that cuts the shot keeps the shot's time left.
- Prone peek: going prone while leaning no longer moves the head and hitbox from the side to the middle in one frame. The lean comes back to the prone limit as fast as a lean let go, about 300 ms, while the body goes down.
- Climbing sound: nothing changes here; the Plus client plays the weapon raise that a ladder or a mantle sends with no weapon, so every player hears what the climber hears.
- MG clip: leaving a turret keeps the player behind the gun, where using it put them, instead of taking them back to where they stood when they took it, so a turret can no longer be used to peek from behind cover.
- Antilag rewinds the pose too (
make PLUS=1): a shot is traced against the other players where they were when the shooter fired, but only their position went back: their lean, yaw, aim and stance flags stayed those of the present, so a shot at a head that leaned out a moment ago missed it. The Plus server keeps each player's pose for every frame and puts it back with the position, the animation of a stance change included: a shot at a head that was there before the player crouched, went prone or stood up hits it. - Antilag and killcam at 60 Hz: the server looked up its recorded frames as if
sv_fps60 meant 60 frames a second, but frames last 16 ms, 62.5 a second. A second back came out as 960 ms, so the antilag placed the other players up to two frames after the moment of the shot, and the killcam started late. It now counts whole frames. Nothing changes at 20 or 40 Hz. - The server sets the rate at 20, 40 and 60 Hz (
make PLUS=1): a Plus server is named by its rate andsv_fpsalone sets it. Every Plus client gets a snapshot every frame and 1,000 bytes a second per Hz (25,000 at least), whatever itsrateandsnaps, which stop at 25000 and 30.g_forceSnapsandg_forceRatestill set them, and a change by rcon now takes effect at once instead of when the player reconnects. 30 and 50 Hz are left out, as they stretch a script'swait 0.05. - Turrets and
trigger_hurtat anysv_fps(make PLUS=1): a manned MG took 50 ms off its time between shots every server frame, so above 20 Hz it fired faster: twice at 40 Hz, once a frame at 60. It now fires at its weapon's rate at any frame rate, an unmanned turret turns back at the same speed, and atrigger_hurthurts every 50 ms (or second) at 50 and 60 Hz too. Nothing changes at 20 Hz or in other builds. - Plus server serves its own downloads over HTTP (
make PLUS=1, Linux): a home server has no web host for its mod iwds, and the UDP download is slow. Withsv_wwwDownload 1andsv_wwwBaseURL auto(in a cfg, as the console takes//for a comment) the server redirects Plus clients toplus:<name>and serves the file itself on TCP on the game port, so open that port in TCP in the router. Only Plus clients use it; a Plus client too old to knowplus:(the released 123 client) refuses the redirect and gets the UDP download, where the stock server would drop it for awwwdl failbeforewwwdl ack. A request is served only to an IP that was just redirected to that file (other IPs are closed at once) (5 minutes to start; a started transfer finishes unless it moves under 1 MB in 30 s, and is then reset), onlyGETandHEAD, and all downloads sharesv_wwwMaxRate. One console line per finished download. On a Windows Plus buildautoredirects nobody. The client's part is in plus-protocol.md. - Votes survive a reconnect (
make PLUS=1): a player who left and joined again got a cleared client, so they could vote a second time in the same vote, or call three more votes. A Plus server keeps both by IP until the map changes; a player from the same IP who joins next takes them. - Fixed shotgun pellet spread (from CoD2x, same name): with
g_shotgun_spread_fix 1the shotgun's 8 pellets follow one of CoD2x's two fixed patterns, turned at random per shot, so the same shot no longer kills or misses by chance; zPAM 4.x tunes its shotgun ranges for it. The server traces the pellets and sends their impacts, so every client, stock or Plus, sees them where they hit. Off by default. waitfollowssv_fps: scripts keep their timing in seconds at any server frame rate, instead of running faster with it. Above 20 Hz (make PLUS=1) the part of a frame a wait cannot take carries to the thread's next wait, so a loop ofwait 0.05at 62.5 Hz averages 50 ms instead of 48, andwait 11 s instead of 1.008.- 20% less traffic to clients: the snapshot writer sent every field of a changed entity in full, even the ones that had not changed. It now marks them as unchanged, as the original does, with the same network format, so every client benefits.
- Master servers:
sv_master2is preset tomaster.cod2x.me, the CoD2x community master.- The
host:portformat insv_master1–sv_master5now works. - A DNS failure is retried instead of clearing the master.
- On Linux,
+set sv_master2 ""on the command line now clears the master. The empty argument used to vanish, sosetchanged nothing and the server kept sending heartbeats to it.
- Overflow fix for Game Pass clients: sending the system info to a client using protocol 119 could overflow a buffer and crash the server.
- Large messages from 1.3 clients: fragmented messages sent by 1.3 clients were misread and dropped; they are now read in the 1.3 format.
dedicatedis honoured:+set dedicated 1was ignored and every server announced itself to the master servers. Now1keeps the server off the public list and2, the default, announces it.- Game files on Windows drives: the Linux build could not see the game files on file systems with large inode numbers, such as Windows drives under WSL. It is now built with 64-bit file offsets.
- Steady game clock on Linux: the server measured time with the wall clock, so every clock correction (NTP, virtual machine time sync) froze the game for a moment. It now uses the monotonic clock.
- Bots after a map change: after a map change, bots stayed connected but out of the game, holding their slots, so the bots mod kept adding more until the server was full. They now come back into the game as soon as the new map loads.
- Eye bob: the eye the server shoots from never bobbed:
BG_GetBobCycledivided the cycle by 255 as integers, so it was always a whole turn; as in 1.3 (0x4fddb6) it divides as a float, and a walking player's eye now bobs.BG_GetSpeedreturned the velocity's full length, so a jump or a fall counted as moving; as in 1.3 (0x4fde06), it takes the horizontal speed only, so the eye does not bob in the air. - Fewer stalls and a cleaner startup: the master server name is resolved once instead of on every authorization timeout, and the server no longer warns about every
+seton the command line.
- Mod folder layout (from zk_libcod, same names):
fs_callbacksnames the script with theCodeCallback_*functions (defaultmaps/mp/gametypes/_callbacksetup),fs_gametypesthe folder of the gametype scripts and their.txtdescriptions (defaultmaps/mp/gametypes), andfs_mapScriptDirectorieswhere a map'smainis:0maps/mp/<map>,1maps/mp/<map>/<map>,2that first and thenmaps/mp/<map>.loc_loadLocalizedMods 1lists the mod'slocalized_*.iwdfiles insv_iwds/sv_iwdNamestoo, so pure clients load them. With manymaps, a stock map's iwd in the library now replaces the stock one only withfs_replaceStockMaps 1; it used to be linked whenever the server changed to it from a custom map. - Load and network switches (from zk_libcod, same names):
sv_isLookingAtOnDemand 1skips the trace that finds what each player looks at every frame and runs it only when a script callsisLookingAt; it also turns off the friendly and enemy crosshair names andtrigger_lookat.sv_fastDownloadSpeed(1–8) sets how many messages a framesv_fastDownloadsends a downloading client.sv_minimizeSysteminfo 1sendstimescale,g_synchronousClients, the fall damage heights,sv_cheats,sv_disableClientConsole,sv_voiceandsv_voiceQualitywith the gamestate instead of the systeminfo, to leave room for the names and checksums of more iwds; a change reaches a client only with its next gamestate (zk_libcod's levels 2 and 3 do the same as 1 here, as the dvars they add do not exist). zk_libcod'snet_noFragmentationDelayis not needed: this server already sends all pending fragments of a message at once. - More admin switches (from zk_libcod, same names):
g_corpseHit 0makes bullets hit a corpse as the surface under it instead of with blood,g_spectateBots 0keeps spectators from following bots,g_logPickup 0leaves theWeapon;andItem;pickup lines out of the game log,sv_botKickMessages 0hides the message for kicked bots,sv_noAuthorize 1lets players in without asking the CD key authorization server (they get GUID 0), andsv_authorizeTimeoutsets how long a connecting player waits for that server (5000 ms, as before).sv_limitLocalRcon 1rate-limits rcon from LAN addresses too; unlike zk_libcod it is off by default, as LAN addresses were never limited here. zk_libcod'ssv_disconnectMessagesandsv_botReconnectModeare not needed: the disconnect message is already not shown, and bots already come back after a map change (sv_kickbotsdrops them instead). - Map ambience switches: as zPAM's
scr_allow_ambient_*cvars, but for every mod and map:g_ambientSound 0silences the distant battle sounds (ambientPlay),g_fireFx 0leaves out the map's loopedfx/fire/effects and the looped sounds whose alias containsfire(smallfire,medfire,bigfireon the stock maps),g_smokeFx 0the loopedfx/smoke/effects,g_weatherFx 0the loopedfx/dust/(the sand on Toujane),fx/misc/snow_andfx/misc/fogbank_effects, andg_fog 0the fog set bysetExpFogandsetCullFog. Only looped map effects (playLoopedFx) are filtered:playFx, such as the SD flak88 explosion, grenades and smoke grenades, is unchanged. The effect entities are still spawned but never sent, so scripts that keep or delete them work as before. A change applies from the next map ormap_restart. All are on by default; turning the fog off lets players see further. - Dvar queries show the right default: typing a dvar's name (in the console or through rcon) printed its current value as the default too, and on some compilers and CPUs the default as the current value;
dvarlistcould show the current value as the latched one. Both values had shared one text buffer. - Passwords kept out of the log:
rcon_passwordandsv_privatePasswordare shown as********in the console log. - Logging and admin settings: the console log can be renamed (
logfileName), keep the logs of previous runs (logfileRotate) and start each line with the date and time (logTimestamps). Accepted rcon commands can be left out of the log (sv_logRcon), the CD key authorization server can be changed (sv_authorizeServer,sv_authorizePort), the server can impose a rate and snapshot rate on every client (g_forceRate,g_forceSnaps), and the messages announcing a kick or a timeout can be turned off (sv_kickMessages,sv_timeoutMessages). The names are the same as in zk_libcod, so its configs keep working. - Long-running servers restart between maps: the server time only goes back to 0 when the server shuts down, and the engine forces that at about day 21.7, in the middle of whatever match is running. After about day 18.6 the server now does it on the next map change instead, so players are disconnected between maps; the forced restart remains for a map that never changes. Commands sent over rcon that shut the server down (
killserver, or a map change that restarts it) also get their reply now: it used to be sent to an empty address. - Snapshot counters reload the map instead of dropping players: on a map that runs for many hours without a map change or a round restart, the counters of the snapshot buffers reach their limit and the server shut down and dropped every player. Since every map load resets them, it now reloads the current map and the players stay connected, as on a map change.
- Clean shutdown on Linux: SIGTERM, SIGINT (Ctrl+C) and SIGHUP make the server quit as the
quitcommand does: players get the final message, the masters the flatline heartbeat, andgames_mp.logand the console log are closed (withg_logSync 0the last lines used to be lost). A second signal while it quits exits at once, a signal thatnohupor the shell ignores stays ignored, and SIGPIPE is ignored. On Windows, logging off or shutting down the system now quits the same way; closing the console window already did. - Console log errors: when the console log can't be opened (a read-only
fs_homepath, a badlogfileName), the server prints the reason once and tries again only whenlogfileorlogfileNamechanges. It used to print that the log was opened, retry on every line printed and rotate the older logs away withlogfileRotateon each retry. - Game log rotation: with
g_logRotateSize, agames_mp.logthat has reached that size is renamed togames_mp.log.1when the next map starts, keepingg_logRotateolder copies. It used to grow forever. - Strict port:
net_strictPort 1stops the server with an error whennet_portis busy, instead of starting on one of the next 9 ports, where players and the masters don't look for it.
- Last player methods from zk_libcod (same names):
getAuthorizationStatus()returns the CD key authorization server's answer for the player ("KEY_IS_GOOD","INVALID_CDKEY","BANNED_CDKEY"…, or""when the server was not asked),setActivateOnUseButtonRelease(1)makes uses (weapon pickups, planting, use triggers) happen when the player lets go of the button,lookAtKiller(inflictor, attacker)turns a dead player's view to the killer (entity numbers, as zk_libcod), andplayScriptAnimation(event, isContinue, force)plays an animation script event on the player's model and returns its duration. zk_libcod'ssetWeaponFuseTimeandsetWeaponRaiseTimeare left out: the client predicts both times. - More callbacks (from zk_libcod, same names and parameters):
_callbacksetup.gsccan defineCodeCallback_PlayerEvent(event, parm)(on the player, for each predictable player event such as firing or footsteps),CodeCallback_EntityEvent(event, parm)(on the entity, for each entity event such as an explosion or a bounce),CodeCallback_Notify(message, args)(on the entity, for each notify the engine sends to it: damage, trigger, menuresponse…),CodeCallback_NotifyDebug(object, message, args)(every notify, script ones included, at the start of the next frame; at most 4096 a frame and 16 arguments each),CodeCallback_MoverBlockage(mover)(on an entity that blocks a moving script brush model, model or origin),CodeCallback_MapWeaponsLoad(num, info)andCodeCallback_MapTurretsLoad(num, info)(before the gametype's main; withg_spawnMapWeapons 0org_spawnMapTurrets 0the map's weapons or turrets are not spawned nor precached and are described ininfo: classname, origin, angles and count for weapons; classname, origin, angles, the four arcs (-1when unset), model, weaponinfo, export and script_gameobjectname for turrets),CodeCallback_DPrintf(message)(every debug print of the main thread outside a running builtin, whose parameters it would clear, developer or not; unlike zk_libcod the message is still printed with developer set) andCodeCallback_CLSpam(type, ip)(when an address goes over the getinfo, getstatus, getchallenge, connect or rcon rate limit, at most 10 times a second in all; LAN addresses have no limit except on connect).g_noMoverBlockage 1lets movers go on when something blocks them. error(),logErrorsandexecute(from zk_libcod, same names):error(message, [terminal])raises a script error with that message, or ends the map whenterminalis set. WithlogErrors 1, script runtime errors are written to the console log without developer mode (the message only: file and line need developer mode).executeandexecute_async_*are zk_libcod's names forexecandexec_async_*and needsv_libcodUnsafeas they do.- More libcod callbacks and player methods (from zk_libcod, same names):
_callbacksetup.gsccan defineCodeCallback_Error(critical, function, message, position)(script runtime errors, delivered on the next frame; in developer modepositionis the"file:line"of the error, anddeveloper 2reports errors without stopping the map),CodeCallback_HitchWarning(msec),CodeCallback_Pickup(type, weapon, name, quantity, clip, origin, angles)(replaces the stock pickup),CodeCallback_Suicide()(replacessuicide();processSuicide()kills),CodeCallback_WeaponChange(index, name)and one callback per button press:Attack,Melee,Use,Reload,LeanLeft,LeanRight,Prone,Crouch,Stand,Ads,MeleeBreath,HoldBreath,FragandSmoke(CodeCallback_<name>Button()). New player methods:isFiring,isMeleeing,isReloading,isThrowingGrenade,isUsingBinoculars,isRechambering,isShellShocked,isChatting,holdBreathButtonPressed,get/setCurrentWeaponAmmo,get/setCurrentWeaponClipAmmo,getCurrentWeaponSlot,get/setSpeed,get/setGravity,getGroundEntity,getViewOrigin,getPlayerstateFlags,getInactivityTime,getEnterTimeandprocessSuicide. Unlike zk_libcod, the weapon change and error callbacks never run inside player movement or the script VM, and asuicide()insideCodeCallback_Suicidedoes not loop. - Admin and server functions (from zk_libcod, same names): player methods
muteClient/unmuteClient,setHiddenFromScoreboardandsetHiddenFromServerStatuswith theiris…getters (hidden players are left out of the scoreboard, or out ofgetstatusand thegetinfocount),setAllowSpectators,setConfigstringForPlayer,getServerCommandQueueSize,getCDKeyHashandgetClientHudElemCount; functionssetConsolePrefix,setNextTestClientNameandresetTestClientNaming.CodeCallback_RemoteCommand(from, args)receives accepted rcon commands andprocessRemoteCommand()runs them; it replacesremotecommand(from, pointer), which crashed the server with any value a script could pass.clientCommand()(alsoprocessClientCommand()) now only works insideCodeCallback_PlayerCommand, for that player, instead of running leftover arguments that could be another player's. A map command,killserverorquitrun withcmd_executestringorprocessRemoteCommand()no longer crashes the server (it runs once the script thread is done), and what a script set for a player withsetSpeed,setGravityand the like no longer carries over to the next player in that slot. graphAutodiscoverlinks likegraphAutodiscoverEx: the two built graphs apart, and the plain one linked every neighbour both ways as a walk, also across a drop or a hole. It now makes the same typed, one-way-down links: onmp_toujanethe same 2051 nodes with 23 fewer edges, and 20 nodes that only those edges reached are no longer accessible from the seed. A graph already saved does not change until it is rebuilt.- Waypoint graphs with A* and more script functions (from zk_libcod):
graphCreate,graphAddNode,graphAddEdge,graphFindPath,graphFindClosestNode,graphAutodiscover,graphSave/graphLoadand the rest of zk_libcod'sgraph*functions let bot scripts navigate a map (src/libcod/gsc_graph.cpp, ported under its MIT license). Unlike in zk_libcod, graphs are also cleared on a fastmap_restart(every round of SD), a bad id or file returns undefined without ending the script thread,graphLoadrefuses files over 64 MB and files with a negative or non-finite edge cost or a non-finite origin, andgraphSaverefuses.iwd,.cfgand.gscnames (also with a trailing.or space, or a:, which Windows would strip or read as a stream).graphAutodiscoverExalso takes an array of seed origins and floods from all of them at once, so a graph that reachessv_graphMaxNodesis spread over the map instead of filling up around the first seed, and it keeps linking the nodes it has after the cap. Also new:abs,floor,ceil,pow,atan2,roundTo,getMilliseconds,getMicroseconds,toHex,fromHex,ord,chr,getEntityCount,logPrintConsoleand thegetUserinfo/setUserinfomethods;bulletTraceandbulletTracePassedtake an optional content mask, andbulletTracealso returnsflags,contentsandmaterial; withsv_botUseTriggerUse 1, a bot standing in a use trigger (such as an SD bomb zone) getsself waittill("bot_trigger", trigger). - Weapon and combat functions (from zk_libcod, same names): player methods
setWeaponSpreadScale,setTurretSpreadScale,setMeleeRangeScale,setMeleeWidthScale,setMeleeHeightScale,setFireRangeScale,setBulletMask/getBulletMask,setFireThroughWalls,enableBulletImpacts/disableBulletImpacts,useTurret,canUseTurret,stopUseTurret,canMantle,getWeaponAnimation,forceShotandnoClip; entity methodsspawnGrenade,getGrenadeFuseTime/addGrenadeFuseTime,isTurret,getTurretOwner,get/setWeaponItemAmmo,get/setWeaponItemClipAmmoandget/setItemQuantity; functionsgetWeaponFuseTime,getWeaponRaiseTime,getWeaponMoveSpeedScale,getWeaponDisplayName,isSemiAutoWeapon,ignoreWeaponandresetIgnoredWeapons. Left out because the client predicts them and would stutter: zk_libcod's setters for jump height, step size and weapon move speed, andsetHoldingWeaponDown. - zk_libcod names and more script functions: zk_libcod's names now work for functions this fork already had under libcod's names (
executeCommand,sendCommandToClient,sendPacket,findConfigStringIndex,fremove,loadDir,getClientConnectState,connectionlessPacketToClient/ToServer,processClientUserinfoChange,throwGrenade,throwSmokeGrenade,setAim,setAnimation), so scripts written for zk_libcod run unchanged. New entity methodsgetTagOrigin,getTagAngles,hasTag,isLinkedTo,getVMin,getVMax,get/setClipmask,getContentsandsetLight; player methodsoverrideContents,isUseTouching,getProtocolString,setOriginAndAnglesandsetWalkValues(bots); functionsmakeString,makeClientLocalizedString,getCvarFlags,getSurfaceName,setNorthYaw,getMoversandget/setSavePersist.setAnimwith an animation name the server doesn't know returns false instead of stopping the map. - Per-player visibility, effects and collision (from zk_libcod, same names): entity methods
hideFromPlayer(the opposite of the stockshowToPlayer; undone when that player's slot is freed) andnotSolidForPlayer/solidForPlayer(a brush model one player walks through); player methodsplayFxForPlayer,playFxOnTagForPlayer,earthquakeForPlayer,enableEarthquakes/disableEarthquakes,setNorthYawForPlayer,setCullFogForPlayer,setExpFogForPlayer,objective_player_add/_delete/_icon/_position/_state(per-player compass objectives),enableSilent/disableSilent(the others stop hearing a player's steps and landings) andsetCollisionTeam/getCollisionTeam("axis","allies","none"or"axis_allies"). What a player walks through is also sent as not solid in that player's snapshots, so the client predicts the same as the server. Unlike zk_libcod, silenced events stay in the player's own playerState, so its prediction is unchanged. Left out: the manual snapshot entity list (zk_libcod's version breaks delta compression) and the talker icons (it fakes voice packets). - Physics for scripts (from zk_libcod, same names): script models can fall and bounce:
enableGravity([collideModels], [alignToGround]),disableGravity,isGravityEnabled,enableBounce([parallel], [perpendicular]),disableBounce,set/add/getEntityVelocityandset/getMaxEntityVelocity, withlandandbouncenotifies (surface name, ground entity). They move on the trajectories the client already extrapolates, so it draws the same path; unlike zk_libcod, the speed limit is also sent to the client, models no longer stick to walls and their angles surviveenableGravity. Withg_bulletDrop 1,enableBulletDrop/disableBulletDrop,setBulletVelocityandsetBulletDragmake a player's bullets fly over the next frames, dropping and slowing down, with impacts, penetration and the bullet settings above still applying; zk_libcod's bullet models are left out. - JSON (from zk_libcod, same names):
json_parse,json_stringify,json_load,json_saveand the non-blockingjson_load_async/json_save_asyncwithjson_async_done/json_async_resultturn JSON into GSC arrays and back, in memory or in files of the mod folder. Built on yyjson, which is compiled into the binary. Unlike zk_libcod, the async writer also works on Windows and saving.iwd,.cfg,.gsc,.soor.dllfiles is refused. - Sounds through voice chat (from zk_libcod, same names):
loadSoundFileencodes an 8192 Hz mono 16-bit sound (raw PCM or WAV) into Speex in the background, andplaySoundFileplays it to a player as voice chat from any player, withsound_file_done/sound_file_stopnotifies; alsostopSoundFile,isPlayingSoundFile,getRemainingSoundFileDuration,getSoundFileDurationandloadSpeexFile/saveSpeexFile. libspeex is compiled into the binary. Unlike zk_libcod, sounds take the memory they need (not a 513 MB array), the playback follows the real frame time, and Speex files can't overflow the voice queue. A WAV with a broken chunk size is refused instead of hanging the server, and chunks after the samples (such asLISTtags) are neither played nor counted in the duration. A player whose voice queue is full gets the rest of the sound on the next frames instead of losing those packets, andsaveSpeexFilerefuses names that end in a dot or a space, which Windows drops, soevil.cfg.can no longer get past its refusal of.iwd,.cfg,.gsc,.soand.dllnames. - HTTP and WebSocket clients (from zk_libcod, same names and callbacks):
httpFetch(url, method, data, headers, timeout, ::onDone, ::onError, [allowInsecure])makes one request and callsonDone(status, body, headers)(headers in an array keyed by lowercase name) oronError(message)on a later frame;webSocketConnect(url, headers, ::onConnect, ::onMessage, ::onClose, ::onError, [reconnectDelayMs], [pingIntervalMs], [allowInsecure])returns an id from 0 to 15 (or -1), reconnects on its own and delivers whole text messages, withwebSocketSendText(id, text)andwebSocketClose(id); thehttp_fetchandwebsocket_*spellings work too. Requests and connections run on their own threads, so a slow server never holds up the game, and they belong to the level: on a map change ormap_restartrequests are cancelled and connections closed, and nothing arrives late.http,https,wsandwssURLs only; bodies, headers and messages over 65000 bytes go toonError(messages are dropped); at most 16 requests and 16 connections at once; redirects are not followed (a 3xx comes toonDonewith itslocationheader). Atimeoutof 0 means the longest, a day. A response with a NUL or a control character in a header name, more than 100 header lines, aContent-Lengththat isn't plain digits (or repeated with different values) or more than 5 interim responses goes toonError. Each connection keeps at most 1 MB of messages the script hasn't taken yet (the rest are dropped and logged) and delivers at most 64 events per frame. Unlike zk_libcod, which is an optional Linux build with libwebsockets, this is built in on Linux and Windows with Mbed TLS 3.6 (src/libcod/mbedtls, Apache-2.0), WebSocket certificates are checked too (against the system's CA list orsv_httpCaFile, unlessallowInsecureis set), a badwebSocketConnectURL returns -1 instead of retrying, andsv_httpAllowedHostscan limit the hosts scripts reach. - More bot buttons in libcod: the script methods
useButton,throwSmokeandholdBreathmake a bot press use (to plant or defuse the bomb), throw a smoke grenade or hold its breath, like the existingfireWeaponandthrowNade. Each takes1to press and0to release.
- Bots use stairs between floors: the waypoint graph left upper floors and cellars cut off from the rest of the map, so a bot that spawned on one never left it: 27 of the 128 spawn points of mp_carentan and of mp_toujane, 5 of mp_burgundy, 12 of mp_brecourt; now 2, 3, 2 and 0.
graphAutodiscoverandgraphAutodiscoverExkeep a node per floor and per side of a wall in each grid cell, look a quarter and half a step aside for a doorway or a narrow stair, and link stairs by walking them in 8-unit steps. Graphs have about a third more nodes (mp_brecourt 16183). The cache is nowwaypoints/<map>_v3.graph, so maps build their graph again once. - Bots patrol only where they can walk: a random patrol node could be on a floor the graph does not connect, 13% of the time on mp_carentan, and the bot then stood at the closest point until the patrol timed out.
- Bots out of ammo fight on: a bot with nothing left kept pressing reload and never fired again. It now changes to its other weapon, or walks at the target to knife it.
- Simple bots:
mods/botsis a small script mod whose bots navigate each map over a waypoint graph built with the libcodgraph*functions: the first time a map is played the graph is generated from all its spawn points at once and saved aswaypoints/<map>_v2.graphin the mod folder, and later loads read it. With nobody in sight they follow what they last saw or heard shooting, patrol towards the enemy side, and only after 20 s without contact head for the nearest enemy. They aim down the sight at range, throw grenades at mid range, knife up close and reload between fights. In SD and CTF each life a bot draws a role: attackers plant the bomb or hunt, defenders guard a bomb site or hunt, and once the bomb is planted the defenders go to defuse it while the planters guard it; in CTF bots steal and bring home the enemy flag, or defend their own, chase its carrier and return it when it is dropped (SD in dual bomb mode is played without objectives).scripts/install_bots.pyinstalls it;bots_count,bots_skillandbots_debugcontrol them. - Bots play HQ: bots take the radio by standing inside it and guard it from around once their team holds it. Radios the waypoint graph can't reach (roofs, cut-off floors) leave the rotation when at least 3 others remain, because a neutral radio never goes away and no bot could take it.
- Fewer path searches and grenade suicides: a bot chasing a moving enemy searched a new path each time the enemy passed into the area of another waypoint, and every tick an enemy flickered in and out of sight; it now follows a moving goal twice a second (at once when the goal jumps far), so the busiest bot searches at most 6 times a second instead of 8. After a throw, a bot no longer walks towards where it threw for the fuse, and it checks the first 60% of the throw (up to 400 units) for cover the grenade would bounce off, not just 150 units: grenade suicides went from 2.8 to 1.4 per 100 throws.
- Whole graph on
mp_brecourt: the waypoint graph ofmp_brecourtneeds 15014 nodes, so the old cap of 8192 stopped the graph at about half of the map.sv_graphMaxNodesdefaults to 32768 (it was 16384, which the graph with floors nearly fills onmp_brecourt, 16183 nodes), andmp_carentan,mp_toujaneandmp_burgundy2085 to 3010. A graph cut off by the cap prints a warning on the console, so a big custom map shows that it needs more.
- Test client that reads snapshots:
scripts/cod2snap.pyparses everything the server sends to a client (gamestate, server commands, snapshots with the playerstate, entities and client states, in 1.0 and 1.3), andcod2client.read_frames()returns one frame per snapshot, so tests can check what one client receives. - HTTP and WebSocket test:
scripts/http_test.pyruns local HTTP, HTTPS, WS and WSS servers, makes a test mod callhttpFetchandwebSocket*against them, and checks the results, the certificate checks, the limits, malformed responses, WebSocket floods, that the server keeps answering during a slow request and that a map change ormap_restartdrops the old level's requests and connections. - Smoke test:
scripts/smoke_test.pystarts the Linux server against a real game folder and checks that it loads a map, answers queries and lets a minimal client (scripts/cod2client.py) connect, receive the gamestate, enter the game and send commands, including in fragmented messages. A second run in internet mode (dedicated 2) heartbeats to a fake master on127.0.0.1and checks the heartbeats, the status sent on its own, the replies to the master's queries and the flatline when SIGTERM stops it, with the real masters cleared so nothing leaves the machine. It also checks that SIGTERM exits with code 0 after closinggames_mp.log, that a console log that can't be opened is reported once and rotates nothing, thatg_logRotateSizerotates the game log thatnet_strictPortstops a second server on a busy port, and that abulletTraceinto a script model before the first frame works.
| Variable | Default | Range | Description |
|---|---|---|---|
sv_rconMaxAttempts |
5 |
0–100 | Wrong rcon passwords allowed per IP before the lockout. 0 disables the lockout. |
sv_rconLockTime |
600 |
0–86400 | Lockout duration in seconds. It is also the window in which attempts are counted. |
sv_rconWhitelist |
"" |
— | IP addresses, separated by spaces or commas, that are never locked out of rcon nor rate limited. Host names are ignored. |
logfileName |
"" |
— | Console log file, in fs_homepath/<mod>. Empty uses console_mp_server.log; names with .. or a full path are ignored. |
logfileRotate |
0 |
0–1000 | Logs of previous runs kept when the server starts, as <name>.1 (newest) to <name>.N. |
logTimestamps |
0 |
0–1 | 1 starts each console log line with the date and time. |
g_logRotateSize |
0 |
0–2047 | Size in MB at which g_log (games_mp.log) is rotated when the next map starts. 0 never rotates it. |
g_logRotate |
1 |
1–1000 | Older game logs kept when g_logRotateSize rotates it, as <name>.1 (newest) to <name>.N. |
sv_plus |
123 |
read-only | make PLUS=1 build only: the Plus protocol version, so a mod can require this build with getCvarInt("sv_plus"). Not sent in serverinfo; other builds do not have it. |
sv_plusNotice |
empty | text | make PLUS=1 build only: what a client without CoD2 Plus reads when refused. Empty uses the default, with the link to the client. |
net_altPort |
0 |
0–65535 | Second UDP port of the 1.0 build, announced as protocol 118 and version 1.3. 0 keeps it closed. Only read at start, so set it on the command line. |
net_strictPort |
0 |
0–1 | 1 stops the server when net_port is busy instead of trying the next 9 ports. Only read at startup, so set it on the command line. |
sv_logRcon |
1 |
0–1 | 0 leaves accepted rcon commands out of the log. Wrong passwords are always logged. |
sv_authorizeServer |
cod2master.activision.com |
— | CD key authorization server. A new value is used from the next connection. |
sv_authorizePort |
20700 |
1–65535 | Port of the authorization server. |
g_forceRate |
0 |
0–1000000 | Rate given to every client instead of its own (minimum 1000). 0 keeps the client's; on a Plus server, 0 is 1,000 bytes a second per Hz (25,000 at least). |
g_forceSnaps |
0 |
0–1000 | Snapshots per second given to every client. 0 keeps the client's; on a Plus server, 0 is a snapshot every frame. |
sv_wwwMaxRate |
1024 |
0–1000000 | make PLUS=1 build only: KB/s that all downloads of sv_wwwBaseURL auto share. 0 is no cap. |
sv_wwwMaxConnections |
4 |
1–64 | make PLUS=1 build only: downloads of sv_wwwBaseURL auto served at once; more are closed and the client uses UDP. |
sv_wwwMaxPerIP |
2 |
1–64 | make PLUS=1 build only: downloads served at once to one IP. |
sv_lanForceRate |
1 |
0–1 | 0 gives LAN clients the rate and snapshots of internet ones, instead of every frame with no rate limit. Plus build only. |
sv_kickMessages |
1 |
0–1 | 0 hides the message that tells everyone a player was kicked. |
sv_timeoutMessages |
1 |
0–1 | 0 hides the message that tells everyone a player timed out. |
sv_botUseTriggerUse |
0 |
0–1 | 1 sends a bot a bot_trigger notify, with the trigger, while it stands in a use trigger it could use. |
g_safePrecache |
0 |
0–1 | 1 turns model and effect precache overflows, and models set without precaching, into warnings: they are shown as the default model or missing effect. From the next map. |
g_reservedModels |
0 |
0–255 | Model slots the map's own entities can't use, kept for the scripts' precaches. From the next map. |
logErrors |
0 |
0–1 | 1 writes script runtime errors to the console log without developer mode (message only). On a Plus server the same message again prints only as a count, every 10 s. |
g_noMoverBlockage |
0 |
0–1 | 1 lets movers (script brush models, models, origins) go on when an entity blocks them. |
g_spawnMapWeapons |
1 |
0–1 | 0 neither spawns nor precaches the map's weapons; CodeCallback_MapWeaponsLoad gets them. |
g_spawnMapTurrets |
1 |
0–1 | 0 neither spawns nor precaches the map's turrets; CodeCallback_MapTurretsLoad gets them. |
g_corpseHit |
1 |
0–1 | 0 makes bullets hit a corpse as the surface under it instead of with blood. |
g_spectateBots |
1 |
0–1 | 0 keeps spectators from following bots. |
g_logPickup |
1 |
0–1 | 0 leaves weapon and item pickups out of the game log. |
sv_botKickMessages |
1 |
0–1 | 0 hides the message for kicked bots. |
sv_noAuthorize |
0 |
0–1 | 1 skips the CD key authorization server; players get GUID 0. |
sv_challengeStateless |
0 |
0–1 | 1 answers getchallenge with the signed challenge alone, with no slot and no global limit, and checks the CD key at connect: a flood of made-up addresses cannot keep players out, but each join waits about 3 seconds more. |
sv_publicAddress |
"" |
— | ip:port players reach the server at, which their Plus ID signatures must name; the port may differ from net_port (docker -p, a NAT remap). Empty: only LAN players get a Plus ID. |
sv_requirePlusId |
0 |
0–1 | 1 refuses players without a valid Plus ID, with sv_plusIdNotice. |
sv_plusIdNotice |
"" |
text | What a player refused by sv_requirePlusId reads. Empty uses the default, with the link to the client. |
sv_plusIdSeenFile |
plusid_seen.txt |
path | Where the playtime of each Plus ID is kept (id first_seen seconds), relative to fs_homepath or absolute; servers can share one file. |
sv_banLists |
"" |
text | Signed shared ban lists, `"url |
sv_banListRefresh |
30 |
1–10080 | Minutes between fetches of each shared ban list. |
sv_authorizeTimeout |
5000 |
0–1200000 | Milliseconds a connecting player waits for the authorization server. |
sv_limitLocalRcon |
0 |
0–1 | 1 applies the rcon rate limit to LAN addresses too. |
sv_isLookingAtOnDemand |
0 |
0–1 | 1 finds what a player looks at only when a script calls isLookingAt (no crosshair names or trigger_lookat then). |
sv_fastDownloadSpeed |
8 |
1–8 | Messages a frame sv_fastDownload sends a downloading client. |
g_ambientSound |
1 |
0–1 | 0 silences the map's distant battle sounds. From the next map. |
g_fireFx |
1 |
0–1 | 0 leaves out the map's looped fx/fire/ effects and fire sounds. From the next map. |
g_smokeFx |
1 |
0–1 | 0 leaves out the map's looped fx/smoke/ effects. From the next map. |
g_weatherFx |
1 |
0–1 | 0 leaves out the map's looped dust, snow and fog bank effects. From the next map. |
g_fog |
1 |
0–1 | 0 keeps map scripts from setting fog. From the next map. |
sv_minimizeSysteminfo |
0 |
0–3 | Above 0, moves some dvars from the systeminfo to the gamestate to make room for more iwds. From the next map. |
fs_callbacks |
"" |
— | Script with the CodeCallback_* functions; empty is maps/mp/gametypes/_callbacksetup. |
fs_gametypes |
"" |
— | Folder of the gametype scripts; empty is maps/mp/gametypes. |
fs_mapScriptDirectories |
0 |
0–2 | Where a map's main is: 0 maps/mp/<map>, 1 maps/mp/<map>/<map>, 2 that first, then maps/mp/<map>. |
fs_replaceStockMaps |
0 |
0–1 | 1 lets manymaps replace a stock map with the iwd of the same name in the library. |
loc_loadLocalizedMods |
0 |
0–1 | 1 lists the mod's localized_*.iwd files for pure clients too. |
g_bulletDrop |
0 |
0–1 | 1 lets enableBulletDrop give a player's bullets travel time and drop. |
g_bulletDropMaxTime |
10000 |
50–60000 | Milliseconds a dropping bullet flies before it is dropped. |
g_shotgun_spread_fix |
0 |
0–1 | 1 fires the 8 pellets of a shotgun on one of CoD2x's two fixed patterns, turned at random per shot, instead of each at random within the spread. Takes precedence over g_fixedWeaponSpreads for an 8-pellet weapon. |
sv_httpAllowedHosts |
"" |
— | Hosts httpFetch and webSocketConnect may reach, separated by spaces or commas; *.example.com allows its subdomains. Empty allows every host. |
sv_libcodUnsafe |
0 |
0–1 | 1 lets scripts use the libcod functions that reach the shell, raw memory, files by any path or any network address. Command line only. |
sv_httpAllowPrivate |
0 |
0–1 | 1 lets httpFetch and webSocketConnect connect to loopback, private, link-local, shared and multicast addresses. Command line only. |
sv_httpCaFile |
"" |
— | PEM file with the certificates https and wss trust. Empty uses the system's: /etc/ssl/certs/ca-certificates.crt or /etc/pki/tls/certs/ca-bundle.crt on Linux, the certificate store on Windows. On Windows the store only holds the root certificates the system has already downloaded, so set this to a CA bundle (such as the cacert.pem from curl) if https or wss hosts fail verification. The file is read again when the variable changes or after an hour. |
g_debugGraph |
0 |
0–1 | 1 prints debug messages from the graph functions. |
sv_graphAstarMaxIterations |
0 |
0–100000 | Maximum nodes one graphFindPath expands. 0 means no limit. |
sv_graphAstarWeight |
1 |
1–2 | A* heuristic weight. Above 1, paths are found faster but can be longer. |
sv_graphMaxGraphs |
8 |
1–64 | Maximum number of graphs at once. |
sv_graphMaxNodes |
32768 |
64–65535 | Maximum nodes in one graph. |