mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 09:07:19 +02:00
some type fixes for marshalling/un-marshalling of data
This commit is contained in:
parent
85ebad979f
commit
75e2fa491a
4 changed files with 4 additions and 5 deletions
|
@ -128,7 +128,6 @@ void DomainServer::readAvailableDatagrams() {
|
|||
|
||||
deconstructPacketHeader(receivedPacket, nodeUUID);
|
||||
packetStream >> nodeType;
|
||||
|
||||
packetStream >> nodePublicAddress >> nodeLocalAddress;
|
||||
|
||||
if (nodePublicAddress.getAddress().isNull()) {
|
||||
|
|
|
@ -464,11 +464,11 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
// check in packet has header, optional UUID, node type, port, IP, node types of interest, null termination
|
||||
QByteArray domainServerPacket = byteArrayWithPopluatedHeader(PacketTypeDomainListRequest);
|
||||
QDataStream packetStream(&domainServerPacket, QIODevice::Append);
|
||||
|
||||
|
||||
// pack our data to send to the domain-server
|
||||
packetStream << _ownerType << _publicSockAddr
|
||||
<< HifiSockAddr(QHostAddress(getHostOrderLocalAddress()), _nodeSocket.localPort())
|
||||
<< (char) _nodeTypesOfInterest.size();
|
||||
<< (quint8) _nodeTypesOfInterest.size();
|
||||
|
||||
// copy over the bytes for node types of interest, if required
|
||||
foreach (NODE_TYPE nodeTypeOfInterest, _nodeTypesOfInterest) {
|
||||
|
|
|
@ -146,7 +146,7 @@ private:
|
|||
QString _domainHostname;
|
||||
HifiSockAddr _domainSockAddr;
|
||||
QUdpSocket _nodeSocket;
|
||||
char _ownerType;
|
||||
NODE_TYPE _ownerType;
|
||||
QSet<NODE_TYPE> _nodeTypesOfInterest;
|
||||
QUuid _ownerUUID;
|
||||
int _numNoReplyDomainCheckIns;
|
||||
|
|
|
@ -34,7 +34,7 @@ int numBytesArithmeticCodingFromBuffer(const char* checkValue) {
|
|||
int packArithmeticallyCodedValue(int value, char* destination) {
|
||||
if (value < 255) {
|
||||
// less than 255, just pack our value
|
||||
destination[0] = (char) value;
|
||||
destination[0] = (uchar) value;
|
||||
return 1;
|
||||
} else {
|
||||
// pack 255 and then recursively pack on
|
||||
|
|
Loading…
Reference in a new issue