Skip to content

Commit 184dd17

Browse files
committed
feat: 千日手と王手千日手の追加
1 parent a576f70 commit 184dd17

3 files changed

Lines changed: 380 additions & 45 deletions

File tree

app/channels/shogi_game_channel.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,14 @@ def unsubscribed
4343

4444
# クライアントからメッセージを受信した時
4545
def board_broadcast_and_store(data)
46-
moveHistory_data = data['moveHistory']
47-
nowTurn_data = data['nowTurn']
48-
boardInfo = data['BoardInfo']
46+
#moveHistory_data = data['moveHistory']
47+
#boardSfenHistory_data = data['boardSfenHistory']
48+
#moveSfenHistory_data = data['moveSfenHistory']
49+
#nowTurn_data = data['nowTurn']
50+
#boardInfo = data['BoardInfo']
51+
#@game_id = data['game_id']
4952
@room_id = data['room_id']
50-
@game_id = data['game_id']
53+
5154
new_board_data=data
5255

5356
#redis_key = "shogi_game:#{@game_id}"
@@ -60,7 +63,7 @@ def board_broadcast_and_store(data)
6063
#WebSocketで配信
6164
ActionCable.server.broadcast("shogi_game_room_#{@room_id}",{data_type: "board_update",new_board_data: new_board_data})
6265
#Rails.logger.info "room_id に対応する moveHistory_data を受信しました: #{@room_id}: #{moveHistory_data}"
63-
new_board_state = { board: "新盤面情報のboadstate", moveHistory: moveHistory_data, nowTurn: nowTurn_data } # 実際はゲームロジックで生成
66+
#new_board_state = { board: "新盤面情報のboadstate", moveHistory: moveHistory_data, nowTurn: nowTurn_data } # 実際はゲームロジックで生成
6467
end
6568

6669
def chat_broadcast_and_store(data)

0 commit comments

Comments
 (0)