NOISSUE Fix --world argument when launcher already running

This commit is contained in:
arthomnix
2023-04-10 21:14:12 +01:00
parent 5ff03584a5
commit 89ac58256c

View File

@@ -1197,6 +1197,7 @@ void Application::messageReceived(const QByteArray& message)
{ {
QString id = received.args["id"]; QString id = received.args["id"];
QString server = received.args["server"]; QString server = received.args["server"];
QString world = received.args["world"];
QString profile = received.args["profile"]; QString profile = received.args["profile"];
bool offline = received.args["offline_enabled"] == "true"; bool offline = received.args["offline_enabled"] == "true";
QString offlineName = received.args["offline_name"]; QString offlineName = received.args["offline_name"];
@@ -1214,9 +1215,11 @@ void Application::messageReceived(const QByteArray& message)
return; return;
} }
QuickPlayTargetPtr serverObject = nullptr; QuickPlayTargetPtr quickPlayTarget = nullptr;
if(!server.isEmpty()) { if(!server.isEmpty()) {
serverObject = std::make_shared<QuickPlayTarget>(QuickPlayTarget::parseMultiplayer(server)); quickPlayTarget = std::make_shared<QuickPlayTarget>(QuickPlayTarget::parseMultiplayer(server));
} else if(!world.isEmpty()) {
quickPlayTarget = std::make_shared<QuickPlayTarget>(QuickPlayTarget::parseSingleplayer(world));
} }
MinecraftAccountPtr accountObject; MinecraftAccountPtr accountObject;
@@ -1232,7 +1235,7 @@ void Application::messageReceived(const QByteArray& message)
instance, instance,
!offline, !offline,
nullptr, nullptr,
serverObject, quickPlayTarget,
accountObject, accountObject,
offlineName offlineName
); );