More stuff goes in HU_AddChatText, fixed /pm list not having the correct coords if kartspeedometer was on.

This commit is contained in:
Latapostrophe 2018-10-11 21:39:19 +02:00
parent 4b2cb6b4e5
commit 102d45f590
3 changed files with 29 additions and 26 deletions

View file

@ -2812,7 +2812,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
msg = KICK_MSG_CON_FAIL; msg = KICK_MSG_CON_FAIL;
} }
CONS_Printf("\x82%s ", player_names[pnum]); //CONS_Printf("\x82%s ", player_names[pnum]);
// If a verified admin banned someone, the server needs to know about it. // If a verified admin banned someone, the server needs to know about it.
// If the playernum isn't zero (the server) then the server needs to record the ban. // If the playernum isn't zero (the server) then the server needs to record the ban.
@ -2829,15 +2829,15 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
switch (msg) switch (msg)
{ {
case KICK_MSG_GO_AWAY: case KICK_MSG_GO_AWAY:
CONS_Printf(M_GetText("has been kicked (Go away)\n")); HU_AddChatText(va("\x82*%s has been kicked (Go away)", player_names[pnum]), false);
break; break;
#ifdef NEWPING #ifdef NEWPING
case KICK_MSG_PING_HIGH: case KICK_MSG_PING_HIGH:
CONS_Printf(M_GetText("left the game (Broke ping limit)\n")); HU_AddChatText(va("\x82*%s left the game (Broke ping limit)", player_names[pnum]), false);
break; break;
#endif #endif
case KICK_MSG_CON_FAIL: case KICK_MSG_CON_FAIL:
CONS_Printf(M_GetText("left the game (Synch failure)\n")); HU_AddChatText(va("\x82*%s left the game (Synch Failure)", player_names[pnum]), false);
if (M_CheckParm("-consisdump")) // Helps debugging some problems if (M_CheckParm("-consisdump")) // Helps debugging some problems
{ {
@ -2873,22 +2873,22 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
} }
break; break;
case KICK_MSG_TIMEOUT: case KICK_MSG_TIMEOUT:
CONS_Printf(M_GetText("left the game (Connection timeout)\n")); HU_AddChatText(va("\x82*%s left the game (Connection timeout)", player_names[pnum]), false);
break; break;
case KICK_MSG_PLAYER_QUIT: case KICK_MSG_PLAYER_QUIT:
if (netgame) // not splitscreen/bots if (netgame) // not splitscreen/bots
CONS_Printf(M_GetText("left the game\n")); HU_AddChatText(va("\x82*%s left the game", player_names[pnum]), false);
break; break;
case KICK_MSG_BANNED: case KICK_MSG_BANNED:
CONS_Printf(M_GetText("has been banned (Don't come back)\n")); HU_AddChatText(va("\x82*%s has been banned (Don't come back)", player_names[pnum]), false);
break; break;
case KICK_MSG_CUSTOM_KICK: case KICK_MSG_CUSTOM_KICK:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1); READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
CONS_Printf(M_GetText("has been kicked (%s)\n"), reason); HU_AddChatText(va("\x82*%s has been kicked (%s)", player_names[pnum], reason), false);
break; break;
case KICK_MSG_CUSTOM_BAN: case KICK_MSG_CUSTOM_BAN:
READSTRINGN(*p, reason, MAX_REASONLENGTH+1); READSTRINGN(*p, reason, MAX_REASONLENGTH+1);
CONS_Printf(M_GetText("has been banned (%s)\n"), reason); HU_AddChatText(va("\x82*%s has been banned (%s)", player_names[pnum], reason), false);
break; break;
} }
@ -3167,9 +3167,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (newplayernum+1 > doomcom->numslots) if (newplayernum+1 > doomcom->numslots)
doomcom->numslots = (INT16)(newplayernum+1); doomcom->numslots = (INT16)(newplayernum+1);
if (netgame)
CONS_Printf(M_GetText("Player %d has joined the game (node %d)\n"), newplayernum+1, node);
// the server is creating my player // the server is creating my player
if (node == mynode) if (node == mynode)
{ {
@ -3228,11 +3225,17 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
D_SendPlayerConfig(); D_SendPlayerConfig();
addedtogame = true; addedtogame = true;
} }
else if (server && netgame && cv_showjoinaddress.value)
if (netgame)
{ {
const char *address; if (server && netgame && cv_showjoinaddress.value)
if (I_GetNodeAddress && (address = I_GetNodeAddress(node)) != NULL) {
CONS_Printf(M_GetText("Player Address is %s\n"), address); const char *address;
if (I_GetNodeAddress && (address = I_GetNodeAddress(node)) != NULL)
HU_AddChatText(va("\x82*Player %d has joined the game (node %d) (%s)", newplayernum+1, node, address), false); // merge join notification + IP to avoid clogging console/chat.
}
else
HU_AddChatText(va("\x82*Player %d has joined the game (node %d)", newplayernum+1, node), false);
} }
if (server && multiplayer && motd[0] != '\0') if (server && multiplayer && motd[0] != '\0')

View file

@ -1140,8 +1140,8 @@ static void SetPlayerName(INT32 playernum, char *newname)
if (strcasecmp(newname, player_names[playernum]) != 0) if (strcasecmp(newname, player_names[playernum]) != 0)
{ {
if (netgame) if (netgame)
CONS_Printf(M_GetText("%s renamed to %s\n"), HU_AddChatText(va("\x82*%s renamed to %s", player_names[playernum], newname), false);
player_names[playernum], newname);
strcpy(player_names[playernum], newname); strcpy(player_names[playernum], newname);
} }
} }
@ -5152,9 +5152,9 @@ static void Mute_OnChange(void)
return; // avoid having this notification put in our console / log when we boot the server. return; // avoid having this notification put in our console / log when we boot the server.
if (cv_mute.value) if (cv_mute.value)
HU_AddChatText(M_GetText("*Chat has been muted."), false); HU_AddChatText(M_GetText("\x82*Chat has been muted."), false);
else else
HU_AddChatText(M_GetText("*Chat is no longer muted."), false); HU_AddChatText(M_GetText("\x82*Chat is no longer muted."), false);
} }
/** Hack to clear all changed flags after game start. /** Hack to clear all changed flags after game start.

View file

@ -1634,15 +1634,15 @@ static void HU_DrawChat(void)
{ {
char name[MAXPLAYERNAME+1]; char name[MAXPLAYERNAME+1];
strlcpy(name, player_names[i], 7); // shorten name to 7 characters. strlcpy(name, player_names[i], 7); // shorten name to 7 characters.
V_DrawFillConsoleMap(chatx+ cv_chatwidth.value + 2, p_dispy- (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud. V_DrawFillConsoleMap(chatx+ cv_chatwidth.value + 2, p_dispy- (6*count) - (cv_kartspeedometer.value ? 16 : 0), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
V_DrawSmallString(chatx+ cv_chatwidth.value + 4, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va("\x82%d\x80 - %s", i, name)); V_DrawSmallString(chatx+ cv_chatwidth.value + 4, p_dispy- (6*count) - (cv_kartspeedometer.value ? 16 : 0), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va("\x82%d\x80 - %s", i, name));
count++; count++;
} }
} }
if (count == 0) // no results. if (count == 0) // no results.
{ {
V_DrawFillConsoleMap(chatx-50, p_dispy- (6*count), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud. V_DrawFillConsoleMap(chatx+ cv_chatwidth.value + 2, p_dispy- (6*count) - (cv_kartspeedometer.value ? 16 : 0), 48, 6, 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); // fill it like the chat so the text doesn't become hard to read because of the hud.
V_DrawSmallString(chatx-48, p_dispy- (6*count), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, "NO RESULT."); V_DrawSmallString(chatx+ cv_chatwidth.value + 4, p_dispy- (6*count) - (cv_kartspeedometer.value ? 16 : 0), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, "NO RESULT.");
} }
} }