示例#1
0
 /** Creates a message for adding the client to the matchmaker queue */
 public QueueMessage() {
   BattleshipPacketExtension root = new BattleshipPacketExtension(ExtensionElements.BATTLESHIP);
   BattleshipPacketExtension queueing = new BattleshipPacketExtension(ExtensionElements.QUEUEING);
   queueing.setAttribute("action", "request");
   root.addSubElement(queueing);
   addExtension(root);
 }
示例#2
0
 /**
  * Creates a message for confirming the assingment of an opponent
  *
  * @param opponentJID the opponent id
  * @param matchId the match id
  */
 public QueueMessage(String opponentJID, String matchId) {
   BattleshipPacketExtension root = new BattleshipPacketExtension(ExtensionElements.BATTLESHIP);
   BattleshipPacketExtension queueing = new BattleshipPacketExtension(ExtensionElements.QUEUEING);
   queueing.setAttribute("action", "assigned");
   queueing.setAttribute("jid", opponentJID);
   queueing.setAttribute("mid", matchId);
   root.addSubElement(queueing);
   addExtension(root);
 }