Initial git commit

This commit is contained in:
2019-04-14 12:18:58 +02:00
commit e1c1b51c90
113 changed files with 2646 additions and 0 deletions

BIN
QuickLaunchUpdateServer/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>QuickLaunchUpdateServer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,67 @@
package run;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import run.Start;
public class ServerThread
implements Runnable {
int PORT;
public ServerThread(int port) {
this.PORT = port;
}
boolean updateNeeded = true;
ServerSocket ses;
Socket s;
DataOutputStream out;
DataInputStream in;
public void run() {
do {
try {
do {
updateNeeded = true;
ses = new ServerSocket(this.PORT);
s = ses.accept();
System.out.println("Connected with: " + s.getInetAddress());
out = new DataOutputStream(s.getOutputStream());
in = new DataInputStream(s.getInputStream());
out.writeFloat(Start.version);
System.out.println(in.readUTF());
System.out.println(in.readUTF());
System.out.println(in.readUTF());
System.out.println(in.readUTF());
updateNeeded = in.readBoolean();
if (updateNeeded) {
System.out.println("Update needed, Download link was send");
out.writeUTF(Start.download);
}
out.close();
in.close();
s.close();
ses.close();
} while (true);
}
catch (IOException io) {
io.printStackTrace();
try {
out.close();
in.close();
s.close();
ses.close();
} catch (IOException e) {
e.printStackTrace();
System.out.println("Server panic");
}
}
} while (true);
}
}

View File

@@ -0,0 +1,25 @@
package run;
import javax.swing.JOptionPane;
import run.ServerThread;
import run.UpdateThread;
public class Start {
public static float version = -1.0f;
public static String download = "";
private static final int PORT = 9999;
public static void main(String[] args) {
version = Float.parseFloat(JOptionPane.showInputDialog("QuickLaunch version:"));
download = JOptionPane.showInputDialog("Link to downloadable");
Thread ut = new Thread(new UpdateThread());
ut.start();
System.out.println("Update thread started");
Thread st = new Thread(new ServerThread(PORT));
st.start();
System.out.println("Server listening");
}
}

View File

@@ -0,0 +1,15 @@
package run;
import javax.swing.JOptionPane;
import run.Start;
public class UpdateThread
implements Runnable {
@Override
public void run() {
do {
Start.version = Float.parseFloat(JOptionPane.showInputDialog("QuickLaunch version (" + Start.version + "): "));
Start.download = JOptionPane.showInputDialog("Link to downloadable:");
} while (true);
}
}