Fix live audio layer reads and harden proxy redirect validation
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.22 R189";
|
||||
window.CHGRID_WEB_VERSION = "2026.02.22 R190";
|
||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||
|
||||
@@ -1476,7 +1476,7 @@ const onAppMessage = createOnMessageHandler({
|
||||
},
|
||||
TELEPORT_SOUND_URL,
|
||||
TELEPORT_START_SOUND_URL,
|
||||
audioLayers,
|
||||
getAudioLayers: () => audioLayers,
|
||||
pushChatMessage,
|
||||
classifySystemMessageSound,
|
||||
SYSTEM_SOUND_URLS,
|
||||
|
||||
@@ -48,7 +48,7 @@ type MessageHandlerDeps = {
|
||||
playRemoteSpatialStepOrTeleport: (url: string, peerX: number, peerY: number) => void;
|
||||
TELEPORT_SOUND_URL: string;
|
||||
TELEPORT_START_SOUND_URL: string;
|
||||
audioLayers: { world: boolean };
|
||||
getAudioLayers: () => { world: boolean };
|
||||
pushChatMessage: (message: string) => void;
|
||||
classifySystemMessageSound: (message: string) => 'logon' | 'logout' | 'notify' | null;
|
||||
SYSTEM_SOUND_URLS: { logon: string; logout: string; notify: string };
|
||||
@@ -138,7 +138,7 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
|
||||
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.audioLayers.world) {
|
||||
if (deps.getAudioLayers().world) {
|
||||
deps.playRemoteSpatialStepOrTeleport(soundUrl, peer.x, peer.y);
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
|
||||
case 'item_use_sound': {
|
||||
const soundUrl = deps.resolveIncomingSoundUrl(message.sound);
|
||||
if (!soundUrl) break;
|
||||
if (deps.audioLayers.world) {
|
||||
if (deps.getAudioLayers().world) {
|
||||
deps.playIncomingItemUseSound(soundUrl, message.x, message.y);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user