Skip to content

Commit

Permalink
fix(#14): fixed a crash when closing minecraft
Browse files Browse the repository at this point in the history
  • Loading branch information
meza committed Apr 2, 2024
1 parent 3404a49 commit 434ce71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/src/main/java/gg/meza/telemetry/Telemetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import net.minecraft.client.MinecraftClient;
import org.apache.commons.codec.digest.DigestUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Telemetry {
private static final String POSTHOG_API_KEY = "POSTHOG_API_KEY_REPL";
private static final String POSTHOG_HOST = "https://eu.posthog.com";
private final PostHog posthog;
private final Map<String, Integer> blockedSoundsCount = new HashMap<>();
private final Map<String, Integer> blockedSoundsCount = new ConcurrentHashMap<>();

// Not actually sending any user info, just using the uuid to create a new uuid that cannot be traced back to the user
private final String uuid = DigestUtils.sha256Hex(MinecraftClient.getInstance().getSession().getUsername());
Expand All @@ -36,7 +36,7 @@ private void sendEvent(String event, String sound, Map<String, Object> extraProp
return;
}

Map<String, Object> baseProps = new HashMap<>(Map.of(
Map<String, Object> baseProps = new ConcurrentHashMap<>(Map.of(
"sound", sound,
"Minecraft Version", MC_VERSION,
"OS", OS_NAME,
Expand Down

0 comments on commit 434ce71

Please sign in to comment.