modify 十三张手动摆牌
This commit is contained in:
parent
b186967189
commit
694e8a5992
|
@ -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() {
|
||||||
|
|
||||||
|
if !player.IsRobot() {
|
||||||
mq.Write(model.ThirteenAutoLog{
|
mq.Write(model.ThirteenAutoLog{
|
||||||
Id: primitive.NewObjectID().Hex(),
|
Id: primitive.NewObjectID().Hex(),
|
||||||
|
Platform: player.Platform,
|
||||||
LogId: sceneEx.logid,
|
LogId: sceneEx.logid,
|
||||||
SnId: player.SnId,
|
SnId: player.SnId,
|
||||||
AutoTime: player.AutoMill.Milliseconds(),
|
AutoTime: player.AutoMill.Milliseconds(),
|
||||||
HandTime: player.HandMill.Milliseconds(),
|
HandTime: player.HandMill.Milliseconds(),
|
||||||
}, mq.BackThirteenAutoLog)
|
}, 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) {
|
||||||
|
|
|
@ -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"`
|
||||||
|
SnId int32 `gorm:"index;column:snid"`
|
||||||
AutoTime int64 // 自动时长,毫秒
|
AutoTime int64 // 自动时长,毫秒
|
||||||
HandTime int64 // 手动时长,毫秒
|
HandTime int64 // 手动时长,毫秒
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue