|
@@ -906,9 +906,29 @@ func (p *Game) Ready(playerID int32) error {
|
|
|
}
|
|
|
}()
|
|
|
|
|
|
+ allReady := true
|
|
|
+ p.locker.Lock()
|
|
|
+ {
|
|
|
+ roomItem := p.RoomMap[roomItem.ID]
|
|
|
+ for _, chairItem := range roomItem.ChairList {
|
|
|
+ if chairItem.PlayerID == 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
+ chairPlayer := p.PlayerMap[chairItem.PlayerID]
|
|
|
+ if chairPlayer.Status != PlayerStatusReady {
|
|
|
+ allReady = false
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ p.locker.Unlock()
|
|
|
+
|
|
|
if !allReady {
|
|
|
p.locker.Lock()
|
|
|
{
|
|
|
+
|
|
|
p.EventInfo(playerID, "准备", fmt.Sprintf("等待房间准备:%d", roomItem.ID))
|
|
|
}
|
|
|
p.locker.Unlock()
|