Skip to content

Commit

Permalink
FAForever#3113 Player status check is added before accepting invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
HermanSkop committed Feb 15, 2024
1 parent 37795c7 commit 8bffbea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/i18n/messages.properties
Expand Up @@ -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\:
Expand Down

0 comments on commit 8bffbea

Please sign in to comment.