Compare commits

...

3 Commits

Author SHA1 Message Date
Qiuzhizhe
00db9f6602 Fix ItemActor::getItemStack() crash 2023-04-08 21:45:41 -07:00
Qiuzhizhe
acc469d6b2 Release v408.3.1 2023-03-26 07:00:35 -07:00
Qiuzhizhe
ac7733eeee Fix 指令在无作弊情况下不能使用 2023-03-26 06:50:43 -07:00
10 changed files with 19 additions and 15 deletions

View File

@ -6,7 +6,7 @@
#define LITELOADER_VERSION_MAJOR 408
#define LITELOADER_VERSION_MINOR 3
#define LITELOADER_VERSION_REVISION 0
#define LITELOADER_VERSION_REVISION 1
#define LITELOADER_VERSION_ACTIONS 0
#define LITELOADER_VERSION_STATUS LITELOADER_VERSION_DEV

View File

@ -390,7 +390,7 @@
/*0*/ virtual ~DynamicCommand();
/*1*/ virtual void execute(class CommandOrigin const& origin, class CommandOutput& output) const;
LIAPI static std::unique_ptr<class DynamicCommandInstance> createCommand(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag1 = {(CommandFlagValue)0x80}, CommandFlag flag2 = {(CommandFlagValue)0}, HMODULE handle = GetCurrentModule());
LIAPI static std::unique_ptr<class DynamicCommandInstance> createCommand(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag1 = {(CommandFlagValue)4}, CommandFlag flag2 = {(CommandFlagValue)0}, HMODULE handle = GetCurrentModule());
LIAPI static std::unique_ptr<class DynamicCommandInstance> createCommand(
std::string const& name,
std::string const& description,
@ -399,7 +399,7 @@
std::vector<std::vector<std::string>>&& overloads,
CallBackFn callback,
CommandPermissionLevel permission = CommandPermissionLevel::GameMasters,
CommandFlag flag1 = {(CommandFlagValue)0x80},
CommandFlag flag1 = {(CommandFlagValue)0x40},
CommandFlag flag2 = {(CommandFlagValue)0},
HMODULE handle = GetCurrentModule());
@ -412,7 +412,7 @@
std::vector<std::vector<std::string>>&& overloads,
CallBackFn callback,
CommandPermissionLevel permission = CommandPermissionLevel::GameMasters,
CommandFlag flag1 = {(CommandFlagValue)0x80},
CommandFlag flag1 = {(CommandFlagValue)0x40},
CommandFlag flag2 = {(CommandFlagValue)0},
HMODULE handle = GetCurrentModule()) {
return setup(createCommand(name, description, std::move(enums), std::move(params), std::move(overloads), std::move(callback), permission, flag1, flag2, handle));
@ -483,7 +483,7 @@
friend class DynamicCommand;
LIAPI DynamicCommandInstance(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag = {(CommandFlagValue)0x80}, HMODULE handle = GetCurrentModule());
LIAPI DynamicCommandInstance(std::string const& name, std::string const& description, CommandPermissionLevel permission = CommandPermissionLevel::GameMasters, CommandFlag flag = {(CommandFlagValue)0x40}, HMODULE handle = GetCurrentModule());
LIAPI bool setBuilder(DynamicCommand::BuilderFn builder);
LIAPI DynamicCommand::BuilderFn initCommandBuilder();

View File

@ -514,7 +514,7 @@ public:
static void setup(CommandRegistry* registry) {
registry->registerCommand("addons", "LiteLoaderBDS Addons Helper (Restart required after addon changes)",
CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x80});
CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x40});
vector<string> addonsList;
for (auto& addon : addons)

View File

@ -118,7 +118,7 @@ public:
static void setup(CommandRegistry* registry) {
registry->registerCommand(
"tpdim", "Teleport to Dimension", CommandPermissionLevel::GameMasters,
{(CommandFlagValue)0}, {(CommandFlagValue)0x80});
{(CommandFlagValue)0}, {(CommandFlagValue)0x40});
registry->addEnum<DimensionType>("DimensionType",
{
{"overworld", DimensionType::OverWorld},
@ -312,7 +312,7 @@ public:
static void setup(CommandRegistry* registry) {
// Register Cmd
registry->registerCommand("ll", "LiteLoaderBDS plugin operations",
CommandPermissionLevel::Console, {(CommandFlagValue)0}, {(CommandFlagValue)0x80});
CommandPermissionLevel::Console, {(CommandFlagValue)0}, {(CommandFlagValue)0x40});
// Register softenum
vector<string> pluginList;
@ -372,7 +372,7 @@ public:
static void setup(CommandRegistry* registry) {
registry->registerCommand("version", "Get the version of this server",
CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x80});
CommandPermissionLevel::GameMasters, {(CommandFlagValue)0}, {(CommandFlagValue)0x40});
registry->registerOverload<VersionCommand>("version");
}
};

View File

@ -10,7 +10,7 @@ bool isUnlockCmdEnabled = true;
void LogCommandRegistration(std::string const& name, char const* description, enum CommandPermissionLevel perm, short flag1, short flag2);
TInstanceHook(void, "?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBDW4CommandPermissionLevel@@UCommandFlag@@3@Z",
CommandRegistry, std::string const& name, char const* description, enum CommandPermissionLevel perm, short flag1, short flag2) {
CommandRegistry, std::string const& name, char const* description, enum CommandPermissionLevel perm, unsigned char flag1, unsigned char flag2) {
// For #643
if (name.find(' ') == std::string::npos) { // If no space inside
// Check whether command is already exists before registering
@ -20,7 +20,7 @@ TInstanceHook(void, "?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@D
}
}
if (ll::globalConfig.enableUnlockCmd) {
flag1 |= 0x80;
flag2 |= 0x40;
}
if (ll::globalConfig.debugMode) {
LogCommandRegistration(name, description, perm, flag1, flag2);

View File

@ -3,7 +3,7 @@
#include <llapi/HookAPI.h>
ItemStack* ItemActor::getItemStack() {
return dAccess<ItemStack*>(this, ll::offset::ITEMACTORAPI_getItemStack); // IDA Player::take Line127
return &dAccess<ItemStack>(this, ll::offset::ITEMACTORAPI_getItemStack); // IDA Player::take Line127
}
int ItemActor::getDespawnTime() {

@ -1 +1 @@
Subproject commit 15e2c6d7149054f36f103de0a86d58e4548a506f
Subproject commit 23548dcf6a1761c0fab3268e733ac84b2b7ccee6

View File

@ -2,6 +2,7 @@
![BDS 1.16.40.02](https://img.shields.io/badge/BDS-1.16.40.02-blue?style=for-the-badge)&emsp;![Protocol 408](https://img.shields.io/badge/Protocol-408-orange?style=for-the-badge)
v408.3.x 版本变更内容
## Added
* 添加`ActorBlockSyncMessage`结构
@ -30,6 +31,10 @@
* 修复`SetDisplayObjectivePacket`类
* 修正`HitResult::getEntity`函数
v408.3.1
* 修复指令在无作弊情况下不能使用
## Other
* 已发布到Tooth库可使用[Lip](https://github.com/LiteLDev/Lip)或者[LipUI](https://github.com/LiteLDev/LipUI)进行安装

View File

@ -19,7 +19,7 @@ using namespace std;
bool RegisterCmd(const string& cmd, const string& describe, int cmdLevel) {
::Global<CommandRegistry>->registerCommand(cmd, describe.c_str(), (CommandPermissionLevel)cmdLevel, {(CommandFlagValue)0},
{(CommandFlagValue)0x80});
{(CommandFlagValue)0x40});
return true;
}

View File

@ -87,7 +87,6 @@ ClassDefine<PlayerClass> PlayerClassBuilder =
.instanceProperty("isAdventure", &PlayerClass::isAdventure)
.instanceProperty("isGliding", &PlayerClass::isGliding)
.instanceProperty("isSurvival", &PlayerClass::isSurvival)
// .instanceProperty("isSpectator", &PlayerClass::isSpectator)
.instanceProperty("isRiding", &PlayerClass::isRiding)
.instanceProperty("isDancing", &PlayerClass::isDancing)
.instanceProperty("isCreative", &PlayerClass::isCreative)