mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
GUI, deck: improved bracket level calculations (added all infinite combos list and spellbook downloader, part of #13341)
This commit is contained in:
parent
1fb4cecd6b
commit
d465c9fb82
9 changed files with 2148 additions and 9 deletions
|
|
@ -27,9 +27,11 @@ import java.util.stream.Stream;
|
|||
* Features:
|
||||
* - [x] find possible bracket level of the deck
|
||||
* - [x] find affected cards by checking group
|
||||
* - [ ] TODO: data download and generate
|
||||
* - [x] can auto-generate infinite combos list, see verify test downloadAndPrepareCommanderBracketsData
|
||||
* - [ ] TODO: tests
|
||||
* - [ ] TODO: table - players brackets level disclose settings
|
||||
* - [ ] TODO: deck - improve gui to show more levels
|
||||
* - [ ] TODO: generate - convert card name to xmage format and assert on bad names (ascii only)
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -291,16 +291,25 @@ public class XmageURLConnection {
|
|||
}
|
||||
}
|
||||
|
||||
public static String downloadText(String resourceUrl) {
|
||||
return downloadText(resourceUrl, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fast download of text data
|
||||
*
|
||||
* @param additionalHeaders set extra headers like application/json
|
||||
*
|
||||
* @return downloaded text on OK 200 response or empty on any other errors
|
||||
*/
|
||||
public static String downloadText(String resourceUrl) {
|
||||
public static String downloadText(String resourceUrl, Map<String, String> additionalHeaders) {
|
||||
XmageURLConnection con = new XmageURLConnection(resourceUrl);
|
||||
con.startConnection();
|
||||
if (con.isConnected()) {
|
||||
try {
|
||||
if (additionalHeaders != null) {
|
||||
con.setRequestHeaders(additionalHeaders);
|
||||
}
|
||||
con.connect();
|
||||
if (con.getResponseCode() == 200) {
|
||||
return con.getGoodResponseAsString();
|
||||
|
|
|
|||
|
|
@ -853,7 +853,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
connection.startConnection();
|
||||
if (connection.isConnected()) {
|
||||
|
||||
// custom headers (ues
|
||||
// custom headers
|
||||
connection.setRequestHeaders(selectedSource.getHttpRequestHeaders(currentUrl));
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue