From 866dc7ef3bd0572e45be80f37641b548de680d54 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 12 Jan 2024 11:53:56 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=B8=89=E6=B6=88=20=E5=B0=86=E9=9A=8F?= =?UTF-8?q?=E6=9C=BA6=E4=B8=AA=E5=AE=9D=E7=9F=B3=E6=9F=93=E6=88=90?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=9B=98=E9=9D=A2=E4=B8=8A=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E6=9C=80=E5=A4=9A=E7=9A=84=E5=AE=9D=E7=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/xxlPlat.go | 26 +++++++++++++++++++++++--- modules/pagoda/api_getrace.go | 20 +++++++++++--------- modules/pagoda/api_racechallenge.go | 2 +- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index a2ca566da..62ba61c42 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -731,6 +731,15 @@ func (this *MapData) SkillUp(pos int32, color int32, skillid int32, value int32, } case 3: // 将随机6个宝石染成当前盘面上颜色最多的宝石 this.SkillChangeColor(value) + bDrop = false + szMap = append(szMap, &pb.MapData{ + Data: this.GetPalatData(), + CurSocre: skillScore, + CurEnergy: skillEnergy, + }) + if list, _ := this.CheckMap(color, false); len(list) > 0 { + szMap = append(szMap, list...) + } case 4: x := int(pos / Width) y := int(pos % Height) @@ -1488,9 +1497,15 @@ func (this *MapData) SkillChangeColor(count int32) { elemCount[v.Color] += 1 } - for k := range elemCount { - if color < k { + for _, v := range elemCount { + if color < v { + color = v + } + } + for k, v := range elemCount { + if color == v { color = k + break } } for i := 0; i < int(count); i++ { @@ -1498,7 +1513,12 @@ func (this *MapData) SkillChangeColor(count int32) { if this.Plat[targetId].Color == color { i-- } else { - this.Plat[targetId].Color = color // 变更颜色 + if this.Plat[targetId].Special == 0 { + this.Plat[targetId].Color = color // 变更颜色 + this.Plat[targetId].Cid = color // 变更颜色 + this.oid++ + this.Plat[targetId].Oid = this.oid // 变唯一id + } } } return diff --git a/modules/pagoda/api_getrace.go b/modules/pagoda/api_getrace.go index a377c3c3f..5e1a0a678 100644 --- a/modules/pagoda/api_getrace.go +++ b/modules/pagoda/api_getrace.go @@ -21,7 +21,7 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq err error update map[string]interface{} ) - update = make(map[string]interface{}, 0) + list, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId()) if err != nil { errdata = &pb.ErrorData{ @@ -33,20 +33,22 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq } if !utils.IsToday(list.Rtime) { + update = make(map[string]interface{}, 0) list.Rtime = configure.Now().Unix() list.Battlecount = 0 update["battlecount"] = list.Battlecount update["rtime"] = list.Rtime - } - - if err = this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), update); err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), + if err = this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), update); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } } } - session.SendMsg(string(this.module.GetType()), PagodaGetRaceResp, &pb.PagodaGetRaceResp{}) + session.SendMsg(string(this.module.GetType()), PagodaGetRaceResp, &pb.PagodaGetRaceResp{ + Data: list, + }) return } diff --git a/modules/pagoda/api_racechallenge.go b/modules/pagoda/api_racechallenge.go index 0238abe84..c38a5815b 100644 --- a/modules/pagoda/api_racechallenge.go +++ b/modules/pagoda/api_racechallenge.go @@ -73,7 +73,7 @@ func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChal } if _, ok := pagoda.Data[conf.Floors]; !ok { - if pagoda.Maxfloor != conf.Floors+1 { + if pagoda.Maxfloor+1 != conf.Floors { errdata = &pb.ErrorData{ // 挑战关卡数据不匹配 Code: pb.ErrorCode_PagodaLevlErr, Title: pb.ErrorCode_PagodaLevlErr.ToString(), From 59f996ddfc087fe88f1e247ebd53bb41e4b1951e Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 12 Jan 2024 15:34:36 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=AE=AD=E9=BE=99=E5=85=BB=E6=88=90?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B1=9E=E6=80=A7=20=E5=85=AD=E5=90=88?= =?UTF-8?q?=E5=A1=94=E9=A2=86=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_skillafteratk.json | 10 +- bin/json/game_skillatk.json | 5 +- modules/dragon/api_train.go | 1 + modules/dragon/model_dragon.go | 2 + modules/dragon/module.go | 2 + modules/hero/hero_test.go | 45 +++++--- modules/pagoda/api_racechallengeover.go | 12 +- modules/pagoda/api_racereward.go | 103 ++++++++++++++++++ modules/pagoda/comp_configure.go | 57 +++++++++- pb/pagoda_msg.pb.go | 29 +++-- .../structs/Game.BuzkashiMountData.go | 4 +- 11 files changed, 226 insertions(+), 44 deletions(-) create mode 100644 modules/pagoda/api_racereward.go diff --git a/bin/json/game_skillafteratk.json b/bin/json/game_skillafteratk.json index 8820dca92..50398b6f5 100644 --- a/bin/json/game_skillafteratk.json +++ b/bin/json/game_skillafteratk.json @@ -40509,7 +40509,9 @@ 1200 ], "FollowSK": [], - "SucFollowSK": [], + "SucFollowSK": [ + 225002319 + ], "FailFollowSK": [], "MustHit": false, "DpsRevisiType": 0, @@ -40638,9 +40640,7 @@ 2 ], "FollowSK": [], - "SucFollowSK": [ - 225002319 - ], + "SucFollowSK": [], "FailFollowSK": [], "MustHit": false, "DpsRevisiType": 0, @@ -72688,7 +72688,7 @@ "TriggerAnim": "", "Type": 12, "Argu": [ - 100 + 300 ], "FollowSK": [], "SucFollowSK": [], diff --git a/bin/json/game_skillatk.json b/bin/json/game_skillatk.json index 078033f43..c44589dbd 100644 --- a/bin/json/game_skillatk.json +++ b/bin/json/game_skillatk.json @@ -32415,12 +32415,13 @@ "ChildSkill": { "Id": [ 225002211, - 225002213, 225002215 ] }, "passSkill": [ - 225002212 + 225002211, + 225002212, + 225002215 ], "Desc": { "key": "skill_skill_atk_Desc_125002211_1", diff --git a/modules/dragon/api_train.go b/modules/dragon/api_train.go index b649bc04d..eba37b871 100644 --- a/modules/dragon/api_train.go +++ b/modules/dragon/api_train.go @@ -148,6 +148,7 @@ func (this *apiComp) Train(session comm.IUserSession, req *pb.DragonTrainReq) (e dragon.Property["energyrecover"] = c.Energyrecover dragon.Property["caddtime"] = c.Caddtime dragon.Property["csubtime"] = c.Csubtime + dragon.Property["offsetspeed"] = c.Offsetspeed update["property"] = dragon.Property // 更新属性 } // 升阶后重置养成属性次数 diff --git a/modules/dragon/model_dragon.go b/modules/dragon/model_dragon.go index 4e198f42e..8c555e314 100644 --- a/modules/dragon/model_dragon.go +++ b/modules/dragon/model_dragon.go @@ -118,6 +118,8 @@ func (this *ModelDragon) CreateDragon(session comm.IUserSession, dragons map[str dragon.Property["energyrecover"] = c.Energyrecover dragon.Property["caddtime"] = c.Caddtime dragon.Property["csubtime"] = c.Csubtime + dragon.Property["offsetspeed"] = c.Offsetspeed + dragon.Property["offsetspeed"] = c.Offsetspeed } } diff --git a/modules/dragon/module.go b/modules/dragon/module.go index 18a3b0ddd..ce02115bc 100644 --- a/modules/dragon/module.go +++ b/modules/dragon/module.go @@ -98,6 +98,7 @@ func (this *Dragon) CreateRobotDragon(dragonid string, lv int32) (dragon *pb.DBD // dragon.Property["itemsprint"] = c.Itemsprint dragon.Property["caddtime"] = c.Caddtime dragon.Property["csubtime"] = c.Csubtime + dragon.Property["offsetspeed"] = c.Offsetspeed } return } @@ -179,6 +180,7 @@ func (this *Dragon) GMModifyDragonLv(uid string, cid string, lv int32) (dragon * dragon.Property["energyrecover"] = c.Energyrecover dragon.Property["caddtime"] = c.Caddtime dragon.Property["csubtime"] = c.Csubtime + dragon.Property["offsetspeed"] = c.Offsetspeed update["property"] = dragon.Property } } diff --git a/modules/hero/hero_test.go b/modules/hero/hero_test.go index 1cfee89a2..51d1334a2 100644 --- a/modules/hero/hero_test.go +++ b/modules/hero/hero_test.go @@ -168,6 +168,34 @@ func Test_Main(t *testing.T) { szByte []byte ) szByte = make([]byte, 0) + //010 2 + // 1<<2 + var star1, star2, star3 int32 + var rst int32 + rst = 1 + for i := 0; i < 3; i++ { + star1 = 1 << i + if rst&star1 == star1 { + star3++ + } + } + star1 = 1 << 0 + //star2 = 1 << 1 + star3 = 1 << 2 // 101 + rst |= star1 + rst |= star2 + rst |= star3 + //rst = star1 ^ star2 ^ star3 // 三星 + //rst = star1 ^ star2 // 2星 + rst ^= star1 + rst ^= star2 + rst ^= star2 + // 校验星 + b1 := (rst&star1 == star1) + b2 := (rst&star2 == star2) + b3 := (rst&star3 == star3) + fmt.Printf("%d,%d,%d,%d", star1, star2, star3, rst) + fmt.Printf("%v,%v,%v,%d", b1, b2, b3, rst) //szByte = append(szByte, 8) fmt.Printf("%v,%s", szByte, string(szByte)) @@ -254,23 +282,6 @@ func Test_Main(t *testing.T) { } defer trace.Stop() - var star1, star2, star3 int32 - var rst int32 - star1 = 1 << 0 - star2 = 1 << 1 - star3 = 1 << 2 - - //rst = star1 ^ star2 ^ star3 // 三星 - //rst = star1 ^ star2 // 2星 - rst ^= star1 - rst ^= star2 - rst ^= star2 - // 校验星 - b1 := (rst&star1 == star1) - b2 := (rst&star2 == star2) - b3 := (rst&star3 == star3) - fmt.Printf("%d,%d,%d,%d", star1, star2, star3, rst) - fmt.Printf("%v,%v,%v,%d", b1, b2, b3, rst) var list []int32 var list2 []int32 list = []int32{1, 2, 3, 4, 5, 6, 7, 8, 9} diff --git a/modules/pagoda/api_racechallengeover.go b/modules/pagoda/api_racechallengeover.go index ef7eccb83..0df5faedb 100644 --- a/modules/pagoda/api_racechallengeover.go +++ b/modules/pagoda/api_racechallengeover.go @@ -29,7 +29,6 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda award []*cfg.Gameatn changExp map[string]int32 costTime int32 // 耗时 - star int32 // 当前星级 new bool // 是否首次挑战 ) changExp = make(map[string]int32, 0) @@ -69,18 +68,23 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda } return } + costTime = req.Report.Costtime if _, ok := list.Data[conf.Floors]; !ok { if list.Maxfloor+1 == conf.Floors { list.Data[conf.Floors] = &pb.RaceData{ Consttime: costTime, - Star: star, + Star: req.Star, + } + if req.Star > 0 { + list.Maxfloor = conf.Floors + mapData["maxfloor"] = list.Maxfloor } - list.Maxfloor = conf.Floors - mapData["maxfloor"] = list.Maxfloor new = true } } + + list.Data[conf.Floors].Star = req.Star list.Battlecount += 1 mapData["data"] = list.Data mapData["battlecount"] = list.Battlecount diff --git a/modules/pagoda/api_racereward.go b/modules/pagoda/api_racereward.go new file mode 100644 index 000000000..1b18e4d8c --- /dev/null +++ b/modules/pagoda/api_racereward.go @@ -0,0 +1,103 @@ +package pagoda + +import ( + "fmt" + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" +) + +//参数校验 +func (this *apiComp) RaceRewardCheck(session comm.IUserSession, req *pb.PagodaRaceRewardReq) (errdata *pb.ErrorData) { + + return +} + +// 六合塔奖励 +func (this *apiComp) RaceReward(session comm.IUserSession, req *pb.PagodaRaceRewardReq) (errdata *pb.ErrorData) { + + var ( + atno []*pb.UserAtno + list *pb.DBPagodaRace + err error + szConf []*cfg.GameSixDirectionsRewardData + res []*cfg.Gameatn + totalStar int32 + floors []int32 + curStr int32 + ) + if errdata = this.RaceRewardCheck(session, req); errdata != nil { + return // 参数校验失败直接返回 + } + + if list, err = this.module.modelRacePagoda.getPagodaRaceList(session.GetUserId()); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + + szConf = this.module.configure.GetSixDirectionsConf(req.Groud) + if len(szConf) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: fmt.Sprintf("conf not fount:%d", req.Groud), + } + return + } + + floors = this.module.configure.GetSixDirectionsGroudConf(req.Groud) + if len(floors) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: fmt.Sprintf("conf not fount:%d", req.Groud), + } + return + } // 1 2 3 + for _, v := range floors { + if d, ok := list.Data[v]; ok { + curStr = 0 + star1 := 0 + for i := 0; i < 3; i++ { + star1 = 1 << i + if int(d.Star)&star1 == star1 { + curStr++ + } + } + totalStar += curStr + } + } + for _, v := range szConf { + if list.Reward[req.Groud] < v.Starnum { + list.Reward[req.Groud] = v.Starnum + res = append(res, v.Reward...) + } + } + if len(res) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_UserNoReward, + Title: pb.ErrorCode_UserNoReward.ToString(), + Message: fmt.Sprintf("UserNoReward:%d", req.Groud), + } + return + } + if errdata, atno = this.module.DispenseAtno(session, res, true); errdata != nil { + return + } + mapData := make(map[string]interface{}, 0) + mapData["reward"] = list.Reward + errdata = this.module.ModifyPagodaData(session.GetUserId(), mapData) + + session.SendMsg(string(this.module.GetType()), "racereward", &pb.PagodaRaceRewardResp{ + Data: list, + }) + go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { + this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "PagodaRaceRewardReq", atno) + }) + + return +} diff --git a/modules/pagoda/comp_configure.go b/modules/pagoda/comp_configure.go index 47ac29fa6..6ec89de38 100644 --- a/modules/pagoda/comp_configure.go +++ b/modules/pagoda/comp_configure.go @@ -13,11 +13,12 @@ import ( const moduleName = "pagoda" const ( - game_pagoda = "game_pagoda.json" - game_pagodaseasonreward = "game_pagodaseasonreward.json" - game_pagodataskreward = "game_pagodataskreward.json" - game_circulate = "game_circulate.json" - game_sixdirections = "game_sixdirections.json" + game_pagoda = "game_pagoda.json" + game_pagodaseasonreward = "game_pagodaseasonreward.json" + game_pagodataskreward = "game_pagodataskreward.json" + game_circulate = "game_circulate.json" + game_sixdirections = "game_sixdirections.json" + game_sixdirectionsreward = "game_sixdirectionsreward.json" ) ///配置管理基础组件 @@ -29,6 +30,8 @@ type configureComp struct { _mapFloor map[int32]int32 // key 页签 value 层数 _mapRace map[int32]*cfg.GameCirculateData // 阵营塔 circulate []int32 + + _mapSixReward map[int32][]*cfg.GameSixDirectionsRewardData // 六合塔奖励 } //组件初始化接口 @@ -40,10 +43,12 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp game_pagoda: cfg.NewGamePagoda, game_circulate: cfg.NewGameCirculate, game_sixdirections: cfg.NewGameSixDirections, + //game_sixdirectionsreward: cfg.NewGameSixDirectionsReward, }) configure.RegisterConfigure(game_pagoda, cfg.NewGamePagoda, this.LoadPagoda) configure.RegisterConfigure(game_circulate, cfg.NewGameCirculate, this.LoadCirculate) + configure.RegisterConfigure(game_sixdirectionsreward, cfg.NewGameSixDirectionsReward, this.LoadSixDirections) return } @@ -229,3 +234,45 @@ func (this *configureComp) GetSixPagodaConf(id int32) (data *cfg.GameSixDirectio err = comm.NewNotFoundConfErr(moduleName, game_sixdirections, id) return } + +func (this *configureComp) LoadSixDirections() { + _m := make(map[int32][]*cfg.GameSixDirectionsRewardData, 0) + if v, err := this.GetConfigure(game_sixdirectionsreward); err == nil { + if configure, ok := v.(*cfg.GameSixDirectionsReward); ok { + for _, v1 := range configure.GetDataList() { + _m[v1.Boxid] = append(_m[v1.Boxid], v1) + } + } + } + + this.hlock.Lock() + this._mapSixReward = make(map[int32][]*cfg.GameSixDirectionsRewardData) + this._mapSixReward = _m + this.hlock.Unlock() + return +} + +// 奖励组 +func (this *configureComp) GetSixDirectionsGroudConf(groud int32) (sz []int32) { + var ( + v interface{} + err error + ) + if v, err = this.GetConfigure(game_sixdirections); err == nil { + if configure, ok := v.(*cfg.GameSixDirections); ok { + for _, v := range configure.GetDataList() { + if v.Groud == groud { + sz = append(sz, v.Floors) + } + } + } + } + return +} + +func (this *configureComp) GetSixDirectionsConf(boxid int32) (conf []*cfg.GameSixDirectionsRewardData) { + this.hlock.RLock() + conf, _ = this._mapSixReward[boxid] + this.hlock.RUnlock() + return +} diff --git a/pb/pagoda_msg.pb.go b/pb/pagoda_msg.pb.go index dd6a4ceca..348e5bdc5 100644 --- a/pb/pagoda_msg.pb.go +++ b/pb/pagoda_msg.pb.go @@ -1271,7 +1271,8 @@ type PagodaRaceRewardResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data *DBPagodaRace `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` + Data *DBPagodaRace `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` + Reward []*UserAtno `protobuf:"bytes,2,rep,name=reward,proto3" json:"reward"` } func (x *PagodaRaceRewardResp) Reset() { @@ -1313,6 +1314,13 @@ func (x *PagodaRaceRewardResp) GetData() *DBPagodaRace { return nil } +func (x *PagodaRaceRewardResp) GetReward() []*UserAtno { + if x != nil { + return x.Reward + } + return nil +} + var File_pagoda_pagoda_msg_proto protoreflect.FileDescriptor var file_pagoda_pagoda_msg_proto_rawDesc = []byte{ @@ -1432,12 +1440,14 @@ var file_pagoda_pagoda_msg_proto_rawDesc = []byte{ 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x6b, 0x73, 0x22, 0x2b, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x64, 0x22, 0x39, 0x0a, 0x14, 0x50, 0x61, 0x67, 0x6f, 0x64, + 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x64, 0x22, 0x5c, 0x0a, 0x14, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x63, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x61, 0x63, 0x65, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x74, 0x61, 0x12, 0x21, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x06, 0x72, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1516,11 +1526,12 @@ var file_pagoda_pagoda_msg_proto_depIdxs = []int32{ 35, // 20: PagodaGetRaceResp.data:type_name -> DBPagodaRace 36, // 21: PagodaCrossRaceRankListResp.ranks:type_name -> DBRaceRank 35, // 22: PagodaRaceRewardResp.data:type_name -> DBPagodaRace - 23, // [23:23] is the sub-list for method output_type - 23, // [23:23] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name + 29, // 23: PagodaRaceRewardResp.reward:type_name -> UserAtno + 24, // [24:24] is the sub-list for method output_type + 24, // [24:24] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_pagoda_pagoda_msg_proto_init() } diff --git a/sys/configure/structs/Game.BuzkashiMountData.go b/sys/configure/structs/Game.BuzkashiMountData.go index dab94cdce..0c43ed7d8 100644 --- a/sys/configure/structs/Game.BuzkashiMountData.go +++ b/sys/configure/structs/Game.BuzkashiMountData.go @@ -33,7 +33,7 @@ type GameBuzkashiMountData struct { Csubtime int32 Energyrecover int32 Maxenergy int32 - Offsetspeed float32 + Offsetspeed int32 } const TypeId_GameBuzkashiMountData = 1598069936 @@ -78,7 +78,7 @@ func (_v *GameBuzkashiMountData)Deserialize(_buf map[string]interface{}) (err er { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["csubtime"].(float64); !_ok_ { err = errors.New("csubtime error"); return }; _v.Csubtime = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["energyrecover"].(float64); !_ok_ { err = errors.New("energyrecover error"); return }; _v.Energyrecover = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["maxenergy"].(float64); !_ok_ { err = errors.New("maxenergy error"); return }; _v.Maxenergy = int32(_tempNum_) } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["offsetspeed"].(float64); !_ok_ { err = errors.New("offsetspeed error"); return }; _v.Offsetspeed = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["offsetspeed"].(float64); !_ok_ { err = errors.New("offsetspeed error"); return }; _v.Offsetspeed = int32(_tempNum_) } return } From 025ba19b9d1d1351793ed93541622c36b2b484ed Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 12 Jan 2024 16:03:19 +0800 Subject: [PATCH 3/6] =?UTF-8?q?gm=20=E5=85=AD=E5=90=88=E5=A1=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gm/module.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/gm/module.go b/modules/gm/module.go index e16742d2e..4f971396d 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -557,7 +557,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "0", Value: datas[0]}, ) - } else if len(datas) == 3 && (datas[0] == "race") { // 一键超神 + } else if len(datas) == 2 && (datas[0] == "race") { // 一键超神 var ( num2 int err error @@ -567,7 +567,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er return } - num2, err = strconv.Atoi(datas[2]) + num2, err = strconv.Atoi(datas[1]) if err != nil { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, @@ -828,7 +828,6 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er log.Field{Key: "0", Value: datas[1]}, ) } - } } } From 716171eb430ce84c5b193ad94f01c6152bb8ca53 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 12 Jan 2024 16:07:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?#43555=20=E4=BB=BB=E5=8A=A1=20=E3=80=90?= =?UTF-8?q?=E6=A2=A6=E5=B7=A5=E5=9C=BA=E7=B3=BB=E7=BB=9F=E3=80=91=20<-?= =?UTF-8?q?=E5=90=8E=E7=AB=AF->=20=E3=80=90=E4=B8=89=E6=B6=88=E3=80=91=20-?= =?UTF-8?q?=20=E7=8E=A9=E5=AE=B6=E6=8A=80=E8=83=BD=E6=B6=88=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E5=A2=9E=E9=95=BF=E8=BF=9B=E5=BA=A6=E6=9D=A1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/xxlPlat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index 62ba61c42..e6308370d 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -1299,7 +1299,7 @@ func (this *MapData) HitElem(color int32, curid int32) (szMap []*pb.MapData) { szMap = append(szMap, &pb.MapData{ Data: this.GetPalatData(), CurSocre: curScore, - CurEnergy: 0, + CurEnergy: energy, }) } sz, _ := this.CheckMap(color, false) From eed78135bff03f8070f1f5e457a9229f5d16dcf9 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 12 Jan 2024 16:27:16 +0800 Subject: [PATCH 5/6] =?UTF-8?q?gm=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pagoda/module.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index f6fa4b168..306f89496 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -264,7 +264,7 @@ func (this *Pagoda) GMModifyRacePagoda(uid string, floor int32) { update["rtime"] = data.Rtime update["battlecount"] = data.Battlecount update["maxfloor"] = data.Maxfloor - this.modelPagoda.modifyPagodaDataByObjId(uid, update) + this.modelRacePagoda.ModifyPagodaRaceData(uid, update) } return } From 358c7cc6bac1a18c8126b19975782d95f194abdd Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 12 Jan 2024 18:00:15 +0800 Subject: [PATCH 6/6] =?UTF-8?q?pro=20=E5=B1=9E=E6=80=A7=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/battle/modelBattle.go | 58 +++++++++++++++++++++++-- modules/hero/hero_test.go | 10 +++-- modules/pagoda/api_getlist.go | 4 -- modules/pagoda/api_racechallengeover.go | 3 +- modules/pagoda/api_racereward.go | 27 +++++++----- 5 files changed, 77 insertions(+), 25 deletions(-) diff --git a/modules/battle/modelBattle.go b/modules/battle/modelBattle.go index 33ff372ec..f579d8ae5 100644 --- a/modules/battle/modelBattle.go +++ b/modules/battle/modelBattle.go @@ -811,37 +811,70 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, vlv int32, tid, p hero = this.module.ModuleHero.GetVirtualHero(hero, vlv) role.Lv = hero.Lv } - + for k, v := range hero.Property { + switch k { + case cfg.GamePropertyType_Base_MaxHp_Per: + hero.Property[cfg.GamePropertyType_Base_MaxHp_Per] = 0 + hero.Property[cfg.GamePropertyType_Base_MaxHp_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_MaxHp_Base]))) + case cfg.GamePropertyType_Base_Atk_Per: + hero.Property[cfg.GamePropertyType_Base_Atk_Per] = 0 + hero.Property[cfg.GamePropertyType_Base_Atk_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Atk_Base]))) + case cfg.GamePropertyType_Base_Def_Per: + hero.Property[cfg.GamePropertyType_Base_Def_Per] = 0 + hero.Property[cfg.GamePropertyType_Base_Def_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Def_Base]))) + case cfg.GamePropertyType_Base_Speed_Per: + hero.Property[cfg.GamePropertyType_Base_Speed_Per] = 0 + hero.Property[cfg.GamePropertyType_Base_Speed_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Speed_Base]))) + } + } for k, v := range hero.Property { role.Property[k] += v if k == cfg.GamePropertyType_Base_MaxHp_Base { - role.Currhp += v } } for k, v := range hero.AddProperty { switch k { case cfg.GamePropertyType_Base_MaxHp_Per: + hero.AddProperty[cfg.GamePropertyType_Base_MaxHp_Per] = 0 hero.AddProperty[cfg.GamePropertyType_Base_MaxHp_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_MaxHp_Base]))) case cfg.GamePropertyType_Base_Atk_Per: + hero.AddProperty[cfg.GamePropertyType_Base_Atk_Per] = 0 hero.AddProperty[cfg.GamePropertyType_Base_Atk_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Atk_Base]))) case cfg.GamePropertyType_Base_Def_Per: + hero.AddProperty[cfg.GamePropertyType_Base_Def_Per] = 0 hero.AddProperty[cfg.GamePropertyType_Base_Def_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Def_Base]))) case cfg.GamePropertyType_Base_Speed_Per: + hero.AddProperty[cfg.GamePropertyType_Base_Speed_Per] = 0 hero.AddProperty[cfg.GamePropertyType_Base_Speed_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Speed_Base]))) } } for k, v := range hero.AddProperty { - //arrt := AttributesTransExt(k) - role.Property[k] += v if k == cfg.GamePropertyType_Base_MaxHp_Base { role.Currhp += v } } + for k, v := range hero.JuexProperty { + switch k { + case cfg.GamePropertyType_Base_MaxHp_Per: + hero.JuexProperty[cfg.GamePropertyType_Base_MaxHp_Per] = 0 + hero.JuexProperty[cfg.GamePropertyType_Base_MaxHp_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_MaxHp_Base]))) + case cfg.GamePropertyType_Base_Atk_Per: + hero.JuexProperty[cfg.GamePropertyType_Base_Atk_Per] = 0 + hero.JuexProperty[cfg.GamePropertyType_Base_Atk_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Atk_Base]))) + case cfg.GamePropertyType_Base_Def_Per: + hero.JuexProperty[cfg.GamePropertyType_Base_Def_Per] = 0 + hero.JuexProperty[cfg.GamePropertyType_Base_Def_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Def_Base]))) + case cfg.GamePropertyType_Base_Speed_Per: + hero.JuexProperty[cfg.GamePropertyType_Base_Speed_Per] = 0 + hero.JuexProperty[cfg.GamePropertyType_Base_Speed_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Speed_Base]))) + } + } + for k, v := range hero.JuexProperty { role.Property[k] += v @@ -849,6 +882,23 @@ func (this *modelBattleComp) createBattleRole(hero *pb.DBHero, vlv int32, tid, p role.Currhp += v } } + + for k, v := range hero.HoroscopeProperty { + switch k { + case cfg.GamePropertyType_Base_MaxHp_Per: + hero.HoroscopeProperty[cfg.GamePropertyType_Base_MaxHp_Per] = 0 + hero.HoroscopeProperty[cfg.GamePropertyType_Base_MaxHp_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_MaxHp_Base]))) + case cfg.GamePropertyType_Base_Atk_Per: + hero.HoroscopeProperty[cfg.GamePropertyType_Base_Atk_Per] = 0 + hero.HoroscopeProperty[cfg.GamePropertyType_Base_Atk_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Atk_Base]))) + case cfg.GamePropertyType_Base_Def_Per: + hero.HoroscopeProperty[cfg.GamePropertyType_Base_Def_Per] = 0 + hero.HoroscopeProperty[cfg.GamePropertyType_Base_Def_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Def_Base]))) + case cfg.GamePropertyType_Base_Speed_Per: + hero.HoroscopeProperty[cfg.GamePropertyType_Base_Speed_Per] = 0 + hero.HoroscopeProperty[cfg.GamePropertyType_Base_Speed_Base] += int32(math.Floor((float64(v) / 1000) * float64(hero.Property[cfg.GamePropertyType_Base_Speed_Base]))) + } + } for k, v := range hero.HoroscopeProperty { role.Property[k] += v diff --git a/modules/hero/hero_test.go b/modules/hero/hero_test.go index 51d1334a2..54c55139f 100644 --- a/modules/hero/hero_test.go +++ b/modules/hero/hero_test.go @@ -172,17 +172,19 @@ func Test_Main(t *testing.T) { // 1<<2 var star1, star2, star3 int32 var rst int32 - rst = 1 + rst = 6 // 101 + rst |= 2 //010 + //fmt.Printf("%d,%d,%d,%d", star1, star2, star3, rst) for i := 0; i < 3; i++ { star1 = 1 << i if rst&star1 == star1 { star3++ } } - star1 = 1 << 0 - //star2 = 1 << 1 + //star1 = 1 << 0 + star2 = 1 << 1 star3 = 1 << 2 // 101 - rst |= star1 + //rst |= star1 rst |= star2 rst |= star3 //rst = star1 ^ star2 ^ star3 // 三星 diff --git a/modules/pagoda/api_getlist.go b/modules/pagoda/api_getlist.go index 11e725172..fd452efc4 100644 --- a/modules/pagoda/api_getlist.go +++ b/modules/pagoda/api_getlist.go @@ -23,10 +23,6 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq } return } - // if list.Complete { // 这个版本不给赛季塔信息 - // list, _ = this.module.modelSeasonPagoda.getSeasonPagodaList(session.GetUserId()) - // } - session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: list}) return } diff --git a/modules/pagoda/api_racechallengeover.go b/modules/pagoda/api_racechallengeover.go index 0df5faedb..f8a7f5c66 100644 --- a/modules/pagoda/api_racechallengeover.go +++ b/modules/pagoda/api_racechallengeover.go @@ -84,7 +84,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda } } - list.Data[conf.Floors].Star = req.Star + list.Data[conf.Floors].Star |= req.Star list.Battlecount += 1 mapData["data"] = list.Data mapData["battlecount"] = list.Battlecount @@ -101,6 +101,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda if list.Data[conf.Floors].Consttime > costTime { // 小于之前的时间 入榜 this.module.modelRacePagoda.SetRacePagodaRankList(score, session.GetUserId()) } + award = append(award, conf.KeyReward...) // 首通奖励 } if err = this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), mapData); err != nil { diff --git a/modules/pagoda/api_racereward.go b/modules/pagoda/api_racereward.go index 1b18e4d8c..aa5919ba8 100644 --- a/modules/pagoda/api_racereward.go +++ b/modules/pagoda/api_racereward.go @@ -39,16 +39,6 @@ func (this *apiComp) RaceReward(session comm.IUserSession, req *pb.PagodaRaceRew return } - szConf = this.module.configure.GetSixDirectionsConf(req.Groud) - if len(szConf) == 0 { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ConfigNoFound, - Title: pb.ErrorCode_ConfigNoFound.ToString(), - Message: fmt.Sprintf("conf not fount:%d", req.Groud), - } - return - } - floors = this.module.configure.GetSixDirectionsGroudConf(req.Groud) if len(floors) == 0 { errdata = &pb.ErrorData{ @@ -58,6 +48,18 @@ func (this *apiComp) RaceReward(session comm.IUserSession, req *pb.PagodaRaceRew } return } // 1 2 3 + if c, err := this.module.configure.GetSixPagodaConf(floors[0]); err == nil { + szConf = this.module.configure.GetSixDirectionsConf(c.Groudreward) + } + + if len(szConf) == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: fmt.Sprintf("conf not fount:%d", req.Groud), + } + return + } for _, v := range floors { if d, ok := list.Data[v]; ok { curStr = 0 @@ -90,10 +92,11 @@ func (this *apiComp) RaceReward(session comm.IUserSession, req *pb.PagodaRaceRew } mapData := make(map[string]interface{}, 0) mapData["reward"] = list.Reward - errdata = this.module.ModifyPagodaData(session.GetUserId(), mapData) + this.module.modelRacePagoda.ModifyPagodaRaceData(session.GetUserId(), mapData) session.SendMsg(string(this.module.GetType()), "racereward", &pb.PagodaRaceRewardResp{ - Data: list, + Data: list, + Reward: atno, }) go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "PagodaRaceRewardReq", atno)