mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
support encoding
This commit is contained in:
parent
d3145b2ffc
commit
50a157bfd2
@ -67,9 +67,10 @@ void SocketLobby::requestReadySession(const QString & session)
|
|||||||
|
|
||||||
void SocketLobby::send(const QString & msg)
|
void SocketLobby::send(const QString & msg)
|
||||||
{
|
{
|
||||||
int sz = msg.size();
|
QByteArray str = msg.toUtf8();
|
||||||
|
int sz = str.size();
|
||||||
QByteArray pack((const char *)&sz, sizeof(sz));
|
QByteArray pack((const char *)&sz, sizeof(sz));
|
||||||
pack.append(qUtf8Printable(msg));
|
pack.append(str);
|
||||||
socket->write(pack);
|
socket->write(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user