|
@@ -8,11 +8,15 @@ import org.apache.logging.log4j.core.config.LoggerConfig;
|
|
|
|
|
|
import javax.swing.*;
|
|
import javax.swing.*;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
|
+import java.net.InetAddress;
|
|
import java.net.Socket;
|
|
import java.net.Socket;
|
|
import java.util.LinkedList;
|
|
import java.util.LinkedList;
|
|
import java.util.Queue;
|
|
import java.util.Queue;
|
|
|
|
|
|
public class BotGame {
|
|
public class BotGame {
|
|
|
|
+
|
|
|
|
+ private static boolean respawn = true;
|
|
|
|
+ private boolean kill = false;
|
|
private boolean switchItharder = false;
|
|
private boolean switchItharder = false;
|
|
private Queue<String> returnMsgs = new LinkedList<>();
|
|
private Queue<String> returnMsgs = new LinkedList<>();
|
|
Object syncer = new Object();
|
|
Object syncer = new Object();
|
|
@@ -34,7 +38,33 @@ public class BotGame {
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
setupLogging(true,2);
|
|
setupLogging(true,2);
|
|
l.info("shizzlemork");
|
|
l.info("shizzlemork");
|
|
- new BotGame().game();
|
|
|
|
|
|
+ while(true)
|
|
|
|
+ {
|
|
|
|
+ l.info("LOOP");
|
|
|
|
+ if(respawn)
|
|
|
|
+ {
|
|
|
|
+ l.info("Respawning");
|
|
|
|
+ respawn=false;
|
|
|
|
+ try {
|
|
|
|
+ Thread.sleep(1);
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+// throw new RuntimeException(e);
|
|
|
|
+ }
|
|
|
|
+ try{
|
|
|
|
+ new BotGame().game();
|
|
|
|
+ }
|
|
|
|
+ catch(Throwable t)
|
|
|
|
+ {
|
|
|
|
+ l.info("catch");
|
|
|
|
+ respawn=true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ Thread.sleep(1000);
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ //throw new RuntimeException(e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
int lastcase=-1;
|
|
int lastcase=-1;
|
|
|
|
|
|
@@ -140,9 +170,9 @@ public class BotGame {
|
|
}
|
|
}
|
|
|
|
|
|
public void game(){
|
|
public void game(){
|
|
- returnMsgs.add("join|masterX244|öoewiuvföewugewgw");
|
|
|
|
|
|
+ returnMsgs.add("join|Red5|mösenpilze-8=====D-fdewcugewgw");
|
|
try {
|
|
try {
|
|
- Socket sck=new Socket("gpn-tron.duckdns.org", 4000);
|
|
|
|
|
|
+ Socket sck=new Socket(InetAddress.getByName("2a0e:c5c1:0:20d:29a9:3142:d2da:33fd"), 4000);
|
|
BufferedReader r = new BufferedReader(new InputStreamReader(sck.getInputStream()));
|
|
BufferedReader r = new BufferedReader(new InputStreamReader(sck.getInputStream()));
|
|
PrintStream out = new PrintStream(sck.getOutputStream(),true,"UTF-8");
|
|
PrintStream out = new PrintStream(sck.getOutputStream(),true,"UTF-8");
|
|
Thread t = new Thread(()->{
|
|
Thread t = new Thread(()->{
|
|
@@ -531,6 +561,8 @@ public class BotGame {
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ kill=true;
|
|
|
|
+ respawn=true;
|
|
throw new Error();
|
|
throw new Error();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -547,17 +579,44 @@ public class BotGame {
|
|
t.start();
|
|
t.start();
|
|
Thread t2 = new Thread(()->{
|
|
Thread t2 = new Thread(()->{
|
|
//System.out.println("Gefangen!");
|
|
//System.out.println("Gefangen!");
|
|
|
|
+ try {
|
|
while(sck.isConnected())
|
|
while(sck.isConnected())
|
|
{
|
|
{
|
|
|
|
+ if(kill)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
synchronized(syncer)
|
|
synchronized(syncer)
|
|
{
|
|
{
|
|
- //l.trace("MSG sent");
|
|
|
|
|
|
+ mösenpilze++;
|
|
|
|
+ if(mösenpilze>300000000)
|
|
|
|
+ {
|
|
|
|
+ mösenpilze=0;
|
|
|
|
+ l.info("WHY THZE FUDGE");
|
|
|
|
+ }
|
|
while(!returnMsgs.isEmpty())
|
|
while(!returnMsgs.isEmpty())
|
|
{
|
|
{
|
|
|
|
+ mösenpilze=0;
|
|
|
|
+ submöse++;
|
|
|
|
+ if(submöse>3)
|
|
|
|
+ {
|
|
|
|
+ möseon=true;
|
|
|
|
+ }
|
|
// FUCK YOU DUMB IDIOT; NO THREAD.SLEEP() HERE!!!!!11!!11elf
|
|
// FUCK YOU DUMB IDIOT; NO THREAD.SLEEP() HERE!!!!!11!!11elf
|
|
String returnMsg = returnMsgs.poll();
|
|
String returnMsg = returnMsgs.poll();
|
|
if(returnMsg == null)
|
|
if(returnMsg == null)
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ submöse2++;
|
|
|
|
+ if(submöse2<3)
|
|
|
|
+ {
|
|
|
|
+ l.trace("22MP");
|
|
|
|
+ }
|
|
|
|
+ else if(submöse2==4);
|
|
|
|
+ {
|
|
|
|
+ l.trace("Hodentasche");
|
|
|
|
+ l.trace(returnMsgs.size());
|
|
|
|
+ }
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
l.trace("PKT="+returnMsg);
|
|
l.trace("PKT="+returnMsg);
|
|
@@ -567,14 +626,24 @@ public class BotGame {
|
|
//l.trace("end of MessageStream");
|
|
//l.trace("end of MessageStream");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //System.out.println("Flucht ist zwecklos");
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
|
|
+ l.error("ZZMP");
|
|
|
|
+ l.error(e);
|
|
|
|
+ System.exit(1337);
|
|
|
|
+ }
|
|
|
|
+ System.out.println("Flucht ist zwecklos");
|
|
|
|
+ System.exit(1337);
|
|
});
|
|
});
|
|
t2.setName("OutputCruncher");
|
|
t2.setName("OutputCruncher");
|
|
t2.start();
|
|
t2.start();
|
|
l.info("asdfqwxix");
|
|
l.info("asdfqwxix");
|
|
}
|
|
}
|
|
catch (IOException ex)
|
|
catch (IOException ex)
|
|
- {
|
|
|
|
|
|
+ {
|
|
|
|
+ respawn=true;
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|
|
l.error(" Unable to connect to Host. Aborting now");
|
|
l.error(" Unable to connect to Host. Aborting now");
|
|
try {
|
|
try {
|
|
@@ -584,4 +653,8 @@ public class BotGame {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ int submöse2=0;
|
|
|
|
+ int submöse=0;
|
|
|
|
+ boolean möseon=false;
|
|
|
|
+ long mösenpilze = 0;
|
|
}
|
|
}
|