@Override
   public void run() {
      try {
         ObjectInputStream input = new ObjectInputStream(this.input);
         String line;
         while (this.socket.isConnected()) {
            line = input.readUTF();
            if (line.startsWith("JOIN")) {
               this.game.join(input.readUTF(), this.player.getOtherPlayer());
            } else if (line.startsWith("PLAY")) {
               Play play = null;
               try {
                  play = (Play) input.readObject();
                  this.game.play(play);
               } catch (ClassNotFoundException ex) {
                  Logger.getLogger(NetworkController.class.getName()).log(Level.SEVERE, null, ex);
               }
               this.unlock();
            } else if (line.startsWith("BYE")) {
               this.socket.close();
            }
         }
      } catch (SocketException e) {
         Logger.getLogger(NetworkController.class.getName()).info("Disconnected");
      } catch (IOException ex) {
         Logger.getLogger(NetworkController.class.getName()).log(Level.SEVERE, null, ex);
      }
   }