Exemplo n.º 1
0
 public void replay() {
   allowUserInput = false;
   try {
     networkManager = ClientNetworkManager.create(this);
   } catch (Exception e) {
     UIUtils.displayException("Replay failed", e);
   }
 }
Exemplo n.º 2
0
 public void connect() {
   allowUserInput = true;
   new Thread(
           () -> {
             try {
               if (temporaryServerSelection == null) {
                 ServerHandler.Server server = ServerHandler.INSTANCE.getServerForPlay();
                 networkManager =
                     ClientNetworkManager.create(
                         SlytherClient.this, server, configuration.shouldRecord);
               } else {
                 networkManager =
                     ClientNetworkManager.create(
                         SlytherClient.this, temporaryServerSelection, configuration.shouldRecord);
               }
               server = networkManager.getIp();
             } catch (Exception e) {
               UIUtils.displayException("Connection failed", e);
             }
           })
       .start();
 }