don't heartbeat at all
This commit is contained in:
parent
8f1fb96ac9
commit
ec2480f48c
@ -200,11 +200,9 @@ func (s *Server) joinAndServe(p person) {
|
|||||||
ch := make(chan struct{})
|
ch := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
defer close(ch)
|
defer close(ch)
|
||||||
for {
|
_, _, err := p.conn.Read(ctx)
|
||||||
_, _, err := p.conn.Read(context.Background())
|
if err != nil {
|
||||||
if err != nil || ctx.Err() != nil {
|
slog.ErrorContext(ctx, "player dropped on hello", "player", p.id, "err", err.Error())
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
id, chall, deal := s.l.Queue(ctx, p.id)
|
id, chall, deal := s.l.Queue(ctx, p.id)
|
||||||
|
@ -39,15 +39,11 @@ const themeIcon = computed(() => dark.value ? 'mdi-moon-waxing-crescent' : 'mdi-
|
|||||||
|
|
||||||
const { status, data, send, open } = useWebSocket<string>(`wss://${window.location.host}/queue`, {
|
const { status, data, send, open } = useWebSocket<string>(`wss://${window.location.host}/queue`, {
|
||||||
immediate: false,
|
immediate: false,
|
||||||
heartbeat: {
|
onDisconnected: (_ws, evt) => {
|
||||||
interval: 1000,
|
console.warn('lost connection', { evt });
|
||||||
message: '{"action":"ping"}',
|
|
||||||
},
|
|
||||||
onDisconnected: (ws, evt) => {
|
|
||||||
console.warn('lost connection', {evt});
|
|
||||||
game.value = null;
|
game.value = null;
|
||||||
dealer.value = null;
|
dealer.value = null;
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
const game = ref<Game | null>(null);
|
const game = ref<Game | null>(null);
|
||||||
const dealer = ref<boolean | null>(null);
|
const dealer = ref<boolean | null>(null);
|
||||||
@ -77,6 +73,7 @@ const loading = computed(() => status.value === 'CONNECTING' || status.value ===
|
|||||||
|
|
||||||
function clickPlay() {
|
function clickPlay() {
|
||||||
open();
|
open();
|
||||||
|
send('hi');
|
||||||
}
|
}
|
||||||
|
|
||||||
function action(evt: Action) {
|
function action(evt: Action) {
|
||||||
|
Loading…
Reference in New Issue
Block a user