Exemple #1
0
 public void send(MessageType type) throws Exception {
   Packet packet = new Packet();
   packet.setType(type);
   Message message = new Message();
   message.setObject(packet);
   channel.send(message);
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 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);
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 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);
 }
Exemple #6
0
 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);
 }