Fix remote voice negotiation and teleport cue timing

This commit is contained in:
Jage9
2026-02-25 02:01:37 -05:00
parent fad78e12af
commit 561801e97c
3 changed files with 6 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
// Maintainer-controlled web client version. // Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.02.25 R262"; window.CHGRID_WEB_VERSION = "2026.02.25 R263";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit"; window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -160,9 +160,8 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
deps.peerManager.setPeerPosition(message.id, message.x, message.y); deps.peerManager.setPeerPosition(message.id, message.x, message.y);
if (peer) { if (peer) {
const movementDelta = Math.hypot(message.x - prevX, message.y - prevY); const movementDelta = Math.hypot(message.x - prevX, message.y - prevY);
const soundUrl = movementDelta > 1.5 ? deps.TELEPORT_START_SOUND_URL : deps.randomFootstepUrl(); if (movementDelta <= 1.5 && deps.getAudioLayers().world) {
if (deps.getAudioLayers().world) { deps.playRemoteSpatialStepOrTeleport(deps.randomFootstepUrl(), peer.x, peer.y);
deps.playRemoteSpatialStepOrTeleport(soundUrl, peer.x, peer.y);
} }
} }
break; break;

View File

@@ -50,6 +50,9 @@ export class PeerManager {
const stream = this.getLocalStream(); const stream = this.getLocalStream();
if (stream) { if (stream) {
stream.getTracks().forEach((track) => pc.addTrack(track, stream)); stream.getTracks().forEach((track) => pc.addTrack(track, stream));
} else {
// Ensure initial offers still negotiate audio receive even before mic setup finishes.
pc.addTransceiver('audio', { direction: 'sendrecv' });
} }
pc.onicecandidate = (event) => { pc.onicecandidate = (event) => {