hab mal bisschen mit Java rumprobiert und eine leichte Console geschrieben die nach Command Programme startet. Nun hab ich das Problem, dass wenn ich z.b. durch den Command Minecraft starte, bekomme ich auf Multiplayer Servern laggs geschweige denn Time-Outs. Woran kann das liegen? Außerdem hab ich die Datei in eine JAR Datei expotiert und dann mit exe4j zu einer exe Console compiliert. Liegt es vielleicht daran? Diese Problem ist außerdem nur bei anderen Java Applikationen wie gesagt z.b. Minecraft.
PHP Code:
package org.sleeyz.console;
import java.io.IOException;
import java.util.Scanner;
public class Konsole {
public static void main(String[] args) throws IOException{
final Scanner sc = new Scanner(System.in);
while (true) {
String input = sc.nextLine();
String[] arrayInput = input.split(" ");
String command = arrayInput[0];
if (input.equalsIgnoreCase("exit")) {
System.exit(0);
} else if (command.equalsIgnoreCase("startwow")) {
Runtime.getRuntime().exec("D:/World of Warcraft Frostmourne/World of Warcraft/Wow.exe");
System.out.println("World of Warcraft is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("startlolpbe")) {
Runtime.getRuntime().exec("C:/Users/Florian/Desktop/LOLPBE.lol.laucher.admin.exe");
System.out.println("League of Legends PBE Server is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("startloleuw")) {
Runtime.getRuntime().exec("D:/Riot/League of Legends.lol.laucher.admin.exe");
System.out.println("League of Legends EUW Server is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("startminecraft")) {
Runtime.getRuntime().exec("C:/Users/Florian/AppData/Roaming/.minecraft/Minecraft.exe");
System.out.println("Minecraft is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("editminecraft")) {
Runtime.getRuntime().exec("explorer.exe C:/Users/Florian/AppData/Roaming/.minecraft");
System.out.println("Minecraft's folder got open! Be careful what you do there!");
}
else if (command.equalsIgnoreCase("feedthebeast")) {
Runtime.getRuntime().exec("C:/Users/Florian/Downloads/FTB_Launcher.exe");
System.out.println("Feed the Beast is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("chrome")) {
Runtime.getRuntime().exec("C:/Users/Florian/AppData/Local/Google/Chrome/Application/chrome.exe");
System.out.println("Google Chrome is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("skype")) {
Runtime.getRuntime().exec("C:/Program Files (x86)/Skype/Phone/Skype.exe");
System.out.println("Skype is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("raidcall")) {
Runtime.getRuntime().exec("C:/Program Files (x86)/RaidCall/Raidcall.exe");
System.out.println("Raidcall is getting started! It could take a moment to load!");
}
else if (command.equalsIgnoreCase("help")) {
System.out.println("Avaible Commands are: startwow, startlolpbe, startloleuw, startminecraft, editminecraft, feedthebeast, help, chrome, skype, raidcall, about");
}
else if (command.equalsIgnoreCase("about")) {
System.out.println("Console coded by: Florian ****** , 2013. All rights reserved!");
}
else if (command.equalsIgnoreCase("say")) {
if (arrayInput.length > 1) {
for (int i = 1; i < arrayInput.length; i++) {
System.out.print(arrayInput[i] + " ");
}
System.out.println();
}
else {
System.err.println("Error: 'say' needs atleast one or more arguments!");
}
}
else {
System.err.println("Error: Command not found!");
}
}
}
}