From 4c03180781d475727191de937ac3f5b198a25032 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Tue, 16 Sep 2025 09:25:00 +0200 Subject: [PATCH] Remove maxsend limit, default to 200MB maxsend, increment value in menus by 1024 each step --- src/cvars.cpp | 2 +- src/d_netfil.c | 4 ++-- src/k_menufunc.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index 63b1f7f90..c13f1fda3 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -622,7 +622,7 @@ void Lagless_OnChange(void); consvar_t cv_lagless = NetVar("lagless", "Off").on_off().onchange(Lagless_OnChange); // max file size to send to a player (in kilobytes) -consvar_t cv_maxsend = NetVar("maxsend", "51200").min_max(0, 51200); +consvar_t cv_maxsend = NetVar("maxsend", "204800").min_max(-1, 999999999); consvar_t cv_noticedownload = NetVar("noticedownload", "Off").on_off(); consvar_t cv_pingtimeout = NetVar("maxdelaytimeout", "10").min_max(8, 120); diff --git a/src/d_netfil.c b/src/d_netfil.c index a95767d5b..f1e7e31dc 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -204,7 +204,7 @@ UINT8 *PutFileNeeded(UINT16 firstfile) // Store in the upper four bits if (!cv_downloading.value) filestatus += (2 << 4); // Won't send - else if ((wadfiles[i]->filesize <= (UINT32)cv_maxsend.value * 1024)) + else if (cv_maxsend.value == -1 || wadfiles[i]->filesize <= (UINT32)cv_maxsend.value * 1024) filestatus += (1 << 4); // Will send if requested // else // filestatus += (0 << 4); -- Won't send, too big @@ -964,7 +964,7 @@ static boolean AddFileToSendQueue(INT32 node, const char *filename, UINT8 fileid } // Handle huge file requests (i.e. bigger than cv_maxsend.value KB) - if (wadfiles[i]->filesize > (UINT32)cv_maxsend.value * 1024) + if (cv_maxsend.value != -1 && wadfiles[i]->filesize > (UINT32)cv_maxsend.value * 1024) { // Too big // Don't inform client (client sucks, man) diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 0b42743cf..eeb642818 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -176,7 +176,7 @@ void M_ChangeCvarDirect(INT32 choice, consvar_t *cv) if (cv == &cv_nettimeout || cv == &cv_jointimeout) choice *= (TICRATE/7); else if (cv == &cv_maxsend) - choice *= 512; + choice *= 1024; CV_AddValue(cv, choice); }