ping on the wobseckot
This commit is contained in:
		
							
								
								
									
										2
									
								
								game.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								game.go
									
									
									
									
									
								
							| @@ -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 | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -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(() => { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user