mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-19 03:18:47 +02:00
have AssignmentFactory return a ThreadedAssignment
This commit is contained in:
parent
bdf9f9eb22
commit
3d14fba7ab
4 changed files with 5 additions and 8 deletions
|
@ -85,7 +85,7 @@ void AssignmentClient::readPendingDatagrams() {
|
|||
qDebug() << "Dropping received assignment since we are currently running one.\n";
|
||||
} else {
|
||||
// construct the deployed assignment from the packet data
|
||||
_currentAssignment = (ThreadedAssignment*) AssignmentFactory::unpackAssignment(packetData, receivedBytes);
|
||||
_currentAssignment = AssignmentFactory::unpackAssignment(packetData, receivedBytes);
|
||||
|
||||
qDebug() << "Received an assignment -" << *_currentAssignment << "\n";
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "AssignmentFactory.h"
|
||||
|
||||
Assignment* AssignmentFactory::unpackAssignment(const unsigned char* dataBuffer, int numBytes) {
|
||||
ThreadedAssignment* AssignmentFactory::unpackAssignment(const unsigned char* dataBuffer, int numBytes) {
|
||||
int headerBytes = numBytesForPacketHeader(dataBuffer);
|
||||
|
||||
Assignment::Type assignmentType = Assignment::AllTypes;
|
||||
|
@ -31,6 +31,6 @@ Assignment* AssignmentFactory::unpackAssignment(const unsigned char* dataBuffer,
|
|||
case Assignment::VoxelServerType:
|
||||
return new VoxelServer(dataBuffer, numBytes);
|
||||
default:
|
||||
return new Assignment(dataBuffer, numBytes);
|
||||
return NULL;
|
||||
}
|
||||
}
|
|
@ -9,11 +9,11 @@
|
|||
#ifndef __hifi__AssignmentFactory__
|
||||
#define __hifi__AssignmentFactory__
|
||||
|
||||
#include "Assignment.h"
|
||||
#include <ThreadedAssignment.h>
|
||||
|
||||
class AssignmentFactory {
|
||||
public:
|
||||
static Assignment* unpackAssignment(const unsigned char* dataBuffer, int numBytes);
|
||||
static ThreadedAssignment* unpackAssignment(const unsigned char* dataBuffer, int numBytes);
|
||||
};
|
||||
|
||||
#endif /* defined(__hifi__AssignmentFactory__) */
|
||||
|
|
|
@ -692,9 +692,6 @@ void VoxelServer::run() {
|
|||
}
|
||||
|
||||
HifiSockAddr senderSockAddr;
|
||||
|
||||
unsigned char* packetData = new unsigned char[MAX_PACKET_SIZE];
|
||||
ssize_t packetLength;
|
||||
|
||||
// set up our jurisdiction broadcaster...
|
||||
_jurisdictionSender = new JurisdictionSender(_jurisdiction);
|
||||
|
|
Loading…
Reference in a new issue