Package de.creepsmash.common.messages.server

Examples of de.creepsmash.common.messages.server.PlayerQuitMessage


          if (game.getClients().isEmpty()) {
            game.shutdown();
            gameTerminated(game);

          } else {
            game.sendAll(new PlayerQuitMessage(player.getName(),
                "Kick", Player.getClient().getClientID()));
            game.gamePlayersChanged();
          }

          Player.getClient().disconnect();
View Full Code Here


    } else if (PlayerJoinedMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new PlayerJoinedMessage();
    } else if (PlayerQuitMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new PlayerQuitMessage();
    } else if (PlayersMessage.PATTERN.matcher(messageString).matches()) {
      messageObject = new PlayersMessage();
    } else if (RegistrationResponseMessage.PATTERN.matcher(
        messageString).matches()) {
      messageObject = new RegistrationResponseMessage();
View Full Code Here

    this.game.removeClient(client);
   
    if (this.game.getClients().isEmpty()) {
      return new TerminatedGameState(this.game);
    } else {
      this.game.sendAll(new PlayerQuitMessage(client.getUserName(), reason,client.getClientID()));
      this.game.gamePlayersChanged();
      return this;
    }
  }
View Full Code Here

    } else if (m instanceof MessageMessage) {
      MessageMessage mMChat = (MessageMessage) m;
      gamePanel.getChatPanel().setMessage(mMChat.getPlayerName(),
          mMChat.getMessage());
    } else if (m instanceof PlayerQuitMessage) {
      PlayerQuitMessage pqm = (PlayerQuitMessage) m;

      for (GameContext con : contexts) {
        if (pqm.getPlayerName().equals(con.getPlayerName())) {
          con.setLives(0);
          con.sendDeathMessage();
          con.fireLivesChangedEvent();
        }
      }
View Full Code Here

      gamePanel.getLoop().setMap(IConstants.Map.getMapById(this.mapId));
      gamePanel.getLoop().start();
    }
   
    if (m instanceof PlayerQuitMessage) {
      PlayerQuitMessage pqm = (PlayerQuitMessage) m;
      DefaultListModel dl =
        (DefaultListModel) this.playerlist.getModel();
     
      if (managementSound != null) {
        managementSound.hornbeepSound();
      }
      dl.removeElement(pqm.getPlayerName());
      removePlayer(pqm.getPlayerName());
      this.chatdialog.sendChatText("System", pqm.getPlayerName()  + " has left...", getCore());
     
    }
   
    if (m instanceof MessageMessage) {
      MessageMessage mm = (MessageMessage) m;
View Full Code Here

TOP

Related Classes of de.creepsmash.common.messages.server.PlayerQuitMessage

Copyright © 2018 www.massapicom. 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.