From be4bc7b2caf7ec35002ec4b20185194d83c8868e Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Fri, 4 Dec 2015 14:55:16 -0800 Subject: [PATCH] going a different way, same packet version, but always send feature requests to old servers --- libraries/networking/src/udt/PacketHeaders.cpp | 3 +-- libraries/networking/src/udt/PacketHeaders.h | 1 - libraries/octree/src/OctreeQuery.cpp | 12 +++++++++--- libraries/octree/src/OctreeQuery.h | 4 ++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/libraries/networking/src/udt/PacketHeaders.cpp b/libraries/networking/src/udt/PacketHeaders.cpp index 158cf15584..93fbe7acdc 100644 --- a/libraries/networking/src/udt/PacketHeaders.cpp +++ b/libraries/networking/src/udt/PacketHeaders.cpp @@ -38,11 +38,10 @@ const QSet RELIABLE_PACKETS = QSet(); PacketVersion versionForPacketType(PacketType packetType) { switch (packetType) { - case PacketType::EntityQuery: case PacketType::EntityAdd: case PacketType::EntityEdit: case PacketType::EntityData: - return VERSION_ENTITIES_DEFAULT_QUERY_BITS; + return VERSION_ENTITIES_HAVE_PARENTS; case PacketType::AvatarData: case PacketType::BulkAvatarData: return 17; diff --git a/libraries/networking/src/udt/PacketHeaders.h b/libraries/networking/src/udt/PacketHeaders.h index a9f89417c0..cd7b9a113c 100644 --- a/libraries/networking/src/udt/PacketHeaders.h +++ b/libraries/networking/src/udt/PacketHeaders.h @@ -161,6 +161,5 @@ const PacketVersion VERSION_ENTITIES_KEYLIGHT_PROPERTIES_GROUP_BIS = 48; const PacketVersion VERSION_ENTITIES_PARTICLES_ADDITIVE_BLENDING = 49; const PacketVersion VERSION_ENTITIES_POLYLINE_TEXTURE = 50; const PacketVersion VERSION_ENTITIES_HAVE_PARENTS = 51; -const PacketVersion VERSION_ENTITIES_DEFAULT_QUERY_BITS = 52; #endif // hifi_PacketHeaders_h diff --git a/libraries/octree/src/OctreeQuery.cpp b/libraries/octree/src/OctreeQuery.cpp index 0288d19b80..0a25b87d83 100644 --- a/libraries/octree/src/OctreeQuery.cpp +++ b/libraries/octree/src/OctreeQuery.cpp @@ -40,9 +40,15 @@ int OctreeQuery::getBroadcastData(unsigned char* destinationBuffer) { // bitMask of less than byte wide items unsigned char bitItems = 0; - // NOTE: we used to use these bits to set feature request items - // if we need to extend the protocol with optional features - // do it here with... setAtBit(bitItems, WANT_FEATURE_BIT); + + // NOTE: we need to keep these here for new clients to talk to old servers. After we know that the clients and + // servers and clients have all been updated we could remove these bits. New servers will always force these + // features on old clients even if they don't ask for them. (which old clients will properly handle). New clients + // will always ask for these so that old servers will use these features. + setAtBit(bitItems, WANT_LOW_RES_MOVING_BIT); + setAtBit(bitItems, WANT_COLOR_AT_BIT); + setAtBit(bitItems, WANT_DELTA_AT_BIT); + setAtBit(bitItems, WANT_COMPRESSION); *destinationBuffer++ = bitItems; diff --git a/libraries/octree/src/OctreeQuery.h b/libraries/octree/src/OctreeQuery.h index 8c72983a7f..8362cff396 100644 --- a/libraries/octree/src/OctreeQuery.h +++ b/libraries/octree/src/OctreeQuery.h @@ -35,6 +35,10 @@ typedef unsigned long long quint64; // First bitset const int WANT_LOW_RES_MOVING_BIT = 0; +const int WANT_COLOR_AT_BIT = 1; +const int WANT_DELTA_AT_BIT = 2; +const int UNUSED_BIT_3 = 3; // unused... available for new feature +const int WANT_COMPRESSION = 4; // 5th bit class OctreeQuery : public NodeData { Q_OBJECT