Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
PermissionsFile.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/server/FileReadResult.h"
9#include "mc/server/commands/CommandPermissionLevel.h"
10#include "mc/server/commands/PlayerPermissionLevel.h"
11
12// auto generated forward declare list
13// clang-format off
15class Player;
16namespace Core { class Path; }
17namespace Json { class Value; }
18// clang-format on
19
21public:
22 // member variables
23 // NOLINTBEGIN
24 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string> const> mFilePath;
25 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::PlayerPermissionLevel>> mPermissions;
26 // NOLINTEND
27
28#ifdef LL_PLAT_S
29public:
30 // prevent constructor by default
32
33#else // LL_PLAT_C
34#endif
35public:
36 // member functions
37 // NOLINTBEGIN
38#ifdef LL_PLAT_S
39 MCNAPI explicit PermissionsFile(::Core::Path const& filePath);
40#endif
41
42 MCNAPI void applyPlayerPermissionsFromDisk(::Player& player, ::CommandPermissionLevel opCommandPermissionLevel);
43
44 MCAPI void persistPlayerPermissionsToDisk(::Player& player, ::PlayerPermissionLevel permission);
45
46 MCNAPI void persistPlayerPermissionsToDisk(::std::string const& playerId, ::PlayerPermissionLevel permission);
47
48 MCNAPI ::std::tuple<::FileReadResult, ::Json::Value> readPermissionFile();
49
50 MCNAPI ::FileReadResult reload();
51
52 MCNAPI ::FileReadResult reloadAndApply(
53 ::Bedrock::NotNullNonOwnerPtr<::GameplayUserManager> userManager,
54 ::CommandPermissionLevel opCommandPermissionLevel
55 );
56 // NOLINTEND
57
58public:
59 // static functions
60 // NOLINTBEGIN
61 MCNAPI static ::std::string _getPermissionIdForPlayer(::Player& player);
62 // NOLINTEND
63
64public:
65 // constructor thunks
66 // NOLINTBEGIN
67#ifdef LL_PLAT_S
68 MCNAPI void* $ctor(::Core::Path const& filePath);
69#endif
70 // NOLINTEND
71};
Definition Path.h:10
Definition GameplayUserManager.h:25
Definition Value.h:16
Definition PermissionsFile.h:20
MCAPI void applyPlayerPermissionsFromDisk(::Player &player, ::CommandPermissionLevel opCommandPermissionLevel)
static MCAPI ::std::string _getPermissionIdForPlayer(::Player &player)
MCAPI::FileReadResult reloadAndApply(::Bedrock::NotNullNonOwnerPtr<::GameplayUserManager > userManager, ::CommandPermissionLevel opCommandPermissionLevel)
MCAPI ::std::tuple<::FileReadResult, ::Json::Value > readPermissionFile()
MCAPI void persistPlayerPermissionsToDisk(::std::string const &playerId, ::PlayerPermissionLevel permission)
MCAPI::FileReadResult reload()
Definition Player.h:131