summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-10-31 09:06:42 +0100
committerPetr Mrázek <peterix@gmail.com>2013-10-31 09:06:42 +0100
commitb018aab1e936dc368090987a72a929987574b1b8 (patch)
tree95354efc7f9096cfee0cc0cfdf27d32237dacd2c
parentf941119fbd89b5677a2895eee3232fa76389b4b5 (diff)
parent8cd6604e40ae5d250f6826d0c7a1985e719ec66c (diff)
downloadMultiMC-b018aab1e936dc368090987a72a929987574b1b8.tar
MultiMC-b018aab1e936dc368090987a72a929987574b1b8.tar.gz
MultiMC-b018aab1e936dc368090987a72a929987574b1b8.tar.lz
MultiMC-b018aab1e936dc368090987a72a929987574b1b8.tar.xz
MultiMC-b018aab1e936dc368090987a72a929987574b1b8.zip
Merge branch 'develop'
-rw-r--r--MultiMC.cpp42
-rw-r--r--logic/LegacyInstance.cpp9
-rw-r--r--logic/OneSixInstance.cpp13
3 files changed, 61 insertions, 3 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index e425aa44..d13d1443 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -152,6 +152,46 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
// set up a basic autodetected proxy (system default)
QNetworkProxyFactory::setUseSystemConfiguration(true);
+ QLOG_INFO() << "Detecting system proxy settings...";
+ auto proxies = QNetworkProxyFactory::systemProxyForQuery();
+ if (proxies.size() == 1 && proxies[0].type() == QNetworkProxy::NoProxy)
+ {
+ QLOG_INFO() << "No proxy found.";
+ }
+ else for (auto proxy : proxies)
+ {
+ QString proxyDesc;
+ if (proxy.type() == QNetworkProxy::NoProxy)
+ {
+ QLOG_INFO() << "Using no proxy is an option!";
+ continue;
+ }
+ switch (proxy.type())
+ {
+ case QNetworkProxy::DefaultProxy:
+ proxyDesc = "Default proxy: ";
+ break;
+ case QNetworkProxy::Socks5Proxy:
+ proxyDesc = "Socks5 proxy: ";
+ break;
+ case QNetworkProxy::HttpProxy:
+ proxyDesc = "HTTP proxy: ";
+ break;
+ case QNetworkProxy::HttpCachingProxy:
+ proxyDesc = "HTTP caching: ";
+ break;
+ case QNetworkProxy::FtpCachingProxy:
+ proxyDesc = "FTP caching: ";
+ break;
+ }
+ proxyDesc += QString("%3@%1:%2 pass %4")
+ .arg(proxy.hostName())
+ .arg(proxy.port())
+ .arg(proxy.user())
+ .arg(proxy.password());
+ QLOG_INFO() << proxyDesc;
+ }
+
// create the global network manager
m_qnam.reset(new QNetworkAccessManager(this));
@@ -354,7 +394,7 @@ std::shared_ptr<JavaVersionList> MultiMC::javalist()
return m_javalist;
}
-int main_gui(MultiMC & app)
+int main_gui(MultiMC &app)
{
// show main window
MainWindow mainWin;
diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp
index f741caad..2fd18693 100644
--- a/logic/LegacyInstance.cpp
+++ b/logic/LegacyInstance.cpp
@@ -74,6 +74,15 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(LoginResponse response)
args << QString("-Xms%1m").arg(settings().get("MinMemAlloc").toInt());
args << QString("-Xmx%1m").arg(settings().get("MaxMemAlloc").toInt());
args << QString("-XX:PermSize=%1m").arg(settings().get("PermGen").toInt());
+/**
+* HACK: Stupid hack for Intel drivers.
+* See: https://mojang.atlassian.net/browse/MCL-767
+*/
+#ifdef Q_OS_WIN32
+ args << QString("-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_"
+ "minecraft.exe.heapdump");
+#endif
+
args << "-jar" << LAUNCHER_FILE;
args << response.player_name;
args << response.session_id;
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp
index d80f6b37..7539d8e5 100644
--- a/logic/OneSixInstance.cpp
+++ b/logic/OneSixInstance.cpp
@@ -119,6 +119,16 @@ MinecraftProcess *OneSixInstance::prepareForLaunch(LoginResponse response)
args << QString("-Xms%1m").arg(settings().get("MinMemAlloc").toInt());
args << QString("-Xmx%1m").arg(settings().get("MaxMemAlloc").toInt());
args << QString("-XX:PermSize=%1m").arg(settings().get("PermGen").toInt());
+
+/**
+ * HACK: Stupid hack for Intel drivers.
+ * See: https://mojang.atlassian.net/browse/MCL-767
+ */
+#ifdef Q_OS_WIN32
+ args << QString("-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_"
+ "minecraft.exe.heapdump");
+#endif
+
QDir natives_dir(natives_dir_raw);
args << QString("-Djava.library.path=%1").arg(natives_dir.absolutePath());
QString classPath;
@@ -148,7 +158,7 @@ MinecraftProcess *OneSixInstance::prepareForLaunch(LoginResponse response)
// Set the width and height for 1.6 instances
bool maximize = settings().get("LaunchMaximized").toBool();
- if(maximize)
+ if (maximize)
{
// this is probably a BAD idea
// args << QString("--fullscreen");
@@ -342,4 +352,3 @@ QString OneSixInstance::instanceConfigFolder() const
{
return PathCombine(minecraftRoot(), "config");
}
-