send a hopeful disconnect packet from ACs and Interface
Showing the changes to interface/src/Application.cpp (1 of 16 files). Show all
Unified · Split
| @@ -804,8 +804,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 803 unmodified lines | |||
| 804 | 804 | ||
| 805 | void Application::aboutToQuit() { | 805 | void Application::aboutToQuit() { |
| 806 | emit beforeAboutToQuit(); | 806 | emit beforeAboutToQuit(); |
| 807 | |||
| 807 | getActiveDisplayPlugin()->deactivate(); | 808 | getActiveDisplayPlugin()->deactivate(); |
| 809 | |||
| 808 | _aboutToQuit = true; | 810 | _aboutToQuit = true; |
| 811 | |||
| 809 | cleanupBeforeQuit(); | 812 | cleanupBeforeQuit(); |
| 810 | } | 813 | } |
| 811 | 814 | ||
| @@ -831,8 +834,14 @@ void Application::cleanupBeforeQuit() { · 19 unmodified lines | |||
| 831 | 834 | ||
| 832 | _entities.clear(); // this will allow entity scripts to properly shutdown | 835 | _entities.clear(); // this will allow entity scripts to properly shutdown |
| 833 | 836 | ||
| 837 | auto nodeList = DependencyManager::get<NodeList>(); | ||
| 838 | |||
| 839 | // send the domain a disconnect packet, force stoppage of domain-server check-ins | ||
| 840 | nodeList->getDomainHandler().disconnect(); | ||
| 841 | nodeList->setIsShuttingDown(true); | ||
| 842 | |||
| 834 | // tell the packet receiver we're shutting down, so it can drop packets | 843 | // tell the packet receiver we're shutting down, so it can drop packets |
| 835 | DependencyManager::get<NodeList>()->getPacketReceiver().setShouldDropPackets(true); | 844 | nodeList->getPacketReceiver().setShouldDropPackets(true); |
| 836 | 845 | ||
| 837 | _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts | 846 | _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts |
| 838 | ScriptEngine::stopAllScripts(this); // stop all currently running global scripts | 847 | ScriptEngine::stopAllScripts(this); // stop all currently running global scripts |
| @@ -852,9 +861,6 @@ void Application::cleanupBeforeQuit() { · 13 unmodified lines | |||
| 852 | saveSettings(); | 861 | saveSettings(); |
| 853 | _window->saveGeometry(); | 862 | _window->saveGeometry(); |
| 854 | 863 | ||
| 855 | // let the avatar mixer know we're out | ||
| 856 | MyAvatar::sendKillAvatar(); | ||
| 857 | |||
| 858 | // stop the AudioClient | 864 | // stop the AudioClient |
| 859 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), | 865 | QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), |
| 860 | "stop", Qt::BlockingQueuedConnection); | 866 | "stop", Qt::BlockingQueuedConnection); |