Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
02c8073
feat: implement username banning functionality in Room class
ann7415 Jan 18, 2026
2bb9b9b
feat: add AdminConsole for server management commands
ann7415 Jan 18, 2026
be9ac38
feat: add error handling for banned sessions in TCPPacketRouter
ann7415 Jan 18, 2026
c0fdb9a
feat: implement IP banning functionality in SessionManager
ann7415 Jan 18, 2026
f3a14d5
feat: integrate AdminConsole for server management in ServerRuntime
ann7415 Jan 18, 2026
1c0bd2f
feat: extend ISessionManager with IP banning and session management m…
ann7415 Jan 18, 2026
45fe949
feat: add username validation and banning check in RoomManager
ann7415 Jan 18, 2026
e3ed1d5
chore: update file header in AdminConsole.hpp for project details
ann7415 Jan 18, 2026
8992906
feat: add [[nodiscard]] attribute to isExpiredLocked method in Sessio…
ann7415 Jan 18, 2026
ae60dc6
chore: update comment for banned IPs storage in SessionManager
ann7415 Jan 18, 2026
98ce07d
feat: mark getRoomData method as noexcept in Room class
ann7415 Jan 18, 2026
2bcd8cc
chore: clean up includes and formatting in header files
ann7415 Jan 18, 2026
d173913
Implement IP banning functionality in FakeSessions class
romain1717 Jan 18, 2026
acb2ae5
refactor: update clearAuthLocked method documentation for clarity
ann7415 Jan 18, 2026
f11778c
feat: add unbanroom command to AdminConsole for removing user bans fr…
ann7415 Jan 18, 2026
292d7c3
refactor: improve score handling logic in GameOverMenu for better rea…
ann7415 Jan 18, 2026
50ef99b
refactor: improve score sorting logic formatting in GameOverMenu for …
ann7415 Jan 18, 2026
3cb67b6
refactor: remove banned session check from TCPPacketRouter for stream…
ann7415 Jan 18, 2026
3360a80
refactor: remove unused ban and kick commands from AdminConsole for c…
ann7415 Jan 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions client/src/ui/gameOver/GameOverMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ namespace Engine
if (_scoresTitle)
_scoresTitle->setPosition(v.cx - 30.f, titleY);
for (std::size_t i = 0; i < _scoreLines.size(); ++i)
if (_scoreLines[i])
_scoreLines[i]->setPosition(v.cx - 90.f, lineStartY + static_cast<float>(i) * 34.f);
if (_scoreLines.at(i))
_scoreLines.at(i)->setPosition(v.cx - 90.f, lineStartY + static_cast<float>(i) * 34.f);
layoutColumnCentered(v.w, v.h * 0.60f, 110.f, {_back.get(), _quit.get()});
}

Expand All @@ -59,26 +59,34 @@ namespace Engine
handleMousePressed(frame);
if (frame.mouseReleased)
handleMouseReleased(frame);
if (const auto w = _world.lock()) {
auto scores = w->getRoomScores();
if (scores.empty()) {
if (!_scoreLines.empty())
_scoreLines[0]->setString("Player 1: 0 pts");
for (std::size_t i = 1; i < _scoreLines.size(); ++i)
_scoreLines[i]->setString("");
return;
}
std::ranges::sort(scores, [](const auto &a, const auto &b) {
return a.second > b.second;
});
const std::size_t n = std::min(scores.size(), _scoreLines.size());
for (std::size_t i = 0; i < n; ++i) {
const std::string name = "Player " + std::to_string(i + 1);
_scoreLines[i]->setString(name + ": " + std::to_string(scores[i].second) + " pts");
}
for (std::size_t i = n; i < _scoreLines.size(); ++i)
_scoreLines[i]->setString("");
if (_backRequested || _quitRequested)
return;
const auto w = _world.lock();
if (!w)
return;
const auto scoresRefOrValue = w->getRoomScores();
auto scores = std::vector(scoresRefOrValue.begin(), scoresRefOrValue.end());
if (scores.empty()) {
if (!_scoreLines.empty() && _scoreLines.at(0))
_scoreLines.at(0)->setString("Player 1: 0 pts");
for (std::size_t i = 1; i < _scoreLines.size(); ++i)
if (_scoreLines.at(i))
_scoreLines.at(i)->setString("");
return;
}
std::ranges::sort(scores, [](const auto &a, const auto &b) {
return a.second > b.second;
});
const std::size_t n = std::min(scores.size(), _scoreLines.size());
for (std::size_t i = 0; i < n; ++i) {
if (!_scoreLines.at(i))
continue;
const std::string name = "Player " + std::to_string(i + 1);
_scoreLines.at(i)->setString(name + ": " + std::to_string(scores.at(i).second) + " pts");
}
for (std::size_t i = n; i < _scoreLines.size(); ++i)
if (_scoreLines.at(i))
_scoreLines.at(i)->setString("");
}

void GameOverMenu::handleMousePressed(const InputFrame &frame) const
Expand Down
Loading
Loading