From 3c3b6f7376ac40934a54f629e994d3491f850cf9 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 4 Jun 2024 15:26:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=A8=E5=A4=A9?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/player.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/model/player.go b/model/player.go index 147c589..d3b13bd 100644 --- a/model/player.go +++ b/model/player.go @@ -1055,6 +1055,13 @@ func GetPlayerDataBySnId(plt string, snid int32, correctData, createIfNotExist b logger.Logger.Tracef("Get %v %v player data error:%v", plt, snid, err) return nil, false } + + // 设置本地时区 + ret.Pd.UpgradeTime = ret.Pd.UpgradeTime.Local() + ret.Pd.CreateTime = ret.Pd.CreateTime.Local() + ret.Pd.LastLoginTime = ret.Pd.LastLoginTime.Local() + ret.Pd.LastLogoutTime = ret.Pd.LastLogoutTime.Local() + return ret.Pd, ret.IsNew } From 5d113056c85ef35d1b3607e88d6fc208d4a65fd4 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 4 Jun 2024 15:39:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=A7=81=E4=BA=BA?= =?UTF-8?q?=E6=88=BF=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/constant.go | 8 ++++---- protocol/gamehall/game.pb.go | 2 +- protocol/gamehall/game.proto | 2 +- public | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/constant.go b/common/constant.go index 448c69e..f3b9390 100644 --- a/common/constant.go +++ b/common/constant.go @@ -168,10 +168,10 @@ const ( // 房间模式 const ( - SceneMode_Public = iota //公共房间 - SceneMode_Private //私人房间 - SceneMode_Match //赛事房间 - SceneMode_Thr //三方房间 + SceneMode_Public = 0 //公共房间 + SceneMode_Private = 2 //私人房间 + SceneMode_Match = 3 //赛事房间 + SceneMode_Thr = 4 //三方房间 ) const ( diff --git a/protocol/gamehall/game.pb.go b/protocol/gamehall/game.pb.go index 72bc23c..da7b4d0 100644 --- a/protocol/gamehall/game.pb.go +++ b/protocol/gamehall/game.pb.go @@ -4726,7 +4726,7 @@ type CSQueryRoomInfo struct { GameIds []int32 `protobuf:"varint,1,rep,packed,name=GameIds,proto3" json:"GameIds,omitempty"` GameSite int32 `protobuf:"varint,2,opt,name=GameSite,proto3" json:"GameSite,omitempty"` //1.初级 2.中级 3.高级 Id []int32 `protobuf:"varint,3,rep,packed,name=Id,proto3" json:"Id,omitempty"` //gamefreeid - SceneMode int32 `protobuf:"varint,4,opt,name=SceneMode,proto3" json:"SceneMode,omitempty"` // 0公共房 1私人房 + SceneMode int32 `protobuf:"varint,4,opt,name=SceneMode,proto3" json:"SceneMode,omitempty"` // 0公共房 2私人房 } func (x *CSQueryRoomInfo) Reset() { diff --git a/protocol/gamehall/game.proto b/protocol/gamehall/game.proto index 4e5defe..180c045 100644 --- a/protocol/gamehall/game.proto +++ b/protocol/gamehall/game.proto @@ -615,7 +615,7 @@ message CSQueryRoomInfo{ repeated int32 GameIds = 1; int32 GameSite = 2; //1.初级 2.中级 3.高级 repeated int32 Id = 3; //gamefreeid - int32 SceneMode = 4; // 0公共房 1私人房 + int32 SceneMode = 4; // 0公共房 2私人房 } //个人创建的房间信息 diff --git a/public b/public index 7f2452e..549a622 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit 7f2452e10c176dc35fc5ed1ffdb0b4145aec8160 +Subproject commit 549a622ad237392dddedae5d13456a06a8328fdd From a13390909db116ddefa21914acd9db2cd82b81b6 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 5 Jun 2024 09:14:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8D=81=E4=B8=89=E5=BC=A0=E8=B0=83?= =?UTF-8?q?=E6=8E=A7=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/thirteen/player.go | 2 ++ gamesrv/thirteen/scene.go | 11 +++++++++++ gamesrv/thirteen/scenepolicy.go | 9 ++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/gamesrv/thirteen/player.go b/gamesrv/thirteen/player.go index 302474e..f3d5a70 100644 --- a/gamesrv/thirteen/player.go +++ b/gamesrv/thirteen/player.go @@ -24,6 +24,7 @@ type PlayerEx struct { odds int32 totalScore int64 defGroup *thirteen.Group + playerPool int // 个人水池分 } func (this *PlayerEx) Clear() { @@ -46,6 +47,7 @@ func (this *PlayerEx) Clear() { this.odds = 0 this.totalScore = 0 this.defGroup = nil + this.playerPool = 0 this.TestLog = this.TestLog[:0] } diff --git a/gamesrv/thirteen/scene.go b/gamesrv/thirteen/scene.go index 63dc6eb..ef15809 100644 --- a/gamesrv/thirteen/scene.go +++ b/gamesrv/thirteen/scene.go @@ -57,6 +57,7 @@ type PlayerData struct { allGroup map[int]*rule.Group TestLog []string RoleId int32 + PlayerPool int // 个人水池分 } type SceneEx struct { @@ -81,6 +82,7 @@ type SceneEx struct { LeaveNum int // 离场扣分人数 testPokers []int64 // 测试牌堆 logid string + ctrlType int // 1控赢 2控输 0不控 } func NewThirteenWaterSceneData(s *base.Scene) *SceneEx { @@ -121,6 +123,7 @@ func (this *SceneEx) Clear() { this.nowMaxCardsIsIn = true this.PlayerBackup = make(map[int32]*PlayerData) this.LeaveNum = 0 + this.ctrlType = 0 for i := 0; i < this.GetPlayerNum(); i++ { if this.seats[i] != nil { @@ -1310,6 +1313,7 @@ func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) { allGroup: p.allGroup, TestLog: testLog, RoleId: p.PlayerData.GetRoleId(), + PlayerPool: p.playerPool, } } @@ -1322,6 +1326,7 @@ func (this *SceneEx) SendHandCardOdds() { robotPlayers = append(robotPlayers, seat) } else { seat.odds = this.GetPlayerOdds(seat.Player, this.GameId, this.robotNum > 0) + seat.playerPool = int(this.PlayerPoolOdds(seat.Player)) if seat.odds > 0 { realPlayersGood = append(realPlayersGood, seat) G += seat.odds @@ -1387,6 +1392,12 @@ func (this *SceneEx) SendHandCardOdds() { isGood := len(realPlayersGood) > 0 && int32(this.RandInt(1000)) < G isBad := len(realPlayersBad) > 0 && int32(this.RandInt(1000)) < B logger.Logger.Tracef("Thirteen SendHandCardOdds Good:%v G:%v Bad:%v B:%v", isGood, G, isBad, B) + if isBad { + this.ctrlType = 2 + } + if isGood && !isBad { + this.ctrlType = 1 + } if isGood || isBad { // 按从大到小排序 this.cardsSort(cardsArr, cardsGroup) diff --git a/gamesrv/thirteen/scenepolicy.go b/gamesrv/thirteen/scenepolicy.go index df0d4ea..e9ab157 100644 --- a/gamesrv/thirteen/scenepolicy.go +++ b/gamesrv/thirteen/scenepolicy.go @@ -1208,9 +1208,11 @@ func (this *StateBilled) OnEnter(s *base.Scene) { if sceneEx, ok := s.ExtraData.(*SceneEx); ok { //通知客户端结算结果 var billed []*thirteen.Billed + playerPool := map[int]int{} // 没离开,剩余玩家结算 for _, playerEx := range sceneEx.players { if playerEx != nil && playerEx.IsGameing() { + playerPool[int(playerEx.SnId)] = playerEx.playerPool if playerEx.gainCoin > 0 { //税前赢的钱 税收 下注额 playerEx.AddServiceFee(playerEx.taxCoin) @@ -1235,6 +1237,7 @@ func (this *StateBilled) OnEnter(s *base.Scene) { // 提前离开的 for _, playerEx := range sceneEx.PlayerBackup { if playerEx != nil && playerEx.isBilled { + playerPool[int(playerEx.SnId)] = playerEx.PlayerPool billed = append(billed, &thirteen.Billed{ Pos: proto.Int32(int32(playerEx.Pos)), Coin: proto.Int64(playerEx.Coin), @@ -1390,7 +1393,11 @@ func (this *StateBilled) OnEnter(s *base.Scene) { thirteenWaterType.PlayerCount = len(person) info, err := model.MarshalGameNoteByFIGHT(&thirteenWaterType) if err == nil { - sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{ + Trend20Lately: "", + CtrlType: sceneEx.ctrlType, + PlayerPool: playerPool, + }) } } }