some type fixes for marshalling/un-marshalling of data

This commit is contained in:
Stephen Birarda 2014-01-28 11:26:36 -08:00
parent 85ebad979f
commit 75e2fa491a
4 changed files with 4 additions and 5 deletions

View file

@ -128,7 +128,6 @@ void DomainServer::readAvailableDatagrams() {
deconstructPacketHeader(receivedPacket, nodeUUID);
packetStream >> nodeType;
packetStream >> nodePublicAddress >> nodeLocalAddress;
if (nodePublicAddress.getAddress().isNull()) {

View file

@ -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) {

View file

@ -146,7 +146,7 @@ private:
QString _domainHostname;
HifiSockAddr _domainSockAddr;
QUdpSocket _nodeSocket;
char _ownerType;
NODE_TYPE _ownerType;
QSet<NODE_TYPE> _nodeTypesOfInterest;
QUuid _ownerUUID;
int _numNoReplyDomainCheckIns;

View file

@ -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