Skip to content

Commit

Permalink
Merge MR 'Reduce the amount of unnecessary messages shown in the game…
Browse files Browse the repository at this point in the history
… chat'

See merge request https://gitlab.com/xonotic/darkplaces/-/merge_requests/155

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
  • Loading branch information
bones-was-here committed Aug 7, 2024
2 parents 2608c8b + 4acc8c4 commit 2f25af6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sv_ccmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ void SV_Name(int clientnum)
PRVM_serveredictstring(host_client->edict, netname) = PRVM_SetEngineString(prog, host_client->name);
if (strcmp(host_client->old_name, host_client->name))
{
if (host_client->begun)
if (host_client->begun && host_client->netconnection)
SV_BroadcastPrintf("\003%s ^7changed name to ^3%s\n", host_client->old_name, host_client->name);
dp_strlcpy(host_client->old_name, host_client->name, sizeof(host_client->old_name));
// send notification to all clients
Expand Down
11 changes: 6 additions & 5 deletions sv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,11 +1085,12 @@ void SV_DropClient(qbool leaving, const char *fmt, ... )
// break the net connection
NetConn_Close(host_client->netconnection);
host_client->netconnection = NULL;

if(fmt)
SV_BroadcastPrintf("\003^3%s left the game (%s)\n", host_client->name, reason);
else
SV_BroadcastPrintf("\003^3%s left the game\n", host_client->name);
}
if(fmt)
SV_BroadcastPrintf("\003^3%s left the game (%s)\n", host_client->name, reason);
else
SV_BroadcastPrintf("\003^3%s left the game\n", host_client->name);

// if a download is active, close it
if (host_client->download_file)
Expand Down Expand Up @@ -2573,7 +2574,7 @@ double SV_Frame(double time)
}

if (sv.perf_lost > 0 && reporting)
SV_BroadcastPrintf("\003" CON_WARN "Server lag report: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));
SV_BroadcastPrintf(CON_WARN "Server lag report: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));

sv.perf_acc_realtime = sv.perf_acc_sleeptime =
sv.perf_acc_lost = sv.perf_acc_offset =
Expand Down

0 comments on commit 2f25af6

Please sign in to comment.