Skip to content

Commit

Permalink
Add Server Name to ReplayViewer.razor
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Mar 2, 2024
1 parent e10c8b3 commit faf2ae1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Client/Components/ReplayViewer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<p>Duration: @Replay.Duration</p>
<p>Date: @DateFormatted</p>
<p>Server ID: @Replay.ServerId</p>
<p>Server Name: @Replay.ServerName</p>
<p>Round ID: @Replay.RoundId</p>
<p>Gamemode: @Replay.Gamemode</p>
<p>Size: @FormattedSize</p>
Expand Down Expand Up @@ -57,6 +58,11 @@
return;

var text = Replay.RoundEndText ?? "";

if (Replay.ServerName == null)
{
Replay.ServerName = "Unknown";
}

const string colorTagPattern = @"\[color=(.*?)\](.*?)\[/color\]";
const string colorTagReplacement = "<span style=\"color:$1\">$2</span>";
Expand Down Expand Up @@ -146,7 +152,7 @@
}
else
{
NameFormatted = Replay.ServerId;
NameFormatted = Replay.ServerName ?? Replay.ServerId;
}
}
}

0 comments on commit faf2ae1

Please sign in to comment.