Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部屋内での複数のカードの位置の同期 #27

Merged
merged 40 commits into from
Apr 25, 2021

Conversation

bana118
Copy link
Collaborator

@bana118 bana118 commented Apr 19, 2021

概要

  • github actionsでのnode.jsのバージョンをdockerでのバージョンに合わせて12.xから14.xに変更
  • デッキ入室時のダイアログ,デッキのピッカーをコンポーネントにして別ファイルにした
  • 部屋内での複数のカードの位置の同期を実装
    • React Native Gesture Handlerを使用
    • 回転,裏返す,複数のカードの同時移動は未実装
    • 自分と相手で視点を反転させるようにはまだしていない
    • offsetは不要になった

クライアント,サーバー間でのカード情報送受信シーケンス図

card-playroom-sequence

動作確認

サーバー(feature/receive_cards_info)を起動した状態でデッキ作成後,同部屋に2端末で入室し,カードを移動させる

関連するサーバーサイドの変更

部屋内での複数のカードの位置の同期のためのWebSocketメッセージの実装 by bana118 · Pull Request #25 · 2d-rpg/card-playroom-server

} catch (error) {
// 設定読み込みエラー
console.log(error);
}
}
return () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useEffectの使い方見た感じ、このreturn文cardsQueryResultuseEffectか、空配列のuseEffectどっちにかいたほうがいいのかね。まあ設定上ありえないんだけど、もしゲーム中にリフェッチまたはポーリングによるクエリの更新があった場合、websocketが一旦切れてしまうおそれがあるという... ただ空配列のuseEffectに入れたら入れたでなんか二重のwebsocketが接続しっぱなしみたいな状況になるw

@YasuakiYoshii
Copy link
Collaborator

あと再直近で移動させたカードのz-indexを最大にする(一番上にもってくる)ほうがいいかも。

@bana118 bana118 merged commit 12ddc1f into develop Apr 25, 2021
@bana118 bana118 deleted the feature/movable_deck branch April 25, 2021 07:10
@bana118 bana118 restored the feature/movable_deck branch May 16, 2021 06:11
@bana118 bana118 deleted the feature/movable_deck branch May 16, 2021 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants