cleanups, fail if packet-version mismatch

This commit is contained in:
Seth Alves 2016-10-05 13:54:09 -07:00
parent 35755ddcb1
commit 1dc52d3bf5
2 changed files with 9 additions and 8 deletions

View file

@ -113,8 +113,6 @@ ACClientApp::ACClientApp(int argc, char* argv[]) :
connect(&domainHandler, SIGNAL(hostnameChanged(const QString&)), SLOT(domainChanged(const QString&)));
// connect(&domainHandler, SIGNAL(resetting()), SLOT(resettingDomain()));
// connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(updateWindowTitle()));
// connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
// connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(clearDomainOctreeDetails()));
connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &ACClientApp::domainConnectionRefused);
@ -123,7 +121,7 @@ ACClientApp::ACClientApp(int argc, char* argv[]) :
connect(nodeList.data(), &NodeList::nodeActivated, this, &ACClientApp::nodeActivated);
// connect(nodeList.data(), &NodeList::uuidChanged, getMyAvatar(), &MyAvatar::setSessionUUID);
// connect(nodeList.data(), &NodeList::uuidChanged, this, &ACClientApp::setSessionUUID);
// connect(nodeList.data(), &NodeList::packetVersionMismatch, this, &ACClientApp::notifyPacketVersionMismatch);
connect(nodeList.data(), &NodeList::packetVersionMismatch, this, &ACClientApp::notifyPacketVersionMismatch);
nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer
<< NodeType::EntityServer << NodeType::AssetServer << NodeType::MessagesMixer);
@ -208,6 +206,13 @@ void ACClientApp::timedOut() {
finish(1);
}
void ACClientApp::notifyPacketVersionMismatch() {
if (_verbose) {
qDebug() << "packet version mismatch";
}
finish(1);
}
void ACClientApp::finish(int exitCode) {
auto nodeList = DependencyManager::get<NodeList>();

View file

@ -27,23 +27,19 @@ public:
ACClientApp(int argc, char* argv[]);
~ACClientApp();
const int stunFailureExitStatus { 1 };
const int iceFailureExitStatus { 2 };
const int domainPingExitStatus { 3 };
private slots:
void domainConnectionRefused(const QString& reasonMessage, int reasonCodeInt, const QString& extraInfo);
void domainChanged(const QString& domainHostname);
void nodeAdded(SharedNodePointer node);
void nodeActivated(SharedNodePointer node);
void nodeKilled(SharedNodePointer node);
void notifyPacketVersionMismatch();
private:
NodeList* _nodeList;
void timedOut();
void finish(int exitCode);
bool _verbose;
QTimer* _pingDomainTimer { nullptr };
bool _sawEntityServer { false };
bool _sawAudioMixer { false };