From 8bffbea999f49652f27646e897c4f26305d09785 Mon Sep 17 00:00:00 2001 From: Herman <82150452+HermanSkop@users.noreply.github.com> Date: Thu, 15 Feb 2024 22:12:43 +0100 Subject: [PATCH] #3113 Player status check is added before accepting invitation --- .../client/teammatchmaking/TeamMatchmakingService.java | 6 ++++++ src/main/resources/i18n/messages.properties | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/faforever/client/teammatchmaking/TeamMatchmakingService.java b/src/main/java/com/faforever/client/teammatchmaking/TeamMatchmakingService.java index 10501d0d23..6e221bc982 100644 --- a/src/main/java/com/faforever/client/teammatchmaking/TeamMatchmakingService.java +++ b/src/main/java/com/faforever/client/teammatchmaking/TeamMatchmakingService.java @@ -29,6 +29,7 @@ import com.faforever.client.notification.Severity; import com.faforever.client.notification.TransientNotification; import com.faforever.client.player.PlayerService; +import com.faforever.client.player.ServerStatus; import com.faforever.client.preferences.MatchmakerPrefs; import com.faforever.client.preferences.PreferencesService; import com.faforever.client.remote.FafServerAccessor; @@ -478,6 +479,11 @@ void acceptPartyInvite(PlayerBean player) { return; } + if (player.getServerStatus() == ServerStatus.OFFLINE) { + notificationService.addImmediateWarnNotification("teammatchmaking.notification.hostIsOffline.message"); + return; + } + fafServerAccessor.acceptPartyInvite(player); navigationHandler.navigateTo(new OpenTeamMatchmakingEvent()); } diff --git a/src/main/resources/i18n/messages.properties b/src/main/resources/i18n/messages.properties index e51365d409..d5cf466206 100644 --- a/src/main/resources/i18n/messages.properties +++ b/src/main/resources/i18n/messages.properties @@ -978,6 +978,8 @@ teammatchmaking.notification.customAlreadyInQueue.title = You are already search teammatchmaking.notification.customAlreadyInQueue.message = Please stop searching for a game before joining a custom game teammatchmaking.notification.gameAlreadyRunning.title = Already in game teammatchmaking.notification.gameAlreadyRunning.message = You cannot join matchmaking while you're in game +teammatchmaking.notification.hostIsOffline.title = Host is offline +teammatchmaking.notification.hostIsOffline.message = You cannot accept party invitation while the host is offline teammatchmaking.playerTitle = Playing matchmaking as\: teammatchmaking.partyTitle = Your party\: teammatchmaking.queueTitle = Join one or more queues when you are ready\: