Skip to content

Commit

Permalink
Update mps to 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AymericBdy committed Jul 18, 2024
1 parent bacee96 commit 646ea7b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dependencies {

implementation 'com.github.stephengold:Libbulletjme:' + libbulletjme_version
implementation "fr.aym.acsguis:ACsGuis:1.2.12"
implementation ":ModProtectionLib:1.4.2"
implementation ":ModProtectionLib:1.5.0"
implementation('org.spongepowered:mixin:0.8.3') {
exclude module: 'guava'
exclude module: 'commons-io'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version=1.12.2
version_suffix=SYNC
version_major=4
version_minor=1
version_patch=0-dev30
version_patch=0-dev31
libbulletjme_version=18.1.0

mavenArtifactId=DynamX
Expand Down
Binary file removed libs/ModProtectionLib-1.4.2.jar
Binary file not shown.
Binary file added libs/ModProtectionLib-1.5.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/fr/dynamx/utils/DynamXConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class DynamXConstants
* For compatibility reasons, the main mps url is still mps.dynamx.fr, but mps dynamically rewrites it to v3.mps.dynamx.fr which has a valid DynamXRootCA certificate <br>
* This rewrite will stay "hidden" and the new packs still need to be ciphered using the mps.dynamx.fr url <br>
* The lets encrypt certificate is used for aux mps urls, and can be used for external mps servers. <br>
* The aux mps is now mps.dynamx.fr, and the other aux url mps2.dynamx.fr currently uses an old certificate valid until September 24.
* The aux mps is now mps.dynamx.fr, and the other aux url mps2.dynamx.fr currently uses old certificates valid until September 24.
*/
public static final String DYNAMX_CERT = "certs/DynamXRootCA.crt", DYNAMX_AUX_CERT = "certs/letsencrypt-isrgrootx1.der";

Expand Down
12 changes: 8 additions & 4 deletions src/main/java/fr/dynamx/utils/DynamXMpsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,24 @@ public String getPatchedMainUrl() {
}

@Override
public URL getHomeUrl(ModProtectionConfig config, int attempt) throws MalformedURLException {
public URL getHomeUrl(ModProtectionConfig config, int attempt, boolean pre150Server) throws MalformedURLException {
String mpsURL = attempt > -1 ? getAuxUrls()[attempt] : getPatchedMainUrl();
return new URL(mpsURL + config.getMpsVersion() + "/home.php?access_key=" + config.getMpsAccessKey());
if (pre150Server)
return new URL(mpsURL + config.getMpsVersion() + "/home.php?access_key=" + config.getMpsAccessKey());
return new URL(mpsURL + "home/" + config.getMpsVersion() + "/" + config.getMpsAccessKey() + "/" + config.getUserId());
}

@Override
public URL getResourceUrl(ModProtectionConfig config, int attempt, String encodedModVersion, String resource, @Nullable ModProtectionContainer.CustomRepoParams params) throws MalformedURLException {
public URL getResourceUrl(ModProtectionConfig config, int attempt, String encodedModVersion, String resource, @Nullable ModProtectionContainer.CustomRepoParams params, boolean pre150Server) throws MalformedURLException {
if (params != null) {
if (attempt == -1)
return new URL(MPS_URL_PATCHER.apply(params.getDomain()) + resource);
return new URL(params.getDomain().replace(getMainUrl(), getAuxUrls()[attempt]) + resource); //apply aux url
}
String mpsURL = (attempt > -1 ? getAuxUrls()[attempt] : getPatchedMainUrl());
return new URL(mpsURL + config.getMpsVersion() + "/router.php?mod_version=" + encodedModVersion + "&target=" + resource);
if (pre150Server)
return new URL(mpsURL + config.getMpsVersion() + "/router.php?mod_version=" + encodedModVersion + "&target=" + resource);
return new URL(mpsURL + "get/" + resource + "/" + encodedModVersion);
}
}
}

0 comments on commit 646ea7b

Please sign in to comment.