From 72aea452d9a96bad125bd1e6cedb54948da103ec Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Tue, 9 Oct 2012 01:58:36 +0200 Subject: [PATCH] Added one more update mirror + slightly improved seeding of the PRNG. --- src/Config.h | 2 +- src/Dialog_Update.cpp | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Config.h b/src/Config.h index 34c651cc..a9dc164b 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 6 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 1134 +#define VER_LAMEXP_BUILD 1136 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Dialog_Update.cpp b/src/Dialog_Update.cpp index c27401e5..5ede6331 100644 --- a/src/Dialog_Update.cpp +++ b/src/Dialog_Update.cpp @@ -62,6 +62,7 @@ static const char *update_mirrors_prim[] = "http://lamexp.sourceforge.net/", "http://free.pages.at/borschdfresser/", "http://lordmulder.github.com/LameXP/", + "http://lord_mulder.bitbucket.org/", "http://www.tricksoft.de/", NULL }; @@ -69,8 +70,8 @@ static const char *update_mirrors_prim[] = static const char *update_mirrors_back[] = { "http://mplayer.savedonthe.net/", - "http://mulder.dummwiedeutsch.de/", - "http://mplayer.somestuff.org/", + "http://www.rarewares.org/", + "http://lord_mulder.doom9.net/", NULL }; @@ -473,17 +474,21 @@ void UpdateDialog::checkForUpdates(void) statusLabel->setText(tr("Checking for new updates online, please wait...")); m_logFile->append(QStringList() << "" << "----" << "" << "Checking for updates online..."); - + QStringList mirrorList; for(int index = 0; update_mirrors_prim[index]; index++) { mirrorList << QString::fromLatin1(update_mirrors_prim[index]); } - qsrand(time(NULL)); - for(int i = 0; i < 4375; i++) + qsrand(GetTickCount() ^ ((DWORD)time(NULL))); + if(const int len = mirrorList.count()) { - mirrorList.swap(i % mirrorList.count(), qrand() % mirrorList.count()); + const int rounds = len * 16; + for(int i = 0; i < rounds; i++) + { + mirrorList.swap(i % len, qrand() % len); + } } for(int index = 0; update_mirrors_back[index]; index++)