Skip to content

Commit

Permalink
0.7
Browse files Browse the repository at this point in the history
- Added debug possibility
  • Loading branch information
Osiris-Team committed Jan 26, 2022
1 parent f9ed72d commit ac4e511
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.osiris</groupId>
<artifactId>SPPU</artifactId>
<version>0.6</version>
<version>0.7</version>
<packaging>jar</packaging>

<name>SPPU</name>
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/osiris/SPPU/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@

import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

import static com.osiris.SPPU.utils.GD.CONFIG;
import static com.osiris.SPPU.utils.GD.SPPU_DIR;

public class Main {
public static boolean isDEBUG;

public static void main(String[] args) throws NotLoadedException, IOException, IllegalKeyException, DuplicateKeyException, DYReaderException, IllegalListException, JLineLinkException, DYWriterException, InterruptedException {
new AL().start("SPPU", false, new File(SPPU_DIR + "/logs"), false);
for (String arg :
args) {
if (arg.equals("debug")) isDEBUG = true;
}
new AL().start("SPPU", isDEBUG, new File(SPPU_DIR + "/logs"), false);
CONFIG = new Config(SPPU_DIR + "/config.yml");
if (CONFIG.getFile().length() == 0) { // First run, enter setup:
Scanner scanner = new Scanner(System.in);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.osiris.SPPU.plugins;

import com.osiris.SPPU.Main;
import com.osiris.SPPU.plugins.search.SearchMaster;
import com.osiris.SPPU.plugins.search.SearchResult;
import com.osiris.SPPU.utils.GD;
Expand All @@ -22,6 +23,7 @@
import org.jsoup.nodes.Document;

import java.io.File;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -278,7 +280,9 @@ else if (code == 3)
// Do premium stuff
if (!updatablePremiumSpigotPlugins.isEmpty()) {
setStatus("Logging in to spigotmc.org...");
try (PlaywrightWindow window = new HBrowser().openCustomWindow().temporaryUserDataDir(true).headless(false).buildPlaywrightWindow()) {
OutputStream debugOut = null;
if (Main.isDEBUG) debugOut = System.out;
try (PlaywrightWindow window = new HBrowser().openCustomWindow().debugOutputStream(debugOut).temporaryUserDataDir(true).headless(false).buildPlaywrightWindow()) {
SpigotAuthenticator spigotAuthenticator = new SpigotAuthenticator();
spigotAuthenticator.attemptLoginForWindow(window, spigotUsername.asString(), spigotPassword.asString(),
spigotUsernameOld.asString(), spigotPasswordOld.asString()); // Throws exception on login fail
Expand Down

0 comments on commit ac4e511

Please sign in to comment.