Skip to content

Commit

Permalink
add runequake mod/observer detection
Browse files Browse the repository at this point in the history
  • Loading branch information
timbergeron committed Oct 23, 2024
1 parent fe5d2cb commit 47c11bb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Quake/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ typedef struct
char observer[2]; // woods for ghost code to memory #observer
int server; // woods for server type detection #servertype
int fps; // woods #f_config
int modtype; // woods #modtype detect mp server mod type 5 - FTE, 4 - hybrid crx, 3 - crmod, 2 - crctf, 1 - crx
int modtype; // woods #modtype detect mp server mod type 6 - runequake, 5 - FTE, 4 - hybrid crx, 3 - crmod, 2 - crctf, 1 - crx
int modetype; // woods crx mode detection -- 1 - ctf, 2 - dm, 3 - ra, 4 - ca, 5 - airshot, 6 - wipeout, 7 - freetag
int playmode; // woods crx play mode detection -- 1 - match, 2 - ffa/normal/pug, 3 - practice
int teamscore[3]; // woods #hud_diff
Expand Down
20 changes: 20 additions & 0 deletions Quake/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ int con_buffersize; //johnfitz -- user can now override default
qboolean con_forcedup; // because no entities to refresh
qboolean matchstats = false; // woods
qboolean netquakeio = false; // woods
qboolean firstCheckPassed = false; // woods

int con_totallines; // total lines in console scrollback
int con_backscroll; // lines up from bottom to display
Expand Down Expand Up @@ -508,6 +509,25 @@ static void Con_Print (const char *txt)
if (!strcmp(txt, "Match unpaused\n") && !cls.demoplayback && !cls.demorecording)
Cmd_ExecuteString("record\n", src_command);

if (cl.modtype == 6) // runequake observer detection
{
if (!strcmp(txt, "Now riding "))
strncpy(cl.observer, "y", sizeof(cl.observer));

if (!strcmp(txt, cl_name.string))
firstCheckPassed = true;
else if (firstCheckPassed && !strcmp(txt, " joined the game\n"))
{
strncpy(cl.observer, "n", sizeof(cl.observer));
firstCheckPassed = false; // Reset flag after the condition is met
}
else if (firstCheckPassed) // The next text was not " joined the game\n", reset the flag
firstCheckPassed = false;

if (q_strcasestr(txt, "]observer"))
strncpy(cl.observer, "y", sizeof(cl.observer));
}

if (strstr(txt, ": ") && cls.signon == SIGNONS && cl.maxclients > 1) // woods #like
{
strncpy(cl.lastchat, txt, sizeof(cl.lastchat) - 1);
Expand Down
9 changes: 9 additions & 0 deletions Quake/gl_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ void SCR_CenterPrint (const char *str) //update centerprint data
return;
}

char qfrunequake[18] = { 247, 247, 247, 174, 242, 245, 238, 229, 241, 245, 225, 235, 229, 174, 227, 239, 237, '\0' }; // woods -- quake font red 'www.runequake.com' #autoid

if ((strstr(str, qfrunequake)))
{
cl.modtype = 6;
strncpy(cl.observer, "y", sizeof(cl.observer));
return;
}

// ===============================
// woods for center print filter -> this is #flagstatus
// ===============================
Expand Down

0 comments on commit 47c11bb

Please sign in to comment.