Make displayName consistent via hash (#775)

This commit is contained in:
Erimel authored and GitHub committed 2023-07-20 15:14:52 -04:00
1 parent ca6f82492d
commit f3346bbeee
1 file changed
+5 -2
@@ -19,7 +19,9 @@ import java.net.NetworkInterface
import java.net.SocketTimeoutException
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.util.*
import java.nio.charset.StandardCharsets
import java.security.MessageDigest
import java.util.Random
import java.util.function.Consumer
/**
@@ -144,7 +146,8 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
connection,
VRServer.getNextLocalTrackerId(),
connection.name + "/" + trackerId,
"IMU Tracker #" + VRServer.currentLocalTrackerId,
"IMU Tracker " + MessageDigest.getInstance("SHA-256")
.digest(connection.hardwareIdentifier.toByteArray(StandardCharsets.UTF_8)).toString().subSequence(3, 8),
null,
trackerNum = trackerId,
hasRotation = true,