Ely.by skin support implemented with room for the future

This commit is contained in:
Zakhar Afonin
2021-06-10 21:36:41 +03:00
parent 6df1be94dd
commit a6a627ab2d
3 changed files with 19 additions and 3 deletions

View File

@@ -771,8 +771,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
}
for (auto profile : account->profiles())
{
auto skinsBase = BuildConfig.SKINS_BASE_MOJANG;
auto skinsArg = profile.id;
if (account->loginType() == "elyby")
{
skinsBase = BuildConfig.SKINS_BASE_ELYBY;
skinsArg = profile.name;
}
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
auto action = Net::Download::makeCached(QUrl(BuildConfig.SKINS_BASE + profile.id + ".png"), meta);
auto action = Net::Download::makeCached(QUrl(skinsBase + skinsArg + ".png"), meta);
skin_dls.append(action);
meta->setStale(true);
}

View File

@@ -172,8 +172,15 @@ void AccountListPage::addAccount(const QString &errMsg)
for (AccountProfile profile : account->profiles())
{
auto skinsBase = BuildConfig.SKINS_BASE_MOJANG;
auto skinsArg = profile.id;
if (account->loginType() == "elyby")
{
skinsBase = BuildConfig.SKINS_BASE_ELYBY;
skinsArg = profile.name;
}
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
auto action = Net::Download::makeCached(QUrl(BuildConfig.SKINS_BASE + profile.id + ".png"), meta);
auto action = Net::Download::makeCached(QUrl(skinsBase + skinsArg + ".png"), meta);
job->addNetAction(action);
meta->setStale(true);
}

View File

@@ -67,7 +67,6 @@ public:
QString RESOURCE_BASE = "https://resources.download.minecraft.net/";
QString LIBRARY_BASE = "https://libraries.minecraft.net/";
QString SKINS_BASE = "https://crafatar.com/skins/";
QString MOJANG_STATUS_URL = "https://status.mojang.com/check";
QString IMGUR_BASE_URL = "https://api.imgur.com/3/";
QString FMLLIBS_BASE_URL = "https://files.multimc.org/fmllibs/";
@@ -77,6 +76,9 @@ public:
QString AUTH_BASE_MOJANG = "https://authserver.mojang.com/";
QString AUTH_BASE_ELYBY = "https://authserver.ely.by/auth/";
QString SKINS_BASE_MOJANG = "https://crafatar.com/skins/";
QString SKINS_BASE_ELYBY = "http://skinsystem.ely.by/skins/";
QString MODPACKSCH_API_BASE_URL = "https://api.modpacks.ch/";
QString LEGACY_FTB_CDN_BASE_URL = "https://dist.creeper.host/FTB2/";