Fix remote voice negotiation and teleport cue timing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Maintainer-controlled web client version.
|
||||
// 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.
|
||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||
|
||||
@@ -160,9 +160,8 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
|
||||
deps.peerManager.setPeerPosition(message.id, message.x, message.y);
|
||||
if (peer) {
|
||||
const movementDelta = Math.hypot(message.x - prevX, message.y - prevY);
|
||||
const soundUrl = movementDelta > 1.5 ? deps.TELEPORT_START_SOUND_URL : deps.randomFootstepUrl();
|
||||
if (deps.getAudioLayers().world) {
|
||||
deps.playRemoteSpatialStepOrTeleport(soundUrl, peer.x, peer.y);
|
||||
if (movementDelta <= 1.5 && deps.getAudioLayers().world) {
|
||||
deps.playRemoteSpatialStepOrTeleport(deps.randomFootstepUrl(), peer.x, peer.y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -50,6 +50,9 @@ export class PeerManager {
|
||||
const stream = this.getLocalStream();
|
||||
if (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) => {
|
||||
|
||||
Reference in New Issue
Block a user