Use structured piano status packets instead of message text matching

This commit is contained in:
Jage9
2026-02-24 19:56:44 -05:00
parent 7488ac9f67
commit fe07fa3e8f
13 changed files with 155 additions and 61 deletions

View File

@@ -49,6 +49,7 @@ type MessageHandlerDeps = {
playRemoteSpatialStepOrTeleport: (url: string, peerX: number, peerY: number) => void;
handleItemActionResultStatus: (message: Extract<IncomingMessage, { type: 'item_action_result' }>) => boolean;
handleRemotePianoNote: (message: Extract<IncomingMessage, { type: 'item_piano_note' }>) => void;
handlePianoStatus: (message: Extract<IncomingMessage, { type: 'item_piano_status' }>) => void;
stopAllRemoteNotesForSender: (senderId: string) => void;
TELEPORT_SOUND_URL: string;
TELEPORT_START_SOUND_URL: string;
@@ -272,6 +273,11 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
deps.handleRemotePianoNote(message);
break;
}
case 'item_piano_status': {
deps.handlePianoStatus(message);
break;
}
}
};
}