Closed ishikota closed 8 years ago
https://github.com/ishikota/PokerServer/issues/12 への対応
DBにGameStateを作ってる最中に,playerからのactionを受け付けて,game_stateにアクセスしてnilでエラー
Channel側でGameStateの作成が完了してから,playerへask, notificationを送信することで,declare_actionでroom.game_stateがnilにならないようにする.
それに向けて,Dealerの中でゲームの進行に合わせて,messageをbroadcastしてたのを, dealerは送信すべきメッセージをまとめてchannelに返すようにして, channel側で送信を負担するように変更.
これによって,dealerからBroadcastのロジックが切り出せた.
https://github.com/ishikota/PokerServer/issues/12 への対応
問題
DBにGameStateを作ってる最中に,playerからのactionを受け付けて,game_stateにアクセスしてnilでエラー
対策
Channel側でGameStateの作成が完了してから,playerへask, notificationを送信することで,declare_actionでroom.game_stateがnilにならないようにする.
それに向けて,Dealerの中でゲームの進行に合わせて,messageをbroadcastしてたのを, dealerは送信すべきメッセージをまとめてchannelに返すようにして, channel側で送信を負担するように変更.
これによって,dealerからBroadcastのロジックが切り出せた.