mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-05 03:43:40 +00:00
修复部分变更的符合函数
This commit is contained in:
parent
5ecd9e710d
commit
958dfe41b5
@ -73,8 +73,8 @@ public:
|
|||||||
storage_.policy_ = allocate & 0x3;
|
storage_.policy_ = allocate & 0x3;
|
||||||
storage_.length_ = length & 0x3FFFFFFF;
|
storage_.length_ = length & 0x3FFFFFFF;
|
||||||
}
|
}
|
||||||
//MCAPI CZString(CZString const& other);
|
MCAPI CZString(CZString const& other);
|
||||||
//MCAPI ~CZString();
|
MCAPI ~CZString();
|
||||||
CZString& operator=(const CZString& other) {
|
CZString& operator=(const CZString& other) {
|
||||||
cstr_ = other.cstr_;
|
cstr_ = other.cstr_;
|
||||||
index_ = other.index_;
|
index_ = other.index_;
|
||||||
@ -153,34 +153,34 @@ public:
|
|||||||
bits_.value_type_ = realValue;
|
bits_.value_type_ = realValue;
|
||||||
value_.real_ = value;
|
value_.real_ = value;
|
||||||
}
|
}
|
||||||
//MCAPI Value(const char* value);
|
MCAPI Value(const char* value);
|
||||||
Value(bool value) {
|
Value(bool value) {
|
||||||
bits_.value_type_ = booleanValue;
|
bits_.value_type_ = booleanValue;
|
||||||
value_.bool_ = value;
|
value_.bool_ = value;
|
||||||
}
|
}
|
||||||
//MCAPI Value(const Value& other);
|
MCAPI Value(const Value& other);
|
||||||
//MCAPI ~Value();
|
MCAPI ~Value();
|
||||||
|
|
||||||
//MCAPI static Value const null;
|
MCAPI static Value const null;
|
||||||
|
|
||||||
//MCAPI void swap(Value& other);
|
MCAPI void swap(Value& other);
|
||||||
ValueType type() const {
|
ValueType type() const {
|
||||||
return bits_.value_type_;
|
return bits_.value_type_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//MCAPI Value& operator=(const Value& other);
|
MCAPI Value& operator=(const Value& other);
|
||||||
|
|
||||||
//MCAPI bool operator<(const Value& other) const;
|
MCAPI bool operator<(const Value& other) const;
|
||||||
//MCAPI bool operator==(const Value& other) const;
|
MCAPI bool operator==(const Value& other) const;
|
||||||
|
|
||||||
//MCAPI std::string asString(std::string const&) const;
|
MCAPI std::string asString(std::string const&) const;
|
||||||
//MCAPI Int asInt(Int) const;
|
MCAPI Int asInt(Int) const;
|
||||||
//MCAPI UInt asUInt(UInt) const;
|
MCAPI UInt asUInt(UInt) const;
|
||||||
//MCAPI float asFloat(float) const;
|
MCAPI float asFloat(float) const;
|
||||||
//MCAPI double asDouble(double) const;
|
MCAPI double asDouble(double) const;
|
||||||
//MCAPI bool asBool(bool) const;
|
MCAPI bool asBool(bool) const;
|
||||||
|
|
||||||
//MCAPI bool isNull() const;
|
MCAPI bool isNull() const;
|
||||||
bool isBool() const {
|
bool isBool() const {
|
||||||
return type() == booleanValue;
|
return type() == booleanValue;
|
||||||
}
|
}
|
||||||
@ -196,48 +196,48 @@ public:
|
|||||||
bool isDouble() const {
|
bool isDouble() const {
|
||||||
return type() == realValue;
|
return type() == realValue;
|
||||||
}
|
}
|
||||||
//MCAPI bool isNumeric() const;
|
MCAPI bool isNumeric() const;
|
||||||
//MCAPI bool isString() const;
|
MCAPI bool isString() const;
|
||||||
bool isArray() const {
|
bool isArray() const {
|
||||||
return type() == arrayValue;
|
return type() == arrayValue;
|
||||||
}
|
}
|
||||||
bool isObject() const {
|
bool isObject() const {
|
||||||
return type() == objectValue;
|
return type() == objectValue;
|
||||||
}
|
}
|
||||||
//MCAPI bool isConvertibleTo(ValueType other) const;
|
MCAPI bool isConvertibleTo(ValueType other) const;
|
||||||
|
|
||||||
//MCAPI ArrayIndex size() const;
|
MCAPI ArrayIndex size() const;
|
||||||
//MCAPI bool empty() const;
|
MCAPI bool empty() const;
|
||||||
void clear() {
|
void clear() {
|
||||||
if (type() == arrayValue || type() == objectValue) {
|
if (type() == arrayValue || type() == objectValue) {
|
||||||
value_.map_->clear();
|
value_.map_->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//MCAPI void resize(ArrayIndex newSize);
|
MCAPI void resize(ArrayIndex newSize);
|
||||||
//MCAPI Value& operator[](ArrayIndex index);
|
MCAPI Value& operator[](ArrayIndex index);
|
||||||
//MCAPI Value& operator[](int index);
|
MCAPI Value& operator[](int index);
|
||||||
//MCAPI const Value& operator[](ArrayIndex index) const;
|
MCAPI const Value& operator[](ArrayIndex index) const;
|
||||||
//MCAPI const Value& operator[](int index) const;
|
MCAPI const Value& operator[](int index) const;
|
||||||
//MCAPI Value& append(const Value& value);
|
MCAPI Value& append(const Value& value);
|
||||||
|
|
||||||
//MCAPI Value& operator[](const char* key);
|
MCAPI Value& operator[](const char* key);
|
||||||
//MCAPI const Value& operator[](const char* key) const;
|
MCAPI const Value& operator[](const char* key) const;
|
||||||
//MCAPI Value& operator[](const std::string& key);
|
MCAPI Value& operator[](const std::string& key);
|
||||||
//MCAPI const Value& operator[](const std::string& key) const;
|
MCAPI const Value& operator[](const std::string& key) const;
|
||||||
//MCAPI Value removeMember(const char* key);
|
MCAPI Value removeMember(const char* key);
|
||||||
void removeMember(const std::string& key) {
|
void removeMember(const std::string& key) {
|
||||||
removeMember(key.c_str());
|
removeMember(key.c_str());
|
||||||
}
|
}
|
||||||
//MCAPI bool isMember(const char* key) const;
|
MCAPI bool isMember(const char* key) const;
|
||||||
bool isMember(const std::string& key) const {
|
bool isMember(const std::string& key) const {
|
||||||
return isMember(key.c_str());
|
return isMember(key.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
//MCAPI const_iterator begin() const;
|
MCAPI const_iterator begin() const;
|
||||||
//MCAPI const_iterator end() const;
|
MCAPI const_iterator end() const;
|
||||||
|
|
||||||
//MCAPI iterator begin();
|
MCAPI iterator begin();
|
||||||
//MCAPI iterator end();
|
MCAPI iterator end();
|
||||||
|
|
||||||
MCAPI std::string toStyledString() const;
|
MCAPI std::string toStyledString() const;
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ public:
|
|||||||
} bits_;
|
} bits_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//MCAPI Value& resolveReference(const char* key, bool create);
|
MCAPI Value& resolveReference(const char* key, bool create);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ValueIteratorBase {
|
class ValueIteratorBase {
|
||||||
@ -273,11 +273,11 @@ public:
|
|||||||
return !isEqual(other);
|
return !isEqual(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
//MCAPI Value key() const;
|
MCAPI Value key() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//MCAPI void increment(void);
|
MCAPI void increment(void);
|
||||||
//MCAPI class Json::Value& deref(void) const;
|
MCAPI class Json::Value& deref(void) const;
|
||||||
|
|
||||||
bool isEqual(const SelfType& other) const {
|
bool isEqual(const SelfType& other) const {
|
||||||
if (isNull_)
|
if (isNull_)
|
||||||
@ -311,8 +311,8 @@ private:
|
|||||||
explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
|
explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//MCAPI SelfType& operator++();
|
MCAPI SelfType& operator++();
|
||||||
//MCAPI reference operator*() const;
|
MCAPI reference operator*() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ValueIterator : public ValueIteratorBase {
|
class ValueIterator : public ValueIteratorBase {
|
||||||
@ -334,15 +334,15 @@ private:
|
|||||||
explicit ValueIterator(const Value::ObjectValues::iterator& current);
|
explicit ValueIterator(const Value::ObjectValues::iterator& current);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// SelfType& operator++() {
|
SelfType& operator++() {
|
||||||
// increment();
|
increment();
|
||||||
// return *this;
|
return *this;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// Json::Value& operator*() {
|
Json::Value& operator*() {
|
||||||
// return deref();
|
return deref();
|
||||||
// }
|
}
|
||||||
// MCAPI reference operator*() const;
|
MCAPI reference operator*() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Features {
|
class Features {
|
||||||
@ -363,14 +363,14 @@ public:
|
|||||||
ptrdiff_t offset_limit;
|
ptrdiff_t offset_limit;
|
||||||
std::string message;
|
std::string message;
|
||||||
};
|
};
|
||||||
//MCAPI Reader();
|
MCAPI Reader();
|
||||||
|
|
||||||
//MCAPI bool parse(const std::string& document, Value& root, bool collectComments = true);
|
MCAPI bool parse(const std::string& document, Value& root, bool collectComments = true);
|
||||||
//MCAPI bool parse(const char* beginDoc, const char* endDoc, Value& root, bool collectComments = true);
|
MCAPI bool parse(const char* beginDoc, const char* endDoc, Value& root, bool collectComments = true);
|
||||||
//MCAPI bool parse(const char* beginDoc, unsigned long long length, Value& root, bool collectComments = true);
|
MCAPI bool parse(const char* beginDoc, unsigned long long length, Value& root, bool collectComments = true);
|
||||||
//MCAPI bool parse(std::istream& is, Value& root, bool collectComments = true);
|
MCAPI bool parse(std::istream& is, Value& root, bool collectComments = true);
|
||||||
|
|
||||||
//MCAPI std::string getFormattedErrorMessages() const;
|
MCAPI std::string getFormattedErrorMessages() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum TokenType {
|
enum TokenType {
|
||||||
@ -434,7 +434,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//MCAPI std::string write(const Value& root) override;
|
MCAPI std::string write(const Value& root) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string document_;
|
std::string document_;
|
||||||
@ -451,7 +451,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//MCAPI std::string write(const Value& root) override;
|
MCAPI std::string write(const Value& root) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::vector<std::string> ChildValues;
|
typedef std::vector<std::string> ChildValues;
|
||||||
|
@ -28,8 +28,7 @@
|
|||||||
|
|
||||||
Actor* Level::getEntity(ActorUniqueID uniqueId) {
|
Actor* Level::getEntity(ActorUniqueID uniqueId) {
|
||||||
try {
|
try {
|
||||||
// 完蛋,没有这个符号
|
return SymCall("?fetchEntity@Level@@QEBAPEAVActor@@UActorUniqueID@@_N@Z", Actor*, Level*, ActorUniqueID)(Global<Level>, uniqueId);
|
||||||
return SymCall("?fetchEntity@Level@@UEBAPEAVActor@@UActorUniqueID@@_N@Z", Actor*, Level*, ActorUniqueID)(Global<Level>, uniqueId);
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -224,8 +223,7 @@ std::vector<Actor*> Level::getAllEntities(int dimId) {
|
|||||||
|
|
||||||
// Check Valid
|
// Check Valid
|
||||||
std::vector<Actor*> result;
|
std::vector<Actor*> result;
|
||||||
// 阿这,这个符号也没有
|
auto currTick = SymCall("?getCurrentTick@Level@@QEBAAEBUTick@@XZ", Tick*, Level*)(lv)->t;
|
||||||
auto currTick = SymCall("?getCurrentTick@Level@@UEBAAEBUTick@@XZ", Tick*, Level*)(lv)->t;
|
|
||||||
for (auto& i : list) {
|
for (auto& i : list) {
|
||||||
// auto entity = SymCall("??$tryUnwrap@VActor@@$$V@WeakEntityRef@@QEBAPEAVActor@@XZ",
|
// auto entity = SymCall("??$tryUnwrap@VActor@@$$V@WeakEntityRef@@QEBAPEAVActor@@XZ",
|
||||||
// Actor*, void*)(&i.second);
|
// Actor*, void*)(&i.second);
|
||||||
@ -292,7 +290,12 @@ Player* Level::getPlayer(const string& info) {
|
|||||||
|
|
||||||
Player* Level::getPlayer(ActorUniqueID id) {
|
Player* Level::getPlayer(ActorUniqueID id) {
|
||||||
// 裂开,这个符号也没有
|
// 裂开,这个符号也没有
|
||||||
return SymCall("?getPlayer@Level@@UEBAPEAVPlayer@@UActorUniqueID@@@Z", Player*, Level*, ActorUniqueID)(Global<Level>, id);
|
Actor* actor = Level::fetchEntity(id,0);
|
||||||
|
if(actor && actor->hasCategory((ActorCategory)1))
|
||||||
|
return (Player*)actor;
|
||||||
|
else
|
||||||
|
return nullptr;
|
||||||
|
//return SymCall("?getPlayer@Level@@UEBAPEAVPlayer@@UActorUniqueID@@@Z", Player*, Level*, ActorUniqueID)(Global<Level>, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actor* Level::spawnMob(Vec3 pos, int dimId, std::string name) {
|
// Actor* Level::spawnMob(Vec3 pos, int dimId, std::string name) {
|
||||||
|
@ -42,20 +42,18 @@ TInstanceHook(void, "?allowIncomingConnections@ServerNetworkHandler@@QEAAXAEBV?$
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// MinecraftCommands
|
// MinecraftCommands
|
||||||
// 没有这个符号
|
// 符号参数与1.19的不同,1.16是三个,1.19是五个
|
||||||
// TInstanceHook(void,
|
TInstanceHook(void,
|
||||||
// "?initCoreEnums@MinecraftCommands@@QEAAXVItemRegistryRef@@AEBVIWorldRegistriesProvider@@AEBVActorFactory@"
|
"?initCoreEnums@MinecraftCommands@@QEAAXAEBVIWorldRegistriesProvider@@_NAEBVBaseGameVersion@@@Z",
|
||||||
// "@AEBVExperiments@@AEBVBaseGameVersion@@@Z",
|
MinecraftCommands, void* a2, __int8 a3,void* a4) {
|
||||||
// MinecraftCommands, void* a2, __int64 a3, __int64 a4, void* a5, void* a6) {
|
original(this, a2, a3, a4);
|
||||||
// original(this, a2, a3, a4, a5, a6);
|
Global<MinecraftCommands> = this;
|
||||||
// Global<MinecraftCommands> = this;
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
// LevelStorage & DBStorage
|
// LevelStorage & DBStorage
|
||||||
// 没有这个符号,去掉应该会狗带吧?
|
TInstanceHook(DBStorage*, "??0DBStorage@@QEAA@UDBStorageConfig@@@Z",
|
||||||
TInstanceHook(DBStorage*, "??0DBStorage@@QEAA@UDBStorageConfig@@V?$not_null@V?$NonOwnerPointer@VLevelDbEnv@@@Bedrock@@@gsl@@@Z",
|
DBStorage, struct DBStorageConfig* config) {
|
||||||
DBStorage, struct DBStorageConfig* config, void* a3) {
|
auto ret = original(this, config);
|
||||||
auto ret = original(this, config, a3);
|
|
||||||
Global<LevelStorage> = (LevelStorage*)this;
|
Global<LevelStorage> = (LevelStorage*)this;
|
||||||
Global<DBStorage> = this;
|
Global<DBStorage> = this;
|
||||||
return ret;
|
return ret;
|
||||||
@ -72,8 +70,7 @@ THook(void*, "??0ChunkSource@@QEAA@V?$unique_ptr@VChunkSource@@U?$default_delete
|
|||||||
|
|
||||||
// RakNetServerLocator
|
// RakNetServerLocator
|
||||||
// ?activate@RakNetServerLocator@@AEAAXXZ
|
// ?activate@RakNetServerLocator@@AEAAXXZ
|
||||||
// 没有这个符号,两个都是一样的
|
TInstanceHook(void*, "?activate@RakNetServerLocator@@AEAAXXZ", RakNetServerLocator) {
|
||||||
TInstanceHook(void*, "?_activate@RakNetServerLocator@@AEAAXXZ", RakNetServerLocator) {
|
|
||||||
//constexpr auto h = do_hash("?_activate@RakNetServerLocator@@AEAAXXZ");
|
//constexpr auto h = do_hash("?_activate@RakNetServerLocator@@AEAAXXZ");
|
||||||
static bool set = false;
|
static bool set = false;
|
||||||
if (!set) {
|
if (!set) {
|
||||||
|
@ -49,9 +49,9 @@ THook(void, "?PlatformBedrockLogOut@@YAXIPEBD@Z", int a1, const char* ts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Block BDS from adding LOG metadata
|
// Block BDS from adding LOG metadata
|
||||||
// 没有这个符号,去掉这个应该也没有影响
|
// 虽然这个是可用的,但开了以后BDS自身的后台记录没有了时间
|
||||||
// THook(void, "?_appendLogEntryMetadata@LogDetails@BedrockLog@@AEAAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V34@W4LogAreaID@@I1HH@Z",
|
// THook(void, "?_appendLogEntryMetadata@LogDetails@BedrockLog@@AEAAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4LogAreaID@@IV34@HH@Z",
|
||||||
// void* a1, void* a2, void** a3, int a4, unsigned int a5, __int64 a6, unsigned int a7, unsigned int a8) {
|
// void* a1, void* a2, int a3, unsigned int a4, size_t *a5, __int64 a6, int a7) {
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -25,20 +25,20 @@ void RegisterSimpleServerLogger() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#include <MC/Command.hpp>
|
#include <MC/Command.hpp>
|
||||||
TInstanceHook(void, "?setPermissions@Player@@QEAAXW4CommandPermissionLevel@@@Z",
|
//TInstanceHook(void, "?setPermissions@Player@@QEAAXW4CommandPermissionLevel@@@Z",
|
||||||
Player, CommandPermissionLevel perm) {
|
// Player, CommandPermissionLevel perm) {
|
||||||
if (LL::globalConfig.enableSimpleServerLogger) {
|
// if (LL::globalConfig.enableSimpleServerLogger) {
|
||||||
static Logger logger("Permissions");
|
// static Logger logger("Permissions");
|
||||||
logger.info("<{}> {}({}) -> {}({})",
|
// logger.info("<{}> {}({}) -> {}({})",
|
||||||
getRealName(), magic_enum::enum_name(getCommandPermissionLevel()), (int)getCommandPermissionLevel(), magic_enum::enum_name(perm), (int)perm);
|
// getRealName(), magic_enum::enum_name(getCommandPermissionLevel()), (int)getCommandPermissionLevel(), magic_enum::enum_name(perm), (int)perm);
|
||||||
}
|
// }
|
||||||
return original(this, perm);
|
// return original(this, perm);
|
||||||
}
|
//}
|
||||||
|
|
||||||
// ==> LiteLoader/Main/BuiltinUnlockCmd.cpp
|
// ==> LiteLoader/Main/BuiltinUnlockCmd.cpp
|
||||||
#include <MC/I18n.hpp>
|
#include <MC/I18n.hpp>
|
||||||
void LogCommandRegistration(std::string const& name, char const* description, enum CommandPermissionLevel perm, short flag1, short flag2) {
|
//void LogCommandRegistration(std::string const& name, char const* description, enum CommandPermissionLevel perm, short flag1, short flag2) {
|
||||||
static Logger logger("RegsterCommand");
|
// static Logger logger("RegsterCommand");
|
||||||
logger.consoleLevel = logger.debug.level;
|
// logger.consoleLevel = logger.debug.level;
|
||||||
logger.debug("{:<18} - {:<12} - {}", name, magic_enum::enum_name(perm), I18n::get(description));
|
// logger.debug("{:<18} - {:<12} - {}", name, magic_enum::enum_name(perm), I18n::get(description));
|
||||||
}
|
//}
|
||||||
|
Loading…
Reference in New Issue
Block a user