Skip to content

Commit 86c2e2d

Browse files
committed
fix: fix compilation
1 parent 54461e2 commit 86c2e2d

2 files changed

Lines changed: 24 additions & 12 deletions

File tree

src/legacy/api/CommandAPI.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "mc/server/commands/CommandContext.h"
3232
#include "mc/server/commands/CommandOutputType.h"
3333
#include "mc/server/commands/CommandPermissionLevel.h"
34-
#include "mc/server/commands/CommandVersion.h"
3534
#include "mc/server/commands/CurrentCmdVersion.h"
3635
#include "mc/server/commands/GenerateMessageResult.h"
3736
#include "mc/server/commands/MinecraftCommands.h"
@@ -423,9 +422,9 @@ Local<Value> CommandClass::newParameter(Arguments const& args) const {
423422
try {
424423
auto name = args[0].asString().toString();
425424
ParamKind::Kind type = static_cast<ParamKind::Kind>(parseEnum<OldParameterType>(args[1]));
426-
std::string enumName = "";
425+
std::string enumName;
427426
bool optional = false;
428-
std::string identifier = "";
427+
std::string identifier;
429428
size_t index = 2;
430429
CommandParameterOption option = CommandParameterOption::None;
431430
if (args.size() > index && args[index].isBoolean()) optional = args[index++].asBoolean().value();
@@ -452,8 +451,8 @@ Local<Value> CommandClass::mandatory(Arguments const& args) const {
452451
try {
453452
auto name = args[0].asString().toString();
454453
ParamKind::Kind type = static_cast<ParamKind::Kind>(parseEnum<OldParameterType>(args[1]));
455-
std::string enumName = "";
456-
std::string identifier = "";
454+
std::string enumName;
455+
std::string identifier;
457456
size_t index = 2;
458457
CommandParameterOption option = CommandParameterOption::None;
459458
if (args.size() > index && args[index].isString()) enumName = args[index++].asString().toString();
@@ -479,8 +478,8 @@ auto CommandClass::optional(Arguments const& args) const -> Local<Value> {
479478
try {
480479
auto name = args[0].asString().toString();
481480
ParamKind::Kind type = static_cast<ParamKind::Kind>(parseEnum<OldParameterType>(args[1]));
482-
std::string enumName = "";
483-
std::string identifier = "";
481+
std::string enumName;
482+
std::string identifier;
484483
size_t index = 2;
485484
CommandParameterOption option = CommandParameterOption::None;
486485
if (args.size() > index && args[index].isString()) enumName = args[index++].asString().toString();
@@ -751,7 +750,7 @@ Local<Value> CommandClass::removeSoftEnumValues(Arguments const& args) {
751750
auto enums = parseStringList(args[1].asArray());
752751
if (ll::getGamingStatus() == ll::GamingStatus::Starting) {
753752
ll::coro::keepThis([name, enums]() -> ll::coro::CoroTask<> {
754-
CommandRegistrar::getInstance(false).removeSoftEnumValues(name, std::move(enums));
753+
CommandRegistrar::getInstance(false).removeSoftEnumValues(name, enums);
755754
co_return;
756755
}).launch(ll::thread::ServerThreadExecutor::getDefault());
757756
} else {

xmake.lua

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ add_rules("mode.debug", "mode.release")
33
add_repositories("levimc-repo " .. (get_config("levimc_repo") or "https://github.com/LiteLDev/xmake-repo.git"))
44

55
if is_config("target_type", "server") then
6-
add_requires("levilamina dab5005c569ae9984ed62f20d209e02f77da9f89", {configs = {target_type = "server"}})
6+
add_requires("levilamina 4adae278d458461eb3a16035194cde1f8b4effef", {configs = {target_type = "server"}})
77
else
8-
add_requires("levilamina dab5005c569ae9984ed62f20d209e02f77da9f89", {configs = {target_type = "client"}})
8+
add_requires("levilamina 4adae278d458461eb3a16035194cde1f8b4effef", {configs = {target_type = "client"}})
99
end
1010

1111
set_toolchains("clang-cl")
1212

1313
add_requires("levibuildscript")
1414

15-
add_requires("legacyremotecall 0c9d2595276013ba36a3ef721bd97c3810c6be1c", {configs = {target_type = get_config(target_type)}})
16-
add_requires("legacymoney e677306c00fcf81e62ea52095d1a97e171220fb6", {configs = {target_type = get_config(target_type)}})
15+
add_requires("legacyremotecall e172e7f9bb96bea39100fd8e8b21b3b5957a5eba", {configs = {target_type = get_config(target_type)}})
16+
add_requires("legacymoney c177566e0d7be49091911aaed66ffa31503e7988", {configs = {target_type = get_config(target_type)}})
1717

1818
add_requires(
1919
"lightwebsocketclient 1.0.1",
@@ -86,6 +86,19 @@ target("LegacyScriptEngine")
8686
"/wd4100",
8787
{force = true}
8888
)
89+
add_cxflags(
90+
"/EHs",
91+
"-Wno-microsoft-cast",
92+
"-Wno-invalid-offsetof",
93+
"-Wno-c++2b-extensions",
94+
"-Wno-microsoft-include",
95+
"-Wno-overloaded-virtual",
96+
"-Wno-ignored-qualifiers",
97+
"-Wno-missing-field-initializers",
98+
"-Wno-potentially-evaluated-expression",
99+
"-Wno-pragma-system-header-outside-header",
100+
{tools = {"clang_cl"}}
101+
)
89102
add_defines(
90103
"NOMINMAX",
91104
"UNICODE",

0 commit comments

Comments
 (0)