mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-10 10:34:56 +02:00
store senderSocket with assignment to be passed to requestor
This commit is contained in:
parent
2804d286d5
commit
ef7e7ae4c5
4 changed files with 14 additions and 1 deletions
|
@ -45,7 +45,10 @@ int main(int argc, const char* argv[]) {
|
|||
// send the assignment
|
||||
}
|
||||
} else if (senderData[0] == PACKET_TYPE_SEND_ASSIGNMENT && packetVersionMatch(senderData)) {
|
||||
Assignment newAssignment((Assignment::Type) *(senderData + numBytesForPacketHeader(senderData)));
|
||||
// assignment server is on a public server
|
||||
// assume that the address we now have for the sender is the public address/port
|
||||
// and store that with the assignment so it can be given to the requestor later
|
||||
Assignment newAssignment((Assignment::Type) *(senderData + numBytesForPacketHeader(senderData)), senderSocket);
|
||||
|
||||
qDebug() << "Received assignment of type " << newAssignment.getType() << "\n";
|
||||
|
||||
|
|
|
@ -90,6 +90,7 @@ int main(int argc, const char * argv[])
|
|||
if (!nodeList->soloNodeOfType(NODE_TYPE_AUDIO_MIXER)) {
|
||||
// we don't have an audio mixer, and we know we need one
|
||||
// so tell that to the assignment server
|
||||
|
||||
Assignment mixerAssignment(Assignment::AudioMixer);
|
||||
nodeList->sendAssignment(mixerAssignment);
|
||||
}
|
||||
|
|
|
@ -10,4 +10,10 @@
|
|||
|
||||
Assignment::Assignment(Assignment::Type type) : _type(type) {
|
||||
|
||||
}
|
||||
|
||||
Assignment::Assignment(Assignment::Type type, sockaddr_in& senderSocket) :
|
||||
_type(type),
|
||||
_senderSocket(senderSocket) {
|
||||
|
||||
}
|
|
@ -19,10 +19,13 @@ public:
|
|||
};
|
||||
|
||||
Assignment(Assignment::Type type);
|
||||
Assignment(Assignment::Type type, sockaddr_in& senderSocket);
|
||||
|
||||
Assignment::Type getType() const { return _type; }
|
||||
|
||||
private:
|
||||
Assignment::Type _type;
|
||||
sockaddr_in _senderSocket;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue