Skip to content

Commit 171a630

Browse files
committed
Fix console pt.2
1 parent 14491b3 commit 171a630

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/main/java/dev/le_app/mcss_api_java/Server.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,8 @@ public String[] getConsole(int lines) throws APIUnauthorizedException, IOExcepti
718718
throw new IOException(Errors.NOT_RECOGNIZED.getMessage() + responseCode);
719719
}
720720

721-
//Get response in a JSON object
722-
JSONObject json = new JSONObject(conn.getInputStream());
723721
//get the JSON array from the object
724-
JSONArray consoleJsonArray = new JSONArray(json);
722+
JSONArray consoleJsonArray = new JSONArray(conn.getInputStream());
725723

726724
//Create a string array to store the console
727725
String[] console = new String[consoleJsonArray.length()];
@@ -782,10 +780,8 @@ public String[] getConsoleFromBeginning(int lines, boolean takeFromBeginning) th
782780
throw new IOException(Errors.NOT_RECOGNIZED.getMessage() + responseCode);
783781
}
784782

785-
//Get response in a JSON object
786-
JSONObject json = new JSONObject(conn.getInputStream());
787783
//get the JSON array from the object
788-
JSONArray consoleJsonArray = new JSONArray(json);
784+
JSONArray consoleJsonArray = new JSONArray(conn.getInputStream());
789785

790786
//Create a string array to store the console
791787
String[] console = new String[consoleJsonArray.length()];
@@ -846,10 +842,8 @@ public String[] getConsoleReversed(int lines, boolean reversed) throws APIUnauth
846842
throw new IOException(Errors.NOT_RECOGNIZED.getMessage() + responseCode);
847843
}
848844

849-
//Get response in a JSON object
850-
JSONObject json = new JSONObject(conn.getInputStream());
851845
//get the JSON array from the object
852-
JSONArray consoleJsonArray = new JSONArray(json);
846+
JSONArray consoleJsonArray = new JSONArray(conn.getInputStream());
853847

854848
//Create a string array to store the console
855849
String[] console = new String[consoleJsonArray.length()];
@@ -913,10 +907,8 @@ public String[] getConsole(int lines, boolean takeFromBeginning, boolean reverse
913907
throw new IOException(Errors.NOT_RECOGNIZED.getMessage() + responseCode);
914908
}
915909

916-
//Get response in a JSON object
917-
JSONObject json = new JSONObject(conn.getInputStream());
918910
//get the JSON array from the object
919-
JSONArray consoleJsonArray = new JSONArray(json);
911+
JSONArray consoleJsonArray = new JSONArray(conn.getInputStream());
920912

921913
//Create a string array to store the console
922914
String[] console = new String[consoleJsonArray.length()];

0 commit comments

Comments
 (0)