Examples of LogoutMessage


Examples of de.creepsmash.common.messages.client.LogoutMessage

   * @return ClientState
   */
  @Override
  public ClientState receiveMessage(ClientMessage message) {
    if (message == null) {
      LogoutMessage m = new LogoutMessage();
      m.setClientId(this.getClient().getClientID());
      try {
        this.gameQueue.put(new QueueMessage<GameMessage>(m));
      } catch (InterruptedException e) {
        inGameLogger.error("InterruptedException", e);
      }
      this.logout();
      inGameLogger.info(
          "client " + this.getClient()
          + " disconnected in InGameState");
      return null;
    } else if (message instanceof UpdateDataRequestMessage) {
      UpdateDataRequestMessage updateDataRequestMessage =
        (UpdateDataRequestMessage) message;
           
      UpdateDataResponseMessage m = new UpdateDataResponseMessage();
      m.setResponseType(AuthenticationService.update(
          this.getClient().getUserName(),
          updateDataRequestMessage.getOldPassword(),
          updateDataRequestMessage.getPassword(),
          updateDataRequestMessage.getEmail()));
      this.getClient().send(m);
      return this;
    } else if (message instanceof ScoreRequestMessage) {
      ScoreRequestMessage requestMessage = (ScoreRequestMessage) message;
      ScoreResponseMessage responseMessage =
        HighscoreService.getScoreMessage(requestMessage.getPlayerName());
      this.getClient().send(responseMessage);
      return this;
    } else if (message instanceof DeleteRequestMessage) {
      DeleteResponseMessage m = new DeleteResponseMessage();
      m.setResponseType(AuthenticationService.delete(
          this.getClient().getUserName()));
      this.getClient().send(m);
      return this;
    } else if (message instanceof GameMessage) {
      try {
View Full Code Here

Examples of de.creepsmash.common.messages.client.LogoutMessage

  /**
   * The run method that executes the logout.
   */
  @Override
  public void run() {
    lobby.getCore().getNetwork().sendMessage(new LogoutMessage());
    lobby.getCore().getNetwork().shutdown();
    lobby.getCore().popScreen();
  }
View Full Code Here

Examples of de.creepsmash.common.messages.client.LogoutMessage

    this.message.addActionListener(a4);

    // Quitbutton
    ActionListener a5 = new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        LogoutMessage gm = new LogoutMessage();
        getCore().getNetwork().sendMessage(gm);
        getCore().getNetwork().shutdown();
        getCore().popScreen();
      }
    };
    this.quit.addActionListener(a5);
   
    quit.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        LogoutMessage gm = new LogoutMessage();
        getCore().getNetwork().sendMessage(gm);
        getCore().getNetwork().shutdown();
        getCore().popScreen();
      }
      });
View Full Code Here

Examples of de.creepsmash.common.messages.client.LogoutMessage

    }

    if (m instanceof DeleteResponseMessage) {
      DeleteResponseMessage drm = (DeleteResponseMessage) m;
      if (drm.getResponseType() == IConstants.ResponseType.ok) {
        LogoutMessage gm = new LogoutMessage();
        getCore().getNetwork().sendMessage(gm);
        getCore().getNetwork().shutdown();
        getCore().clearScreen();
        getCore().pushScreen(new LoginPanel());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.