Skip to content

Commit

Permalink
Remove Private IP from automap
Browse files Browse the repository at this point in the history
Update automap.cpp
  • Loading branch information
kphoenix137 committed Feb 13, 2025
1 parent 420b569 commit cc2c48d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Source/automap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <algorithm>
#include <cstdint>
#include <regex>

#include <fmt/format.h>

Expand Down Expand Up @@ -1410,10 +1411,15 @@ void DrawAutomapText(const Surface &out)

if (gbIsMultiplayer) {
if (GameName != "0.0.0.0" && !IsLoopback) {
std::string description = std::string(_("Game: "));
description.append(GameName);
DrawString(out, description, linePosition);
linePosition.y += 15;
std::regex ipRegex(
R"((\d{1,3}\.){3}\d{1,3})");

if (!std::regex_match(GameName, ipRegex)) {
std::string description = std::string(_("Game: "));
description.append(GameName);
DrawString(out, description, linePosition);
linePosition.y += 15;
}
}

std::string description;
Expand Down

0 comments on commit cc2c48d

Please sign in to comment.