From 8ab8cbacfeab9f7be600160ba6549b80b42dab06 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Fri, 25 Oct 2024 10:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E8=AF=B7=E7=A7=AF=E5=88=86=E6=8E=92?= =?UTF-8?q?=E8=A1=8C=E6=A6=9C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/tienlen/scenepolicy_tienlen.go | 16 +++++++---- ranksrv/rank/invitelog.go | 40 ++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 5965abc..c62b886 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -1000,16 +1000,20 @@ func (this *SceneHandCardStateTienLen) OnEnter(s *base.Scene) { sceneEx.SendHandCardOdds() } }*/ - - if sceneEx.WGCreateScene.GetCloseCtrl() { - sceneEx.RandomCards() + if len(sceneEx.testPokers) > 1 { + sceneEx.SendHandCardOdds() } else { - if sceneEx.IsMatchScene() || sceneEx.IsCustom() { - sceneEx.SendHandCard_Match() + if sceneEx.WGCreateScene.GetCloseCtrl() { + sceneEx.RandomCards() } else { - sceneEx.SendHandCardOdds() + if sceneEx.IsMatchScene() || sceneEx.IsCustom() { + sceneEx.SendHandCard_Match() + } else { + sceneEx.SendHandCardOdds() + } } } + } for _, seat := range sceneEx.seats { diff --git a/ranksrv/rank/invitelog.go b/ranksrv/rank/invitelog.go index e0a89f8..c9bd649 100644 --- a/ranksrv/rank/invitelog.go +++ b/ranksrv/rank/invitelog.go @@ -25,6 +25,39 @@ var InviteLogMgrInstance = com.NewListMgr[*model.InviteInfo]( return ret, nil }) +var RobotInviteMgr = &RobotManager{} + +type RobotManager struct { +} + +func (this *RobotManager) InterestClockEvent() int { + return 1 << common.ClockEventDay +} + +func (this *RobotManager) OnMonthTimer() { +} + +func (this *RobotManager) ClockEventMax() { + return +} +func (this *RobotManager) OnSecTimer() { +} + +func (this *RobotManager) OnMiniTimer() { +} + +func (this *RobotManager) OnHourTimer() { +} + +func (this *RobotManager) OnWeekTimer() { +} + +func (this *RobotManager) OnShutdown() { +} + +func (this *RobotManager) OnDayTimer() { + RobotRandon() +} func RobotRandon() { //机器人随机 robotNum := rand.Intn(21) + 10 @@ -53,10 +86,5 @@ func RobotRandon() { })).StartByFixExecutor("SaveRankInviteTask") } func init() { - common.RegisterClockFunc(&common.ClockFunc{ - OnDayTimerFunc: func() { - RobotRandon() - logger.Logger.Trace("邀请积分排行榜0点机器人随机完成!") - }, - }) + common.ClockMgrSingleton.RegisterSinker(RobotInviteMgr) }