summaryrefslogtreecommitdiffstats
path: root/depends/launcher/org/multimc/EntryPoint.java
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-02-16 00:10:45 +0100
committerPetr Mrázek <peterix@gmail.com>2014-02-16 00:10:45 +0100
commit7ceb2cacb129d5924087f616cfc0b949689ed4fe (patch)
tree0bf4136e72a4d6bd56bbaf434fbddced719b01cd /depends/launcher/org/multimc/EntryPoint.java
parent8219dbf612f4e6f603d304348fc388e364602f98 (diff)
downloadMultiMC-7ceb2cacb129d5924087f616cfc0b949689ed4fe.tar
MultiMC-7ceb2cacb129d5924087f616cfc0b949689ed4fe.tar.gz
MultiMC-7ceb2cacb129d5924087f616cfc0b949689ed4fe.tar.lz
MultiMC-7ceb2cacb129d5924087f616cfc0b949689ed4fe.tar.xz
MultiMC-7ceb2cacb129d5924087f616cfc0b949689ed4fe.zip
Fix a few bugs in profilers.
* Legacy was launching before the profiler. * Some clarity changes. * Report problem with empty strings as profiler paths.
Diffstat (limited to 'depends/launcher/org/multimc/EntryPoint.java')
-rw-r--r--depends/launcher/org/multimc/EntryPoint.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/depends/launcher/org/multimc/EntryPoint.java b/depends/launcher/org/multimc/EntryPoint.java
index 9e4ea0c1..f9fe68d6 100644
--- a/depends/launcher/org/multimc/EntryPoint.java
+++ b/depends/launcher/org/multimc/EntryPoint.java
@@ -29,7 +29,8 @@ public class EntryPoint
private enum Action
{
Proceed,
- Launch
+ Launch,
+ Abort
}
public static void main(String[] args)
@@ -62,8 +63,17 @@ public class EntryPoint
{
String[] pair = inData.split(" ", 2);
- if(pair.length == 1 && pair[0].equals("launch"))
- return Action.Launch;
+ if(pair.length == 1)
+ {
+ String command = pair[0];
+ if (pair[0].equals("launch"))
+ return Action.Launch;
+
+ else if (pair[0].equals("abort"))
+ return Action.Abort;
+
+ else throw new ParseException();
+ }
if(pair.length != 2)
throw new ParseException();
@@ -109,6 +119,7 @@ public class EntryPoint
return 1;
}
boolean isListening = true;
+ boolean isAborted = false;
// Main loop
while (isListening)
{
@@ -119,7 +130,13 @@ public class EntryPoint
inData = buffer.readLine();
if (inData != null)
{
- if(parseLine(inData) == Action.Launch)
+ Action a = parseLine(inData);
+ if(a == Action.Abort)
+ {
+ isListening = false;
+ isAborted = true;
+ }
+ if(a == Action.Launch)
{
isListening = false;
}
@@ -138,6 +155,11 @@ public class EntryPoint
return 1;
}
}
+ if(isAborted)
+ {
+ System.err.println("Launch aborted by MultiMC.");
+ return 1;
+ }
if(m_launcher != null)
{
return m_launcher.launch(m_params);