Showing the changes to interface/src/Application.cpp (1 of 42 files). Show all
Unified · Split
| @@ -46,7 +46,7 @@ · 45 unmodified lines | |||
| 46 | #include <QFileDialog> | 46 | #include <QFileDialog> |
| 47 | #include <QDesktopServices> | 47 | #include <QDesktopServices> |
| 48 | 48 | ||
| 49 | #include <AgentTypes.h> | 49 | #include <NodeTypes.h> |
| 50 | #include <AudioInjectionManager.h> | 50 | #include <AudioInjectionManager.h> |
| 51 | #include <AudioInjector.h> | 51 | #include <AudioInjector.h> |
| 52 | #include <Logstash.h> | 52 | #include <Logstash.h> |
| @@ -73,7 +73,7 @@ static char STAR_CACHE_FILE[] = "cachedStars.txt"; · 20 unmodified lines | |||
| 73 | 73 | ||
| 74 | static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored | 74 | static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored |
| 75 | 75 | ||
| 76 | const glm::vec3 START_LOCATION(4.f, 0.f, 5.f); // Where one's own agent begins in the world | 76 | const glm::vec3 START_LOCATION(4.f, 0.f, 5.f); // Where one's own node begins in the world |
| 77 | // (will be overwritten if avatar data file is found) | 77 | // (will be overwritten if avatar data file is found) |
| 78 | 78 | ||
| 79 | const int IDLE_SIMULATE_MSECS = 16; // How often should call simulate and other stuff | 79 | const int IDLE_SIMULATE_MSECS = 16; // How often should call simulate and other stuff |
| @@ -211,11 +211,11 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 131 unmodified lines | |||
| 211 | listenPort = atoi(portStr); | 211 | listenPort = atoi(portStr); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | AgentList::createInstance(AGENT_TYPE_AVATAR, listenPort); | 214 | NodeList::createInstance(NODE_TYPE_AGENT, listenPort); |
| 215 | 215 | ||
| 216 | _enableNetworkThread = !cmdOptionExists(argc, constArgv, "--nonblocking"); | 216 | _enableNetworkThread = !cmdOptionExists(argc, constArgv, "--nonblocking"); |
| 217 | if (!_enableNetworkThread) { | 217 | if (!_enableNetworkThread) { |
| 218 | AgentList::getInstance()->getAgentSocket()->setBlocking(false); | 218 | NodeList::getInstance()->getNodeSocket()->setBlocking(false); |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | const char* domainIP = getCmdOption(argc, constArgv, "--domain"); | 221 | const char* domainIP = getCmdOption(argc, constArgv, "--domain"); |
| @@ -234,21 +234,21 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 12 unmodified lines | |||
| 234 | // Voxel File. | 234 | // Voxel File. |
| 235 | _voxelsFilename = getCmdOption(argc, constArgv, "-i"); | 235 | _voxelsFilename = getCmdOption(argc, constArgv, "-i"); |
| 236 | 236 | ||
| 237 | // the callback for our instance of AgentList is attachNewHeadToAgent | 237 | // the callback for our instance of NodeList is attachNewHeadToNode |
| 238 | AgentList::getInstance()->linkedDataCreateCallback = &attachNewHeadToAgent; | 238 | NodeList::getInstance()->linkedDataCreateCallback = &attachNewHeadToNode; |
| 239 | 239 | ||
| 240 | #ifdef _WIN32 | 240 | #ifdef _WIN32 |
| 241 | WSADATA WsaData; | 241 | WSADATA WsaData; |
| 242 | int wsaresult = WSAStartup(MAKEWORD(2,2), &WsaData); | 242 | int wsaresult = WSAStartup(MAKEWORD(2,2), &WsaData); |
| 243 | #endif | 243 | #endif |
| 244 | 244 | ||
| 245 | // tell the AgentList instance who to tell the domain server we care about | 245 | // tell the NodeList instance who to tell the domain server we care about |
| 246 | const char agentTypesOfInterest[] = {AGENT_TYPE_AUDIO_MIXER, AGENT_TYPE_AVATAR_MIXER, AGENT_TYPE_VOXEL_SERVER}; | 246 | const char nodeTypesOfInterest[] = {NODE_TYPE_AUDIO_MIXER, NODE_TYPE_AVATAR_MIXER, NODE_TYPE_VOXEL_SERVER}; |
| 247 | AgentList::getInstance()->setAgentTypesOfInterest(agentTypesOfInterest, sizeof(agentTypesOfInterest)); | 247 | NodeList::getInstance()->setNodeTypesOfInterest(nodeTypesOfInterest, sizeof(nodeTypesOfInterest)); |
| 248 | 248 | ||
| 249 | // start the agentList threads | 249 | // start the nodeList threads |
| 250 | AgentList::getInstance()->startSilentAgentRemovalThread(); | 250 | NodeList::getInstance()->startSilentNodeRemovalThread(); |
| 251 | AgentList::getInstance()->startPingUnknownAgentsThread(); | 251 | NodeList::getInstance()->startPingUnknownNodesThread(); |
| 252 | 252 | ||
| 253 | _window->setCentralWidget(_glWidget); | 253 | _window->setCentralWidget(_glWidget); |
| 254 | 254 | ||
| @@ -483,17 +483,17 @@ void Application::resizeGL(int width, int height) { · 228 unmodified lines | |||
| 483 | glLoadIdentity(); | 483 | glLoadIdentity(); |
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | void Application::broadcastToAgents(unsigned char* data, size_t bytes, const char type) { | 486 | void Application::broadcastToNodes(unsigned char* data, size_t bytes, const char type) { |
| 487 | 487 | ||
| 488 | int n = AgentList::getInstance()->broadcastToAgents(data, bytes, &type, 1); | 488 | int n = NodeList::getInstance()->broadcastToNodes(data, bytes, &type, 1); |
| 489 | 489 | ||
| 490 | BandwidthMeter::ChannelIndex channel; | 490 | BandwidthMeter::ChannelIndex channel; |
| 491 | switch (type) { | 491 | switch (type) { |
| 492 | case AGENT_TYPE_AVATAR: | 492 | case NODE_TYPE_AGENT: |
| 493 | case AGENT_TYPE_AVATAR_MIXER: | 493 | case NODE_TYPE_AVATAR_MIXER: |
| 494 | channel = BandwidthMeter::AVATARS; | 494 | channel = BandwidthMeter::AVATARS; |
| 495 | break; | 495 | break; |
| 496 | case AGENT_TYPE_VOXEL_SERVER: | 496 | case NODE_TYPE_VOXEL_SERVER: |
| 497 | channel = BandwidthMeter::VOXELS; | 497 | channel = BandwidthMeter::VOXELS; |
| 498 | break; | 498 | break; |
| 499 | default: | 499 | default: |
| @@ -506,7 +506,7 @@ void Application::sendVoxelServerAddScene() { · 6 unmodified lines | |||
| 506 | char message[100]; | 506 | char message[100]; |
| 507 | sprintf(message,"%c%s",'Z',"add scene"); | 507 | sprintf(message,"%c%s",'Z',"add scene"); |
| 508 | int messageSize = strlen(message) + 1; | 508 | int messageSize = strlen(message) + 1; |
| 509 | broadcastToAgents((unsigned char*)message, messageSize, AGENT_TYPE_VOXEL_SERVER); | 509 | broadcastToNodes((unsigned char*)message, messageSize, NODE_TYPE_VOXEL_SERVER); |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | void Application::keyPressEvent(QKeyEvent* event) { | 512 | void Application::keyPressEvent(QKeyEvent* event) { |
| @@ -879,13 +879,13 @@ void Application::wheelEvent(QWheelEvent* event) { · 366 unmodified lines | |||
| 879 | 879 | ||
| 880 | void sendPingPackets() { | 880 | void sendPingPackets() { |
| 881 | 881 | ||
| 882 | char agentTypesOfInterest[] = {AGENT_TYPE_VOXEL_SERVER, AGENT_TYPE_AUDIO_MIXER, AGENT_TYPE_AVATAR_MIXER}; | 882 | char nodeTypesOfInterest[] = {NODE_TYPE_VOXEL_SERVER, NODE_TYPE_AUDIO_MIXER, NODE_TYPE_AVATAR_MIXER}; |
| 883 | long long currentTime = usecTimestampNow(); | 883 | long long currentTime = usecTimestampNow(); |
| 884 | char pingPacket[1 + sizeof(currentTime)]; | 884 | char pingPacket[1 + sizeof(currentTime)]; |
| 885 | pingPacket[0] = PACKET_HEADER_PING; | 885 | pingPacket[0] = PACKET_HEADER_PING; |
| 886 | 886 | ||
| 887 | memcpy(&pingPacket[1], ¤tTime, sizeof(currentTime)); | 887 | memcpy(&pingPacket[1], ¤tTime, sizeof(currentTime)); |
| 888 | AgentList::getInstance()->broadcastToAgents((unsigned char*)pingPacket, 1 + sizeof(currentTime), agentTypesOfInterest, 3); | 888 | NodeList::getInstance()->broadcastToNodes((unsigned char*)pingPacket, 1 + sizeof(currentTime), nodeTypesOfInterest, 3); |
| 889 | 889 | ||
| 890 | } | 890 | } |
| 891 | 891 | ||
| @@ -911,8 +911,8 @@ void Application::timer() { · 19 unmodified lines | |||
| 911 | _serialHeadSensor.pair(); | 911 | _serialHeadSensor.pair(); |
| 912 | } | 912 | } |
| 913 | 913 | ||
| 914 | // ask the agent list to check in with the domain server | 914 | // ask the node list to check in with the domain server |
| 915 | AgentList::getInstance()->sendDomainServerCheckIn(); | 915 | NodeList::getInstance()->sendDomainServerCheckIn(); |
| 916 | } | 916 | } |
| 917 | 917 | ||
| 918 | static glm::vec3 getFaceVector(BoxFace face) { | 918 | static glm::vec3 getFaceVector(BoxFace face) { |
| @@ -981,9 +981,9 @@ void Application::terminate() { · 62 unmodified lines | |||
| 981 | } | 981 | } |
| 982 | 982 | ||
| 983 | void Application::sendAvatarVoxelURLMessage(const QUrl& url) { | 983 | void Application::sendAvatarVoxelURLMessage(const QUrl& url) { |
| 984 | uint16_t ownerID = AgentList::getInstance()->getOwnerID(); | 984 | uint16_t ownerID = NodeList::getInstance()->getOwnerID(); |
| 985 | 985 | ||
| 986 | if (ownerID == UNKNOWN_AGENT_ID) { | 986 | if (ownerID == UNKNOWN_NODE_ID) { |
| 987 | return; // we don't yet know who we are | 987 | return; // we don't yet know who we are |
| 988 | } | 988 | } |
| 989 | QByteArray message; | 989 | QByteArray message; |
| @@ -991,7 +991,7 @@ void Application::sendAvatarVoxelURLMessage(const QUrl& url) { · 1 unmodified line | |||
| 991 | message.append((const char*)&ownerID, sizeof(ownerID)); | 991 | message.append((const char*)&ownerID, sizeof(ownerID)); |
| 992 | message.append(url.toEncoded()); | 992 | message.append(url.toEncoded()); |
| 993 | 993 | ||
| 994 | broadcastToAgents((unsigned char*)message.data(), message.size(), AGENT_TYPE_AVATAR_MIXER); | 994 | broadcastToNodes((unsigned char*)message.data(), message.size(), NODE_TYPE_AVATAR_MIXER); |
| 995 | } | 995 | } |
| 996 | 996 | ||
| 997 | void Application::processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes) { | 997 | void Application::processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes) { |
| @@ -999,17 +999,17 @@ void Application::processAvatarVoxelURLMessage(unsigned char *packetData, size_t · 1 unmodified line | |||
| 999 | packetData++; | 999 | packetData++; |
| 1000 | dataBytes--; | 1000 | dataBytes--; |
| 1001 | 1001 | ||
| 1002 | // read the agent id | 1002 | // read the node id |
| 1003 | uint16_t agentID = *(uint16_t*)packetData; | 1003 | uint16_t nodeID = *(uint16_t*)packetData; |
| 1004 | packetData += sizeof(agentID); | 1004 | packetData += sizeof(nodeID); |
| 1005 | dataBytes -= sizeof(agentID); | 1005 | dataBytes -= sizeof(nodeID); |
| 1006 | 1006 | ||
| 1007 | // make sure the agent exists | 1007 | // make sure the node exists |
| 1008 | Agent* agent = AgentList::getInstance()->agentWithID(agentID); | 1008 | Node* node = NodeList::getInstance()->nodeWithID(nodeID); |
| 1009 | if (!agent || !agent->getLinkedData()) { | 1009 | if (!node || !node->getLinkedData()) { |
| 1010 | return; | 1010 | return; |
| 1011 | } | 1011 | } |
| 1012 | Avatar* avatar = static_cast<Avatar*>(agent->getLinkedData()); | 1012 | Avatar* avatar = static_cast<Avatar*>(node->getLinkedData()); |
| 1013 | if (!avatar->isInitialized()) { | 1013 | if (!avatar->isInitialized()) { |
| 1014 | return; // wait until initialized | 1014 | return; // wait until initialized |
| 1015 | } | 1015 | } |
| @@ -1224,7 +1224,7 @@ void Application::sendVoxelEditMessage(PACKET_HEADER header, VoxelDetail& detail · 208 unmodified lines | |||
| 1224 | int sizeOut; | 1224 | int sizeOut; |
| 1225 | 1225 | ||
| 1226 | if (createVoxelEditMessage(header, 0, 1, &detail, bufferOut, sizeOut)){ | 1226 | if (createVoxelEditMessage(header, 0, 1, &detail, bufferOut, sizeOut)){ |
| 1227 | Application::broadcastToAgents(bufferOut, sizeOut, AGENT_TYPE_VOXEL_SERVER); | 1227 | Application::broadcastToNodes(bufferOut, sizeOut, NODE_TYPE_VOXEL_SERVER); |
| 1228 | delete[] bufferOut; | 1228 | delete[] bufferOut; |
| 1229 | } | 1229 | } |
| 1230 | } | 1230 | } |
| @@ -1305,7 +1305,7 @@ bool Application::sendVoxelsOperation(VoxelNode* node, void* extraData) { · 74 unmodified lines | |||
| 1305 | 1305 | ||
| 1306 | // if we have room don't have room in the buffer, then send the previously generated message first | 1306 | // if we have room don't have room in the buffer, then send the previously generated message first |
| 1307 | if (args->bufferInUse + codeAndColorLength > MAXIMUM_EDIT_VOXEL_MESSAGE_SIZE) { | 1307 | if (args->bufferInUse + codeAndColorLength > MAXIMUM_EDIT_VOXEL_MESSAGE_SIZE) { |
| 1308 | broadcastToAgents(args->messageBuffer, args->bufferInUse, AGENT_TYPE_VOXEL_SERVER); | 1308 | broadcastToNodes(args->messageBuffer, args->bufferInUse, NODE_TYPE_VOXEL_SERVER); |
| 1309 | args->bufferInUse = sizeof(PACKET_HEADER_SET_VOXEL_DESTRUCTIVE) + sizeof(unsigned short int); // reset | 1309 | args->bufferInUse = sizeof(PACKET_HEADER_SET_VOXEL_DESTRUCTIVE) + sizeof(unsigned short int); // reset |
| 1310 | } | 1310 | } |
| 1311 | 1311 | ||
| @@ -1386,7 +1386,7 @@ void Application::importVoxels() { · 74 unmodified lines | |||
| 1386 | 1386 | ||
| 1387 | // If we have voxels left in the packet, then send the packet | 1387 | // If we have voxels left in the packet, then send the packet |
| 1388 | if (args.bufferInUse > (sizeof(PACKET_HEADER_SET_VOXEL_DESTRUCTIVE) + sizeof(unsigned short int))) { | 1388 | if (args.bufferInUse > (sizeof(PACKET_HEADER_SET_VOXEL_DESTRUCTIVE) + sizeof(unsigned short int))) { |
| 1389 | broadcastToAgents(args.messageBuffer, args.bufferInUse, AGENT_TYPE_VOXEL_SERVER); | 1389 | broadcastToNodes(args.messageBuffer, args.bufferInUse, NODE_TYPE_VOXEL_SERVER); |
| 1390 | } | 1390 | } |
| 1391 | 1391 | ||
| 1392 | if (calculatedOctCode) { | 1392 | if (calculatedOctCode) { |
| @@ -1438,7 +1438,7 @@ void Application::pasteVoxels() { · 45 unmodified lines | |||
| 1438 | 1438 | ||
| 1439 | // If we have voxels left in the packet, then send the packet | 1439 | // If we have voxels left in the packet, then send the packet |
| 1440 | if (args.bufferInUse > (sizeof(PACKET_HEADER_SET_VOXEL_DESTRUCTIVE) + sizeof(unsigned short int))) { | 1440 | if (args.bufferInUse > (sizeof(PACKET_HEADER_SET_VOXEL_DESTRUCTIVE) + sizeof(unsigned short int))) { |
| 1441 | broadcastToAgents(args.messageBuffer, args.bufferInUse, AGENT_TYPE_VOXEL_SERVER); | 1441 | broadcastToNodes(args.messageBuffer, args.bufferInUse, NODE_TYPE_VOXEL_SERVER); |
| 1442 | } | 1442 | } |
| 1443 | 1443 | ||
| 1444 | if (calculatedOctCode) { | 1444 | if (calculatedOctCode) { |
| @@ -1831,7 +1831,7 @@ void Application::update(float deltaTime) { · 386 unmodified lines | |||
| 1831 | 1831 | ||
| 1832 | // Update transmitter | 1832 | // Update transmitter |
| 1833 | 1833 | ||
| 1834 | // Sample hardware, update view frustum if needed, and send avatar data to mixer/agents | 1834 | // Sample hardware, update view frustum if needed, and send avatar data to mixer/nodes |
| 1835 | updateAvatar(deltaTime); | 1835 | updateAvatar(deltaTime); |
| 1836 | 1836 | ||
| 1837 | // read incoming packets from network | 1837 | // read incoming packets from network |
| @@ -1840,11 +1840,11 @@ void Application::update(float deltaTime) { · 2 unmodified lines | |||
| 1840 | } | 1840 | } |
| 1841 | 1841 | ||
| 1842 | //loop through all the other avatars and simulate them... | 1842 | //loop through all the other avatars and simulate them... |
| 1843 | AgentList* agentList = AgentList::getInstance(); | 1843 | NodeList* nodeList = NodeList::getInstance(); |
| 1844 | agentList->lock(); | 1844 | nodeList->lock(); |
| 1845 | for(AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) { | 1845 | for(NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { |
| 1846 | if (agent->getLinkedData() != NULL) { | 1846 | if (node->getLinkedData() != NULL) { |
| 1847 | Avatar *avatar = (Avatar *)agent->getLinkedData(); | 1847 | Avatar *avatar = (Avatar *)node->getLinkedData(); |
| 1848 | if (!avatar->isInitialized()) { | 1848 | if (!avatar->isInitialized()) { |
| 1849 | avatar->init(); | 1849 | avatar->init(); |
| 1850 | } | 1850 | } |
| @@ -1852,7 +1852,7 @@ void Application::update(float deltaTime) { · 1 unmodified line | |||
| 1852 | avatar->setMouseRay(mouseRayOrigin, mouseRayDirection); | 1852 | avatar->setMouseRay(mouseRayOrigin, mouseRayDirection); |
| 1853 | } | 1853 | } |
| 1854 | } | 1854 | } |
| 1855 | agentList->unlock(); | 1855 | nodeList->unlock(); |
| 1856 | 1856 | ||
| 1857 | // Simulate myself | 1857 | // Simulate myself |
| 1858 | if (_gravityUse->isChecked()) { | 1858 | if (_gravityUse->isChecked()) { |
| @@ -1974,19 +1974,19 @@ void Application::updateAvatar(float deltaTime) { · 115 unmodified lines | |||
| 1974 | _myAvatar.setCameraNearClip(_viewFrustum.getNearClip()); | 1974 | _myAvatar.setCameraNearClip(_viewFrustum.getNearClip()); |
| 1975 | _myAvatar.setCameraFarClip(_viewFrustum.getFarClip()); | 1975 | _myAvatar.setCameraFarClip(_viewFrustum.getFarClip()); |
| 1976 | 1976 | ||
| 1977 | AgentList* agentList = AgentList::getInstance(); | 1977 | NodeList* nodeList = NodeList::getInstance(); |
| 1978 | if (agentList->getOwnerID() != UNKNOWN_AGENT_ID) { | 1978 | if (nodeList->getOwnerID() != UNKNOWN_NODE_ID) { |
| 1979 | // if I know my ID, send head/hand data to the avatar mixer and voxel server | 1979 | // if I know my ID, send head/hand data to the avatar mixer and voxel server |
| 1980 | unsigned char broadcastString[200]; | 1980 | unsigned char broadcastString[200]; |
| 1981 | unsigned char* endOfBroadcastStringWrite = broadcastString; | 1981 | unsigned char* endOfBroadcastStringWrite = broadcastString; |
| 1982 | 1982 | ||
| 1983 | *(endOfBroadcastStringWrite++) = PACKET_HEADER_HEAD_DATA; | 1983 | *(endOfBroadcastStringWrite++) = PACKET_HEADER_HEAD_DATA; |
| 1984 | endOfBroadcastStringWrite += packAgentId(endOfBroadcastStringWrite, agentList->getOwnerID()); | 1984 | endOfBroadcastStringWrite += packNodeId(endOfBroadcastStringWrite, nodeList->getOwnerID()); |
| 1985 | 1985 | ||
| 1986 | endOfBroadcastStringWrite += _myAvatar.getBroadcastData(endOfBroadcastStringWrite); | 1986 | endOfBroadcastStringWrite += _myAvatar.getBroadcastData(endOfBroadcastStringWrite); |
| 1987 | 1987 | ||
| 1988 | broadcastToAgents(broadcastString, endOfBroadcastStringWrite - broadcastString, AGENT_TYPE_VOXEL_SERVER); | 1988 | broadcastToNodes(broadcastString, endOfBroadcastStringWrite - broadcastString, NODE_TYPE_VOXEL_SERVER); |
| 1989 | broadcastToAgents(broadcastString, endOfBroadcastStringWrite - broadcastString, AGENT_TYPE_AVATAR_MIXER); | 1989 | broadcastToNodes(broadcastString, endOfBroadcastStringWrite - broadcastString, NODE_TYPE_AVATAR_MIXER); |
| 1990 | 1990 | ||
| 1991 | // once in a while, send my voxel url | 1991 | // once in a while, send my voxel url |
| 1992 | const float AVATAR_VOXEL_URL_SEND_INTERVAL = 1.0f; // seconds | 1992 | const float AVATAR_VOXEL_URL_SEND_INTERVAL = 1.0f; // seconds |
| @@ -1995,7 +1995,7 @@ void Application::updateAvatar(float deltaTime) { · 2 unmodified lines | |||
| 1995 | } | 1995 | } |
| 1996 | } | 1996 | } |
| 1997 | 1997 | ||
| 1998 | // If I'm in paint mode, send a voxel out to VOXEL server agents. | 1998 | // If I'm in paint mode, send a voxel out to VOXEL server nodes. |
| 1999 | if (_paintOn) { | 1999 | if (_paintOn) { |
| 2000 | 2000 | ||
| 2001 | glm::vec3 avatarPos = _myAvatar.getPosition(); | 2001 | glm::vec3 avatarPos = _myAvatar.getPosition(); |
| @@ -2300,12 +2300,12 @@ void Application::displaySide(Camera& whichCamera) { · 298 unmodified lines | |||
| 2300 | } | 2300 | } |
| 2301 | 2301 | ||
| 2302 | if (_renderAvatarsOn->isChecked()) { | 2302 | if (_renderAvatarsOn->isChecked()) { |
| 2303 | // Render avatars of other agents | 2303 | // Render avatars of other nodes |
| 2304 | AgentList* agentList = AgentList::getInstance(); | 2304 | NodeList* nodeList = NodeList::getInstance(); |
| 2305 | agentList->lock(); | 2305 | nodeList->lock(); |
| 2306 | for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) { | 2306 | for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { |
| 2307 | if (agent->getLinkedData() != NULL && agent->getType() == AGENT_TYPE_AVATAR) { | 2307 | if (node->getLinkedData() != NULL && node->getType() == NODE_TYPE_AGENT) { |
| 2308 | Avatar *avatar = (Avatar *)agent->getLinkedData(); | 2308 | Avatar *avatar = (Avatar *)node->getLinkedData(); |
| 2309 | if (!avatar->isInitialized()) { | 2309 | if (!avatar->isInitialized()) { |
| 2310 | avatar->init(); | 2310 | avatar->init(); |
| 2311 | } | 2311 | } |
| @@ -2313,7 +2313,7 @@ void Application::displaySide(Camera& whichCamera) { · 1 unmodified line | |||
| 2313 | avatar->setDisplayingLookatVectors(_renderLookatOn->isChecked()); | 2313 | avatar->setDisplayingLookatVectors(_renderLookatOn->isChecked()); |
| 2314 | } | 2314 | } |
| 2315 | } | 2315 | } |
| 2316 | agentList->unlock(); | 2316 | nodeList->unlock(); |
| 2317 | 2317 | ||
| 2318 | // Render my own Avatar | 2318 | // Render my own Avatar |
| 2319 | if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { | 2319 | if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| @@ -2396,17 +2396,17 @@ void Application::displayOverlay() { · 76 unmodified lines | |||
| 2396 | 2396 | ||
| 2397 | // Stats at upper right of screen about who domain server is telling us about | 2397 | // Stats at upper right of screen about who domain server is telling us about |
| 2398 | glPointSize(1.0f); | 2398 | glPointSize(1.0f); |
| 2399 | char agents[100]; | 2399 | char nodes[100]; |
| 2400 | 2400 | ||
| 2401 | AgentList* agentList = AgentList::getInstance(); | 2401 | NodeList* nodeList = NodeList::getInstance(); |
| 2402 | int totalAvatars = 0, totalServers = 0; | 2402 | int totalAvatars = 0, totalServers = 0; |
| 2403 | 2403 | ||
| 2404 | for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) { | 2404 | for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { |
| 2405 | agent->getType() == AGENT_TYPE_AVATAR ? totalAvatars++ : totalServers++; | 2405 | node->getType() == NODE_TYPE_AGENT ? totalAvatars++ : totalServers++; |
| 2406 | } | 2406 | } |
| 2407 | 2407 | ||
| 2408 | sprintf(agents, "Servers: %d, Avatars: %d\n", totalServers, totalAvatars); | 2408 | sprintf(nodes, "Servers: %d, Avatars: %d\n", totalServers, totalAvatars); |
| 2409 | drawtext(_glWidget->width() - 150, 20, 0.10, 0, 1.0, 0, agents, 1, 0, 0); | 2409 | drawtext(_glWidget->width() - 150, 20, 0.10, 0, 1.0, 0, nodes, 1, 0, 0); |
| 2410 | 2410 | ||
| 2411 | if (_paintOn) { | 2411 | if (_paintOn) { |
| 2412 | 2412 | ||
| @@ -2434,14 +2434,14 @@ void Application::displayStats() { · 21 unmodified lines | |||
| 2434 | if (_testPing->isChecked()) { | 2434 | if (_testPing->isChecked()) { |
| 2435 | int pingAudio = 0, pingAvatar = 0, pingVoxel = 0; | 2435 | int pingAudio = 0, pingAvatar = 0, pingVoxel = 0; |
| 2436 | 2436 | ||
| 2437 | AgentList *agentList = AgentList::getInstance(); | 2437 | NodeList *nodeList = NodeList::getInstance(); |
| 2438 | Agent *audioMixerAgent = agentList->soloAgentOfType(AGENT_TYPE_AUDIO_MIXER); | 2438 | Node *audioMixerNode = nodeList->soloNodeOfType(NODE_TYPE_AUDIO_MIXER); |
| 2439 | Agent *avatarMixerAgent = agentList->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER); | 2439 | Node *avatarMixerNode = nodeList->soloNodeOfType(NODE_TYPE_AVATAR_MIXER); |
| 2440 | Agent *voxelServerAgent = agentList->soloAgentOfType(AGENT_TYPE_VOXEL_SERVER); | 2440 | Node *voxelServerNode = nodeList->soloNodeOfType(NODE_TYPE_VOXEL_SERVER); |
| 2441 | 2441 | ||
| 2442 | pingAudio = audioMixerAgent ? audioMixerAgent->getPingMs() : 0; | 2442 | pingAudio = audioMixerNode ? audioMixerNode->getPingMs() : 0; |
| 2443 | pingAvatar = avatarMixerAgent ? avatarMixerAgent->getPingMs() : 0; | 2443 | pingAvatar = avatarMixerNode ? avatarMixerNode->getPingMs() : 0; |
| 2444 | pingVoxel = voxelServerAgent ? voxelServerAgent->getPingMs() : 0; | 2444 | pingVoxel = voxelServerNode ? voxelServerNode->getPingMs() : 0; |
| 2445 | 2445 | ||
| 2446 | char pingStats[200]; | 2446 | char pingStats[200]; |
| 2447 | sprintf(pingStats, "Ping audio/avatar/voxel: %d / %d / %d ", pingAudio, pingAvatar, pingVoxel); | 2447 | sprintf(pingStats, "Ping audio/avatar/voxel: %d / %d / %d ", pingAudio, pingAvatar, pingVoxel); |
| @@ -2476,7 +2476,7 @@ void Application::displayStats() { · 28 unmodified lines | |||
| 2476 | voxelStats << "Voxels Bits per Colored: " << voxelsBytesPerColored * 8; | 2476 | voxelStats << "Voxels Bits per Colored: " << voxelsBytesPerColored * 8; |
| 2477 | drawtext(10, statsVerticalOffset + 310, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); | 2477 | drawtext(10, statsVerticalOffset + 310, 0.10f, 0, 1.0, 0, (char *)voxelStats.str().c_str()); |
| 2478 | 2478 | ||
| 2479 | Agent *avatarMixer = AgentList::getInstance()->soloAgentOfType(AGENT_TYPE_AVATAR_MIXER); | 2479 | Node *avatarMixer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_AVATAR_MIXER); |
| 2480 | char avatarMixerStats[200]; | 2480 | char avatarMixerStats[200]; |
| 2481 | 2481 | ||
| 2482 | if (avatarMixer) { | 2482 | if (avatarMixer) { |
| @@ -2847,13 +2847,13 @@ QAction* Application::checkedVoxelModeAction() const { · 364 unmodified lines | |||
| 2847 | return 0; | 2847 | return 0; |
| 2848 | } | 2848 | } |
| 2849 | 2849 | ||
| 2850 | void Application::attachNewHeadToAgent(Agent* newAgent) { | 2850 | void Application::attachNewHeadToNode(Node* newNode) { |
| 2851 | if (newAgent->getLinkedData() == NULL) { | 2851 | if (newNode->getLinkedData() == NULL) { |
| 2852 | newAgent->setLinkedData(new Avatar(newAgent)); | 2852 | newNode->setLinkedData(new Avatar(newNode)); |
| 2853 | } | 2853 | } |
| 2854 | } | 2854 | } |
| 2855 | 2855 | ||
| 2856 | // Receive packets from other agents/servers and decide what to do with them! | 2856 | // Receive packets from other nodes/servers and decide what to do with them! |
| 2857 | void* Application::networkReceive(void* args) { | 2857 | void* Application::networkReceive(void* args) { |
| 2858 | sockaddr senderAddress; | 2858 | sockaddr senderAddress; |
| 2859 | ssize_t bytesReceived; | 2859 | ssize_t bytesReceived; |
| @@ -2866,7 +2866,7 @@ void* Application::networkReceive(void* args) { · 6 unmodified lines | |||
| 2866 | app->_wantToKillLocalVoxels = false; | 2866 | app->_wantToKillLocalVoxels = false; |
| 2867 | } | 2867 | } |
| 2868 | 2868 | ||
| 2869 | if (AgentList::getInstance()->getAgentSocket()->receive(&senderAddress, app->_incomingPacket, &bytesReceived)) { | 2869 | if (NodeList::getInstance()->getNodeSocket()->receive(&senderAddress, app->_incomingPacket, &bytesReceived)) { |
| 2870 | app->_packetCount++; | 2870 | app->_packetCount++; |
| 2871 | app->_bytesCount += bytesReceived; | 2871 | app->_bytesCount += bytesReceived; |
| 2872 | 2872 | ||
| @@ -2889,7 +2889,7 @@ void* Application::networkReceive(void* args) { · 16 unmodified lines | |||
| 2889 | app->_environment.parseData(&senderAddress, app->_incomingPacket, bytesReceived); | 2889 | app->_environment.parseData(&senderAddress, app->_incomingPacket, bytesReceived); |
| 2890 | break; | 2890 | break; |
| 2891 | case PACKET_HEADER_BULK_AVATAR_DATA: | 2891 | case PACKET_HEADER_BULK_AVATAR_DATA: |
| 2892 | AgentList::getInstance()->processBulkAgentData(&senderAddress, | 2892 | NodeList::getInstance()->processBulkNodeData(&senderAddress, |
| 2893 | app->_incomingPacket, | 2893 | app->_incomingPacket, |
| 2894 | bytesReceived); | 2894 | bytesReceived); |
| 2895 | getInstance()->_bandwidthMeter.inputStream(BandwidthMeter::AVATARS).updateValue(bytesReceived); | 2895 | getInstance()->_bandwidthMeter.inputStream(BandwidthMeter::AVATARS).updateValue(bytesReceived); |
| @@ -2898,7 +2898,7 @@ void* Application::networkReceive(void* args) { · 2 unmodified lines | |||
| 2898 | processAvatarVoxelURLMessage(app->_incomingPacket, bytesReceived); | 2898 | processAvatarVoxelURLMessage(app->_incomingPacket, bytesReceived); |
| 2899 | break; | 2899 | break; |
| 2900 | default: | 2900 | default: |
| 2901 | AgentList::getInstance()->processAgentData(&senderAddress, app->_incomingPacket, bytesReceived); | 2901 | NodeList::getInstance()->processNodeData(&senderAddress, app->_incomingPacket, bytesReceived); |
| 2902 | break; | 2902 | break; |
| 2903 | } | 2903 | } |
| 2904 | } else if (!app->_enableNetworkThread) { | 2904 | } else if (!app->_enableNetworkThread) { |