Class LogoutMessage


  • public class LogoutMessage
    extends AttributeMessage
    The message sent when logging out.
    • Constructor Detail

      • LogoutMessage

        public LogoutMessage​(Player player,
                             Game.LogoutReason reason)
        Create a new LogoutMessage. Note: The logout reason is non-i18n for now as it is just logged.
        Parameters:
        player - The Player that has logged out.
        reason - A reason for logging out.
      • LogoutMessage

        public LogoutMessage​(Game game,
                             FreeColXMLReader xr)
                      throws javax.xml.stream.XMLStreamException
        Create a new LogoutMessage from a stream.
        Parameters:
        game - The Game to read within.
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if the stream is corrupt.
    • Method Detail

      • aiHandler

        public void aiHandler​(FreeColServer freeColServer,
                              AIPlayer aiPlayer)
        AI-side handler for this message. AI handlers always return null. FIXME: One day the FreeColServer should devolve to AIMain.
        Overrides:
        aiHandler in class TrivialMessage
        Parameters:
        freeColServer - The FreeColServer handling the request.
        aiPlayer - The AIPlayer the message was sent to.
      • clientHandler

        public void clientHandler​(FreeColClient freeColClient)
        Client-side handler for this message. Client handlers always return null.
        Overrides:
        clientHandler in class TrivialMessage
        Parameters:
        freeColClient - The FreeColClient to handle this message.
      • serverHandler

        public ChangeSet serverHandler​(FreeColServer freeColServer,
                                       ServerPlayer serverPlayer)
        Server-side handler for this message.
        Overrides:
        serverHandler in class TrivialMessage
        Parameters:
        freeColServer - The FreeColServer handling the request.
        serverPlayer - The ServerPlayer that sent the request.
        Returns:
        A ChangeSet defining the response.
      • getPlayer

        public Player getPlayer​(Game game)
        Get the player logging out.
        Parameters:
        game - A Game to find the player in.
        Returns:
        The player found.
      • getReason

        public Game.LogoutReason getReason()
        Get the reason for logging out.
        Returns:
        The LogoutReason.