modify 十三张手动摆牌

This commit is contained in:
sk 2024-12-21 09:05:08 +08:00
parent b186967189
commit 694e8a5992
2 changed files with 20 additions and 12 deletions

View File

@ -940,6 +940,10 @@ func (this *StateOp) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, param
} }
} }
if len(params) == 1 {
sceneEx.SelectCards(playerEx, int(params[0]))
}
if len(params) == 0 { if len(params) == 0 {
playerEx.preCardsO = &rule.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1} playerEx.preCardsO = &rule.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1}
} }
@ -974,13 +978,16 @@ func (this *StateOp) OnLeave(s *base.Scene) {
for _, player := range sceneEx.players { for _, player := range sceneEx.players {
if player != nil && player.IsGameing() { if player != nil && player.IsGameing() {
mq.Write(model.ThirteenAutoLog{ if !player.IsRobot() {
Id: primitive.NewObjectID().Hex(), mq.Write(model.ThirteenAutoLog{
LogId: sceneEx.logid, Id: primitive.NewObjectID().Hex(),
SnId: player.SnId, Platform: player.Platform,
AutoTime: player.AutoMill.Milliseconds(), LogId: sceneEx.logid,
HandTime: player.HandMill.Milliseconds(), SnId: player.SnId,
}, mq.BackThirteenAutoLog) AutoTime: player.AutoMill.Milliseconds(),
HandTime: player.HandMill.Milliseconds(),
}, mq.BackThirteenAutoLog)
}
// 使用预选牌 // 使用预选牌
if player.preCardsO != nil && player.preCardsO.PokerType != -1 && (player.cardsO == nil || player.cardsO.PokerType == -1) { if player.preCardsO != nil && player.preCardsO.PokerType != -1 && (player.cardsO == nil || player.cardsO.PokerType == -1) {

View File

@ -1,9 +1,10 @@
package model package model
type ThirteenAutoLog struct { type ThirteenAutoLog struct {
Id string Id string `gorm:"primaryKey"`
LogId string Platform string `gorm:"-"`
SnId int32 LogId string `gorm:"index;column:logid"`
AutoTime int64 // 自动时长,毫秒 SnId int32 `gorm:"index;column:snid"`
HandTime int64 // 手动时长,毫秒 AutoTime int64 // 自动时长,毫秒
HandTime int64 // 手动时长,毫秒
} }