英雄登记支持批量操作

This commit is contained in:
meixiongfeng 2023-03-16 12:36:30 +08:00
parent 790fea5ca1
commit d21716fa20
5 changed files with 458 additions and 521 deletions

View File

@ -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
}
]

View File

@ -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
},
{

View File

@ -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
}
]
}

View File

@ -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)
}
//玩家

View File

@ -841,39 +841,49 @@ 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 {
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 {
for _, v := range heroOid {
_hero, c := this.GetHeroByObjID(session.GetUserId(), v)
if c != pb.ErrorCode_Success {
code = c
return
}
_szHero = append(_szHero, _hero)
}
}
for _, v := range _szHero {
_heroMap = make(map[string]interface{})
if fulllvenr == 0 && _hero.Fulllvenr != 0 {
if fulllvenr == 0 && v.Fulllvenr != 0 {
v.Fulllvenr = 0
_heroMap["fulllvenr"] = 0
} else if _hero.Fulllvenr == 0 && fulllvenr != 0 {
} else if v.Fulllvenr == 0 && fulllvenr != 0 {
// 校验有没有满级
if _hero.Lv < this.configure.GetHeroMaxLv(_hero.Star) {
if v.Lv < this.configure.GetHeroMaxLv(v.Star) {
code = pb.ErrorCode_HeroLvNoEnough // 必须满级
return
}
_hero.Fulllvenr = fulllvenr
_heroMap["fulllvenr"] = _hero.Fulllvenr
v.Fulllvenr = fulllvenr
_heroMap["fulllvenr"] = v.Fulllvenr
} else {
code = pb.ErrorCode_HeroIsRegister
@ -881,20 +891,22 @@ func (this *Hero) RegisterInstructor(session comm.IUserSession, heroOid string,
}
if this.IsCross() {
if model != nil {
if err := model.ChangeList(session.GetUserId(), heroOid, _heroMap); err != 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(), heroOid, _heroMap); err != nil { // 修改英雄信息
if err := this.modelHero.ChangeList(session.GetUserId(), v.Id, _heroMap); err != nil { // 修改英雄信息
this.Errorf("err:%v", err)
code = pb.ErrorCode_DBError
return
}
}
_changeHero = append(_changeHero, _hero)
_changeHero = append(_changeHero, v)
}
session.SendMsg(string(this.GetType()), "change", &pb.HeroChangePush{List: _changeHero})
return
}