temporary dependency bandaid

This commit is contained in:
altalk23 2023-12-30 21:34:04 +03:00
parent 9ff1059452
commit 157261171b
5 changed files with 27 additions and 6 deletions

View file

@ -353,25 +353,39 @@ void Loader::Impl::buildModGraph() {
}
void Loader::Impl::loadModGraph(Mod* node, bool early) {
if (node->isEnabled()) {
return;
}
if (early && !node->needsEarlyLoad()) {
m_modsToLoad.push_back(node);
return;
}
if (node->hasUnresolvedDependencies())
if (node->hasUnresolvedDependencies()) {
log::debug("{} {} has unresolved dependencies", node->getID(), node->getVersion());
return;
if (node->hasUnresolvedIncompatibilities())
}
if (node->hasUnresolvedIncompatibilities()) {
log::debug("{} {} has unresolved incompatibilities", node->getID(), node->getVersion());
return;
}
log::debug("{} {}", node->getID(), node->getVersion());
log::pushNest();
if (node->isEnabled()) {
if (node->shouldLoad()) {
bool hasUnresolvedDependencies = false;
for (auto const& dep : node->m_impl->m_dependants) {
if (dep->isEnabled())
continue;
m_modsToLoad.push_front(dep);
hasUnresolvedDependencies = true;
}
if (hasUnresolvedDependencies) {
log::debug("Has unresolved dependencies, loading later");
log::popNest();
return;
}
log::popNest();
return;
}
m_currentlyLoadingMod = node;

View file

@ -17,7 +17,7 @@ ModMetadata::Impl& ModMetadataImpl::getImpl(ModMetadata& info) {
bool ModMetadata::Dependency::isResolved() const {
return this->importance != Importance::Required ||
this->mod && this->mod->isEnabled() && this->version.compare(this->mod->getVersion());
this->mod && this->mod->shouldLoad() && this->version.compare(this->mod->getVersion());
}
bool ModMetadata::Incompatibility::isResolved() const {

View file

@ -19,6 +19,7 @@ Result<> Mod::Impl::loadPlatformBinary() {
return Ok();
}
std::string err = dlerror();
log::error("Unable to load the SO: dlerror returned ({})", err);
return Err("Unable to load the SO: dlerror returned (" + err + ")");
}

View file

@ -243,6 +243,8 @@ void printModsAndroid(std::stringstream& stream) {
static std::string s_result;
bool crashlog::setupPlatformHandler() {
(void)utils::file::createDirectoryAll(crashlog::getCrashLogDirectory());
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, "com/geode/launcher/utils/GeodeUtils", "getLogcatCrashBuffer", "()Ljava/lang/String;")) {

View file

@ -59,6 +59,10 @@ GEODE_SIZE_CHECK(StartPosObject, 0x668);
GEODE_SIZE_CHECK(LabelGameObject, 0x690);
// GEODE_SIZE_CHECK(EventLinkTrigger, 0x688);
GEODE_SIZE_CHECK(GJBaseGameLayer, 0x2d40);
GEODE_MEMBER_CHECK(GJBaseGameLayer, m_level, 0x5f0);
GEODE_MEMBER_CHECK(GameManager, m_gameLayer, 0x174);
// GEODE_MEMBER_CHECK(CCNode, m_pUserObject, 0xcc);
// needed classes are ones in the ids folder and some generic ones (i think they are already done though so only ids)