Error in my Server-Log Dont know why

Discussion in 'Spigot Help' started by SourceWriters, Jul 3, 2015.

  1. Hello, like you see in my log, i have a Problem with a Plugin. I wrote this Plugin by myself, because of this point i have here the code of Line 349

    Code (Text):

      public static void checkInGame() {
         for(String server : ingame.keySet()) {
           String adress = cfg.getString("server." + server + ".adress");
           int port = cfg.getInt("server." + server + ".port");
         
      Socket socket = new Socket();
      try {
             socket.connect(new InetSocketAddress(adress, port), 1 * 1000);
     
      DataOutputStream out = new DataOutputStream(socket.getOutputStream());
      DataInputStream in = new DataInputStream(socket.getInputStream());
     
      out.write(0xFE);
     
      StringBuilder str = new StringBuilder();
     
      int b;
      while ((b = in.read()) != -1) {
      if (b != 0 && b > 16 && b != 255 && b != 23 && b != 24) {
      str.append((char) b);
      }
      }
     
      /*
      <Name>
      <IP>
      <Current/Max>
      <MOTD>
      */
     
      String[] data = str.toString().split("ยง");
      String motd = data[0];
      int onlinePlayers = Integer.valueOf(data[1]);
      int maxPlayers = Integer.valueOf(data[2]);  
      if(!motd.equalsIgnoreCase("Ingame")) {
         String type = ingame.get(server);
         ingame.remove(server);
         servers.put(server, type);
      }
      } catch (IOException e) {
            }
      try {
             socket.close();
           } catch (IOException e) {
             e.printStackTrace();
           }
         }
       
       }
     
    Hofefully you can help me, YellowPhoenix18
     

    Attached Files:

    • log.txt
      File size:
      32.2 KB
      Views:
      148