aboutsummaryrefslogtreecommitdiff
path: root/libraries/LocalPeer/src/LocalPeer.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2021-10-31 21:42:06 +0100
committerPetr Mrázek <peterix@gmail.com>2021-10-31 21:43:33 +0100
commit27f276ef13f49b4d21b6c17db5d4cd5e404ea259 (patch)
treeec4f42a099b6f3df467536b0c9a9ac9e0677ab53 /libraries/LocalPeer/src/LocalPeer.cpp
parent393d17b8d383d7514b45ba980cc0246859bad085 (diff)
downloadPrismLauncher-27f276ef13f49b4d21b6c17db5d4cd5e404ea259.tar.gz
PrismLauncher-27f276ef13f49b4d21b6c17db5d4cd5e404ea259.tar.bz2
PrismLauncher-27f276ef13f49b4d21b6c17db5d4cd5e404ea259.zip
GH-1795 add terminal launch option to use a specific Minecraft profile
Used like this: ``` ./MultiMC --launch 1.17.1 --profile MultiMCTest --server mc.hypixel.net ```
Diffstat (limited to 'libraries/LocalPeer/src/LocalPeer.cpp')
-rw-r--r--libraries/LocalPeer/src/LocalPeer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libraries/LocalPeer/src/LocalPeer.cpp b/libraries/LocalPeer/src/LocalPeer.cpp
index 129f3abc..cb218466 100644
--- a/libraries/LocalPeer/src/LocalPeer.cpp
+++ b/libraries/LocalPeer/src/LocalPeer.cpp
@@ -155,7 +155,7 @@ bool LocalPeer::isClient()
}
-bool LocalPeer::sendMessage(const QString &message, int timeout)
+bool LocalPeer::sendMessage(const QByteArray &message, int timeout)
{
if (!isClient())
return false;
@@ -177,7 +177,7 @@ bool LocalPeer::sendMessage(const QString &message, int timeout)
return false;
}
- QByteArray uMsg(message.toUtf8());
+ QByteArray uMsg(message);
QDataStream ds(&socket);
ds.writeBytes(uMsg.constData(), uMsg.size());
@@ -232,10 +232,9 @@ void LocalPeer::receiveConnection()
delete socket;
return;
}
- QString message(QString::fromUtf8(uMsg));
socket->write(ack, qstrlen(ack));
socket->waitForBytesWritten(1000);
socket->waitForDisconnected(1000); // make sure client reads ack
delete socket;
- emit messageReceived(message); //### (might take a long time to return)
+ emit messageReceived(uMsg); //### (might take a long time to return)
}