import playerUpdate from "../sender/player-update";
function closeSocketBeforeUnload() {
    const socket = window.Eden.socket;
    if (!socket) {
        return;
    }
    socket.onclose = function () { };
    socket.close();
}
export function clearOnOpenSideEffects() {
    window.removeEventListener("beforeunload", closeSocketBeforeUnload);
}
export default function onOpen() {
    clearOnOpenSideEffects();
    playerUpdate();
    window.addEventListener("beforeunload", closeSocketBeforeUnload);
}
