Examples of ChatMessage


Examples of com.pragprog.aebook.persistchat.ChatMessage

                }
            }

            /** Send a chat message to the server. */
            private void sendMessageToServer() { // (20)
                ChatMessage chatmsg = new ChatMessage(getUser(), messageBox
                        .getText(), getCurrentChat());
                messageBox.setText("");
                chatService.postMessage(chatmsg,
                        new AsyncCallback<List<ChatMessage>>() {
                            public void onFailure(Throwable caught) {
                                PersistChat.this.addNewMessage(new ChatMessage(
                                        "System", "Error sending message: "
                                                + caught.getMessage(),
                                        getCurrentChat()));
                            }

View Full Code Here

Examples of com.pragprog.aebook.persistchat.ChatMessage

                }
            }

            /** Send a chat message to the server. */
            private void sendMessageToServer() { // (19)
                ChatMessage chatmsg = new ChatMessage(user,
                        messageBox.getText(), getCurrentChat());
                messageBox.setText("");
                chatService.postMessage(chatmsg,
                        new AsyncCallback<Void>() {
                    public void onFailure(Throwable caught) {
                        Chat.this.addNewMessage(new ChatMessage(
                                "System", "Error sending message: " +
                                caught.getMessage(),
                                getCurrentChat()));
                    }

View Full Code Here

Examples of com.pragprog.aebook.persistchat.ChatMessage

                }
            }

            /** Send a chat message to the server. */
            private void sendMessageToServer() { // (19)
                ChatMessage chatmsg = new ChatMessage(user,
                        messageBox.getText(), getCurrentChat());
                messageBox.setText("");
                chatService.postMessage(chatmsg,
                        new AsyncCallback<Void>() {
                    public void onFailure(Throwable caught) {
                        Chat.this.addNewMessage(new ChatMessage(
                                "System", "Error sending message: " +
                                caught.getMessage(),
                                getCurrentChat()));
                    }

View Full Code Here

Examples of com.tankz.systems.network.messages.ChatMessage

    NetworkListener networkListener = new NetworkListener();
   
    networkListener.registerHandler(ChatMessage.class, new Handler() {
      @Override
      public void handle(Connection connection, Object object) {
        ChatMessage msg = (ChatMessage) object;
        System.out.println("Got message: " + msg.getMessage());
      }
    });

    networkListener.setConnectionHandler(new ConnectionHandler() {
      @Override
View Full Code Here

Examples of fysix.communication.msg.ChatMessage

    try {
      boolean quit = false;
      //      byte key[] = new byte[1];
      while(!quit)
      {
        ChatMessage msgT = new ChatMessage();
        byte msgBuf[] = msgT.build();
        System.out.println("Press to close...");
        int i = System.in.read();
        switch(i)
        {
        case 's':
View Full Code Here

Examples of games.stendhal.server.core.engine.ChatMessage

      while (chatMessagesSet.next()) {
        String source = chatMessagesSet.getString("source");
        String message = chatMessagesSet.getString("message");
        String timedate = chatMessagesSet.getString("timedate");
        String messagetype = chatMessagesSet.getString("messagetype");
        ChatMessage chatmessage = new ChatMessage(source, message, timedate, messagetype);
        list.add(chatmessage);
      }

      chatMessagesSet.close();
      return list;
View Full Code Here

Examples of mage.view.ChatMessage

      }
      else if (callback.getMethod().equals("watchGame")) {
        watchGame((UUID) callback.getData());
      }
      else if (callback.getMethod().equals("chatMessage")) {
        ChatMessage message = (ChatMessage) callback.getData();
        ChatPanel panel = session.getChats().get(message.getChatId());
        if (panel != null)
          panel.receiveMessage(message.getMessage(), message.getColor());
      }
      else if (callback.getMethod().equals("replayInit")) {
        session.getGame().init((GameView) callback.getData());
      }
      else if (callback.getMethod().equals("replayDone")) {
        session.getGame().modalMessage((String) callback.getData());
        session.getGame().hideGame();
      }
      else if (callback.getMethod().equals("replayUpdate")) {
        session.getGame().updateGame((GameView) callback.getData());
      }
      else if (callback.getMethod().equals("gameInit")) {
        session.getGame().init((GameView) callback.getData());
        session.ack("gameInit");
      }
      else if (callback.getMethod().equals("gameOver")) {
        session.getGame().modalMessage((String) callback.getData());
        session.getGame().hideGame();
      }
      else if (callback.getMethod().equals("gameAsk")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().ask(message.getMessage(), message.getGameView());
      }
      else if (callback.getMethod().equals("gameTarget")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().pickTarget(message.getMessage(), message.getCardsView(), message.getGameView(), message.getTargets(), message.isFlag());
      }
      else if (callback.getMethod().equals("gameSelect")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().select(message.getMessage(), message.getGameView());
      }
      else if (callback.getMethod().equals("gameChooseAbility")) {
        session.getGame().pickAbility((AbilityPickerView) callback.getData());
      }
      else if (callback.getMethod().equals("gameChoose")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().getChoice(message.getMessage(), message.getStrings());
      }
      else if (callback.getMethod().equals("gamePlayMana")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().playMana(message.getMessage(), message.getGameView());
      }
      else if (callback.getMethod().equals("gamePlayXMana")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().playXMana(message.getMessage(), message.getGameView());
      }
      else if (callback.getMethod().equals("gameSelectAmount")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().getAmount(message.getMin(), message.getMax(), message.getMessage());
      }
      else if (callback.getMethod().equals("gameReveal")) {
        GameClientMessage message = (GameClientMessage) callback.getData();
        session.getGame().revealCards(message.getMessage(), message.getCardsView());
      }
      else if (callback.getMethod().equals("gameUpdate")) {
        session.getGame().updateGame((GameView) callback.getData());
      }
      else if (callback.getMethod().equals("gameInform")) {
        if (callback.getMessageId() > messageId) {
          GameClientMessage message = (GameClientMessage) callback.getData();
          session.getGame().inform(message.getMessage(), message.getGameView());
        }
        else {
          logger.warning("message out of sequence - ignoring");
        }
      }
View Full Code Here

Examples of mage.view.ChatMessage

    Calendar cal = new GregorianCalendar();
    final String msg = timeFormatter.format(cal.getTime()) + " " + userName + ":" + message;
    for (UUID sessionId: clients.keySet()) {
      Session session = SessionManager.getInstance().getSession(sessionId);
      if (session != null)
        session.fireCallback(new ClientCallback("chatMessage", new ChatMessage(chatId, msg, color)));
      else
        kill(sessionId);
    }
  }
View Full Code Here

Examples of mage.view.ChatMessage

            execute("sendBroadcastMessage", sessionId, new Action() {
                @Override
                public void execute() {
                    for (User user : UserManager.getInstance().getUsers()) {
                        if (message.toLowerCase(Locale.ENGLISH).startsWith("warn")) {
                            user.fireCallback(new ClientCallback("serverMessage", null, new ChatMessage("SERVER", message, null, MessageColor.RED)));
                        } else {
                            user.fireCallback(new ClientCallback("serverMessage", null, new ChatMessage("SERVER", message, null, MessageColor.BLUE)));
                        }
                    }
                }
            }, true);
        }
View Full Code Here

Examples of mage.view.ChatMessage

        }
    }

    public boolean broadcastInfoToUser(User toUser, String message) {
        if (clients.containsKey(toUser.getId())) {
            toUser.fireCallback(new ClientCallback("chatMessage", chatId, new ChatMessage(null, message, timeFormatter.format(new Date()), MessageColor.BLUE, MessageType.USER_INFO, null)));
            return true;
        }
        return false;
    }
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.