上传配置同步代码

This commit is contained in:
liwei 2023-07-27 17:02:26 +08:00
parent 0f85389b6e
commit cb09010997
5 changed files with 610 additions and 21 deletions

View File

@ -2,7 +2,7 @@
{ {
"Id": 1, "Id": 1,
"GroupId": 300001, "GroupId": 300001,
"buffID": 125004311, "buffID": 770076113,
"GroupNum": 3, "GroupNum": 3,
"BuffWt": 50, "BuffWt": 50,
"TypeWt": 50 "TypeWt": 50
@ -10,7 +10,7 @@
{ {
"Id": 2, "Id": 2,
"GroupId": 300001, "GroupId": 300001,
"buffID": 125004312, "buffID": 770077113,
"GroupNum": 3, "GroupNum": 3,
"BuffWt": 50, "BuffWt": 50,
"TypeWt": 50 "TypeWt": 50
@ -18,7 +18,7 @@
{ {
"Id": 3, "Id": 3,
"GroupId": 300001, "GroupId": 300001,
"buffID": 135006211, "buffID": 770070113,
"GroupNum": 3, "GroupNum": 3,
"BuffWt": 50, "BuffWt": 50,
"TypeWt": 50 "TypeWt": 50
@ -26,7 +26,7 @@
{ {
"Id": 4, "Id": 4,
"GroupId": 300002, "GroupId": 300002,
"buffID": 151513212, "buffID": 770071113,
"GroupNum": 1, "GroupNum": 1,
"BuffWt": 50, "BuffWt": 50,
"TypeWt": 50 "TypeWt": 50

View File

@ -671,7 +671,7 @@
100106 100106
], ],
"previoustage": 0, "previoustage": 0,
"Episodetype": 3, "Episodetype": 1,
"openlevel": 1, "openlevel": 1,
"EditorStage": 0, "EditorStage": 0,
"venturemodel": "", "venturemodel": "",
@ -834,7 +834,7 @@
100107 100107
], ],
"previoustage": 0, "previoustage": 0,
"Episodetype": 3, "Episodetype": 1,
"openlevel": 1, "openlevel": 1,
"EditorStage": 0, "EditorStage": 0,
"venturemodel": "", "venturemodel": "",
@ -854,7 +854,7 @@
"hide": 0, "hide": 0,
"destroy": 1, "destroy": 1,
"progress": 1, "progress": 1,
"frontstoryid": 10258, "frontstoryid": 0,
"afterstoryid": 0, "afterstoryid": 0,
"maingroupName": { "maingroupName": {
"key": "", "key": "",
@ -1088,7 +1088,7 @@
"hide": 0, "hide": 0,
"destroy": 1, "destroy": 1,
"progress": 1, "progress": 1,
"frontstoryid": 0, "frontstoryid": 10258,
"afterstoryid": 0, "afterstoryid": 0,
"maingroupName": { "maingroupName": {
"key": "", "key": "",
@ -1287,7 +1287,7 @@
"firstaward": [ "firstaward": [
{ {
"a": "item", "a": "item",
"t": "1000001", "t": "10000001",
"n": 1 "n": 1
} }
], ],
@ -3949,7 +3949,7 @@
"firstaward": [ "firstaward": [
{ {
"a": "item", "a": "item",
"t": "1000005", "t": "10000005",
"n": 1 "n": 1
} }
], ],
@ -4012,7 +4012,7 @@
"firstaward": [ "firstaward": [
{ {
"a": "item", "a": "item",
"t": "1000006", "t": "10000006",
"n": 1 "n": 1
} }
], ],
@ -4074,7 +4074,7 @@
"firstaward": [ "firstaward": [
{ {
"a": "item", "a": "item",
"t": "1000013", "t": "10000013",
"n": 1 "n": 1
} }
], ],
@ -4136,7 +4136,7 @@
"firstaward": [ "firstaward": [
{ {
"a": "item", "a": "item",
"t": "1000001", "t": "10000001",
"n": 1 "n": 1
} }
], ],

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,8 @@ func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineRec
chapterconf *cfg.GameMainChapterData chapterconf *cfg.GameMainChapterData
awardConfs []*cfg.GameMainStarrewardData awardConfs []*cfg.GameMainStarrewardData
awardid int32 awardid int32
awardConf *cfg.GameMainStarrewardData
reward []*pb.UserAssets
pass int32 pass int32
ok bool ok bool
err error err error
@ -96,7 +98,7 @@ func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineRec
} }
return return
} }
award.Award[req.Stage] = 2
if awardConfs, ok = this.module.configure.getrewardMap()[awardid]; !ok { if awardConfs, ok = this.module.configure.getrewardMap()[awardid]; !ok {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound, Code: pb.ErrorCode_ConfigNoFound,
@ -109,9 +111,44 @@ func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineRec
for _, v := range awardConfs { for _, v := range awardConfs {
if v.Starnum == req.Stage { if v.Starnum == req.Stage {
ok = true ok = true
awardConf = v
} }
} }
session.SendMsg(string(this.module.GetType()), "receiveaward", &pb.MainlineReceiveAwardResp{}) if !ok {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,
Title: pb.ErrorCode_ReqParameterError.ToString(),
Message: fmt.Sprintf("Stage:%d no found ", req.Stage),
}
return
}
if errdata = this.module.DispenseRes(session, awardConf.Reward, true); errdata != nil {
return
}
reward = make([]*pb.UserAssets, 0)
for _, v := range awardConf.Reward {
reward = append(reward, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
if err = this.module.modelMline.updateMainlineData(session.GetUserId(), info); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
session.SendMsg(string(this.module.GetType()), "receiveaward", &pb.MainlineReceiveAwardResp{
Rtype: req.Rtype,
Chapter: req.Chapter,
Group: req.Group,
Stage: req.Stage,
Reward: reward,
})
return return
} }

View File

@ -48,7 +48,7 @@ func (this *configureComp) getchapterMap() map[int32][]*cfg.GameMainStageData {
func (this *configureComp) getrewardMap() map[int32][]*cfg.GameMainStarrewardData { func (this *configureComp) getrewardMap() map[int32][]*cfg.GameMainStarrewardData {
this.lock.Lock() this.lock.Lock()
rewardMap := this.rewardMap rewardMap := this.rewardMap
this.lock.RUnlock() this.lock.Unlock()
return rewardMap return rewardMap
} }
@ -111,7 +111,7 @@ func (this *configureComp) GetMainChapterConf(id int32) (conf *cfg.GameMainChapt
v interface{} v interface{}
ok bool ok bool
) )
if v, err = this.GetConfigure(game_mainchapter); err == nil { if v, err = this.GetConfigure(game_mainchapter); err != nil {
this.module.Errorln(err) this.module.Errorln(err)
return return
} }