mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
send correctly sized packet for assignment
This commit is contained in:
parent
f52c1c909b
commit
2804d286d5
3 changed files with 9 additions and 3 deletions
|
@ -49,6 +49,11 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
qDebug() << "Received assignment of type " << newAssignment.getType() << "\n";
|
||||
|
||||
// for the puroposes of debugging before implementing a GUID system - only keep latest
|
||||
if (assignmentQueue.size() > 0) {
|
||||
assignmentQueue.pop();
|
||||
}
|
||||
|
||||
// add this assignment to the queue
|
||||
assignmentQueue.push(newAssignment);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
class Assignment {
|
||||
public:
|
||||
|
||||
enum Type {
|
||||
AudioMixer
|
||||
};
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include "Assignment.h"
|
||||
#include "NodeList.h"
|
||||
#include "NodeTypes.h"
|
||||
#include "PacketHeaders.h"
|
||||
|
@ -377,10 +378,9 @@ void NodeList::requestAssignment() {
|
|||
void NodeList::sendAssignment(Assignment& assignment) {
|
||||
unsigned char assignmentPacket[MAX_PACKET_SIZE];
|
||||
int numHeaderBytes = populateTypeAndVersion(assignmentPacket, PACKET_TYPE_SEND_ASSIGNMENT);
|
||||
|
||||
qDebug() << "The socket IP is " << inet_ntoa(assignmentServerSocket.sin_addr);
|
||||
*(assignmentPacket + numHeaderBytes) = assignment.getType();
|
||||
|
||||
_nodeSocket.send((sockaddr*) &assignmentServerSocket, assignmentPacket, numHeaderBytes);
|
||||
_nodeSocket.send((sockaddr*) &assignmentServerSocket, assignmentPacket, numHeaderBytes + sizeof(unsigned char));
|
||||
}
|
||||
|
||||
Node* NodeList::addOrUpdateNode(sockaddr* publicSocket, sockaddr* localSocket, char nodeType, uint16_t nodeId) {
|
||||
|
|
Loading…
Reference in a new issue