配置读取调整

This commit is contained in:
meixiongfeng 2023-01-07 11:55:02 +08:00
parent 338a2daa28
commit 367a553c15
4 changed files with 31 additions and 25 deletions

View File

@ -10,6 +10,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100101",
"text": "1-1"
@ -94,6 +95,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100102",
"text": "1-2"
@ -178,6 +180,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100103",
"text": "1-3"
@ -262,6 +265,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100104",
"text": "1-4"
@ -346,6 +350,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100105",
"text": "1-5"
@ -430,6 +435,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100106",
"text": "1-6"
@ -506,7 +512,7 @@
{
"id": 1100201,
"chapterid": 11002,
"previoustage": 0,
"previoustage": 1100106,
"Episodetype": 1,
"openlevel": 1,
"Episodelocation": {
@ -514,6 +520,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100201",
"text": "2-1"
@ -598,6 +605,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100202",
"text": "2-2"
@ -683,6 +691,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100203",
"text": "2-3"
@ -767,6 +776,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100204",
"text": "2-4"
@ -851,6 +861,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100205",
"text": "2-5"
@ -935,6 +946,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100206",
"text": "2-6"
@ -1011,7 +1023,7 @@
{
"id": 1100301,
"chapterid": 11003,
"previoustage": 0,
"previoustage": 1100206,
"Episodetype": 1,
"openlevel": 1,
"Episodelocation": {
@ -1019,6 +1031,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100301",
"text": "3-1"
@ -1103,6 +1116,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100302",
"text": "3-2"
@ -1187,6 +1201,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100303",
"text": "3-3"
@ -1271,6 +1286,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100304",
"text": "3-4"
@ -1356,6 +1372,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100305",
"text": "3-5"
@ -1439,6 +1456,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100306",
"text": "3-6"
@ -1514,7 +1532,7 @@
{
"id": 1100401,
"chapterid": 11004,
"previoustage": 0,
"previoustage": 1100306,
"Episodetype": 1,
"openlevel": 1,
"Episodelocation": {
@ -1522,6 +1540,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100401",
"text": "4-1"
@ -1605,6 +1624,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100402",
"text": "4-2"
@ -1689,6 +1709,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100403",
"text": "4-3"
@ -1773,6 +1794,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100404",
"text": "4-4"
@ -1857,6 +1879,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100405",
"text": "4-5"
@ -1941,6 +1964,7 @@
"y": 0,
"z": 0
},
"EditorStage": 0,
"mainlineName": {
"key": "mainlineName1100406",
"text": "4-6"

View File

@ -52,8 +52,8 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MlineChallenge
for _, v := range list {
if chapter == v.ChapterId { // 有上一章节数据
// 获取该章节最后一关卡ID
stage := this.module.configure.GetLastStageIDByChapter(chapter)
if _, ok := v.Star[stage]; ok {
//stage := this.module.configure.GetLastStageIDByChapter(chapter)
if _, ok := v.Star[stageConf.Previoustage]; ok {
bCheck = true
}
break

View File

@ -96,26 +96,6 @@ func (this *configureComp) GetPreMainChapter(id int32) (stageID int32) {
return
}
// 获取该章节最后一关ID
func (this *configureComp) GetLastStageIDByChapter(id int32) (stageID int32) {
var (
sz []int32
)
if v, err := this.GetConfigure(game_mainstage); err == nil {
if configure, ok := v.(*cfg.GameMainStage); ok {
for _, v := range configure.GetDataList() {
if v.Chapterid == id {
sz = append(sz, v.Id)
}
}
}
}
if len(sz) > 0 {
stageID = sz[len(sz)-1]
}
return stageID
}
func (this *configureComp) GetFirstStageIDByChapter(iType int32) *cfg.GameMainStageData {
if v, err := this.GetConfigure(game_mainstage); err == nil {
if configure, ok := v.(*cfg.GameMainStage); ok {

View File

@ -18,6 +18,7 @@ type GameMainStageData struct {
Episodetype int32
Openlevel int32
Episodelocation serialization.Vector3
EditorStage int32
MainlineName string
Title string
Desc string
@ -54,6 +55,7 @@ func (_v *GameMainStageData)Deserialize(_buf map[string]interface{}) (err error)
_v.Episodelocation = serialization.NewVector3(_x_, _y_, _z_)
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EditorStage"].(float64); !_ok_ { err = errors.New("EditorStage error"); return }; _v.EditorStage = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["mainlineName"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.MainlineName error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.MainlineName, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["title"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Title error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Title, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["desc"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Desc error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Desc, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }