上传配置同步代码

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

View File

@ -671,7 +671,7 @@
100106
],
"previoustage": 0,
"Episodetype": 3,
"Episodetype": 1,
"openlevel": 1,
"EditorStage": 0,
"venturemodel": "",
@ -834,7 +834,7 @@
100107
],
"previoustage": 0,
"Episodetype": 3,
"Episodetype": 1,
"openlevel": 1,
"EditorStage": 0,
"venturemodel": "",
@ -854,7 +854,7 @@
"hide": 0,
"destroy": 1,
"progress": 1,
"frontstoryid": 10258,
"frontstoryid": 0,
"afterstoryid": 0,
"maingroupName": {
"key": "",
@ -1088,7 +1088,7 @@
"hide": 0,
"destroy": 1,
"progress": 1,
"frontstoryid": 0,
"frontstoryid": 10258,
"afterstoryid": 0,
"maingroupName": {
"key": "",
@ -1287,7 +1287,7 @@
"firstaward": [
{
"a": "item",
"t": "1000001",
"t": "10000001",
"n": 1
}
],
@ -3949,7 +3949,7 @@
"firstaward": [
{
"a": "item",
"t": "1000005",
"t": "10000005",
"n": 1
}
],
@ -4012,7 +4012,7 @@
"firstaward": [
{
"a": "item",
"t": "1000006",
"t": "10000006",
"n": 1
}
],
@ -4074,7 +4074,7 @@
"firstaward": [
{
"a": "item",
"t": "1000013",
"t": "10000013",
"n": 1
}
],
@ -4136,7 +4136,7 @@
"firstaward": [
{
"a": "item",
"t": "1000001",
"t": "10000001",
"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
awardConfs []*cfg.GameMainStarrewardData
awardid int32
awardConf *cfg.GameMainStarrewardData
reward []*pb.UserAssets
pass int32
ok bool
err error
@ -96,7 +98,7 @@ func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineRec
}
return
}
award.Award[req.Stage] = 2
if awardConfs, ok = this.module.configure.getrewardMap()[awardid]; !ok {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
@ -109,9 +111,44 @@ func (this *apiComp) ReceiveAward(session comm.IUserSession, req *pb.MainlineRec
for _, v := range awardConfs {
if v.Starnum == req.Stage {
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
}

View File

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