LH 11 månader sedan
förälder
incheckning
51950128b8

+ 32 - 0
GPNBots/build.gradle

@@ -0,0 +1,32 @@
+defaultTasks 'distZip'
+
+apply plugin: 'java-library'
+apply plugin: 'application'
+
+
+sourceCompatibility = 1.17
+version = 'SNAPSHOT'
+mainClassName = 'de.nplusc.izc.GPN.bot.Main'
+
+
+jar{
+	manifest{
+		attributes 'Implementation-Title': 'GPNBots',
+					'Implementation-Version': 'SNAPSHOT',
+					'Main-Class': 'de.nplusc.izc.GPN.bot.Main'
+					
+	}
+}
+
+repositories{
+	mavenCentral()
+}
+
+dependencies{
+	api group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.+'
+	api group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.+'
+	api group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.+'
+	api group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.+'
+	api group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '2.+'
+	api "org.yaml:snakeyaml:1.14"
+}

+ 4 - 0
GPNBots/src/main/java/de/nplusc/izc/GPN/bot/GPN22.java

@@ -0,0 +1,4 @@
+package de.nplusc.izc.GPN.bot;
+
+public class GPN22 {
+}

+ 9 - 0
GPNBots/src/main/java/de/nplusc/izc/GPN/bot/Main.java

@@ -0,0 +1,9 @@
+package de.nplusc.izc.GPN.bot;
+
+import org.yaml.snakeyaml.Yaml;
+
+public class Main {
+    public static void main(String[] args) {
+        Yaml y = new Yaml();
+    }
+}

+ 79 - 6
QuickStuff/src/main/java/GPN/BotGame.java

@@ -8,11 +8,15 @@ import org.apache.logging.log4j.core.config.LoggerConfig;
 
 import javax.swing.*;
 import java.io.*;
+import java.net.InetAddress;
 import java.net.Socket;
 import java.util.LinkedList;
 import java.util.Queue;
 
 public class BotGame {
+
+    private static boolean respawn = true;
+    private boolean kill = false;
     private boolean switchItharder = false;
     private Queue<String> returnMsgs = new LinkedList<>();
     Object syncer = new Object();
@@ -34,7 +38,33 @@ public class BotGame {
     public static void main(String[] args) {
         setupLogging(true,2);
         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;
 
@@ -140,9 +170,9 @@ public class BotGame {
     }
 
     public void game(){
-        returnMsgs.add("join|masterX244|öoewiuvföewugewgw");
+        returnMsgs.add("join|Red5|mösenpilze-8=====D-fdewcugewgw");
         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()));
             PrintStream out = new PrintStream(sck.getOutputStream(),true,"UTF-8");
             Thread t = new Thread(()->{
@@ -531,6 +561,8 @@ public class BotGame {
                         }
                         else
                         {
+                            kill=true;
+                            respawn=true;
                            throw new Error();
                         }
 
@@ -547,17 +579,44 @@ public class BotGame {
             t.start();
             Thread t2 = new Thread(()->{
                 //System.out.println("Gefangen!");
+                try {
                 while(sck.isConnected())
                 {
+                    if(kill)
+                    {
+                        return;
+                    }
                     synchronized(syncer)
                     {
-                        //l.trace("MSG sent");
+                        mösenpilze++;
+                        if(mösenpilze>300000000)
+                        {
+                            mösenpilze=0;
+                            l.info("WHY THZE FUDGE");
+                        }
                         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
                             String returnMsg = returnMsgs.poll();
                             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;
                             }
                             l.trace("PKT="+returnMsg);
@@ -567,14 +626,24 @@ public class BotGame {
                         //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.start();
             l.info("asdfqwxix");
         }
         catch (IOException ex)
-    {
+        {
+            respawn=true;
         ex.printStackTrace();
         l.error(" Unable to connect to Host. Aborting now");
         try {
@@ -584,4 +653,8 @@ public class BotGame {
         }
     }
     }
+    int submöse2=0;
+    int submöse=0;
+    boolean möseon=false;
+    long mösenpilze = 0;
 }

+ 1 - 1
settings.gradle

@@ -1,4 +1,4 @@
 include 'ToolKit','iZpl',  'IZSetup','WPCMGr','UpidTK', 'izstreamer', 'LogBlockHeatMapper','iZlaunch',
 'iZpaqSFX','MazeViewer','TWPUtil',"iZplPlugins:WMP","iZplPlugins:foobar2000_others","iZplPlugins:itunes","iZplPlugins:GameRadio",
 "iZplPlugins:Editor","izpl-shared","iZpl-server","iZplPlugins:Smartphonizer","QuickStuff","external:java-progressbar","iZplPlugins:rtsslink","iZplPlugins:JukeBox",
-"iZplPlugins:Extractor","spungit_deathtimer","iZplPlugins:discordjukebox","SenaBitWiggler","PlaceDECSVWiggler","SplitSecondARKiver"
+"iZplPlugins:Extractor","spungit_deathtimer","iZplPlugins:discordjukebox","SenaBitWiggler","PlaceDECSVWiggler","SplitSecondARKiver","GPNBots"