public void send(MessageType type) throws Exception { Packet packet = new Packet(); packet.setType(type); Message message = new Message(); message.setObject(packet); channel.send(message); }
public void sendJoin(String name) throws Exception { Message message = new Message(); Packet packet = new Packet(); packet.setType(MessageType.Join); packet.setpName(name); message.setObject(packet); channel.send(message); }
public void sendInfo(String info, Address address) throws Exception { Packet packet = new Packet(); packet.setType(MessageType.Info); packet.setInfo(info); Message message = new Message(address); message.setObject(packet); channel.send(message); }
public void send(MessageType type, Address address) throws Exception { Packet packet = new Packet(); packet.setType(type); packet.setReply(false); Message message = new Message(address); message.setObject(packet); channel.send(message); }
public void sendGameStatusToClient() throws Exception { Packet packet = new Packet(); packet.setType(MessageType.Update_Families); packet.setReply(false); packet.setGameStatus(new GameStatus().update(serverGameInfo)); Message message = new Message(); message.setObject(packet); channel.send(message); }
public void sendGameStatusUpdate(MessageType type) throws Exception { Packet packet = new Packet(); packet.setType(type); packet.setReply(true); packet.setGameStatus(new GameStatus().update(gameInfo)); Message message = new Message(); message.setObject(packet); channel.send(message); }