import playersSync from "../receiver/players-sync";
import { EdenWebsocketMessageTypes, parseIncomingWebsocketMessage, } from "../contracts.js";
export default function onMessage(event) {
    const message = parseIncomingWebsocketMessage(event.data);
    if (!message) {
        return;
    }
    if (message.type === EdenWebsocketMessageTypes.playersSync) {
        playersSync(message.players);
    }
}
