From 29b37be18e94bee88252ef4a82b6715f2c5b7800 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 16 Mar 2023 11:31:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=85=AC=E4=BC=9A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/api_create.go | 42 +++++++++++++++++++------------------- modules/user/module.go | 2 ++ 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/modules/user/api_create.go b/modules/user/api_create.go index 22eaa8281..b7660c575 100644 --- a/modules/user/api_create.go +++ b/modules/user/api_create.go @@ -96,34 +96,34 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (c //初始化用户设置 // this.module.modelSetting.InitSetting(session.GetUserId()) - go func() { - //初始化公会 date3.10 - sociaty := this.module.CrossCreateSociaty(uid, req.NickName) - if sociaty == nil { - return - } - this.module.Debugf("公会ID:%v", sociaty.Id) - exUpdate := map[string]interface{}{ - "sociatyId": sociaty.Id, - } + // go func() { + // //初始化公会 date3.10 + // sociaty := this.module.CrossCreateSociaty(uid, req.NickName) + // if sociaty == nil { + // return + // } + // this.module.Debugf("公会ID:%v", sociaty.Id) + // exUpdate := map[string]interface{}{ + // "sociatyId": sociaty.Id, + // } - if err := this.module.ModuleUser.ChangeUserExpand(uid, exUpdate); err != nil { - code = pb.ErrorCode_DBError - this.module.Error("更新玩家公会ID", - log.Field{Key: "uid", Value: uid}, - log.Field{Key: "sociatyId", Value: sociaty.Id}, - log.Field{Key: "err", Value: err.Error()}, - ) - return - } + // if err := this.module.ModuleUser.ChangeUserExpand(uid, exUpdate); err != nil { + // code = pb.ErrorCode_DBError + // this.module.Error("更新玩家公会ID", + // log.Field{Key: "uid", Value: uid}, + // log.Field{Key: "sociatyId", Value: sociaty.Id}, + // log.Field{Key: "err", Value: err.Error()}, + // ) + // return + // } - }() + // }() if err := session.SendMsg(string(this.module.GetType()), UserSubTypeCreate, &pb.UserCreateResp{IsSucc: true}); err != nil { code = pb.ErrorCode_SystemError } if req.Figure != 0 { - this.module.ModuleRtask.TriggerTask(uid,&comm.TaskParam{TT:comm.Rtype72,Params: []int32{1}}) + this.module.ModuleRtask.TriggerTask(uid, comm.GettaskParam(comm.Rtype72,1)) } this.mail.SendMailByCid(session, comm.Welcomemail, nil) diff --git a/modules/user/module.go b/modules/user/module.go index 4c69025cf..44a057cdc 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -245,6 +245,7 @@ func (this *User) CrossUserSession(uid string) *pb.CacheUser { } // 跨服创建玩家公会 date 3.10 +// Deprecated func (this *User) CrossCreateSociaty(uid, sociatyName string) *pb.DBSociaty { sociaty := &pb.DBSociaty{} this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), @@ -253,6 +254,7 @@ func (this *User) CrossCreateSociaty(uid, sociatyName string) *pb.DBSociaty { } // date 3.10 +// Deprecated func (this *User) RpcCreateSociaty(ctx context.Context, req *pb.RPCGeneralReqA2, rsp *pb.DBSociaty) error { conn, err := db.Local() if err != nil { From d21716fa20b3c6333c181e62f966bca5a75e92ca Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 16 Mar 2023 12:36:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E7=99=BB=E8=AE=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_pandamasjs.json | 6 +- bin/json/game_pandamastj.json | 24 +- bin/json/game_vikingboss.json | 867 ++++++++++++++++------------------ comm/imodule.go | 2 +- modules/hero/module.go | 80 ++-- 5 files changed, 458 insertions(+), 521 deletions(-) diff --git a/bin/json/game_pandamasjs.json b/bin/json/game_pandamasjs.json index 8786cac6b..e5be7e0c6 100644 --- a/bin/json/game_pandamasjs.json +++ b/bin/json/game_pandamasjs.json @@ -1,14 +1,14 @@ [ { "id": 1, - "unlock_condition": 20010 + "unlock_condition": 6000001 }, { "id": 2, - "unlock_condition": 20011 + "unlock_condition": 6000002 }, { "id": 3, - "unlock_condition": 20012 + "unlock_condition": 6000003 } ] \ No newline at end of file diff --git a/bin/json/game_pandamastj.json b/bin/json/game_pandamastj.json index dfefc2aa1..15d8ed7fb 100644 --- a/bin/json/game_pandamastj.json +++ b/bin/json/game_pandamastj.json @@ -104,7 +104,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_13002", "atlas_score": 105 }, { @@ -122,7 +122,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_13001", "atlas_score": 120 }, { @@ -140,7 +140,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_44002", "atlas_score": 135 }, { @@ -158,7 +158,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_24005", "atlas_score": 150 }, { @@ -176,7 +176,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_14005", "atlas_score": 165 }, { @@ -194,7 +194,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_44006", "atlas_score": 180 }, { @@ -212,7 +212,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_43001", "atlas_score": 195 }, { @@ -230,7 +230,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_35002", "atlas_score": 210 }, { @@ -248,7 +248,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_45004", "atlas_score": 225 }, { @@ -266,7 +266,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_35001", "atlas_score": 240 }, { @@ -284,7 +284,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_25001", "atlas_score": 255 }, { @@ -302,7 +302,7 @@ "key": "wuguan_2", "text": "图鉴信息描述" }, - "icon": "", + "icon": "sbkp_js_45001", "atlas_score": 270 }, { diff --git a/bin/json/game_vikingboss.json b/bin/json/game_vikingboss.json index a9baa1d98..091aa4b21 100644 --- a/bin/json/game_vikingboss.json +++ b/bin/json/game_vikingboss.json @@ -3652,237 +3652,12 @@ { "id": 30050, "copytype": 4, - "bossid": 32, + "bossid": 31, "name": { - "key": "viking_boss_1002", - "text": "冰之泰坦" + "key": "viking_boss_1001", + "text": "火焰泰坦" }, - "difficulty": 1, - "BattleReadyID": 112, - "captionrecommend": [ - 25001, - 25004, - 34006, - 35001, - 35002 - ], - "firstprize": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - } - ], - "dropshow": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - }, - { - "a": "equi", - "t": "10110", - "n": 1 - }, - { - "a": "equi", - "t": "10111", - "n": 1 - }, - { - "a": "equi", - "t": "10112", - "n": 1 - }, - { - "a": "equi", - "t": "10113", - "n": 1 - } - ], - "drop": 1011, - "scene": "", - "bossmodel": 11009, - "boss_skill": 51004, - "boss": [ - 710001, - 710001, - 710001 - ], - "ps_consume": [ - { - "a": "item", - "t": "100100", - "n": 6 - } - ], - "ps_mg": [ - { - "a": "item", - "t": "100100", - "n": 5 - } - ] - }, - { - "id": 30060, - "copytype": 4, - "bossid": 32, - "name": { - "key": "viking_boss_1002", - "text": "冰之泰坦" - }, - "difficulty": 2, - "BattleReadyID": 112, - "captionrecommend": [ - 25001, - 25004, - 34006, - 35001, - 35002 - ], - "firstprize": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - } - ], - "dropshow": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - }, - { - "a": "equi", - "t": "10120", - "n": 1 - }, - { - "a": "equi", - "t": "10121", - "n": 1 - }, - { - "a": "equi", - "t": "10122", - "n": 1 - }, - { - "a": "equi", - "t": "10113", - "n": 1 - } - ], - "drop": 1012, - "scene": "", - "bossmodel": 11009, - "boss_skill": 51004, - "boss": [ - 710001, - 710001, - 710001 - ], - "ps_consume": [ - { - "a": "item", - "t": "100100", - "n": 7 - } - ], - "ps_mg": [ - { - "a": "item", - "t": "100100", - "n": 6 - } - ] - }, - { - "id": 30070, - "copytype": 4, - "bossid": 32, - "name": { - "key": "viking_boss_1002", - "text": "冰之泰坦" - }, - "difficulty": 3, - "BattleReadyID": 112, - "captionrecommend": [ - 25001, - 25004, - 34006, - 35001, - 35002 - ], - "firstprize": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - } - ], - "dropshow": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - }, - { - "a": "equi", - "t": "10120", - "n": 1 - }, - { - "a": "equi", - "t": "10121", - "n": 1 - }, - { - "a": "equi", - "t": "10122", - "n": 1 - }, - { - "a": "equi", - "t": "10123", - "n": 1 - } - ], - "drop": 1013, - "scene": "", - "bossmodel": 11009, - "boss_skill": 51004, - "boss": [ - 710001, - 710001, - 710001 - ], - "ps_consume": [ - { - "a": "item", - "t": "100100", - "n": 8 - } - ], - "ps_mg": [ - { - "a": "item", - "t": "100100", - "n": 7 - } - ] - }, - { - "id": 30080, - "copytype": 4, - "bossid": 32, - "name": { - "key": "viking_boss_1002", - "text": "冰之泰坦" - }, - "difficulty": 4, + "difficulty": 5, "BattleReadyID": 112, "captionrecommend": [ 25001, @@ -3925,7 +3700,232 @@ "n": 1 } ], - "drop": 1014, + "drop": 1004, + "scene": "", + "bossmodel": 11009, + "boss_skill": 51004, + "boss": [ + 710001, + 710001, + 710001 + ], + "ps_consume": [ + { + "a": "item", + "t": "100100", + "n": 9 + } + ], + "ps_mg": [ + { + "a": "item", + "t": "100100", + "n": 8 + } + ] + }, + { + "id": 30060, + "copytype": 4, + "bossid": 31, + "name": { + "key": "viking_boss_1001", + "text": "火焰泰坦" + }, + "difficulty": 6, + "BattleReadyID": 112, + "captionrecommend": [ + 25001, + 25004, + 34006, + 35001, + 35002 + ], + "firstprize": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + } + ], + "dropshow": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "equi", + "t": "10130", + "n": 1 + }, + { + "a": "equi", + "t": "10131", + "n": 1 + }, + { + "a": "equi", + "t": "10132", + "n": 1 + }, + { + "a": "equi", + "t": "10123", + "n": 1 + } + ], + "drop": 1004, + "scene": "", + "bossmodel": 11009, + "boss_skill": 51004, + "boss": [ + 710001, + 710001, + 710001 + ], + "ps_consume": [ + { + "a": "item", + "t": "100100", + "n": 9 + } + ], + "ps_mg": [ + { + "a": "item", + "t": "100100", + "n": 8 + } + ] + }, + { + "id": 30070, + "copytype": 4, + "bossid": 31, + "name": { + "key": "viking_boss_1001", + "text": "火焰泰坦" + }, + "difficulty": 7, + "BattleReadyID": 112, + "captionrecommend": [ + 25001, + 25004, + 34006, + 35001, + 35002 + ], + "firstprize": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + } + ], + "dropshow": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "equi", + "t": "10130", + "n": 1 + }, + { + "a": "equi", + "t": "10131", + "n": 1 + }, + { + "a": "equi", + "t": "10132", + "n": 1 + }, + { + "a": "equi", + "t": "10123", + "n": 1 + } + ], + "drop": 1004, + "scene": "", + "bossmodel": 11009, + "boss_skill": 51004, + "boss": [ + 710001, + 710001, + 710001 + ], + "ps_consume": [ + { + "a": "item", + "t": "100100", + "n": 9 + } + ], + "ps_mg": [ + { + "a": "item", + "t": "100100", + "n": 8 + } + ] + }, + { + "id": 30080, + "copytype": 4, + "bossid": 31, + "name": { + "key": "viking_boss_1001", + "text": "火焰泰坦" + }, + "difficulty": 8, + "BattleReadyID": 112, + "captionrecommend": [ + 25001, + 25004, + 34006, + 35001, + 35002 + ], + "firstprize": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + } + ], + "dropshow": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "equi", + "t": "10130", + "n": 1 + }, + { + "a": "equi", + "t": "10131", + "n": 1 + }, + { + "a": "equi", + "t": "10132", + "n": 1 + }, + { + "a": "equi", + "t": "10123", + "n": 1 + } + ], + "drop": 1004, "scene": "", "bossmodel": 11009, "boss_skill": 51004, @@ -3952,237 +3952,12 @@ { "id": 30090, "copytype": 4, - "bossid": 33, + "bossid": 31, "name": { - "key": "viking_boss_1003", - "text": "森林泰坦" + "key": "viking_boss_1001", + "text": "火焰泰坦" }, - "difficulty": 1, - "BattleReadyID": 112, - "captionrecommend": [ - 25001, - 25004, - 34006, - 35001, - 35002 - ], - "firstprize": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - } - ], - "dropshow": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - }, - { - "a": "equi", - "t": "10110", - "n": 1 - }, - { - "a": "equi", - "t": "10111", - "n": 1 - }, - { - "a": "equi", - "t": "10112", - "n": 1 - }, - { - "a": "equi", - "t": "10113", - "n": 1 - } - ], - "drop": 1021, - "scene": "", - "bossmodel": 11009, - "boss_skill": 51004, - "boss": [ - 710001, - 710001, - 710001 - ], - "ps_consume": [ - { - "a": "item", - "t": "100100", - "n": 6 - } - ], - "ps_mg": [ - { - "a": "item", - "t": "100100", - "n": 5 - } - ] - }, - { - "id": 30100, - "copytype": 4, - "bossid": 33, - "name": { - "key": "viking_boss_1003", - "text": "森林泰坦" - }, - "difficulty": 2, - "BattleReadyID": 112, - "captionrecommend": [ - 25001, - 25004, - 34006, - 35001, - 35002 - ], - "firstprize": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - } - ], - "dropshow": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - }, - { - "a": "equi", - "t": "10120", - "n": 1 - }, - { - "a": "equi", - "t": "10121", - "n": 1 - }, - { - "a": "equi", - "t": "10122", - "n": 1 - }, - { - "a": "equi", - "t": "10113", - "n": 1 - } - ], - "drop": 1022, - "scene": "", - "bossmodel": 11009, - "boss_skill": 51004, - "boss": [ - 710001, - 710001, - 710001 - ], - "ps_consume": [ - { - "a": "item", - "t": "100100", - "n": 7 - } - ], - "ps_mg": [ - { - "a": "item", - "t": "100100", - "n": 6 - } - ] - }, - { - "id": 30110, - "copytype": 4, - "bossid": 33, - "name": { - "key": "viking_boss_1003", - "text": "森林泰坦" - }, - "difficulty": 3, - "BattleReadyID": 112, - "captionrecommend": [ - 25001, - 25004, - 34006, - 35001, - 35002 - ], - "firstprize": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - } - ], - "dropshow": [ - { - "a": "attr", - "t": "diamond", - "n": 100 - }, - { - "a": "equi", - "t": "10120", - "n": 1 - }, - { - "a": "equi", - "t": "10121", - "n": 1 - }, - { - "a": "equi", - "t": "10122", - "n": 1 - }, - { - "a": "equi", - "t": "10123", - "n": 1 - } - ], - "drop": 1023, - "scene": "", - "bossmodel": 11009, - "boss_skill": 51004, - "boss": [ - 710001, - 710001, - 710001 - ], - "ps_consume": [ - { - "a": "item", - "t": "100100", - "n": 8 - } - ], - "ps_mg": [ - { - "a": "item", - "t": "100100", - "n": 7 - } - ] - }, - { - "id": 30120, - "copytype": 4, - "bossid": 33, - "name": { - "key": "viking_boss_1003", - "text": "森林泰坦" - }, - "difficulty": 4, + "difficulty": 9, "BattleReadyID": 112, "captionrecommend": [ 25001, @@ -4225,7 +4000,7 @@ "n": 1 } ], - "drop": 1024, + "drop": 1004, "scene": "", "bossmodel": 11009, "boss_skill": 51004, @@ -4250,14 +4025,14 @@ ] }, { - "id": 30130, + "id": 30100, "copytype": 4, - "bossid": 34, + "bossid": 31, "name": { "key": "viking_boss_1001", - "text": "武器BOSS" + "text": "火焰泰坦" }, - "difficulty": 1, + "difficulty": 10, "BattleReadyID": 112, "captionrecommend": [ 25001, @@ -4281,26 +4056,26 @@ }, { "a": "equi", - "t": "20010", + "t": "10130", "n": 1 }, { "a": "equi", - "t": "20011", + "t": "10131", "n": 1 }, { "a": "equi", - "t": "20012", + "t": "10132", "n": 1 }, { "a": "equi", - "t": "20013", + "t": "10123", "n": 1 } ], - "drop": 1001, + "drop": 1004, "scene": "", "bossmodel": 11009, "boss_skill": 51004, @@ -4313,14 +4088,164 @@ { "a": "item", "t": "100100", - "n": 6 + "n": 9 } ], "ps_mg": [ { "a": "item", "t": "100100", - "n": 5 + "n": 8 + } + ] + }, + { + "id": 30110, + "copytype": 4, + "bossid": 31, + "name": { + "key": "viking_boss_1001", + "text": "火焰泰坦" + }, + "difficulty": 11, + "BattleReadyID": 112, + "captionrecommend": [ + 25001, + 25004, + 34006, + 35001, + 35002 + ], + "firstprize": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + } + ], + "dropshow": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "equi", + "t": "10130", + "n": 1 + }, + { + "a": "equi", + "t": "10131", + "n": 1 + }, + { + "a": "equi", + "t": "10132", + "n": 1 + }, + { + "a": "equi", + "t": "10123", + "n": 1 + } + ], + "drop": 1004, + "scene": "", + "bossmodel": 11009, + "boss_skill": 51004, + "boss": [ + 710001, + 710001, + 710001 + ], + "ps_consume": [ + { + "a": "item", + "t": "100100", + "n": 9 + } + ], + "ps_mg": [ + { + "a": "item", + "t": "100100", + "n": 8 + } + ] + }, + { + "id": 30120, + "copytype": 4, + "bossid": 31, + "name": { + "key": "viking_boss_1001", + "text": "火焰泰坦" + }, + "difficulty": 12, + "BattleReadyID": 112, + "captionrecommend": [ + 25001, + 25004, + 34006, + 35001, + 35002 + ], + "firstprize": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + } + ], + "dropshow": [ + { + "a": "attr", + "t": "diamond", + "n": 100 + }, + { + "a": "equi", + "t": "10130", + "n": 1 + }, + { + "a": "equi", + "t": "10131", + "n": 1 + }, + { + "a": "equi", + "t": "10132", + "n": 1 + }, + { + "a": "equi", + "t": "10123", + "n": 1 + } + ], + "drop": 1004, + "scene": "", + "bossmodel": 11009, + "boss_skill": 51004, + "boss": [ + 710001, + 710001, + 710001 + ], + "ps_consume": [ + { + "a": "item", + "t": "100100", + "n": 9 + } + ], + "ps_mg": [ + { + "a": "item", + "t": "100100", + "n": 8 } ] } diff --git a/comm/imodule.go b/comm/imodule.go index f5f151a28..b265b84cf 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -99,7 +99,7 @@ type ( GetAllMaxHero(session IUserSession) (code pb.ErrorCode) // 教习登记 - RegisterInstructor(session IUserSession, heroOid string, registerId int32) (code pb.ErrorCode) + RegisterInstructor(session IUserSession, heroOid []string, registerId int32) (code pb.ErrorCode) } //玩家 diff --git a/modules/hero/module.go b/modules/hero/module.go index 918d90cc0..282920607 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -841,60 +841,72 @@ func (this *Hero) InRange(heroRecord *pb.DBHeroRecord, strPool []string, update return } -func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string, fulllvenr int32) (code pb.ErrorCode) { +func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid []string, fulllvenr int32) (code pb.ErrorCode) { var ( - _hero *pb.DBHero + _szHero []*pb.DBHero model *db.DBModel err error _heroMap map[string]interface{} _changeHero []*pb.DBHero // 变化的英雄 ) + if this.IsCross() { - _hero = &pb.DBHero{} + _hero := &pb.DBHero{} if model, err = this.GetDBModuleByUid(session.GetUserId(), this.modelHero.TableName, this.modelHero.Expired); err == nil { - if err := model.GetListObj(session.GetUserId(), heroOid, _hero); err != nil { - this.Errorf("err:%v", err) - return + for _, v := range heroOid { + if err := model.GetListObj(session.GetUserId(), v, _hero); err != nil { + this.Errorf("err:%v", err) + return + } } } + _szHero = append(_szHero, _hero) } else { - _hero, code = this.GetHeroByObjID(session.GetUserId(), heroOid) - if code != pb.ErrorCode_Success { - return + for _, v := range heroOid { + _hero, c := this.GetHeroByObjID(session.GetUserId(), v) + if c != pb.ErrorCode_Success { + code = c + return + } + _szHero = append(_szHero, _hero) } } - _heroMap = make(map[string]interface{}) - if fulllvenr == 0 && _hero.Fulllvenr != 0 { - _heroMap["fulllvenr"] = 0 - } else if _hero.Fulllvenr == 0 && fulllvenr != 0 { - // 校验有没有满级 - if _hero.Lv < this.configure.GetHeroMaxLv(_hero.Star) { - code = pb.ErrorCode_HeroLvNoEnough // 必须满级 - return - } - _hero.Fulllvenr = fulllvenr - _heroMap["fulllvenr"] = _hero.Fulllvenr + for _, v := range _szHero { + _heroMap = make(map[string]interface{}) + if fulllvenr == 0 && v.Fulllvenr != 0 { + v.Fulllvenr = 0 + _heroMap["fulllvenr"] = 0 + } else if v.Fulllvenr == 0 && fulllvenr != 0 { + // 校验有没有满级 + if v.Lv < this.configure.GetHeroMaxLv(v.Star) { + code = pb.ErrorCode_HeroLvNoEnough // 必须满级 + return + } + v.Fulllvenr = fulllvenr + _heroMap["fulllvenr"] = v.Fulllvenr - } else { - code = pb.ErrorCode_HeroIsRegister - return - } - if this.IsCross() { - if model != nil { - if err := model.ChangeList(session.GetUserId(), heroOid, _heroMap); err != nil { + } else { + code = pb.ErrorCode_HeroIsRegister + return + } + if this.IsCross() { + if model != nil { + if err := model.ChangeList(session.GetUserId(), v.Id, _heroMap); err != nil { + this.Errorf("err:%v", err) + code = pb.ErrorCode_DBError + return + } + } + } else { + if err := this.modelHero.ChangeList(session.GetUserId(), v.Id, _heroMap); err != nil { // 修改英雄信息 this.Errorf("err:%v", err) code = pb.ErrorCode_DBError return } } - } else { - if err := this.modelHero.ChangeList(session.GetUserId(), heroOid, _heroMap); err != nil { // 修改英雄信息 - this.Errorf("err:%v", err) - code = pb.ErrorCode_DBError - return - } + _changeHero = append(_changeHero, v) } - _changeHero = append(_changeHero, _hero) + session.SendMsg(string(this.GetType()), "change", &pb.HeroChangePush{List: _changeHero}) return }