mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Commit to resolve requests made by @Daenyth discussed after the commit.
See https://github.com/Cockatrice/Cockatrice/pull/1340 for details.
This commit is contained in:
parent
62dc3a7ca3
commit
94942e1a92
5 changed files with 12 additions and 10 deletions
|
|
@ -35,7 +35,6 @@
|
|||
#include "QtNetwork/QNetworkInterface"
|
||||
#include <QCryptographicHash>
|
||||
|
||||
|
||||
#include "main.h"
|
||||
#include "window_main.h"
|
||||
#include "dlg_settings.h"
|
||||
|
|
@ -100,7 +99,7 @@ bool settingsValid()
|
|||
!settingsCache->getPicsPath().isEmpty();
|
||||
}
|
||||
|
||||
void generateClientID()
|
||||
QString const generateClientID()
|
||||
{
|
||||
QString macList;
|
||||
foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces())
|
||||
|
|
@ -110,7 +109,7 @@ void generateClientID()
|
|||
macList += interface.hardwareAddress() + ".";
|
||||
}
|
||||
QString strClientID = QCryptographicHash::hash(macList.toUtf8(), QCryptographicHash::Sha1).toHex().right(15);
|
||||
settingsCache->setClientID(strClientID);
|
||||
return strClientID;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
|
@ -220,7 +219,7 @@ int main(int argc, char *argv[])
|
|||
QIcon icon(":/resources/appicon.svg");
|
||||
ui.setWindowIcon(icon);
|
||||
|
||||
generateClientID(); //generate the users client id
|
||||
settingsCache->setClientID(generateClientID());
|
||||
qDebug() << "ClientID In Cache: " << settingsCache->getClientID();
|
||||
|
||||
ui.showMaximized();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue