feat: add time for heart beat
This commit is contained in:
@@ -76,10 +76,11 @@ type stateMsg struct {
|
||||
HandCounts [4]int `json:"hand_counts"`
|
||||
Trick []trickView `json:"trick"`
|
||||
LeadSuit string `json:"lead_suit,omitempty"`
|
||||
TricksWon [2]int `json:"tricks_won"`
|
||||
Scores [2]int `json:"scores"`
|
||||
TargetScore int `json:"target_score"`
|
||||
Players []PlayerInfo `json:"players"`
|
||||
TricksWon [2]int `json:"tricks_won"`
|
||||
Scores [2]int `json:"scores"`
|
||||
TargetScore int `json:"target_score"`
|
||||
TurnTimeoutMs int `json:"turn_timeout_ms"` // مهلتِ نوبتِ انسان (برای شمارندهی کلاینت)
|
||||
Players []PlayerInfo `json:"players"`
|
||||
}
|
||||
|
||||
// handOverMsg نتیجه یک هَند.
|
||||
@@ -118,7 +119,7 @@ type playerStatusMsg struct {
|
||||
}
|
||||
|
||||
// buildState نمای بازی را برای جایگاه seat میسازد (کارت بقیه مخفی میماند).
|
||||
func buildState(g *game.Game, roomID string, seat int, players []PlayerInfo) stateMsg {
|
||||
func buildState(g *game.Game, roomID string, seat int, players []PlayerInfo, turnTimeoutMs int) stateMsg {
|
||||
hand := g.Hand(seat)
|
||||
handStr := make([]string, len(hand))
|
||||
for i, c := range hand {
|
||||
|
||||
Reference in New Issue
Block a user