mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:37:35 +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);
|
deconstructPacketHeader(receivedPacket, nodeUUID);
|
||||||
packetStream >> nodeType;
|
packetStream >> nodeType;
|
||||||
|
|
||||||
packetStream >> nodePublicAddress >> nodeLocalAddress;
|
packetStream >> nodePublicAddress >> nodeLocalAddress;
|
||||||
|
|
||||||
if (nodePublicAddress.getAddress().isNull()) {
|
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
|
// check in packet has header, optional UUID, node type, port, IP, node types of interest, null termination
|
||||||
QByteArray domainServerPacket = byteArrayWithPopluatedHeader(PacketTypeDomainListRequest);
|
QByteArray domainServerPacket = byteArrayWithPopluatedHeader(PacketTypeDomainListRequest);
|
||||||
QDataStream packetStream(&domainServerPacket, QIODevice::Append);
|
QDataStream packetStream(&domainServerPacket, QIODevice::Append);
|
||||||
|
|
||||||
// pack our data to send to the domain-server
|
// pack our data to send to the domain-server
|
||||||
packetStream << _ownerType << _publicSockAddr
|
packetStream << _ownerType << _publicSockAddr
|
||||||
<< HifiSockAddr(QHostAddress(getHostOrderLocalAddress()), _nodeSocket.localPort())
|
<< HifiSockAddr(QHostAddress(getHostOrderLocalAddress()), _nodeSocket.localPort())
|
||||||
<< (char) _nodeTypesOfInterest.size();
|
<< (quint8) _nodeTypesOfInterest.size();
|
||||||
|
|
||||||
// copy over the bytes for node types of interest, if required
|
// copy over the bytes for node types of interest, if required
|
||||||
foreach (NODE_TYPE nodeTypeOfInterest, _nodeTypesOfInterest) {
|
foreach (NODE_TYPE nodeTypeOfInterest, _nodeTypesOfInterest) {
|
||||||
|
|
|
@ -146,7 +146,7 @@ private:
|
||||||
QString _domainHostname;
|
QString _domainHostname;
|
||||||
HifiSockAddr _domainSockAddr;
|
HifiSockAddr _domainSockAddr;
|
||||||
QUdpSocket _nodeSocket;
|
QUdpSocket _nodeSocket;
|
||||||
char _ownerType;
|
NODE_TYPE _ownerType;
|
||||||
QSet<NODE_TYPE> _nodeTypesOfInterest;
|
QSet<NODE_TYPE> _nodeTypesOfInterest;
|
||||||
QUuid _ownerUUID;
|
QUuid _ownerUUID;
|
||||||
int _numNoReplyDomainCheckIns;
|
int _numNoReplyDomainCheckIns;
|
||||||
|
|
|
@ -34,7 +34,7 @@ int numBytesArithmeticCodingFromBuffer(const char* checkValue) {
|
||||||
int packArithmeticallyCodedValue(int value, char* destination) {
|
int packArithmeticallyCodedValue(int value, char* destination) {
|
||||||
if (value < 255) {
|
if (value < 255) {
|
||||||
// less than 255, just pack our value
|
// less than 255, just pack our value
|
||||||
destination[0] = (char) value;
|
destination[0] = (uchar) value;
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
// pack 255 and then recursively pack on
|
// pack 255 and then recursively pack on
|
||||||
|
|
Loading…
Reference in a new issue