Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all
Unified · Split
| @@ -167,7 +167,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 166 unmodified lines | |||
| 167 | _applicationOverlay(), | 167 | _applicationOverlay(), |
| 168 | _runningScriptsWidget(new RunningScriptsWidget(_window)), | 168 | _runningScriptsWidget(new RunningScriptsWidget(_window)), |
| 169 | _runningScriptsWidgetWasVisible(false), | 169 | _runningScriptsWidgetWasVisible(false), |
| 170 | _trayIcon(new QSystemTrayIcon(_window)) | 170 | _trayIcon(new QSystemTrayIcon(_window)), |
| 171 | _lastNackTime(usecTimestampNow()) | ||
| 171 | { | 172 | { |
| 172 | // read the ApplicationInfo.ini file for Name/Version/Domain information | 173 | // read the ApplicationInfo.ini file for Name/Version/Domain information |
| 173 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); | 174 | QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat); |
| @@ -2091,7 +2092,63 @@ void Application::updateMyAvatar(float deltaTime) { · 1917 unmodified lines | |||
| 2091 | _lastQueriedViewFrustum = _viewFrustum; | 2092 | _lastQueriedViewFrustum = _viewFrustum; |
| 2092 | } | 2093 | } |
| 2093 | } | 2094 | } |
| 2095 | |||
| 2096 | // sent a nack packet containing missing sequence numbers of received packets | ||
| 2097 | { | ||
| 2098 | quint64 now = usecTimestampNow(); | ||
| 2099 | quint64 sinceLastNack = now - _lastNackTime; | ||
| 2100 | const quint64 TOO_LONG_SINCE_LAST_NACK = 100 * MSECS_PER_SECOND; | ||
| 2101 | if (sinceLastNack > TOO_LONG_SINCE_LAST_NACK) { | ||
| 2102 | _lastNackTime = now; | ||
| 2103 | |||
| 2104 | //_octreeServerSceneStats- | ||
| 2105 | } | ||
| 2094 | } | 2106 | } |
| 2107 | } | ||
| 2108 | |||
| 2109 | |||
| 2110 | void Application::sendNack() { | ||
| 2111 | /* | ||
| 2112 | // now that we know the node ID, let's add these stats to the stats for that node... | ||
| 2113 | _octreeSceneStatsLock.lockForWrite(); | ||
| 2114 | if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) { | ||
| 2115 | OctreeSceneStats& stats = _octreeServerSceneStats[nodeUUID]; | ||
| 2116 | stats.trackIncomingOctreePacket(packet, wasStatsPacket, sendingNode->getClockSkewUsec()); | ||
| 2117 | } | ||
| 2118 | _octreeSceneStatsLock.unlock(); | ||
| 2119 | */ | ||
| 2120 | |||
| 2121 | char packet[MAX_PACKET_SIZE]; | ||
| 2122 | NodeList* nodeList = NodeList::getInstance(); | ||
| 2123 | |||
| 2124 | // iterates thru all nodes in NodeList | ||
| 2125 | foreach(const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) { | ||
| 2126 | |||
| 2127 | char* dataAt = packet; | ||
| 2128 | int bytesRemaining = MAX_PACKET_SIZE; | ||
| 2129 | |||
| 2130 | int numBytesPacketHeader = populatePacketHeader(packet, PacketTypeOctreeDataNack, node->getUUID()); | ||
| 2131 | dataAt += numBytesPacketHeader; | ||
| 2132 | bytesRemaining -= numBytesPacketHeader; | ||
| 2133 | |||
| 2134 | |||
| 2135 | |||
| 2136 | uint16_t numSequenceNumbers; | ||
| 2137 | |||
| 2138 | |||
| 2139 | |||
| 2140 | |||
| 2141 | OctreeSceneStats& stats = _octreeServerSceneStats[node->getUUID()]; | ||
| 2142 | int numSequenceNumbersAvailable = stats.getNumSequenceNumberToNack(); | ||
| 2143 | |||
| 2144 | |||
| 2145 | // make sure we still have an active socket | ||
| 2146 | nodeList->writeUnverifiedDatagram(reinterpret_cast<const char*>(queryPacket), packetLength, node); | ||
| 2147 | } | ||
| 2148 | } | ||
| 2149 | |||
| 2150 | |||
| 2151 | |||
| 2095 | 2152 | ||
| 2096 | void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { | 2153 | void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { |
| 2097 | 2154 | ||