Package de.creepsmash.common.messages.client

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


            && (!GameLobby.this.message.getText().equals(""))) {
          if (GameLobby.this.message.getText().length() > 180){
            GameLobby.this.errorDialog("Please don't enter more then 180 keystrokes.");
            return;
          }else{
          SendMessageMessage m = new SendMessageMessage();
          m.setMessage(GameLobby.this.message.getText());
          GameLobby.this.message.setText("");
          m.setClientId(GameLobby.this.getCore().getPlayerId());
          GameLobby.this.getCore().getNetwork().sendMessage(m);
          }
        }
      }
    };
View Full Code Here


        + this.credits;
    }
   
    if (message != null) {

      SendMessageMessage mes = new SendMessageMessage();
      mes.setClientId(getPlayerId());
      mes.setMessage(message);
      getNetwork().sendMessage(mes);

      // sends a messages to all players that we have left
      SendMessageMessage chatMsg = new SendMessageMessage();
      chatMsg.setClientId(getPlayerId());
      chatMsg.setMessage("has left the game");
      getNetwork().sendMessage(chatMsg);
     
      getNetwork().sendMessage(new ExitGameMessage());
      System.exit(1);
      return false;
View Full Code Here

   * method for ActionEvent on sendButton to sen a message to chatdialog.
   * @param evt for ActionEvent
   */
  public void sendButtonActionPerformed(ActionEvent evt) {
    if (!message.getText().equals("")) {
      SendMessageMessage m = new SendMessageMessage();
      m.setMessage(message.getText());
      this.getCore().getNetwork().sendMessage(m);
      message.setText("");
    }
  }
View Full Code Here

  public void sendText(final KeyEvent evt) {

    if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
      // send Message
      if (context != null) {
        SendMessageMessage chatMsg = new SendMessageMessage();
        chatMsg.setClientId(context.getPlayerId());
        chatMsg.setMessage(getText());
        gamepanel.getCore().getNetwork().sendMessage(chatMsg);
        this.message.setText("");
      }

    }
View Full Code Here

    this.quit.setBackground(Color.BLACK);
    this.quit.setForeground(Color.GREEN);
    this.quit.addMouseListener(new MouseAdapter() {
      public void mousePressed(MouseEvent e) {
        // sends a messages to all players that we have left
        SendMessageMessage chatMsg = new SendMessageMessage();
        chatMsg.setClientId(context.getPlayerId());
        chatMsg.setMessage("has left the game");
        getCore().getNetwork().sendMessage(chatMsg);

        getCore().popScreen();
        getCore().getNetwork().sendMessage(new ExitGameMessage());
        if (!loop.isRunning()) {
View Full Code Here

   * leaves the game.
   */
  private void leave() {
    if (!loop.isRunning()) {
      // sends a messages to all players that we have left
      SendMessageMessage chatMsg = new SendMessageMessage();
      chatMsg.setClientId(context.getPlayerId());
      chatMsg.setMessage("has left the game");
      getCore().getNetwork().sendMessage(chatMsg);

      loop.setGameOver(false);
      this.getCore().popScreen();
      this.getCore().getNetwork().sendMessage(new ExitGameMessage());
View Full Code Here

 
  /**
   *
   */
  public void run() {
    SendMessageMessage m = new SendMessageMessage();

    m.setMessage("GAME START COUNTDOWN 2");
    core.getNetwork().sendMessage(m);
   
    for (int i = 2; i > 0; i--) {
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      m.setMessage("in " + (new Integer(i).toString()));
      core.getNetwork().sendMessage(m);
    }
   
   
    core.getNetwork().sendMessage(new StartGameRequestMessage());
View Full Code Here

TOP

Related Classes of de.creepsmash.common.messages.client.SendMessageMessage

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.