Skip to content

Commit

Permalink
添加对古役模式下的牌谱分析
Browse files Browse the repository at this point in the history
  • Loading branch information
EndlessCheng committed Jun 7, 2019
1 parent b5fb095 commit 98b787c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions majsoul_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type majsoulRecordBaseInfo struct {
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`

Config *majsoulGameConfig `json:"config"`

Accounts []_majsoulRecordAccount `json:"accounts"`
}

Expand Down
16 changes: 16 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/fatih/color"
"github.com/EndlessCheng/mahjong-helper/util/model"
"github.com/EndlessCheng/mahjong-helper/util/debug"
"github.com/EndlessCheng/mahjong-helper/util"
)

type mjHandler struct {
Expand Down Expand Up @@ -189,6 +190,21 @@ func (h *mjHandler) runAnalysisMajsoulMessageTask() {
h.majsoulCurrentRecordUUID = d.CurrentRecordUUID
clearConsole()
fmt.Printf("正在解析雀魂牌谱:%s", baseInfo.String())

// 标记古役模式
isGuyiMode := baseInfo.Config.isGuyiMode()
util.SetConsiderOldYaku(isGuyiMode)
if isGuyiMode {
fmt.Println()
color.HiGreen("古役模式已开启")
}

gameConf.addMajsoulAccountID(d.AccountID)
if d.AccountID != gameConf.currentActiveMajsoulAccountID {
fmt.Println()
printAccountInfo(d.AccountID)
gameConf.currentActiveMajsoulAccountID = d.AccountID
}
case len(d.RecordActions) > 0:
if h.majsoulCurrentRecordUUID == "" {
h.logError(fmt.Errorf("错误:程序未收到所观看的雀魂牌谱的 UUID"))
Expand Down

0 comments on commit 98b787c

Please sign in to comment.