chainhackers / gamejutsu-demos

GameJutsu framework web demos
MIT License
2 stars 4 forks source link

No "connect" dialog button #77

Closed poludnev closed 1 year ago

poludnev commented 1 year ago

In some cases, the gamefield doesn't show connect button, so can not connect to XMTP chat. If the chat is not connected, throws an exception

poludnev commented 1 year ago

The case occur when we start a new game after another game has just finished, and we goes new "new game" page without reloading. the grey screen ("shade") in the gameFeild component is show under the conditions below:

useEffect(() => { if (!rivalPlayerAddress) { setShowShade(true); setIsWaiting(true);

}
if (!!rivalPlayerAddress) {
  setIsWaiting(false);
  setIsConnecting(true);
  // return;
}
if (isConnected) {
  console.log('isConnected gameField', isConnected);
  setIsConnecting(false);
  setIsWaiting(false);
  setShowShade(false);
  // return;
}

}, [rivalPlayerAddress, isConnected]);

if we don't reload the page, XMTP client is still connected, to isShowShade is set to false.

originalskobka commented 1 year ago

После завершения игры и создания новой, отсутствует кнопка "Press to connect".

Видео - https://disk.yandex.ru/i/FAjtHlQqEdHyeQ

poludnev commented 1 year ago

Ready to test with direct branch: https://github.com/chainhackers/gamejutsu-demos/tree/77-no-connect-button

or wait for the pr approved: https://github.com/chainhackers/gamejutsu-demos/pull/110

poludnev commented 1 year ago

@originalskobka ready to test

originalskobka commented 1 year ago

Для проверки сыграл несколько игр в Tic-Tac-Toe. Завершал игры сценариями:

  1. Создатель игры победил
  2. Создатель игры проиграл
  3. Создателя игры дисквалифицировали
  4. Оппонента дисквалифицировали Каждая новая игра создавалась без обновления страницы, каждый раз была кнопка "Press to connect". Все окей.