Showing the changes to assignment-client/src/AssignmentFactory.cpp (1 of 107 files). Show all
Unified · Split
| @@ -17,15 +17,13 @@ · 16 unmodified lines | |||
| 17 | #include "avatars/AvatarMixer.h" | 17 | #include "avatars/AvatarMixer.h" |
| 18 | #include "entities/EntityServer.h" | 18 | #include "entities/EntityServer.h" |
| 19 | 19 | ||
| 20 | ThreadedAssignment* AssignmentFactory::unpackAssignment(const QByteArray& packet) { | 20 | ThreadedAssignment* AssignmentFactory::unpackAssignment(NLPacket& packet) { |
| 21 | QDataStream packetStream(packet); | ||
| 22 | packetStream.skipRawData(numBytesForPacketHeader(packet)); | ||
| 23 | 21 | ||
| 24 | quint8 packedType; | 22 | quint8 packedType; |
| 25 | packetStream >> packedType; | 23 | packet.peekPrimitive(&packedType); |
| 26 | 24 | ||
| 27 | Assignment::Type unpackedType = (Assignment::Type) packedType; | 25 | Assignment::Type unpackedType = (Assignment::Type) packedType; |
| 28 | 26 | ||
| 29 | switch (unpackedType) { | 27 | switch (unpackedType) { |
| 30 | case Assignment::AudioMixerType: | 28 | case Assignment::AudioMixerType: |
| 31 | return new AudioMixer(packet); | 29 | return new AudioMixer(packet); |