Class ClientDisconnected

All Implemented Interfaces:
Serializable

public class ClientDisconnected extends FixedStatusResponse
This Response is generated when a lobby's client disconnected and is sent to the lobby's clients. Therefore, it is FixedStatusResponse
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • lastDisconnectedNickname

      private final String lastDisconnectedNickname
    • players

      private final List<String> players
  • Constructor Details

    • ClientDisconnected

      public ClientDisconnected(String lastDisconnectedNickname, List<String> players)
      Create the response
      Parameters:
      lastDisconnectedNickname - the nickname of the player that just disconnected
      players - the list of still connected players
  • Method Details

    • getPlayers

      public List<String> getPlayers()
      Get the players still connected to the lobby
      Returns:
      an Unmodifiable List containing players still in the lobby
    • getLastDisconnectedNickname

      public String getLastDisconnectedNickname()
      Get the user that generated this response by disconnecting
      Returns:
      the nickname of the user that just disconnected from the lobby