Package com.benkyou.common.messages

Examples of com.benkyou.common.messages.ChatClientMessage


    }

    public void messageReceived(HostedConnection source, Message m) {
        if (m instanceof ChatClientMessage) {
            ChatClientMessage chatClientMessage = (ChatClientMessage) m;
           /* if(chatClientMessage.isNewUser()){
              chatClientMessage.setUUID((String)source.getAttribute("UUID"));
              gameServer.getMyServer().broadcast(chatClientMessage); 
            }*/
            gameServer.getMyServer().broadcast(chatClientMessage.setReliable(false));

        }
    }
View Full Code Here


                Player p =new Player(loginMessage.getLoginName(), loginMessage.getID(), (String) source.getAttribute("UUID"));
                System.out.println("Client connected! username: " + loginMessage.getLoginName() + " ip: " + source.getAddress() );
                gameServer.getPlayerList().add(p);
                source.getServer().getConnection(source.getId()).send(new PlayerMessage(loginMessage.getLoginName(),loginMessage.getID(),p.getUUID()));
                //gameServer.getMyServer().broadcast(Filters.notEqualTo(source), new LoginMessage(loginMessage.getLoginName(), null, loginMessage.getID(), p.getUUID()));
                  gameServer.getMyServer().broadcast(new ChatClientMessage("BenkyouServer", p.getName() + " Has joined the server!"));
                gameServer.syncPlayers();
           
           
            }
        }
View Full Code Here

    public ChatServerListener() {
    }

    public void messageReceived(HostedConnection source, Message m) {
        if (m instanceof ChatClientMessage) {
            ChatClientMessage message = (ChatClientMessage) m;
            source.getServer().broadcast(message);
        }
    }
View Full Code Here

    * @param source
    * @param m
    */
   public void messageReceived(Client source, Message m) {
        if(m instanceof ChatClientMessage){
            ChatClientMessage chatClientMessage = (ChatClientMessage) m;
            if(chatClientMessage.isNewUser()){
                gameClient.addChatter(new Chatter(chatClientMessage.getName(),chatClientMessage.getUUID()));
                gameClient.addChatText(chatClientMessage.getName(), chatClientMessage.getMessage());
            }
              gameClient.addChatText(chatClientMessage.getName(), chatClientMessage.getMessage());
           
        }
       
    }
View Full Code Here

TOP

Related Classes of com.benkyou.common.messages.ChatClientMessage

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.