Remove Analystics

This commit is contained in:
Kam committed 2026-01-23 00:51:01 -05:00
1 parent a9b602713c
commit aa923fae54
2 files changed
-72

No files matched your search

@@ -34,25 +34,6 @@ public class ServerTickHandler {
@SubscribeEvent
public void playerLogin(PlayerEvent.PlayerLoggedInEvent event) {
EntityPlayerMP player = (EntityPlayerMP) event.player;
// Temporary Disabled
// if (serverName == null) {
// String e = "local";
// MinecraftServer server = MinecraftServer.getServer();
// if (server.isDedicatedServer()) {
// try {
// e = InetAddress.getByName(server.getServerHostname()).getCanonicalHostName();
// } catch (UnknownHostException e1) {
// e = MinecraftServer.getServer().getServerHostname();
// }
// if (server.getPort() != 25565)
// e += ":" + server.getPort();
// }
// if (e == null || e.startsWith("192.168") || e.contains("127.0.0.1") || e.startsWith("localhost"))
// e = "local";
// serverName = e;
// }
// AnalyticsTracking.sendData(event.player, "join", serverName);
PlayerData playerData = PlayerData.get(event.player);
if (playerData != null) {
playerData.onLogin();
@@ -1,53 +0,0 @@
package noppes.npcs.client;
import net.minecraft.entity.player.EntityPlayer;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.UUID;
public class AnalyticsTracking {
public static void sendData(final EntityPlayer player, final String event, final String data) {
Runnable r = new Runnable() {
@Override
public void run() {
try {
UUID uuid = player.getUniqueID();
String analyticsPostData = "v=1" +
"&tid=UA-29079943-5" +
"&cid=" + uuid.toString() +
"&t=event" +
"&ec=customnpcs_1.7d" +
"&ea=" + event +
"&el=" + data +
"&ev=300";
URL url = new URL("http://www.google-analytics.com/collect");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setConnectTimeout(10000);
connection.setReadTimeout(10000);
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Length", Integer.toString(analyticsPostData.getBytes().length));
OutputStream dataOutput = connection.getOutputStream();
dataOutput.write(analyticsPostData.getBytes());
dataOutput.close();
connection.getInputStream().close();
} catch (IOException e) {
}
}
};
Thread t = new Thread(r);
t.start();
}
}