Cleanup code

This commit is contained in:
Liam 2022-10-30 14:45:25 +00:00
parent b633e0b59b
commit f998291b2e

@ -6,6 +6,7 @@ import { useSongDataStore } from "../store/songDataStore";
import { getMapHashFromLevelId } from "./map/mapHelpers"; import { getMapHashFromLevelId } from "./map/mapHelpers";
const ip = useSettingsStore.getState().socketAddr || "localhost"; const ip = useSettingsStore.getState().socketAddr || "localhost";
const updatePlayerData = usePlayerDataStore.getState().updatePlayerData;
let cutData: any = []; let cutData: any = [];
cutData.saberA = { cutData.saberA = {
@ -17,8 +18,6 @@ cutData.saberB = {
totalScore: [0, 0, 0], totalScore: [0, 0, 0],
}; };
const updatePlayerData = usePlayerDataStore.getState().updatePlayerData;
export function connectClient(attempt: number = 1) { export function connectClient(attempt: number = 1) {
const client = new W3CWebSocket(`ws://${ip}:6557/socket`); const client = new W3CWebSocket(`ws://${ip}:6557/socket`);
const retryTime = 30_000 * attempt > 60_000 ? 60_000 : 30_000 * attempt; const retryTime = 30_000 * attempt > 60_000 ? 60_000 : 30_000 * attempt;
@ -85,7 +84,6 @@ const handlers: any = {
state.setCurrentScore(finalScore); state.setCurrentScore(finalScore);
state.setPercent(percent); state.setPercent(percent);
state.setPp(percent); state.setPp(percent);
state.updateMapData( state.updateMapData(
getMapHashFromLevelId(levelId), getMapHashFromLevelId(levelId),
difficultyEnum, difficultyEnum,