From 5b865543a89303b475b20faa7580a520f393f8a7 Mon Sep 17 00:00:00 2001 From: Qiuzhizhe <42761326+quizhizhe@users.noreply.github.com> Date: Thu, 28 Jan 2021 17:25:33 +0800 Subject: [PATCH 1/5] Update cmake-build.yml --- .github/workflows/cmake-build.yml | 62 +++++++++++++++---------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 4e5d17b..308ef08 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -3,7 +3,7 @@ name: CMake on: push: branches: - - 1.16.4-main + - 1.16.201 env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -26,25 +26,25 @@ jobs: working-directory: ${{github.workspace}} run: ls -# - name: Create Build Environment -# # 主目录下面建立一个build目录(trapdoor/trapdoor/build) -# run: cmake -E make_directory ${{github.workspace}}/build -# -# - name: Configure CMake -# shell: powershell -# working-directory: ${{github.workspace}}/build -# # Note the current convention is to use the -S and -B options here to specify source -# # and build directories, but this is only available with CMake 3.13 and higher. -# # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 -# #在这个目录下执行cmake构建vs工程 -# run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release -# -# - name: Build -# working-directory: ${{github.workspace}}/build -# shell: powershell -# # Execute the build. You can specify a specific target with "--target " -# run: cmake --build . --config Release -# + - name: Create Build Environment + # 主目录下面建立一个build目录(trapdoor/trapdoor/build) + run: cmake -E make_directory ${{github.workspace}}/build + + - name: Configure CMake + shell: powershell + working-directory: ${{github.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + #在这个目录下执行cmake构建vs工程 + run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release + + - name: Build + working-directory: ${{github.workspace}}/build + shell: powershell + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config Release + # - name: Create Release # id: create_release # uses: actions/create-release@v1 @@ -56,17 +56,17 @@ jobs: # draft: false # prerelease: false # -# - name: Upload Release Asset -# id: upload-release-asset -# uses: actions/upload-release-asset@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# upload_url: ${{ steps.create_release.outputs.upload_url }} -# asset_path: ${{github.workspace}}/build/Release/trapdoor-mod.dll -# asset_name: trapdoor-mod.dll -# asset_content_type: application/dll -# + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: https://github.com/quizhizhe/TrapDoor/releases/tag/1.16.4 + asset_path: ${{github.workspace}}/build/Release/trapdoor-mod.dll + asset_name: trapdoor-v0.9.20-1.16.201.dll + asset_content_type: application/dll + ## - name: Test ## working-directory: ${{github.workspace}}/build ## shell: powershell From 0495949acb6e431c04a9cd883eca919f9accce8d Mon Sep 17 00:00:00 2001 From: quizhizhe <2660974080@qq.com> Date: Tue, 16 Feb 2021 23:07:24 +0800 Subject: [PATCH 2/5] remove player destroy record --- .github/workflows/cmake-build.yml | 60 ++++++++-------- .idea/modules.xml | 8 --- .idea/workspace.xml | 45 ++++++++++-- CMakeLists.txt | 1 - mod/TrapdoorMod.cpp | 6 +- mod/TrapdoorMod.h | 6 +- mod/player/Player.cpp | 74 ++++++++++---------- mod/player/PlayerStatisticManager.cpp | 98 +++++++++++++-------------- mod/player/PlayerStatisticManager.h | 50 +++++++------- 9 files changed, 186 insertions(+), 162 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 308ef08..06f119a 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -26,25 +26,25 @@ jobs: working-directory: ${{github.workspace}} run: ls - - name: Create Build Environment - # 主目录下面建立一个build目录(trapdoor/trapdoor/build) - run: cmake -E make_directory ${{github.workspace}}/build - - - name: Configure CMake - shell: powershell - working-directory: ${{github.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - #在这个目录下执行cmake构建vs工程 - run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release - - - name: Build - working-directory: ${{github.workspace}}/build - shell: powershell - # Execute the build. You can specify a specific target with "--target " - run: cmake --build . --config Release - +# - name: Create Build Environment +# # 主目录下面建立一个build目录(trapdoor/trapdoor/build) +# run: cmake -E make_directory ${{github.workspace}}/build +# +# - name: Configure CMake +# shell: powershell +# working-directory: ${{github.workspace}}/build +# # Note the current convention is to use the -S and -B options here to specify source +# # and build directories, but this is only available with CMake 3.13 and higher. +# # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 +# #在这个目录下执行cmake构建vs工程 +# run: cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release +# +# - name: Build +# working-directory: ${{github.workspace}}/build +# shell: powershell +# # Execute the build. You can specify a specific target with "--target " +# run: cmake --build . --config Release +# # - name: Create Release # id: create_release # uses: actions/create-release@v1 @@ -56,17 +56,17 @@ jobs: # draft: false # prerelease: false # - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: https://github.com/quizhizhe/TrapDoor/releases/tag/1.16.4 - asset_path: ${{github.workspace}}/build/Release/trapdoor-mod.dll - asset_name: trapdoor-v0.9.20-1.16.201.dll - asset_content_type: application/dll - +# - name: Upload Release Asset +# id: upload-release-asset +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: https://github.com/quizhizhe/TrapDoor/releases/tag/1.16.4 +# asset_path: ${{github.workspace}}/build/Release/trapdoor-mod.dll +# asset_name: trapdoor-v0.9.20-1.16.201.dll +# asset_content_type: application/dll +# ## - name: Test ## working-directory: ${{github.workspace}}/build ## shell: powershell diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 288a846..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9393011..88fd42c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -13,7 +13,18 @@ - + + + + + + + + + + + + @@ -52,10 +64,10 @@ - - + + - @@ -68,15 +80,21 @@ + + + + - - + + + 1610412403756 + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c93b0e..20bfbb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,6 @@ target_include_directories(${MOD_API_NAME} ) target_link_libraries(${MOD_API_NAME} ${PROJECT_SOURCE_DIR}/api/lib/detours.lib) -target_link_libraries(${MOD_API_NAME} ${PROJECT_SOURCE_DIR}/api/lib/sqlite3.lib) diff --git a/mod/TrapdoorMod.cpp b/mod/TrapdoorMod.cpp index 5b5c27d..ea10566 100644 --- a/mod/TrapdoorMod.cpp +++ b/mod/TrapdoorMod.cpp @@ -36,7 +36,7 @@ namespace mod { void TrapdoorMod::initialize() { BDSMod::initialize(); this->commandManager.setCommandConfig(this->configManager.getCommandsConfig()); - this->playerStatisticManager.init("trapdoor.db"); +// this->playerStatisticManager.init("trapdoor.db"); mod::initBackup(); this->initFunctionEnable(); this->villageHelper.setConfig(this->configManager.getVillageConfig()); @@ -80,7 +80,7 @@ namespace mod { error(player, "该功能已被关闭,请联系服主"); return; } - this->playerStatisticManager.setAble(holder->getBool()); +// this->playerStatisticManager.setAble(holder->getBool()); info(player, "设置玩家行为统计为 %d", holder->getBool()); })); @@ -386,7 +386,7 @@ namespace mod { auto functionCfg = this->configManager.getFunctionConfig(); this->spawnHelper.setAble(functionCfg.spawnHelper); this->rotationHelper.setAble(functionCfg.cactusRotation); - this->playerStatisticManager.setAble(functionCfg.playerStat); +// this->playerStatisticManager.setAble(functionCfg.playerStat); this->simpleBuilder.setAble(functionCfg.simpleDraw); this->hopperChannelManager.setAble(functionCfg.hopperCounter); } diff --git a/mod/TrapdoorMod.h b/mod/TrapdoorMod.h index 2eeaf18..ab75830 100644 --- a/mod/TrapdoorMod.h +++ b/mod/TrapdoorMod.h @@ -16,7 +16,7 @@ #include "player/PlayerFunction.h" #include "player/SimpleBuilder.h" #include "SlimeChunkHelper.h" -#include "player/PlayerStatisticManager.h" +//#include "player/PlayerStatisticManager.h" namespace mod { @@ -37,7 +37,7 @@ namespace mod { PlayerFunction playerFunctions; SimpleBuilder simpleBuilder; SlimeChunkHelper slimeChunkHelper; - PlayerStatisticManager playerStatisticManager; +// PlayerStatisticManager playerStatisticManager; void registerTickCommand(); @@ -81,7 +81,7 @@ namespace mod { inline SpawnAnalyzer &getSpawnAnalyzer() { return this->spawnAnalyzer; } - inline PlayerStatisticManager &getPlayerStatisticManager() { return this->playerStatisticManager; } +// inline PlayerStatisticManager &getPlayerStatisticManager() { return this->playerStatisticManager; } inline std::string getLevelName() { return this->configManager.getServerConfig().levelName; } diff --git a/mod/player/Player.cpp b/mod/player/Player.cpp index e15c177..9fb5221 100644 --- a/mod/player/Player.cpp +++ b/mod/player/Player.cpp @@ -17,43 +17,43 @@ //player place block using namespace SymHook; - -THook( - int64_t, - MSSYM_B1QE21onBlockPlacedByPlayerB1AE34VanillaServerGameplayEventListenerB2AAA4UEAAB1QE14AW4EventResultB2AAE10AEAVPlayerB2AAA9AEBVBlockB2AAE12AEBVBlockPosB3AAUA1NB1AA1Z, - void *self, - trapdoor::Actor *player, - trapdoor::Block &block, - const trapdoor::BlockPos &pos, - bool flag -) { - auto modInstance = trapdoor::bdsMod->asInstance(); - modInstance->getPlayerStatisticManager().insetPlayerAction(player->getNameTag(), pos, - mod::PlayerStatisticManager::PLACE_BLOCK, - player->getDimensionID(), - block.getName()); - - return original(self, player, block, pos, flag); -} +// +//THook( +// int64_t, +// MSSYM_B1QE21onBlockPlacedByPlayerB1AE34VanillaServerGameplayEventListenerB2AAA4UEAAB1QE14AW4EventResultB2AAE10AEAVPlayerB2AAA9AEBVBlockB2AAE12AEBVBlockPosB3AAUA1NB1AA1Z, +// void *self, +// trapdoor::Actor *player, +// trapdoor::Block &block, +// const trapdoor::BlockPos &pos, +// bool flag +//) { +// auto modInstance = trapdoor::bdsMod->asInstance(); +// modInstance->getPlayerStatisticManager().insetPlayerAction(player->getNameTag(), pos, +// mod::PlayerStatisticManager::PLACE_BLOCK, +// player->getDimensionID(), +// block.getName()); +// +// return original(self, player, block, pos, flag); +//} //player destroy block - -THook( - void, - MSSYM_B2QUE20destroyBlockInternalB1AA8GameModeB2AAA4AEAAB1UE13NAEBVBlockPosB2AAA1EB1AA1Z, - uint64_t *self, - const trapdoor::BlockPos *pos, - int64_t a3, - int a4 -) { - uint64_t *ptr = self + 1; - auto player = reinterpret_cast(*ptr); - auto modInstance = trapdoor::bdsMod->asInstance(); - auto block = player->getBlockSource()->getBlock(pos->x, pos->y, pos->z); - modInstance->getPlayerStatisticManager().insetPlayerAction(player->getNameTag(), *pos, - mod::PlayerStatisticManager::DESTROY_BLOCK, - player->getDimensionID(), - block->getName()); - original(self, pos, a3, a4); -} +// +//THook( +// void, +// MSSYM_B2QUE20destroyBlockInternalB1AA8GameModeB2AAA4AEAAB1UE13NAEBVBlockPosB2AAA1EB1AA1Z, +// uint64_t *self, +// const trapdoor::BlockPos *pos, +// int64_t a3, +// int a4 +//) { +// uint64_t *ptr = self + 1; +// auto player = reinterpret_cast(*ptr); +// auto modInstance = trapdoor::bdsMod->asInstance(); +// auto block = player->getBlockSource()->getBlock(pos->x, pos->y, pos->z); +// modInstance->getPlayerStatisticManager().insetPlayerAction(player->getNameTag(), *pos, +// mod::PlayerStatisticManager::DESTROY_BLOCK, +// player->getDimensionID(), +// block->getName()); +// original(self, pos, a3, a4); +//} diff --git a/mod/player/PlayerStatisticManager.cpp b/mod/player/PlayerStatisticManager.cpp index 46a4f38..e71254b 100644 --- a/mod/player/PlayerStatisticManager.cpp +++ b/mod/player/PlayerStatisticManager.cpp @@ -8,53 +8,53 @@ #include "tools/MsgBuilder.h" namespace mod { - int mod::PlayerStatisticManager::createPlayerActionTable() { - const std::string playerActionTableSQL = - R"( - create table if not exists player_acton( - action_id integer primary key autoincrement, - player_id VARCHAR(128) not null, - action_time timestamp not null default (datetime('now','localtime')), - action_type int, - action_dim int, - action_p_x int, - action_p_y int, - action_p_z int, - action_string VARCHAR(512) - ) - )"; - return this->executeSQL(playerActionTableSQL); - } - - int PlayerStatisticManager::executeSQL(const std::string &sql) { - char *errorMsg; - auto rc = sqlite3_exec(db, sql.c_str(), nullptr, nullptr, &errorMsg); - if (rc != SQLITE_OK) { - L_DEBUG("SQL error: %s\n", errorMsg); - sqlite3_free(errorMsg); - } - return rc; - } - - void PlayerStatisticManager::insetPlayerAction(const std::string &playerName, const trapdoor::BlockPos &pos, - PlayerStatisticManager::PLAYER_ACTION playerAction, int dim, - const std::string &msg) { - - auto sql = trapdoor::format( - "insert into player_acton(player_id,action_type,action_dim,action_p_x,action_p_y,action_p_z,action_string)\n" - " VALUES ('%s', %d,%d,%d,%d,%d, '%s')", - playerName.c_str(), playerAction, dim, pos.x, pos.y, pos.z, msg.c_str() - ); - this->executeSQL(sql); - } - - void PlayerStatisticManager::init(const std::string &dbName) { - L_INFO("begin init player statistic database"); - sqlite3_open(dbName.c_str(), &this->db); - if (this->createPlayerActionTable() != 0) { - L_ERROR("create table failure"); - } else { - L_INFO("success create table"); - } - } +// int mod::PlayerStatisticManager::createPlayerActionTable() { +// const std::string playerActionTableSQL = +// R"( +// create table if not exists player_acton( +// action_id integer primary key autoincrement, +// player_id VARCHAR(128) not null, +// action_time timestamp not null default (datetime('now','localtime')), +// action_type int, +// action_dim int, +// action_p_x int, +// action_p_y int, +// action_p_z int, +// action_string VARCHAR(512) +// ) +// )"; +// return this->executeSQL(playerActionTableSQL); +// } +// +// int PlayerStatisticManager::executeSQL(const std::string &sql) { +// char *errorMsg; +// auto rc = sqlite3_exec(db, sql.c_str(), nullptr, nullptr, &errorMsg); +// if (rc != SQLITE_OK) { +// L_DEBUG("SQL error: %s\n", errorMsg); +// sqlite3_free(errorMsg); +// } +// return rc; +// } +// +// void PlayerStatisticManager::insetPlayerAction(const std::string &playerName, const trapdoor::BlockPos &pos, +// PlayerStatisticManager::PLAYER_ACTION playerAction, int dim, +// const std::string &msg) { +// +// auto sql = trapdoor::format( +// "insert into player_acton(player_id,action_type,action_dim,action_p_x,action_p_y,action_p_z,action_string)\n" +// " VALUES ('%s', %d,%d,%d,%d,%d, '%s')", +// playerName.c_str(), playerAction, dim, pos.x, pos.y, pos.z, msg.c_str() +// ); +// this->executeSQL(sql); +// } +// +// void PlayerStatisticManager::init(const std::string &dbName) { +// L_INFO("begin init player statistic database"); +// sqlite3_open(dbName.c_str(), &this->db); +// if (this->createPlayerActionTable() != 0) { +// L_ERROR("create table failure"); +// } else { +// L_INFO("success create table"); +// } +// } } diff --git a/mod/player/PlayerStatisticManager.h b/mod/player/PlayerStatisticManager.h index 3653762..34479f4 100644 --- a/mod/player/PlayerStatisticManager.h +++ b/mod/player/PlayerStatisticManager.h @@ -11,31 +11,31 @@ #include "tools/noncopyable .h" namespace mod { - - class PlayerStatisticManager : noncopyable { - sqlite3 *db = nullptr; - bool enable = false; - - int executeSQL(const std::string &sql); - - int createPlayerActionTable(); - - public: - enum PLAYER_ACTION { - DESTROY_BLOCK, - PLACE_BLOCK - }; - - inline void setAble(bool able) { this->enable = able; } - - inline bool isEnable() const { return this->enable; } - - void init(const std::string &dbName); - - void insetPlayerAction(const std::string &playerName, const trapdoor::BlockPos &pos, - PLAYER_ACTION playerAction, int dim, const std::string &msg - ); - }; +// +// class PlayerStatisticManager : noncopyable { +// sqlite3 *db = nullptr; +// bool enable = false; +// +// int executeSQL(const std::string &sql); +// +// int createPlayerActionTable(); +// +// public: +// enum PLAYER_ACTION { +// DESTROY_BLOCK, +// PLACE_BLOCK +// }; +// +// inline void setAble(bool able) { this->enable = able; } +// +// inline bool isEnable() const { return this->enable; } +// +// void init(const std::string &dbName); +// +// void insetPlayerAction(const std::string &playerName, const trapdoor::BlockPos &pos, +// PLAYER_ACTION playerAction, int dim, const std::string &msg +// ); +// }; } From 1faa3554827dc349fdea9d431bb6c3b4587a2bff Mon Sep 17 00:00:00 2001 From: 0x506978656c <66031115+0x506978656c@users.noreply.github.com> Date: Fri, 19 Feb 2021 09:21:56 +0200 Subject: [PATCH 3/5] Updated HsaManager Added the corrections to the algorithm --- mod/spawn/HsaManager.cpp | 43 ++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/mod/spawn/HsaManager.cpp b/mod/spawn/HsaManager.cpp index b59aee7..502450b 100644 --- a/mod/spawn/HsaManager.cpp +++ b/mod/spawn/HsaManager.cpp @@ -2,6 +2,7 @@ // Created by xhy on 2020/12/27. // + #include "HsaManager.h" #include #include "BDSMod.h" @@ -31,27 +32,37 @@ namespace mod { hsaBoundingBox.minPos = firsthsa.boundingBox.minPos; hsaBoundingBox.maxPos = firsthsa.boundingBox.maxPos; for (const auto &hsa : this->hsaList) { - hsaBoundingBox.minPos.x = min(hsaBoundingBox.minPos.x, hsa.boundingBox.minPos.x); - hsaBoundingBox.minPos.y = min(hsaBoundingBox.minPos.y, hsa.boundingBox.minPos.y); - hsaBoundingBox.minPos.z = min(hsaBoundingBox.minPos.z, hsa.boundingBox.minPos.z); - hsaBoundingBox.maxPos.x = max(hsaBoundingBox.maxPos.x, hsa.boundingBox.maxPos.x); - hsaBoundingBox.maxPos.y = max(hsaBoundingBox.maxPos.y, hsa.boundingBox.maxPos.y); - hsaBoundingBox.maxPos.z = max(hsaBoundingBox.maxPos.z, hsa.boundingBox.maxPos.z); + hsaBoundingBox.minPos.x = + min(hsaBoundingBox.minPos.x, hsa.boundingBox.minPos.x); + hsaBoundingBox.minPos.y = + min(hsaBoundingBox.minPos.y, hsa.boundingBox.minPos.y); + hsaBoundingBox.minPos.z = + min(hsaBoundingBox.minPos.z, hsa.boundingBox.minPos.z); + hsaBoundingBox.maxPos.x = + max(hsaBoundingBox.maxPos.x, hsa.boundingBox.maxPos.x); + hsaBoundingBox.maxPos.y = + max(hsaBoundingBox.maxPos.y, hsa.boundingBox.maxPos.y); + hsaBoundingBox.maxPos.z = + max(hsaBoundingBox.maxPos.z, hsa.boundingBox.maxPos.z); } info(player, "%s %s", hsaBoundingBox.minPos.toString().c_str(), hsaBoundingBox.maxPos.toString().c_str()); info(player, "%d", firsthsa.dimensionID); int points = 0, maxPoints = 0; trapdoor::BlockPos pos; - for (int x = hsaBoundingBox.minPos.x - 44; x <= hsaBoundingBox.maxPos.x + 44; x++) + for (int x = hsaBoundingBox.minPos.x - 44; + x <= hsaBoundingBox.maxPos.x + 44; x++) for (int y = max(hsaBoundingBox.minPos.y - 44, 0); - y <= min(hsaBoundingBox.maxPos.y + 44, 127 + firsthsa.dimensionID == 1 ? 0 : 128); + y <= min(hsaBoundingBox.maxPos.y + 44, + 127 + firsthsa.dimensionID == 1 ? 0 : 128); y++) - for (int z = hsaBoundingBox.minPos.z - 44; z <= hsaBoundingBox.maxPos.z + 44; z++) { + for (int z = hsaBoundingBox.minPos.z - 44; + z <= hsaBoundingBox.maxPos.z + 44; z++) { points = 0; for (const auto &hsa : this->hsaList) { - float dis = hsa.boundingBox.getCenter().distanceTo( - trapdoor::BlockPos(x, y, z)); + float dis = hsa.boundingBox.getSpawnArea() + .getCenter() + .distanceTo({x, y, z}); if (dis >= 24.0 && dis <= 44.0) { points += 1; } @@ -70,7 +81,8 @@ namespace mod { auto block = player->getBlockSource()->getBlock(standPos.x, standPos.y, standPos.z); for (const auto &hsa : this->hsaList) { - trapdoor::BlockPos pos = hsa.boundingBox.getCenter(); + trapdoor::BlockPos pos = + hsa.boundingBox.getSpawnArea().getCenter().toBlockPos(); player->getBlockSource()->setBlock(&pos, block); } } @@ -111,13 +123,14 @@ namespace mod { void HsaManager::list(Actor *player) { // todo - info(player, "developing"); + info(player, "Developing..."); } + } // namespace mod using namespace SymHook; -//HSA collector +// HSA collector THook( void, MSSYM_B2QUE17spawnStructureMobB1AA7SpawnerB2AAE20AEAAXAEAVBlockSourceB2AAE12AEBVBlockPosB2AAE25AEBUHardcodedSpawningAreaB1AE10LevelChunkB2AAE19AEBVSpawnConditionsB3AAAA1Z, @@ -153,4 +166,4 @@ THook( blockSource->getBiome(blockPos); modInstance->getHsaManager().insert(info); -} \ No newline at end of file +} From 5ab6b0d959a921d0c8d84a6ffd08b433800148fd Mon Sep 17 00:00:00 2001 From: 0x506978656c <66031115+0x506978656c@users.noreply.github.com> Date: Fri, 19 Feb 2021 09:26:39 +0200 Subject: [PATCH 4/5] Updated ModInfo Changed version to latest version --- mod/TrapdoorMod.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/TrapdoorMod.h b/mod/TrapdoorMod.h index ab75830..ea2a4e9 100644 --- a/mod/TrapdoorMod.h +++ b/mod/TrapdoorMod.h @@ -21,8 +21,8 @@ namespace mod { struct ModInfo { - const std::string minecraftVersion = "1.16.4.02"; - const std::string modVersion = "trapdoor-0.9.20"; + const std::string minecraftVersion = "1.16.201"; + const std::string modVersion = "trapdoor-0.9.21"; }; class TrapdoorMod : public trapdoor::BDSMod { @@ -89,4 +89,4 @@ namespace mod { }; } -#endif //MOD_TRAPDOORMOD_H \ No newline at end of file +#endif //MOD_TRAPDOORMOD_H From b5953920436d3950c05fbe35257de61cf9c34594 Mon Sep 17 00:00:00 2001 From: 0x506978656c <66031115+0x506978656c@users.noreply.github.com> Date: Fri, 19 Feb 2021 09:31:41 +0200 Subject: [PATCH 5/5] Cleaned up the extra player stats code Commented out fully player statistics manager --- mod/TrapdoorMod.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod/TrapdoorMod.cpp b/mod/TrapdoorMod.cpp index ea10566..95796d7 100644 --- a/mod/TrapdoorMod.cpp +++ b/mod/TrapdoorMod.cpp @@ -74,15 +74,18 @@ namespace mod { ->then(ARG("draw", "开启/关闭区块draw命令", BOOL, { this->simpleBuilder.setAble(holder->getBool()); info(player, "设置简单建造为 %d", holder->getBool()); - })) + })); +/* + //commented out fully player statistics manager ->then(ARG("stat", "开启/关闭玩家行为统计", BOOL, { if (!configManager.getFunctionConfig().playerStat) { error(player, "该功能已被关闭,请联系服主"); return; } -// this->playerStatisticManager.setAble(holder->getBool()); + this->playerStatisticManager.setAble(holder->getBool()); info(player, "设置玩家行为统计为 %d", holder->getBool()); })); +*/ //史莱姆显示 commandManager.registerCmd("slime", "史莱姆区块相关")