diff --git a/assignment-client/src/main.cpp b/assignment-client/src/main.cpp index 564d827e0e..a0cf0be4c1 100644 --- a/assignment-client/src/main.cpp +++ b/assignment-client/src/main.cpp @@ -53,7 +53,7 @@ void childClient() { sockaddr_in senderSocket = {}; // create a request assignment, accept all assignments, pass the desired pool (if it exists) - Assignment requestAssignment(Assignment::RequestDirection, Assignment::AllTypes); + Assignment requestAssignment(Assignment::RequestCommand, Assignment::AllTypes); while (true) { if (usecTimestampNow() - usecTimestamp(&lastRequest) >= ASSIGNMENT_REQUEST_INTERVAL_USECS) { diff --git a/domain-server/src/main.cpp b/domain-server/src/main.cpp index 088416d1d0..ab266b33de 100644 --- a/domain-server/src/main.cpp +++ b/domain-server/src/main.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -108,11 +108,11 @@ int main(int argc, const char* argv[]) { // as a domain-server we will always want an audio mixer and avatar mixer // setup the create assignments for those - Assignment audioMixerAssignment(Assignment::CreateDirection, + Assignment audioMixerAssignment(Assignment::CreateCommand, Assignment::AudioMixerType, Assignment::LocalLocation); - Assignment avatarMixerAssignment(Assignment::CreateDirection, + Assignment avatarMixerAssignment(Assignment::CreateCommand, Assignment::AvatarMixerType, Assignment::LocalLocation); diff --git a/libraries/shared/src/Assignment.cpp b/libraries/shared/src/Assignment.cpp index 117d6716e0..0f7b59aeab 100644 --- a/libraries/shared/src/Assignment.cpp +++ b/libraries/shared/src/Assignment.cpp @@ -13,8 +13,8 @@ const char IPv4_ADDRESS_DESIGNATOR = 4; const char IPv6_ADDRESS_DESIGNATOR = 6; -Assignment::Assignment(Assignment::Direction direction, Assignment::Type type, Assignment::Location location) : - _direction(direction), +Assignment::Assignment(Assignment::Command command, Assignment::Type type, Assignment::Location location) : + _command(command), _type(type), _location(location), _attachedPublicSocket(NULL), @@ -35,11 +35,11 @@ Assignment::Assignment(const unsigned char* dataBuffer, int numBytes) : int numBytesRead = 0; if (dataBuffer[0] == PACKET_TYPE_REQUEST_ASSIGNMENT) { - _direction = Assignment::RequestDirection; + _command = Assignment::RequestCommand; } else if (dataBuffer[0] == PACKET_TYPE_CREATE_ASSIGNMENT) { - _direction = Assignment::CreateDirection; + _command = Assignment::CreateCommand; } else if (dataBuffer[0] == PACKET_TYPE_DEPLOY_ASSIGNMENT) { - _direction = Assignment::DeployDirection; + _command = Assignment::DeployCommand; } numBytesRead += numBytesForPacketHeader(dataBuffer); @@ -60,7 +60,7 @@ Assignment::Assignment(const unsigned char* dataBuffer, int numBytes) : qDebug("Received a socket that cannot be unpacked!\n"); } - if (_direction == Assignment::CreateDirection) { + if (_command == Assignment::CreateCommand) { delete _attachedLocalSocket; _attachedLocalSocket = newSocket; } else { diff --git a/libraries/shared/src/Assignment.h b/libraries/shared/src/Assignment.h index 3d364945ba..99d22b791e 100644 --- a/libraries/shared/src/Assignment.h +++ b/libraries/shared/src/Assignment.h @@ -23,10 +23,10 @@ public: AllTypes }; - enum Direction { - CreateDirection, - DeployDirection, - RequestDirection + enum Command { + CreateCommand, + DeployCommand, + RequestCommand }; enum Location { @@ -34,7 +34,7 @@ public: LocalLocation }; - Assignment(Assignment::Direction direction, + Assignment(Assignment::Command command, Assignment::Type type, Assignment::Location location = Assignment::GlobalLocation); @@ -45,7 +45,7 @@ public: ~Assignment(); - Assignment::Direction getDirection() const { return _direction; } + Assignment::Command getCommand() const { return _command; } Assignment::Type getType() const { return _type; } Assignment::Location getLocation() const { return _location; } const timeval& getTime() const { return _time; } @@ -65,7 +65,7 @@ public: void setCreateTimeToNow() { gettimeofday(&_time, NULL); } private: - Assignment::Direction _direction; /// the direction of the assignment (Create, Deploy, Request) + Assignment::Command _command; /// the command for this assignment (Create, Deploy, Request) Assignment::Type _type; /// the type of the assignment, defines what the assignee will do Assignment::Location _location; /// the location of the assignment, allows a domain to preferentially use local ACs sockaddr* _attachedPublicSocket; /// pointer to a public socket that relates to assignment, depends on direction diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index a51cf12ab3..50853c1c93 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -382,7 +382,7 @@ const sockaddr_in GLOBAL_ASSIGNMENT_SOCKET = socketForHostnameAndHostOrderPort(G void NodeList::sendAssignment(Assignment& assignment) { unsigned char assignmentPacket[MAX_PACKET_SIZE]; - PACKET_TYPE assignmentPacketType = assignment.getDirection() == Assignment::CreateDirection + PACKET_TYPE assignmentPacketType = assignment.getCommand() == Assignment::CreateCommand ? PACKET_TYPE_CREATE_ASSIGNMENT : PACKET_TYPE_REQUEST_ASSIGNMENT;