History

Merge pull request #6383 from birarda/goodbye-packet

send a hopeful disconnect packet from ACs and Interface

Seth Alves committed 11 years ago

Commit 36af3152 parents 8dcf245 584e35e16 files · +169 −141Browse files

Showing the changes to interface/src/Application.cpp (1 of 16 files). Show all

Unified · Split

interface/src/Application.cpp+10−4
@@ -804,8 +804,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 803 unmodified lines
804804
805805 void Application::aboutToQuit() {
806806 emit beforeAboutToQuit();
807+
807808 getActiveDisplayPlugin()->deactivate();
809+
808810 _aboutToQuit = true;
811+
809812 cleanupBeforeQuit();
810813 }
811814
@@ -831,8 +834,14 @@ void Application::cleanupBeforeQuit() { · 19 unmodified lines
831834
832835 _entities.clear(); // this will allow entity scripts to properly shutdown
833836
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+
834843 // 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);
836845
837846 _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts
838847 ScriptEngine::stopAllScripts(this); // stop all currently running global scripts
@@ -852,9 +861,6 @@ void Application::cleanupBeforeQuit() { · 13 unmodified lines
852861 saveSettings();
853862 _window->saveGeometry();
854863
855− // let the avatar mixer know we're out
856− MyAvatar::sendKillAvatar();
857−
858864 // stop the AudioClient
859865 QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
860866 "stop", Qt::BlockingQueuedConnection);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t