Skip to content

Commit

Permalink
feat: add global PropertiesSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Dec 26, 2023
1 parent 7687fcb commit c3140f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/ll/api/service/GlobalService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ LL_AUTO_INSTANCE_HOOK(MinecraftDestructor, HookPriority::High, "??1Minecraft@@UE
origin();
}

// PropertiesSettings

LL_AUTO_INSTANCE_HOOK(
PropertiesSettingsConstructor,
HookPriority::High,
"??0PropertiesSettings@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z",
PropertiesSettings*,
std::string const& path
) {
auto self = origin(path);
ll::Global<PropertiesSettings>.init(self);
return self;
}
LL_AUTO_INSTANCE_HOOK(PropertiesSettingsDestructor, HookPriority::High, "??1PropertiesSettings@@QEAA@XZ", void) {
ll::Global<PropertiesSettings>.init(nullptr);
origin();
}

// ServerNetworkHandler

LL_AUTO_TYPED_INSTANCE_HOOK(
Expand Down
2 changes: 2 additions & 0 deletions src/ll/api/service/GlobalService.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace RakNet {
class RakPeer;
}
class Minecraft;
class PropertiesSettings;
class ServerLevel;
class Level;
class ServerNetworkHandler;
Expand All @@ -27,6 +28,7 @@ concept IsGlobalService = concepts::IsOneOf<
Minecraft,
Level,
ServerNetworkHandler,
PropertiesSettings,
RakNet::RakPeer,
NetworkSystem,
ResourcePackRepository>;
Expand Down

0 comments on commit c3140f6

Please sign in to comment.