Compare commits

...
Author SHA1 Message Date
Alug 00bc8bc149 limit addon only stuff to server info screen
quite honestly everything else is awful and i dont want to bother with it
2026-01-27 18:23:51 +01:00
Alug f12b55f63b rename addonsonly variable to cl_addonsonly
very generic name so add the prefix for whatever cl means
2026-01-27 18:08:12 +01:00
Alug 3e476d7658 implement allowing to load addons and gamestate only instead of joining server
really messy, needs some cleanup, not sure if this is good at all
2026-01-27 18:06:22 +01:00
2 changed files with 57 additions and 22 deletions

No files matched your search

+41 -16
View File
@@ -100,6 +100,10 @@ static int map_icon_request_count; // current count of icon requests sent
static UINT8 *map_icon_data; static UINT8 *map_icon_data;
static patch_t *map_icon; static patch_t *map_icon;
// if true, signals the game to only load addons AND gamestate
// instead of fully joining a server
static boolean cl_addonsonly = false;
plrinfo playerinfo[MAXPLAYERS] = {}; plrinfo playerinfo[MAXPLAYERS] = {};
SINT8 joinnode = 0; // used for CL_VIEWSERVER SINT8 joinnode = 0; // used for CL_VIEWSERVER
@@ -1438,6 +1442,7 @@ static void CL_DrawConnectionStatus(void)
// Buttons // Buttons
V_DrawFill(8, BASEVIDHEIGHT - 14, BASEVIDWIDTH - 16, 12, 239); V_DrawFill(8, BASEVIDHEIGHT - 14, BASEVIDWIDTH - 16, 12, 239);
V_DrawThinString(16, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sESC%s] = Abort", "\x82", "\x80")); V_DrawThinString(16, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sESC%s] = Abort", "\x82", "\x80"));
V_DrawCenteredThinString(BASEVIDWIDTH/2, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sSPACE%s] = Load Addons", "\x82", "\x80"));
V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sENTER%s] = Join", "\x82", "\x80")); V_DrawRightAlignedThinString(BASEVIDWIDTH - 12, BASEVIDHEIGHT - 12, V_ALLOWLOWERCASE, va("[%sENTER%s] = Join", "\x82", "\x80"));
} }
else if (filedownload.current != -1) else if (filedownload.current != -1)
@@ -2579,7 +2584,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
return true; return true;
} }
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES; cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
} }
else else
{ {
@@ -2600,6 +2605,17 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
return true; return true;
} }
static void FreeMapIcon(void)
{
if (map_icon != NULL)
Patch_Free(map_icon);
map_icon = NULL;
if (map_icon_data != NULL)
Z_Free(map_icon_data);
map_icon_data = NULL;
map_icon_request_count = 0;
}
/** Called by CL_ConnectToServer /** Called by CL_ConnectToServer
* *
* \param tmpsave The name of the gamestate file??? * \param tmpsave The name of the gamestate file???
@@ -2624,7 +2640,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
case CL_ASKFULLFILELIST: case CL_ASKFULLFILELIST:
if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved
cl_mode = (cv_serverinfoscreen.value) ? CL_VIEWSERVER : CL_CHECKFILES; cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent) else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent)
{ {
if (CL_AskFileList(fileneedednum)) if (CL_AskFileList(fileneedednum))
@@ -2757,7 +2773,19 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
{ {
// Gamestate is now handled within CL_LoadReceivedSavegame() // Gamestate is now handled within CL_LoadReceivedSavegame()
CL_LoadReceivedSavegame(false); CL_LoadReceivedSavegame(false);
if (cl_addonsonly)
{
// close connection after savegame load
// we want the actual server state
// in case theres some stuff like records to be synched
cl_mode = CL_ABORTED;
}
else
{
cl_mode = CL_CONNECTED; cl_mode = CL_CONNECTED;
}
break; break;
} // don't break case continue to CL_CONNECTED } // don't break case continue to CL_CONNECTED
else else
@@ -2771,7 +2799,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
case CL_ABORTED: case CL_ABORTED:
cl_mode = CL_SEARCHING; cl_mode = CL_SEARCHING;
return false; return false;
} }
GetPackets(); GetPackets();
@@ -2793,24 +2820,21 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
{ {
if (key == KEY_ENTER || key == KEY_JOY1) if (key == KEY_ENTER || key == KEY_JOY1)
{ {
cl_addonsonly = false;
cl_mode = CL_CHECKFILES; cl_mode = CL_CHECKFILES;
if (map_icon != NULL) FreeMapIcon();
Patch_Free(map_icon);
map_icon = NULL;
if (map_icon_data != NULL)
Z_Free(map_icon_data);
map_icon_data = NULL;
} }
else if (key == KEY_ESCAPE || key == KEY_JOY1+1) else if (key == KEY_ESCAPE || key == KEY_JOY1+1)
{ {
cl_mode = CL_ABORTED; cl_mode = CL_ABORTED;
if (map_icon != NULL) cl_addonsonly = false;
Patch_Free(map_icon); FreeMapIcon();
map_icon = NULL; }
if (map_icon_data != NULL) else if (key == KEY_SPACE || key == KEY_JOY1+2)
Z_Free(map_icon_data); {
map_icon_data = NULL; cl_addonsonly = true;
map_icon_request_count = 0; cl_mode = CL_CHECKFILES;
FreeMapIcon();
} }
} }
@@ -2819,6 +2843,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
{ {
CONS_Printf(M_GetText("Network game synchronization aborted.\n")); CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
CL_AbortConnection(); CL_AbortConnection();
cl_addonsonly = false;
return false; return false;
} }
+16 -6
View File
@@ -1305,12 +1305,21 @@ boolean M_Responder(event_t *ev)
{ {
playback_last_menu_interaction_leveltime = leveltime; playback_last_menu_interaction_leveltime = leveltime;
// Flip left/right with up/down for the playback menu, since it's a horizontal icon row. // Flip left/right with up/down for the playback menu, since it's a horizontal icon row.
switch (ch) switch (ch)
{ {
case KEY_LEFTARROW: ch = KEY_UPARROW; break; case KEY_LEFTARROW:
case KEY_UPARROW: ch = KEY_RIGHTARROW; break; ch = KEY_UPARROW;
case KEY_RIGHTARROW: ch = KEY_DOWNARROW; break; break;
case KEY_DOWNARROW: ch = KEY_LEFTARROW; break; case KEY_UPARROW:
ch = KEY_RIGHTARROW;
break;
case KEY_RIGHTARROW:
ch = KEY_DOWNARROW;
break;
case KEY_DOWNARROW:
ch = KEY_LEFTARROW;
break;
// arbitrary keyboard shortcuts because fuck you // arbitrary keyboard shortcuts because fuck you
@@ -1361,7 +1370,8 @@ boolean M_Responder(event_t *ev)
G_AdjustView(4, 1, true); G_AdjustView(4, 1, true);
break; break;
default: break; default:
break;
} }
} }
@@ -1486,6 +1496,7 @@ boolean M_Responder(event_t *ev)
} }
return false; return false;
break;
default: default:
CON_Responder(ev); CON_Responder(ev);
@@ -10046,7 +10057,6 @@ static void M_DrawVideoMode(void)
va("Wait %d second%s", testtime, (testtime > 1) ? "s" : "")); va("Wait %d second%s", testtime, (testtime > 1) ? "s" : ""));
M_CentreText(OP_VideoModeDef.y + 158, M_CentreText(OP_VideoModeDef.y + 158,
"or press ESC to return"); "or press ESC to return");
} }
else else
{ {