diff --git a/assignment-client/src/audio/AvatarAudioStream.cpp b/assignment-client/src/audio/AvatarAudioStream.cpp index 9fd44d9e85..0cece94094 100644 --- a/assignment-client/src/audio/AvatarAudioStream.cpp +++ b/assignment-client/src/audio/AvatarAudioStream.cpp @@ -18,7 +18,7 @@ AvatarAudioStream::AvatarAudioStream(bool isStereo, const InboundAudioStream::Se { } -int AvatarAudioStream::parseStreamProperties (PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) { +int AvatarAudioStream::parseStreamProperties(PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) { int readBytes = 0; if (type == PacketTypeSilentAudioFrame) { @@ -53,6 +53,6 @@ int AvatarAudioStream::parseStreamProperties (PacketType::Value type, const QByt int numAudioBytes = packetAfterSeqNum.size() - readBytes; numAudioSamples = numAudioBytes / sizeof(int16_t); } - + return readBytes; } diff --git a/assignment-client/src/audio/AvatarAudioStream.h b/assignment-client/src/audio/AvatarAudioStream.h index 78f57bb18f..7dc87f7d41 100644 --- a/assignment-client/src/audio/AvatarAudioStream.h +++ b/assignment-client/src/audio/AvatarAudioStream.h @@ -19,13 +19,13 @@ class AvatarAudioStream : public PositionalAudioStream { public: AvatarAudioStream(bool isStereo, const InboundAudioStream::Settings& settings); - + private: // disallow copying of AvatarAudioStream objects AvatarAudioStream(const AvatarAudioStream&); AvatarAudioStream& operator= (const AvatarAudioStream&); - int parseStreamProperties (PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples); + int parseStreamProperties(PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples); }; #endif // hifi_AvatarAudioStream_h diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index 3725c22988..c885a67674 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -168,7 +168,7 @@ int InboundAudioStream::parseData(const QByteArray& packet) { return readBytes; } -int InboundAudioStream::parseStreamProperties (PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) { +int InboundAudioStream::parseStreamProperties(PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) { if (type == PacketTypeSilentAudioFrame) { quint16 numSilentSamples = 0; memcpy(&numSilentSamples, packetAfterSeqNum.constData(), sizeof(quint16)); @@ -181,7 +181,7 @@ int InboundAudioStream::parseStreamProperties (PacketType::Value type, const QBy } } -int InboundAudioStream::parseAudioData (PacketType::Value type, const QByteArray& packetAfterStreamProperties, int numAudioSamples) { +int InboundAudioStream::parseAudioData(PacketType::Value type, const QByteArray& packetAfterStreamProperties, int numAudioSamples) { return _ringBuffer.writeData(packetAfterStreamProperties.data(), numAudioSamples * sizeof(int16_t)); } diff --git a/libraries/audio/src/InboundAudioStream.h b/libraries/audio/src/InboundAudioStream.h index 370d853bd2..cb8494f23e 100644 --- a/libraries/audio/src/InboundAudioStream.h +++ b/libraries/audio/src/InboundAudioStream.h @@ -194,11 +194,11 @@ protected: /// parses the info between the seq num and the audio data in the network packet and calculates /// how many audio samples this packet contains (used when filling in samples for dropped packets). /// default implementation assumes no stream properties and raw audio samples after stream propertiess - virtual int parseStreamProperties (PacketType::Value type, const QByteArray& packetAfterSeqNum, int& networkSamples); + virtual int parseStreamProperties(PacketType::Value type, const QByteArray& packetAfterSeqNum, int& networkSamples); /// parses the audio data in the network packet. /// default implementation assumes packet contains raw audio samples after stream properties - virtual int parseAudioData (PacketType::Value type, const QByteArray& packetAfterStreamProperties, int networkSamples); + virtual int parseAudioData(PacketType::Value type, const QByteArray& packetAfterStreamProperties, int networkSamples); /// writes silent samples to the buffer that may be dropped to reduce latency caused by the buffer virtual int writeDroppableSilentSamples(int silentSamples); diff --git a/libraries/audio/src/InjectedAudioStream.cpp b/libraries/audio/src/InjectedAudioStream.cpp index b1005fb9db..b7e9a40942 100644 --- a/libraries/audio/src/InjectedAudioStream.cpp +++ b/libraries/audio/src/InjectedAudioStream.cpp @@ -30,7 +30,7 @@ InjectedAudioStream::InjectedAudioStream(const QUuid& streamIdentifier, const bo const uchar MAX_INJECTOR_VOLUME = 255; -int InjectedAudioStream::parseStreamProperties (PacketType::Value type, +int InjectedAudioStream::parseStreamProperties(PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples) { // setup a data stream to read from this packet diff --git a/libraries/audio/src/InjectedAudioStream.h b/libraries/audio/src/InjectedAudioStream.h index 29a9947a24..2460f83f40 100644 --- a/libraries/audio/src/InjectedAudioStream.h +++ b/libraries/audio/src/InjectedAudioStream.h @@ -31,7 +31,7 @@ private: InjectedAudioStream& operator= (const InjectedAudioStream&); AudioStreamStats getAudioStreamStats() const; - int parseStreamProperties (PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples); + int parseStreamProperties(PacketType::Value type, const QByteArray& packetAfterSeqNum, int& numAudioSamples); const QUuid _streamIdentifier; float _radius; diff --git a/libraries/audio/src/MixedProcessedAudioStream.cpp b/libraries/audio/src/MixedProcessedAudioStream.cpp index 2a5b94cac1..f596c3a8b3 100644 --- a/libraries/audio/src/MixedProcessedAudioStream.cpp +++ b/libraries/audio/src/MixedProcessedAudioStream.cpp @@ -42,7 +42,7 @@ int MixedProcessedAudioStream::writeLastFrameRepeatedWithFade(int samples) { return deviceSamplesWritten; } -int MixedProcessedAudioStream::parseAudioData (PacketType::Value type, const QByteArray& packetAfterStreamProperties, int networkSamples) { +int MixedProcessedAudioStream::parseAudioData(PacketType::Value type, const QByteArray& packetAfterStreamProperties, int networkSamples) { emit addedStereoSamples(packetAfterStreamProperties); diff --git a/libraries/audio/src/MixedProcessedAudioStream.h b/libraries/audio/src/MixedProcessedAudioStream.h index efd06b996e..265095597b 100644 --- a/libraries/audio/src/MixedProcessedAudioStream.h +++ b/libraries/audio/src/MixedProcessedAudioStream.h @@ -35,7 +35,7 @@ public: protected: int writeDroppableSilentSamples(int silentSamples); int writeLastFrameRepeatedWithFade(int samples); - int parseAudioData (PacketType::Value type, const QByteArray& packetAfterStreamProperties, int networkSamples); + int parseAudioData(PacketType::Value type, const QByteArray& packetAfterStreamProperties, int networkSamples); private: int networkToDeviceSamples(int networkSamples); diff --git a/libraries/entities/src/EntityEditPacketSender.cpp b/libraries/entities/src/EntityEditPacketSender.cpp index c6c61f70a0..e5225b5ebb 100644 --- a/libraries/entities/src/EntityEditPacketSender.cpp +++ b/libraries/entities/src/EntityEditPacketSender.cpp @@ -18,7 +18,7 @@ #include "EntityItem.h" -void EntityEditPacketSender::adjustEditPacketForClockSkew (PacketType::Value type, +void EntityEditPacketSender::adjustEditPacketForClockSkew(PacketType::Value type, unsigned char* editBuffer, size_t length, int clockSkew) { if (type == PacketTypeEntityAdd || type == PacketTypeEntityEdit) { @@ -26,7 +26,7 @@ void EntityEditPacketSender::adjustEditPacketForClockSkew (PacketType::Value typ } } -void EntityEditPacketSender::queueEditEntityMessage (PacketType::Value type, EntityItemID modelID, +void EntityEditPacketSender::queueEditEntityMessage(PacketType::Value type, EntityItemID modelID, const EntityItemProperties& properties) { if (!_shouldSend) { return; // bail early diff --git a/libraries/entities/src/EntityEditPacketSender.h b/libraries/entities/src/EntityEditPacketSender.h index ff0c02789e..ce88f41b04 100644 --- a/libraries/entities/src/EntityEditPacketSender.h +++ b/libraries/entities/src/EntityEditPacketSender.h @@ -24,12 +24,12 @@ public: /// which voxel-server node or nodes the packet should be sent to. Can be called even before voxel servers are known, in /// which case up to MaxPendingMessages will be buffered and processed when voxel servers are known. /// NOTE: EntityItemProperties assumes that all distances are in meter units - void queueEditEntityMessage (PacketType::Value type, EntityItemID modelID, const EntityItemProperties& properties); + void queueEditEntityMessage(PacketType::Value type, EntityItemID modelID, const EntityItemProperties& properties); void queueEraseEntityMessage(const EntityItemID& entityItemID); // My server type is the model server virtual char getMyNodeType() const { return NodeType::EntityServer; } - virtual void adjustEditPacketForClockSkew (PacketType::Value type, unsigned char* editBuffer, size_t length, int clockSkew); + virtual void adjustEditPacketForClockSkew(PacketType::Value type, unsigned char* editBuffer, size_t length, int clockSkew); }; #endif // hifi_EntityEditPacketSender_h diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index ae021a7b67..7e7b21417e 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -614,7 +614,7 @@ void EntityItemPropertiesFromScriptValueHonorReadOnly(const QScriptValue &object // // TODO: Implement support for script and visible properties. // -bool EntityItemProperties::encodeEntityEditPacket (PacketType::Value command, EntityItemID id, const EntityItemProperties& properties, +bool EntityItemProperties::encodeEntityEditPacket(PacketType::Value command, EntityItemID id, const EntityItemProperties& properties, unsigned char* bufferOut, int sizeIn, int& sizeOut) { OctreePacketData ourDataPacket(false, sizeIn); // create a packetData object to add out packet details too. OctreePacketData* packetData = &ourDataPacket; // we want a pointer to this so we can use our APPEND_ENTITY_PROPERTY macro diff --git a/libraries/entities/src/EntityItemProperties.h b/libraries/entities/src/EntityItemProperties.h index a1f64e03bd..8bc932c0ed 100644 --- a/libraries/entities/src/EntityItemProperties.h +++ b/libraries/entities/src/EntityItemProperties.h @@ -174,7 +174,7 @@ public: void setGlowLevel(float value) { _glowLevel = value; _glowLevelChanged = true; } void setLocalRenderAlpha(float value) { _localRenderAlpha = value; _localRenderAlphaChanged = true; } - static bool encodeEntityEditPacket (PacketType::Value command, EntityItemID id, const EntityItemProperties& properties, + static bool encodeEntityEditPacket(PacketType::Value command, EntityItemID id, const EntityItemProperties& properties, unsigned char* bufferOut, int sizeIn, int& sizeOut); static bool encodeEraseEntityMessage(const EntityItemID& entityItemID, diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index e4b34fc51f..31f1f2cfc0 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -32,7 +32,7 @@ EntityScriptingInterface::EntityScriptingInterface() : connect(nodeList.data(), &NodeList::canRezChanged, this, &EntityScriptingInterface::canRezChanged); } -void EntityScriptingInterface::queueEntityMessage (PacketType::Value packetType, +void EntityScriptingInterface::queueEntityMessage(PacketType::Value packetType, EntityItemID entityID, const EntityItemProperties& properties) { getEntityPacketSender()->queueEditEntityMessage(packetType, entityID, properties); } diff --git a/libraries/entities/src/EntityScriptingInterface.h b/libraries/entities/src/EntityScriptingInterface.h index 378a3cdf4a..c232437757 100644 --- a/libraries/entities/src/EntityScriptingInterface.h +++ b/libraries/entities/src/EntityScriptingInterface.h @@ -164,7 +164,7 @@ private: bool actionWorker(const QUuid& entityID, std::function actor); bool setVoxels(QUuid entityID, std::function actor); bool setPoints(QUuid entityID, std::function actor); - void queueEntityMessage (PacketType::Value packetType, EntityItemID entityID, const EntityItemProperties& properties); + void queueEntityMessage(PacketType::Value packetType, EntityItemID entityID, const EntityItemProperties& properties); /// actually does the work of finding the ray intersection, can be called in locking mode or tryLock mode RayToEntityIntersectionResult findRayIntersectionWorker(const PickRay& ray, Octree::lockType lockType, diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 5a16f5a003..7d626f1a63 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -63,7 +63,7 @@ void EntityTree::eraseAllOctreeElements(bool createNewRoot) { Octree::eraseAllOctreeElements(createNewRoot); } -bool EntityTree::handlesEditPacketType (PacketType::Value packetType) const { +bool EntityTree::handlesEditPacketType(PacketType::Value packetType) const { // we handle these types of "edit" packets switch (packetType) { case PacketTypeEntityAdd: @@ -572,7 +572,7 @@ EntityItemPointer EntityTree::findEntityByEntityItemID(const EntityItemID& entit return foundEntity; } -int EntityTree::processEditPacketData (PacketType::Value packetType, const unsigned char* packetData, int packetLength, +int EntityTree::processEditPacketData(PacketType::Value packetType, const unsigned char* packetData, int packetLength, const unsigned char* editData, int maxLength, const SharedNodePointer& senderNode) { if (!getIsServer()) { diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index 99d08fc937..5c65b94868 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -65,8 +65,8 @@ public: virtual PacketType::Value expectedDataPacketType() const { return PacketTypeEntityData; } virtual bool canProcessVersion(PacketVersion thisVersion) const { return thisVersion >= VERSION_ENTITIES_USE_METERS_AND_RADIANS; } - virtual bool handlesEditPacketType (PacketType::Value packetType) const; - virtual int processEditPacketData (PacketType::Value packetType, const unsigned char* packetData, int packetLength, + virtual bool handlesEditPacketType(PacketType::Value packetType) const; + virtual int processEditPacketData(PacketType::Value packetType, const unsigned char* packetData, int packetLength, const unsigned char* editData, int maxLength, const SharedNodePointer& senderNode); virtual bool rootElementHasData() const { return true; } diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h index 40d43ec02f..ceb0427ef0 100644 --- a/libraries/networking/src/LimitedNodeList.h +++ b/libraries/networking/src/LimitedNodeList.h @@ -119,7 +119,7 @@ public: bool packetVersionAndHashMatch(const QByteArray& packet); - // QByteArray byteArrayWithPopulatedHeader (PacketType::Value packetType) + // QByteArray byteArrayWithPopulatedHeader(PacketType::Value packetType) // { return byteArrayWithUUIDPopulatedHeader(packetType, _sessionUUID); } // int populatePacketHeader(QByteArray& packet, PacketType::Value packetType) // { return populatePacketHeaderWithUUID(packet, packetType, _sessionUUID); } @@ -285,7 +285,7 @@ protected: void stopInitialSTUNUpdate(bool success); - void sendPacketToIceServer (PacketType::Value packetType, const HifiSockAddr& iceServerSockAddr, const QUuid& headerID, + void sendPacketToIceServer(PacketType::Value packetType, const HifiSockAddr& iceServerSockAddr, const QUuid& headerID, const QUuid& peerRequestID = QUuid()); QUuid _sessionUUID; diff --git a/libraries/networking/src/Node.cpp b/libraries/networking/src/Node.cpp index fcb22a08b0..667e975398 100644 --- a/libraries/networking/src/Node.cpp +++ b/libraries/networking/src/Node.cpp @@ -67,7 +67,7 @@ void Node::updateClockSkewUsec(int clockSkewSample) { _clockSkewUsec = (int)_clockSkewMovingPercentile.getValueAtPercentile(); } -PacketSequenceNumber Node::getLastSequenceNumberForPacketType (PacketType::Value packetType) const { +PacketSequenceNumber Node::getLastSequenceNumberForPacketType(PacketType::Value packetType) const { auto typeMatch = _lastSequenceNumbers.find(packetType); if (typeMatch != _lastSequenceNumbers.end()) { return typeMatch->second; diff --git a/libraries/octree/src/EditPacketBuffer.cpp b/libraries/octree/src/EditPacketBuffer.cpp index 9968990692..966a315a41 100644 --- a/libraries/octree/src/EditPacketBuffer.cpp +++ b/libraries/octree/src/EditPacketBuffer.cpp @@ -20,7 +20,7 @@ EditPacketBuffer::EditPacketBuffer() : } -EditPacketBuffer::EditPacketBuffer (PacketType::Value type, unsigned char* buffer, size_t length, qint64 satoshiCost, QUuid nodeUUID) : +EditPacketBuffer::EditPacketBuffer(PacketType::Value type, unsigned char* buffer, size_t length, qint64 satoshiCost, QUuid nodeUUID) : _nodeUUID(nodeUUID), _currentType(type), _currentSize(length), diff --git a/libraries/octree/src/EditPacketBuffer.h b/libraries/octree/src/EditPacketBuffer.h index e817a07d12..9a7ec47b9a 100644 --- a/libraries/octree/src/EditPacketBuffer.h +++ b/libraries/octree/src/EditPacketBuffer.h @@ -21,7 +21,7 @@ class EditPacketBuffer { public: EditPacketBuffer(); - EditPacketBuffer (PacketType::Value type, unsigned char* codeColorBuffer, size_t length, + EditPacketBuffer(PacketType::Value type, unsigned char* codeColorBuffer, size_t length, qint64 satoshiCost = 0, const QUuid nodeUUID = QUuid()); QUuid _nodeUUID; diff --git a/libraries/octree/src/Octree.h b/libraries/octree/src/Octree.h index 2397c6bcae..ddded47171 100644 --- a/libraries/octree/src/Octree.h +++ b/libraries/octree/src/Octree.h @@ -230,8 +230,8 @@ public: virtual bool canProcessVersion(PacketVersion thisVersion) const { return thisVersion == versionForPacketType(expectedDataPacketType()); } virtual PacketVersion expectedVersion() const { return versionForPacketType(expectedDataPacketType()); } - virtual bool handlesEditPacketType (PacketType::Value packetType) const { return false; } - virtual int processEditPacketData (PacketType::Value packetType, const unsigned char* packetData, int packetLength, + virtual bool handlesEditPacketType(PacketType::Value packetType) const { return false; } + virtual int processEditPacketData(PacketType::Value packetType, const unsigned char* packetData, int packetLength, const unsigned char* editData, int maxLength, const SharedNodePointer& sourceNode) { return 0; } virtual bool recurseChildrenWithData() const { return true; } diff --git a/libraries/octree/src/OctreeEditPacketSender.cpp b/libraries/octree/src/OctreeEditPacketSender.cpp index d94d3b613c..e6c1a2fa35 100644 --- a/libraries/octree/src/OctreeEditPacketSender.cpp +++ b/libraries/octree/src/OctreeEditPacketSender.cpp @@ -159,7 +159,7 @@ void OctreeEditPacketSender::processPreServerExistsPackets() { } } -void OctreeEditPacketSender::queuePendingPacketToNodes (PacketType::Value type, unsigned char* buffer, +void OctreeEditPacketSender::queuePendingPacketToNodes(PacketType::Value type, unsigned char* buffer, size_t length, qint64 satoshiCost) { // If we're asked to save messages while waiting for voxel servers to arrive, then do so... @@ -213,7 +213,7 @@ void OctreeEditPacketSender::queuePacketToNodes(unsigned char* buffer, size_t le // NOTE: editPacketBuffer - is JUST the octcode/color and does not contain the packet header! -void OctreeEditPacketSender::queueOctreeEditMessage (PacketType::Value type, unsigned char* editPacketBuffer, +void OctreeEditPacketSender::queueOctreeEditMessage(PacketType::Value type, unsigned char* editPacketBuffer, size_t length, qint64 satoshiCost) { if (!_shouldSend) { diff --git a/libraries/octree/src/OctreeEditPacketSender.h b/libraries/octree/src/OctreeEditPacketSender.h index a9b9efb73c..caeeea5508 100644 --- a/libraries/octree/src/OctreeEditPacketSender.h +++ b/libraries/octree/src/OctreeEditPacketSender.h @@ -30,7 +30,7 @@ public: /// Queues a single edit message. Will potentially send a pending multi-command packet. Determines which server /// node or nodes the packet should be sent to. Can be called even before servers are known, in which case up to /// MaxPendingMessages will be buffered and processed when servers are known. - void queueOctreeEditMessage (PacketType::Value type, unsigned char* buffer, size_t length, qint64 satoshiCost = 0); + void queueOctreeEditMessage(PacketType::Value type, unsigned char* buffer, size_t length, qint64 satoshiCost = 0); /// Releases all queued messages even if those messages haven't filled an MTU packet. This will move the packed message /// packets onto the send queue. If running in threaded mode, the caller does not need to do any further processing to @@ -81,7 +81,7 @@ public: // you must override these... virtual char getMyNodeType() const = 0; - virtual void adjustEditPacketForClockSkew (PacketType::Value type, + virtual void adjustEditPacketForClockSkew(PacketType::Value type, unsigned char* editPacketBuffer, size_t length, int clockSkew) { } bool hasDestinationWalletUUID() const { return !_destinationWalletUUID.isNull(); } @@ -99,7 +99,7 @@ signals: protected: bool _shouldSend; void queuePacketToNode(const QUuid& nodeID, unsigned char* buffer, size_t length, qint64 satoshiCost = 0); - void queuePendingPacketToNodes (PacketType::Value type, unsigned char* buffer, size_t length, qint64 satoshiCost = 0); + void queuePendingPacketToNodes(PacketType::Value type, unsigned char* buffer, size_t length, qint64 satoshiCost = 0); void queuePacketToNodes(unsigned char* buffer, size_t length, qint64 satoshiCost = 0); void initializePacket(EditPacketBuffer& packetBuffer, PacketType::Value type, int nodeClockSkew); void releaseQueuedPacket(EditPacketBuffer& packetBuffer); // releases specific queued packet