Moved to more specific User-Agent in the service Checker

This commit is contained in:
Jerom van der Sar 2013-07-10 23:32:31 +02:00
parent cd16c7fb10
commit 6d9e9406ec
4 changed files with 7 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#Mon, 08 Jul 2013 20:48:59 -0400 #Wed, 10 Jul 2013 23:30:57 +0200
program.VERSION=2.21 program.VERSION=2.21
program.BUILDNUM=292 program.BUILDNUM=294
program.BUILDDATE=07/08/2013 08\:48 PM program.BUILDDATE=07/10/2013 11\:30 PM

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Mon Jul 08 20:48:59 EDT 2013 #Wed Jul 10 23:30:57 CEST 2013
build.number=293 build.number=295

View File

@ -77,7 +77,7 @@ public class TFM_ServiceChecker
// Well, lets bypass that! >:D // Well, lets bypass that! >:D
HttpURLConnection connection = (HttpURLConnection) new URL(check_url).openConnection(); HttpURLConnection connection = (HttpURLConnection) new URL(check_url).openConnection();
connection.setRequestMethod("GET"); connection.setRequestMethod("GET");
connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.2 Safari/537.36");
connection.setRequestProperty("Host", "xpaw.ru"); connection.setRequestProperty("Host", "xpaw.ru");
connection.setRequestProperty("Accept", "*/*"); connection.setRequestProperty("Accept", "*/*");
connection.setUseCaches(false); connection.setUseCaches(false);
@ -108,7 +108,6 @@ public class TFM_ServiceChecker
} }
catch (Exception ex) catch (Exception ex)
{ {
TFM_Log.severe(ex);
} }
} }
}); });

View File

@ -107,7 +107,7 @@ public class TotalFreedomMod extends JavaPlugin
server.getScheduler().scheduleSyncRepeatingTask(this, new TFM_Heartbeat(this), HEARTBEAT_RATE * 20L, HEARTBEAT_RATE * 20L); server.getScheduler().scheduleSyncRepeatingTask(this, new TFM_Heartbeat(this), HEARTBEAT_RATE * 20L, HEARTBEAT_RATE * 20L);
// Service uptime checker // Service uptime checker
server.getScheduler().scheduleSyncRepeatingTask(this, TFM_ServiceChecker.checker, SERVICE_CHECKER_RATE * 20L, 5 * 20L); server.getScheduler().scheduleSyncRepeatingTask(this, TFM_ServiceChecker.checker, SERVICE_CHECKER_RATE * 20L, 1 * 20L);
TFM_CommandLoader.getInstance().scan(); TFM_CommandLoader.getInstance().scan();