Skip to content

Commit

Permalink
Revert "Install NodePose and ScoreSyncStateManager in AppInstaller, k…
Browse files Browse the repository at this point in the history
…eep original intact"

This reverts commit d54b4dc.
  • Loading branch information
michael-r-elp committed Aug 30, 2024
1 parent e28087b commit 8e904bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/Hooks/MainSystemBinderHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "Zenject/ConcreteIdBinderNonGeneric.hpp"
#include "Zenject/FromBinderNonGeneric.hpp"
#include "Objects/MpEntitlementChecker.hpp"
// #include "NodePoseSyncState/MpNodePoseSyncStateManager.hpp"
// #include "ScoreSyncState/MpScoreSyncStateManager.hpp"
#include "NodePoseSyncState/MpNodePoseSyncStateManager.hpp"
#include "ScoreSyncState/MpScoreSyncStateManager.hpp"

MAKE_AUTO_HOOK_ORIG_MATCH(MainSystemInit_InstallBindings, &::GlobalNamespace::MainSystemInit::InstallBindings, void, GlobalNamespace::MainSystemInit* self, Zenject::DiContainer* container, bool isRunningFromTests) {
MainSystemInit_InstallBindings(self, container, isRunningFromTests);
Expand All @@ -23,17 +23,17 @@ MAKE_AUTO_HOOK_ORIG_MATCH(MainSystemInit_InstallBindings, &::GlobalNamespace::Ma
auto toarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::Objects::MpEntitlementChecker*>();
container->Bind(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(bindarray.convert()))->To(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(toarray.convert()))->FromNewComponentOnRoot()->AsSingle()->NonLazy();

// container->Unbind<GlobalNamespace::NodePoseSyncStateManager*>();
// container->Unbind<GlobalNamespace::INodePoseSyncStateManager*>();
container->Unbind<GlobalNamespace::NodePoseSyncStateManager*>();
container->Unbind<GlobalNamespace::INodePoseSyncStateManager*>();

// bindarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::NodePoseSyncState::MpNodePoseSyncStateManager*, GlobalNamespace::NodePoseSyncStateManager*, GlobalNamespace::INodePoseSyncStateManager*, Zenject::IInitializable*, System::IDisposable*>();
// toarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::NodePoseSyncState::MpNodePoseSyncStateManager*>();
// container->Bind(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(bindarray.convert()))->To(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(toarray.convert()))->FromNewComponentOnRoot()->AsSingle();
bindarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::NodePoseSyncState::MpNodePoseSyncStateManager*, GlobalNamespace::NodePoseSyncStateManager*, GlobalNamespace::INodePoseSyncStateManager*, Zenject::IInitializable*, System::IDisposable*>();
toarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::NodePoseSyncState::MpNodePoseSyncStateManager*>();
container->Bind(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(bindarray.convert()))->To(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(toarray.convert()))->FromNewComponentOnRoot()->AsSingle();

// container->Unbind<GlobalNamespace::ScoreSyncStateManager*>();
// container->Unbind<GlobalNamespace::IScoreSyncStateManager*>();
container->Unbind<GlobalNamespace::ScoreSyncStateManager*>();
container->Unbind<GlobalNamespace::IScoreSyncStateManager*>();

// bindarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::ScoreSyncState::MpScoreSyncStateManager*, GlobalNamespace::ScoreSyncStateManager*, GlobalNamespace::IScoreSyncStateManager*, Zenject::IInitializable*, System::IDisposable*>();
// toarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::ScoreSyncState::MpScoreSyncStateManager*>();
// container->Bind(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(bindarray.convert()))->To(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(toarray.convert()))->FromNewComponentOnRoot()->AsSingle();
bindarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::ScoreSyncState::MpScoreSyncStateManager*, GlobalNamespace::ScoreSyncStateManager*, GlobalNamespace::IScoreSyncStateManager*, Zenject::IInitializable*, System::IDisposable*>();
toarray = Lapiz::ArrayUtils::TypeArray<MultiplayerCore::ScoreSyncState::MpScoreSyncStateManager*>();
container->Bind(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(bindarray.convert()))->To(reinterpret_cast<::System::Collections::Generic::IEnumerable_1<System::Type*>*>(toarray.convert()))->FromNewComponentOnRoot()->AsSingle();
}
3 changes: 0 additions & 3 deletions src/Installers/MpAppInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "Patchers/PlayerCountPatcher.hpp"
#include "Repositories/MpStatusRepository.hpp"
#include "NodePoseSyncState/MpNodePoseSyncStateManager.hpp"
#include "ScoreSyncState/MpScoreSyncStateManager.hpp"

#include "Zenject/DiContainer.hpp"
#include "Zenject/FromBinderNonGeneric.hpp"
Expand All @@ -24,7 +23,6 @@ using namespace MultiplayerCore::Patchers;
using namespace MultiplayerCore::Beatmaps::Providers;
using namespace MultiplayerCore::Repositories;
using namespace MultiplayerCore::NodePoseSyncState;
using namespace MultiplayerCore::ScoreSyncState;

namespace MultiplayerCore::Installers {
void MpAppInstaller::InstallBindings() {
Expand All @@ -35,7 +33,6 @@ namespace MultiplayerCore::Installers {
// player stuff
container->BindInterfacesAndSelfTo<MpPlayerManager*>()->AsSingle();
container->BindInterfacesAndSelfTo<MpNodePoseSyncStateManager*>()->AsSingle();
container->BindInterfacesAndSelfTo<MpScoreSyncStateManager*>()->AsSingle();

// beatmap stuff
container->Bind<MpLevelDownloader*>()->ToSelf()->AsSingle();
Expand Down

0 comments on commit 8e904bb

Please sign in to comment.