ping on the wobseckot

This commit is contained in:
Branden J Brown 2024-02-02 19:01:19 -06:00
parent b2618e1ba8
commit 9e66855dc6
2 changed files with 9 additions and 1 deletions

View File

@ -41,6 +41,8 @@ func applyAction(g *game.Match, a action) error {
return g.Apply(a.Player, 6) return g.Apply(a.Player, 6)
case "7": case "7":
return g.Apply(a.Player, 7) return g.Apply(a.Player, 7)
case "ping":
return nil
default: default:
return errWeirdAction return errWeirdAction
} }

View File

@ -37,7 +37,13 @@ const toggleDark = useToggle(dark);
const theme = computed(() => dark.value ? 'dark' : 'light'); const theme = computed(() => dark.value ? 'dark' : 'light');
const themeIcon = computed(() => dark.value ? 'mdi-moon-waxing-crescent' : 'mdi-white-balance-sunny'); const themeIcon = computed(() => dark.value ? 'mdi-moon-waxing-crescent' : 'mdi-white-balance-sunny');
const { status, data, send, open } = useWebSocket<string>(`wss://${window.location.host}/queue`, { immediate: false }); const { status, data, send, open } = useWebSocket<string>(`wss://${window.location.host}/queue`, {
immediate: false,
heartbeat: {
interval: 5000,
message: '{"action":"ping"}',
},
});
const game = ref<Game | null>(null); const game = ref<Game | null>(null);
const dealer = ref<boolean | null>(null); const dealer = ref<boolean | null>(null);
watchEffect(() => { watchEffect(() => {