Merge pull request #5372 from birarda/protocol

fix for reading of type from SVO files
This commit is contained in:
Clément Brisset 2015-07-20 15:27:58 -07:00
commit ac153699b1
5 changed files with 17 additions and 24 deletions

View file

@ -64,13 +64,7 @@ std::unique_ptr<NLPacket> NLPacket::fromReceivedPacket(std::unique_ptr<char> dat
}
std::unique_ptr<NLPacket> NLPacket::createCopy(const NLPacket& other) {
auto packet = std::unique_ptr<NLPacket>(new NLPacket(other));
if (other.isOpen()) {
packet->open(other.openMode());
}
return packet;
return std::unique_ptr<NLPacket>(new NLPacket(other));
}
NLPacket::NLPacket(PacketType::Value type, qint64 size) :

View file

@ -44,13 +44,7 @@ std::unique_ptr<Packet> Packet::fromReceivedPacket(std::unique_ptr<char> data, q
}
std::unique_ptr<Packet> Packet::createCopy(const Packet& other) {
auto packet = std::unique_ptr<Packet>(new Packet(other));
if (other.isOpen()) {
packet->open(other.openMode());
}
return packet;
return std::unique_ptr<Packet>(new Packet(other));
}
qint64 Packet::totalHeadersSize() const {
@ -104,6 +98,11 @@ Packet::Packet(const Packet& other) :
QIODevice()
{
*this = other;
if (other.isOpen()) {
this->open(other.openMode());
}
this->seek(other.pos());
}

View file

@ -81,7 +81,7 @@ public:
using QIODevice::read;
QByteArray read(qint64 maxSize);
template<typename T> qint64 peekPrimitive(T* data);
template<typename T> qint64 readPrimitive(T* data);
template<typename T> qint64 writePrimitive(const T& data);

View file

@ -69,7 +69,7 @@ PacketVersion versionForPacketType(PacketType::Value packetType) {
case EntityData:
return VERSION_ENTITIES_NEW_PROTOCOL_LAYER;
default:
return 10;
return 11;
}
}

View file

@ -27,7 +27,7 @@
// NOTE: if you want the name of the packet packetType to be available for debugging or logging, update nameForPacketType() as well
namespace PacketType {
enum Value {
enum Value {
Unknown,
StunResponse,
DomainList,
@ -62,18 +62,18 @@ namespace PacketType {
DomainConnectRequest,
DomainServerRequireDTLS,
NodeJsonStats,
EntityQuery,
EntityData,
EntityAdd,
EntityErase,
EntityEdit,
OctreeDataNack,
StopNode,
AudioEnvironment,
EntityEditNack,
ICEServerHeartbeat,
ICEPing,
ICEPingReply
ICEPingReply,
EntityData,
EntityQuery,
EntityAdd,
EntityErase,
EntityEdit
};
};
@ -138,6 +138,6 @@ const PacketVersion VERSION_ENTITIES_FACE_CAMERA = 30;
const PacketVersion VERSION_ENTITIES_SCRIPT_TIMESTAMP = 31;
const PacketVersion VERSION_ENTITIES_SCRIPT_TIMESTAMP_FIX = 32;
const PacketVersion VERSION_ENTITIES_HAVE_SIMULATION_OWNER_AND_ACTIONS_OVER_WIRE = 33;
const PacketVersion VERSION_ENTITIES_NEW_PROTOCOL_LAYER = 34;
const PacketVersion VERSION_ENTITIES_NEW_PROTOCOL_LAYER = 35;
#endif // hifi_PacketHeaders_h