예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }