mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:23:09 +02:00
Merge pull request #5372 from birarda/protocol
fix for reading of type from SVO files
This commit is contained in:
commit
ac153699b1
5 changed files with 17 additions and 24 deletions
|
@ -64,13 +64,7 @@ std::unique_ptr<NLPacket> NLPacket::fromReceivedPacket(std::unique_ptr<char> dat
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<NLPacket> NLPacket::createCopy(const NLPacket& other) {
|
std::unique_ptr<NLPacket> NLPacket::createCopy(const NLPacket& other) {
|
||||||
auto packet = std::unique_ptr<NLPacket>(new NLPacket(other));
|
return std::unique_ptr<NLPacket>(new NLPacket(other));
|
||||||
|
|
||||||
if (other.isOpen()) {
|
|
||||||
packet->open(other.openMode());
|
|
||||||
}
|
|
||||||
|
|
||||||
return packet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NLPacket::NLPacket(PacketType::Value type, qint64 size) :
|
NLPacket::NLPacket(PacketType::Value type, qint64 size) :
|
||||||
|
|
|
@ -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) {
|
std::unique_ptr<Packet> Packet::createCopy(const Packet& other) {
|
||||||
auto packet = std::unique_ptr<Packet>(new Packet(other));
|
return std::unique_ptr<Packet>(new Packet(other));
|
||||||
|
|
||||||
if (other.isOpen()) {
|
|
||||||
packet->open(other.openMode());
|
|
||||||
}
|
|
||||||
|
|
||||||
return packet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 Packet::totalHeadersSize() const {
|
qint64 Packet::totalHeadersSize() const {
|
||||||
|
@ -104,6 +98,11 @@ Packet::Packet(const Packet& other) :
|
||||||
QIODevice()
|
QIODevice()
|
||||||
{
|
{
|
||||||
*this = other;
|
*this = other;
|
||||||
|
|
||||||
|
if (other.isOpen()) {
|
||||||
|
this->open(other.openMode());
|
||||||
|
}
|
||||||
|
|
||||||
this->seek(other.pos());
|
this->seek(other.pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ public:
|
||||||
|
|
||||||
using QIODevice::read;
|
using QIODevice::read;
|
||||||
QByteArray read(qint64 maxSize);
|
QByteArray read(qint64 maxSize);
|
||||||
|
|
||||||
template<typename T> qint64 peekPrimitive(T* data);
|
template<typename T> qint64 peekPrimitive(T* data);
|
||||||
template<typename T> qint64 readPrimitive(T* data);
|
template<typename T> qint64 readPrimitive(T* data);
|
||||||
template<typename T> qint64 writePrimitive(const T& data);
|
template<typename T> qint64 writePrimitive(const T& data);
|
||||||
|
|
|
@ -69,7 +69,7 @@ PacketVersion versionForPacketType(PacketType::Value packetType) {
|
||||||
case EntityData:
|
case EntityData:
|
||||||
return VERSION_ENTITIES_NEW_PROTOCOL_LAYER;
|
return VERSION_ENTITIES_NEW_PROTOCOL_LAYER;
|
||||||
default:
|
default:
|
||||||
return 10;
|
return 11;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
// NOTE: if you want the name of the packet packetType to be available for debugging or logging, update nameForPacketType() as well
|
||||||
|
|
||||||
namespace PacketType {
|
namespace PacketType {
|
||||||
enum Value {
|
enum Value {
|
||||||
Unknown,
|
Unknown,
|
||||||
StunResponse,
|
StunResponse,
|
||||||
DomainList,
|
DomainList,
|
||||||
|
@ -62,18 +62,18 @@ namespace PacketType {
|
||||||
DomainConnectRequest,
|
DomainConnectRequest,
|
||||||
DomainServerRequireDTLS,
|
DomainServerRequireDTLS,
|
||||||
NodeJsonStats,
|
NodeJsonStats,
|
||||||
EntityQuery,
|
|
||||||
EntityData,
|
|
||||||
EntityAdd,
|
|
||||||
EntityErase,
|
|
||||||
EntityEdit,
|
|
||||||
OctreeDataNack,
|
OctreeDataNack,
|
||||||
StopNode,
|
StopNode,
|
||||||
AudioEnvironment,
|
AudioEnvironment,
|
||||||
EntityEditNack,
|
EntityEditNack,
|
||||||
ICEServerHeartbeat,
|
ICEServerHeartbeat,
|
||||||
ICEPing,
|
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 = 31;
|
||||||
const PacketVersion VERSION_ENTITIES_SCRIPT_TIMESTAMP_FIX = 32;
|
const PacketVersion VERSION_ENTITIES_SCRIPT_TIMESTAMP_FIX = 32;
|
||||||
const PacketVersion VERSION_ENTITIES_HAVE_SIMULATION_OWNER_AND_ACTIONS_OVER_WIRE = 33;
|
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
|
#endif // hifi_PacketHeaders_h
|
||||||
|
|
Loading…
Reference in a new issue