From 0464f296e8775e2a5c84e3ec44a5585e54ead3ea Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 10 Nov 2023 18:53:26 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/catchbugs/api_handleend.go | 2 +- modules/catchbugs/room.go | 217 +++++++++++++++-------------- 2 files changed, 111 insertions(+), 108 deletions(-) diff --git a/modules/catchbugs/api_handleend.go b/modules/catchbugs/api_handleend.go index 8aea1cbd2..36752fa11 100644 --- a/modules/catchbugs/api_handleend.go +++ b/modules/catchbugs/api_handleend.go @@ -43,6 +43,6 @@ func (this *apiComp) HandleEnd(session comm.IUserSession, req *pb.CatchbugsHandl } return } - session.SendMsg(string(this.module.GetType()), "handle", &pb.CatchbugsHandleEndResp{}) + session.SendMsg(string(this.module.GetType()), "handleend", &pb.CatchbugsHandleEndResp{}) return } diff --git a/modules/catchbugs/room.go b/modules/catchbugs/room.go index 2ecc5d4b9..f16e133de 100644 --- a/modules/catchbugs/room.go +++ b/modules/catchbugs/room.go @@ -12,14 +12,15 @@ import ( ) type Room struct { - module *CatchBugs - data *pb.DBCatchBugsRoom - conf *cfg.GameCatchbugSkillData - sessions []comm.IUserSession - starttime time.Time - round int32 - isReplenish bool - handleplayer string + module *CatchBugs + data *pb.DBCatchBugsRoom + conf *cfg.GameCatchbugSkillData + sessions []comm.IUserSession + starttime time.Time + round int32 + isReplenish bool + handleplayer string + handleplayers int32 } func (this *Room) GameStart() (err error) { @@ -28,12 +29,10 @@ func (this *Room) GameStart() (err error) { this.module.Errorln(err) return } - if err = this.Broadcast("gameready", &pb.CatchbugsGameReadyPush{ + this.SendAllSessions("gameready", &pb.CatchbugsGameReadyPush{ ServicePath: fmt.Sprintf("%s/%s", this.module.service.GetType(), this.module.service.GetId()), Room: this.data, - }); err != nil { - this.module.Errorln(err) - } + }, true) return } @@ -45,21 +44,22 @@ func (this *Room) PlayerReadyEnd(uid string) (err error) { this.data.Blue.Ready = true } - if this.data.Rules.Headstart == 0 { - this.handleplayer = this.data.Red.Info.Uid - } else { - this.handleplayer = this.data.Blue.Info.Uid + if this.handleplayer == "" { + if this.data.Rules.Headstart == 0 { + this.handleplayer = this.data.Red.Info.Uid + } else { + this.handleplayer = this.data.Blue.Info.Uid + } } if this.data.Red.Ready && this.data.Blue.Ready { //两个人都准备了 this.data.Red.Ready = false this.data.Blue.Ready = false - if err = this.Broadcast("roundstart", &pb.CatchbugsRoundStartPush{ + this.SendAllSessions("roundstart", &pb.CatchbugsRoundStartPush{ Round: this.round, Handleplayer: this.handleplayer, - }); err != nil { - this.module.Errorln(err) - } + }, true) + this.handleplayers = 0 } return } @@ -105,15 +105,13 @@ func (this *Room) PlayerHandle(uid string, handle *pb.CatchbugsHandleReq) (err e } } - if err = this.Broadcast("opencard", &pb.CatchbugsOpenCardPush{ + this.SendAllSessions("opencard", &pb.CatchbugsOpenCardPush{ Roomid: this.data.Rid, Handleplayer: uid, Index: handle.Index, Number: number, Issucc: issucc, - }); err != nil { - this.module.Errorln(err) - } + }, true) return } @@ -127,59 +125,14 @@ func (this *Room) PlayerHandleEnd(uid string, handle *pb.CatchbugsHandleEndReq) var ( card []*pb.DBCatchBugsCard ) - + this.handleplayers++ if this.data.Red.Info.Uid == uid { this.handleplayer = this.data.Blue.Info.Uid } else { this.handleplayer = this.data.Red.Info.Uid } + state := this.checkGameOver() - if state == 2 || this.round == 3 { - this.ReplenishCard() - card = this.data.Card - if err = this.Broadcast("tableschange", &pb.CatchbugsTablesChangePush{ - Changetype: 1, - Card: card, - }); err != nil { - this.module.Errorln(err) - } - } else { - this.round++ - } - if this.round%this.conf.Round == 0 { //触发技能 - switch this.data.Rules.Skill { - case 1: - this.data.Card = Skill1Effect(this.data.Card) - card = this.data.Card - if err = this.Broadcast("tableschange", &pb.CatchbugsTablesChangePush{ - Changetype: 0, - Card: card, - }); err != nil { - this.module.Errorln(err) - } - break - case 2: - this.data.Card = Skill2Effect(this.data.Card) - card = this.data.Card - if err = this.Broadcast("tableschange", &pb.CatchbugsTablesChangePush{ - Changetype: 0, - Card: card, - }); err != nil { - this.module.Errorln(err) - } - break - case 4: - this.data.Card = Skill4Effect(this.data.Card) - card = this.data.Card - if err = this.Broadcast("tableschange", &pb.CatchbugsTablesChangePush{ - Changetype: 0, - Card: card, - }); err != nil { - this.module.Errorln(err) - } - break - } - } if state == 3 { winuid := "" if len(this.data.Red.Cards) > len(this.data.Blue.Cards) { @@ -205,18 +158,63 @@ func (this *Room) PlayerHandleEnd(uid string, handle *pb.CatchbugsHandleEndReq) "integral": this.data.Blue.Integral, }) } - if err = this.Broadcast("gameover", &pb.CatchbugsGameOverPush{ + this.SendAllSessions("gameover", &pb.CatchbugsGameOverPush{ Winuid: winuid, Redintegral: this.data.Red.Integral, Blueintegral: this.data.Blue.Integral, - }); err != nil { - - this.module.Errorln(err) - } + }, true) } else { - if err = this.Broadcast("roundend", &pb.CatchbugsRoundEndPush{}); err != nil { - this.module.Errorln(err) + if state == 2 { //需要补拍 + this.ReplenishCard() + card = this.data.Card + this.SendAllSessions("tableschange", &pb.CatchbugsTablesChangePush{ + Changetype: 1, + Card: card, + }, false) + this.SendAllSessions("roundend", &pb.CatchbugsRoundEndPush{}, true) + } else { + if this.handleplayers == 2 { + this.round++ + if this.round == 3 { + this.ReplenishCard() + card = this.data.Card + this.SendAllSessions("tableschange", &pb.CatchbugsTablesChangePush{ + Changetype: 1, + Card: card, + }, false) + } + if this.round%this.conf.Round == 0 { //触发技能 + switch this.data.Rules.Skill { + case 1: + this.data.Card = Skill1Effect(this.data.Card) + card = this.data.Card + this.SendAllSessions("tableschange", &pb.CatchbugsTablesChangePush{ + Changetype: 0, + Card: card, + }, false) + break + case 2: + this.data.Card = Skill2Effect(this.data.Card) + card = this.data.Card + this.SendAllSessions("tableschange", &pb.CatchbugsTablesChangePush{ + Changetype: 0, + Card: card, + }, false) + break + case 4: + this.data.Card = Skill4Effect(this.data.Card) + card = this.data.Card + this.SendAllSessions("tableschange", &pb.CatchbugsTablesChangePush{ + Changetype: 0, + Card: card, + }, false) + break + } + } + this.SendAllSessions("roundend", &pb.CatchbugsRoundEndPush{}, true) + } } + } return @@ -260,46 +258,51 @@ func (this *Room) ReplenishCard() { func (this *Room) AiHanle(stype string) { switch stype { - case "gameready": - go this.PlayerReadyEnd(this.data.Blue.Info.Uid) + case "gameready", "roundend": + this.PlayerReadyEnd(this.data.Blue.Info.Uid) break case "roundstart": - go func() { - randoms := []int32{2, 3, 4, 5, 6} - random := randoms[comm.GetRandW(randoms)] - cardsSlice := []int32{} - for _, v := range this.data.Card { - if !v.Isopen { - cardsSlice = append(cardsSlice, v.Index) - } + if this.handleplayer != this.data.Blue.Info.Uid { + return + } + randoms := []int32{2, 3, 4, 5, 6} + random := randoms[comm.GetRandW(randoms)] + cardsSlice := []int32{} + for _, v := range this.data.Card { + if !v.Isopen { + cardsSlice = append(cardsSlice, v.Index) } - if random > int32(len(cardsSlice)) { - random = int32(len(cardsSlice)) - } - indexs := comm.RandShuffle(len(cardsSlice)) - for i, v := range indexs[0:random] { - this.PlayerHandle(this.data.Blue.Info.Uid, &pb.CatchbugsHandleReq{ - Roomid: this.data.Rid, - Index: cardsSlice[v], - Number: int32(i % 2), - }) - } - this.PlayerHandleEnd(this.data.Blue.Info.Uid, &pb.CatchbugsHandleEndReq{ + } + if random > int32(len(cardsSlice)) { + random = int32(len(cardsSlice)) + } + indexs := comm.RandShuffle(len(cardsSlice)) + for i, v := range indexs[0:random] { + this.PlayerHandle(this.data.Blue.Info.Uid, &pb.CatchbugsHandleReq{ Roomid: this.data.Rid, + Index: cardsSlice[v], + Number: int32(i % 2), }) - }() + } + this.PlayerHandleEnd(this.data.Blue.Info.Uid, &pb.CatchbugsHandleEndReq{ + Roomid: this.data.Rid, + }) break } } -func (this *Room) Broadcast(stype string, msg proto.Message) (err error) { - if err = this.module.SendMsgToSession(string(this.module.GetType()), stype, msg, this.sessions...); err != nil { - this.module.Errorln(err) +func (this *Room) SendAllSessions(stype string, msg proto.Message, ispush bool) { + for _, v := range this.sessions { + v.SendMsg(string(this.module.GetType()), stype, msg) } - if this.data.Blue.Isai { //是ai - this.AiHanle(stype) + if ispush { + for _, v := range this.sessions { + v.Push() + } + } + if this.data.Blue.Isai { + go this.AiHanle(stype) } - return } //技能效果1 随机2x2的区域 旋转 From 43c899498d044b2039ffcb6fac0cbcc4e85a1ab1 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 13 Nov 2023 11:16:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8D=95=E7=BE=8A?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/catchbugs/api_handle.go | 4 +- modules/catchbugs/room.go | 9 +- modules/parkour/module.go | 2 + modules/user/api_create.go | 2 - pb/parkour_msg.pb.go | 146 +++++++++++++++----------------- 5 files changed, 80 insertions(+), 83 deletions(-) diff --git a/modules/catchbugs/api_handle.go b/modules/catchbugs/api_handle.go index bd8d855dc..8ae2dc5a9 100644 --- a/modules/catchbugs/api_handle.go +++ b/modules/catchbugs/api_handle.go @@ -37,8 +37,8 @@ func (this *apiComp) Handle(session comm.IUserSession, req *pb.CatchbugsHandleRe if err = room.PlayerHandle(session.GetUserId(), req); errdata != nil { errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.String(), + Code: pb.ErrorCode_SystemError, + Title: pb.ErrorCode_SystemError.String(), Message: err.Error(), } return diff --git a/modules/catchbugs/room.go b/modules/catchbugs/room.go index f16e133de..4afff6f95 100644 --- a/modules/catchbugs/room.go +++ b/modules/catchbugs/room.go @@ -59,7 +59,7 @@ func (this *Room) PlayerReadyEnd(uid string) (err error) { Round: this.round, Handleplayer: this.handleplayer, }, true) - this.handleplayers = 0 + } return } @@ -70,6 +70,11 @@ func (this *Room) PlayerHandle(uid string, handle *pb.CatchbugsHandleReq) (err e err = fmt.Errorf("It's not your operation!") return } + + if this.data.Card[handle.Index].Isopen { + err = fmt.Errorf("card is opened") + return + } var ( issucc bool number int32 @@ -212,6 +217,8 @@ func (this *Room) PlayerHandleEnd(uid string, handle *pb.CatchbugsHandleEndReq) } } this.SendAllSessions("roundend", &pb.CatchbugsRoundEndPush{}, true) + } else { + this.SendAllSessions("roundend", &pb.CatchbugsRoundEndPush{}, true) } } diff --git a/modules/parkour/module.go b/modules/parkour/module.go index 4c80e54e8..02d6aff43 100644 --- a/modules/parkour/module.go +++ b/modules/parkour/module.go @@ -577,7 +577,9 @@ func (this *Parkour) overtimer(task *timewheel.Task, args ...interface{}) { Race: &pb.DBRace{ Id: battle.Id, Redmember: battle.RedMember, + Redscores: battle.RedScore, Bulemember: battle.BuleMember, + Bulescores: battle.BuleScore, }, Award: award[v.GetUserId()], }) diff --git a/modules/user/api_create.go b/modules/user/api_create.go index a418ca3d6..fadbaf122 100644 --- a/modules/user/api_create.go +++ b/modules/user/api_create.go @@ -117,12 +117,10 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e } //异步逻辑 go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - this.mail.SendMailByCid(session, comm.Welcomemail, nil) if len(tasks) > 0 { this.module.ModuleBuried.TriggerBuried(session, tasks...) } - this.module.WriteUserLog(session.GetUserId(), "UserCreateReq", res) }) return diff --git a/pb/parkour_msg.pb.go b/pb/parkour_msg.pb.go index df7d93eaa..ba1f599ba 100644 --- a/pb/parkour_msg.pb.go +++ b/pb/parkour_msg.pb.go @@ -1442,10 +1442,9 @@ type ParkourRaceOverPush struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Winside int32 `protobuf:"varint,1,opt,name=winside,proto3" json:"winside"` //0平局 1 红方胜利 2 蓝方胜利 - Race *DBRace `protobuf:"bytes,2,opt,name=race,proto3" json:"race"` //比赛信息 - Weekintegral int32 `protobuf:"varint,3,opt,name=weekintegral,proto3" json:"weekintegral"` //周长积分 - Award []*UserAtno `protobuf:"bytes,4,rep,name=award,proto3" json:"award"` //奖励 + Winside int32 `protobuf:"varint,1,opt,name=winside,proto3" json:"winside"` //0平局 1 红方胜利 2 蓝方胜利 + Race *DBRace `protobuf:"bytes,2,opt,name=race,proto3" json:"race"` //比赛信息 + Award []*UserAtno `protobuf:"bytes,4,rep,name=award,proto3" json:"award"` //奖励 } func (x *ParkourRaceOverPush) Reset() { @@ -1494,13 +1493,6 @@ func (x *ParkourRaceOverPush) GetRace() *DBRace { return nil } -func (x *ParkourRaceOverPush) GetWeekintegral() int32 { - if x != nil { - return x.Weekintegral - } - return 0 -} - func (x *ParkourRaceOverPush) GetAward() []*UserAtno { if x != nil { return x.Award @@ -2293,75 +2285,73 @@ var file_parkour_parkour_msg_proto_rawDesc = []byte{ 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x65, 0x76, 0x69, 0x76, 0x61, 0x6c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x22, 0x91, 0x01, 0x0a, 0x13, 0x50, - 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x61, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x50, 0x75, - 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x04, - 0x72, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x52, - 0x61, 0x63, 0x65, 0x52, 0x04, 0x72, 0x61, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x77, 0x65, 0x65, - 0x6b, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0c, 0x77, 0x65, 0x65, 0x6b, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x1f, 0x0a, - 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x22, 0x26, - 0x0a, 0x14, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x48, 0x0a, 0x15, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, - 0x72, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, - 0x22, 0x19, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x41, 0x6c, 0x6c, 0x57, 0x65, - 0x65, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0xc5, 0x01, 0x0a, 0x18, - 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x41, 0x6c, 0x6c, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, - 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x50, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x68, 0x70, 0x22, 0x6d, 0x0a, 0x13, 0x50, 0x61, + 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x61, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x50, 0x75, 0x73, + 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x72, + 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x52, 0x61, + 0x63, 0x65, 0x52, 0x04, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, + 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x22, 0x26, 0x0a, 0x14, 0x50, 0x61, 0x72, + 0x6b, 0x6f, 0x75, 0x72, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, + 0x64, 0x22, 0x48, 0x0a, 0x15, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x57, 0x65, 0x65, 0x6b, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, + 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x41, 0x6c, 0x6c, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x57, 0x65, 0x65, 0x6b, 0x72, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x72, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, - 0x77, 0x61, 0x72, 0x64, 0x1a, 0x3d, 0x0a, 0x0f, 0x57, 0x65, 0x65, 0x6b, 0x72, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x35, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x65, - 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x1a, - 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x18, 0x50, 0x61, - 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x6f, - 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x52, 0x04, 0x72, - 0x61, 0x63, 0x65, 0x22, 0x7e, 0x0a, 0x16, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, - 0x72, 0x4a, 0x6f, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, - 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x03, 0x61, 0x69, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x03, - 0x61, 0x69, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, - 0x72, 0x4a, 0x6f, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x38, - 0x0a, 0x18, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, - 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, - 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x52, 0x50, 0x43, 0x50, - 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5c, 0x0a, 0x16, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, - 0x6f, 0x75, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x63, 0x63, 0x52, 0x65, 0x71, 0x12, - 0x1f, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, - 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64, - 0x12, 0x21, 0x0a, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x04, 0x62, - 0x75, 0x6c, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, - 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x53, 0x75, 0x63, 0x63, 0x52, 0x65, 0x73, 0x70, 0x22, 0x49, - 0x0a, 0x19, 0x52, 0x50, 0x43, 0x5f, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x54, 0x72, 0x75, - 0x73, 0x74, 0x65, 0x65, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x52, 0x50, 0x43, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x22, 0xc5, 0x01, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x6b, 0x6f, + 0x75, 0x72, 0x41, 0x6c, 0x6c, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, + 0x72, 0x41, 0x6c, 0x6c, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x2e, 0x57, 0x65, 0x65, 0x6b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0a, 0x77, 0x65, 0x65, 0x6b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, + 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x1a, + 0x3d, 0x0a, 0x0f, 0x57, 0x65, 0x65, 0x6b, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x35, + 0x0a, 0x17, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x18, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, + 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x72, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x07, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x52, 0x04, 0x72, 0x61, 0x63, 0x65, 0x22, 0x7e, + 0x0a, 0x16, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4a, 0x6f, 0x69, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x70, 0x74, + 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x70, + 0x74, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x0a, + 0x03, 0x61, 0x69, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, + 0x61, 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x03, 0x61, 0x69, 0x73, 0x22, 0x19, + 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4a, 0x6f, 0x69, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x22, 0x38, 0x0a, 0x18, 0x52, 0x50, 0x43, + 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x61, 0x69, + 0x6e, 0x69, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, + 0x72, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x5c, 0x0a, 0x16, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x53, 0x75, 0x63, 0x63, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x03, 0x72, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, 0x63, 0x65, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x04, 0x62, + 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x52, 0x61, + 0x63, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x04, 0x62, 0x75, 0x6c, 0x65, 0x22, 0x19, + 0x0a, 0x17, 0x52, 0x50, 0x43, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x53, 0x75, 0x63, 0x63, 0x52, 0x65, 0x73, 0x70, 0x22, 0x49, 0x0a, 0x19, 0x52, 0x50, 0x43, 0x5f, 0x50, 0x61, 0x72, 0x6b, 0x6f, 0x75, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x65, 0x73, - 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x75, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x52, 0x50, 0x43, 0x5f, 0x50, 0x61, 0x72, 0x6b, + 0x6f, 0x75, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x65, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( From e3ae5d11b8e2a68b4ed204e172e5552464ee0b05 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 13 Nov 2023 13:52:37 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8D=95=E7=BE=8A?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/parkour/api_recoverhp.go | 2 +- modules/parkour/configure.go | 2 +- modules/parkour/module.go | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/parkour/api_recoverhp.go b/modules/parkour/api_recoverhp.go index 58c2d2bb4..b5c05513b 100644 --- a/modules/parkour/api_recoverhp.go +++ b/modules/parkour/api_recoverhp.go @@ -40,7 +40,7 @@ func (this *apiComp) RecoverHp(session comm.IUserSession, req *pb.ParkourRecover } } //恢复hp - go this.module.recoverhp(req.Battleid, req.Uid, this.module.ModuleTools.GetGlobalConf().BuzkashiHpbumphp) + go this.module.recoverhp(req.Battleid, session.GetUserId(), this.module.ModuleTools.GetGlobalConf().BuzkashiHpbumphp) } else { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, diff --git a/modules/parkour/configure.go b/modules/parkour/configure.go index 42a48dfcd..2230abe4c 100644 --- a/modules/parkour/configure.go +++ b/modules/parkour/configure.go @@ -219,7 +219,7 @@ func (this *configureComp) getActiveRewardByS(score int32) (conf *cfg.GameQualif this.module.Errorln(err) } else { for _, conf = range v.(*cfg.GameQualifying).GetDataList() { - if score > conf.ScoreLow && score <= conf.ScoreUp { + if score >= conf.ScoreLow && score <= conf.ScoreUp { return } } diff --git a/modules/parkour/module.go b/modules/parkour/module.go index 02d6aff43..3e17243ea 100644 --- a/modules/parkour/module.go +++ b/modules/parkour/module.go @@ -591,7 +591,6 @@ func (this *Parkour) overtimer(task *timewheel.Task, args ...interface{}) { for _, v := range battle.RedMember { if !v.Isai { - if danconf, err = this.configure.getActiveRewardByS(v.Integral); err != nil { this.Errorln(err) continue From 569d9774db7024ad01a4cf9f4cc4d37f33ce35e4 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 13 Nov 2023 13:57:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=B8=8A=E4=BC=A0ai=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/catchbugs/room.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/catchbugs/room.go b/modules/catchbugs/room.go index 4afff6f95..5fa141b9f 100644 --- a/modules/catchbugs/room.go +++ b/modules/catchbugs/room.go @@ -106,7 +106,7 @@ func (this *Room) PlayerHandle(uid string, handle *pb.CatchbugsHandleReq) (err e this.data.Blue.Cards = append(this.data.Red.Cards, this.data.Card[this.data.Blue.Lastopencard].Cid) } number = 1 - this.data.Red.Lastopencard = 0 + this.data.Blue.Lastopencard = 0 } }