From 11837949b48ec9fb2541c9b5a257590556ba9cde Mon Sep 17 00:00:00 2001
From: meixiongfeng <766881921@qq.com>
Date: Tue, 25 Jul 2023 19:48:37 +0800
Subject: [PATCH 1/3] =?UTF-8?q?buff=E6=8E=89=E8=90=BD=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
bin/json/game_bufflottery.json | 56 +---
bin/json/game_stronebuff.json | 280 +++++++++++++++---
modules/stonehenge/configure.go | 193 +-----------
sys/configure/structs/Game.BufflotteryData.go | 12 +-
sys/configure/structs/Game.StroneBuffData.go | 2 +
sys/configure/structs/Game.TrendChoseData.go | 6 +-
6 files changed, 262 insertions(+), 287 deletions(-)
diff --git a/bin/json/game_bufflottery.json b/bin/json/game_bufflottery.json
index 09d8d0cce..43d6606df 100644
--- a/bin/json/game_bufflottery.json
+++ b/bin/json/game_bufflottery.json
@@ -2,96 +2,64 @@
{
"Id": 1,
"GroupId": 100001,
- "GroupType": 1,
- "SubGroupWt": 1000,
- "SubGroupId": 1001,
- "SubGroupType": 1,
"buffID": 251023111,
- "SubGroupNum": 3,
+ "GroupNum": 3,
"BuffWt": 50,
"TypeWt": 60
},
{
"Id": 2,
"GroupId": 100001,
- "GroupType": 1,
- "SubGroupWt": 0,
- "SubGroupId": 1001,
- "SubGroupType": 0,
"buffID": 251023112,
- "SubGroupNum": 0,
+ "GroupNum": 0,
"BuffWt": 50,
"TypeWt": 60
},
{
"Id": 3,
"GroupId": 100001,
- "GroupType": 1,
- "SubGroupWt": 0,
- "SubGroupId": 1001,
- "SubGroupType": 0,
"buffID": 200000001,
- "SubGroupNum": 0,
+ "GroupNum": 0,
"BuffWt": 50,
"TypeWt": 60
},
{
"Id": 4,
"GroupId": 100001,
- "GroupType": 1,
- "SubGroupWt": 0,
- "SubGroupId": 1001,
- "SubGroupType": 0,
"buffID": 200000002,
- "SubGroupNum": 0,
+ "GroupNum": 0,
"BuffWt": 50,
"TypeWt": 60
},
{
"Id": 5,
- "GroupId": 100002,
- "GroupType": 2,
- "SubGroupWt": 1000,
- "SubGroupId": 1001,
- "SubGroupType": 1,
+ "GroupId": 100001,
"buffID": 253005111,
- "SubGroupNum": 2,
+ "GroupNum": 0,
"BuffWt": 50,
"TypeWt": 60
},
{
"Id": 6,
- "GroupId": 100002,
- "GroupType": 0,
- "SubGroupWt": 0,
- "SubGroupId": 1001,
- "SubGroupType": 0,
+ "GroupId": 100001,
"buffID": 253005112,
- "SubGroupNum": 0,
+ "GroupNum": 0,
"BuffWt": 50,
"TypeWt": 60
},
{
"Id": 7,
- "GroupId": 100002,
- "GroupType": 0,
- "SubGroupWt": 1000,
- "SubGroupId": 1002,
- "SubGroupType": 2,
+ "GroupId": 100001,
"buffID": 225002011,
- "SubGroupNum": 1,
+ "GroupNum": 0,
"BuffWt": 500,
"TypeWt": 600
},
{
"Id": 8,
- "GroupId": 100002,
- "GroupType": 0,
- "SubGroupWt": 0,
- "SubGroupId": 1002,
- "SubGroupType": 0,
+ "GroupId": 100001,
"buffID": 225002012,
- "SubGroupNum": 0,
+ "GroupNum": 0,
"BuffWt": 500,
"TypeWt": 600
}
diff --git a/bin/json/game_stronebuff.json b/bin/json/game_stronebuff.json
index 56c48bdd7..a738f8982 100644
--- a/bin/json/game_stronebuff.json
+++ b/bin/json/game_stronebuff.json
@@ -1,9 +1,9 @@
[
{
- "BuffId": 143006310,
+ "BuffId": 125004311,
"BuffGroupId": 1001,
"Type": 1,
- "SkillId": 143006311,
+ "SkillId": 125004311,
"BuffLevel": 1,
"Quality": 1,
"BuffIcon": "",
@@ -23,7 +23,7 @@
}
},
{
- "BuffId": 125004310,
+ "BuffId": 125004312,
"BuffGroupId": 1001,
"Type": 1,
"SkillId": 125004311,
@@ -46,9 +46,9 @@
}
},
{
- "BuffId": 135006210,
+ "BuffId": 135006211,
"BuffGroupId": 1002,
- "Type": 2,
+ "Type": 1,
"SkillId": 135006211,
"BuffLevel": 1,
"Quality": 2,
@@ -69,10 +69,10 @@
}
},
{
- "BuffId": 135006310,
+ "BuffId": 135006212,
"BuffGroupId": 1002,
- "Type": 2,
- "SkillId": 135006311,
+ "Type": 1,
+ "SkillId": 135006211,
"BuffLevel": 2,
"Quality": 2,
"BuffIcon": "",
@@ -92,10 +92,10 @@
}
},
{
- "BuffId": 144004310,
+ "BuffId": 135006311,
"BuffGroupId": 1003,
- "Type": 3,
- "SkillId": 144004311,
+ "Type": 2,
+ "SkillId": 135006311,
"BuffLevel": 1,
"Quality": 1,
"BuffIcon": "",
@@ -115,10 +115,10 @@
}
},
{
- "BuffId": 124006310,
+ "BuffId": 135006312,
"BuffGroupId": 1003,
- "Type": 3,
- "SkillId": 124006311,
+ "Type": 2,
+ "SkillId": 135006311,
"BuffLevel": 2,
"Quality": 1,
"BuffIcon": "",
@@ -138,10 +138,10 @@
}
},
{
- "BuffId": 144002310,
+ "BuffId": 144004311,
"BuffGroupId": 1004,
- "Type": 4,
- "SkillId": 144002311,
+ "Type": 2,
+ "SkillId": 144004311,
"BuffLevel": 1,
"Quality": 2,
"BuffIcon": "",
@@ -161,10 +161,10 @@
}
},
{
- "BuffId": 151513210,
+ "BuffId": 144004312,
"BuffGroupId": 1004,
- "Type": 4,
- "SkillId": 151513211,
+ "Type": 2,
+ "SkillId": 144004311,
"BuffLevel": 2,
"Quality": 2,
"BuffIcon": "",
@@ -184,10 +184,10 @@
}
},
{
- "BuffId": 143002310,
+ "BuffId": 124006311,
"BuffGroupId": 1005,
- "Type": 4,
- "SkillId": 143002311,
+ "Type": 3,
+ "SkillId": 124006311,
"BuffLevel": 1,
"Quality": 3,
"BuffIcon": "",
@@ -207,10 +207,10 @@
}
},
{
- "BuffId": 115005310,
+ "BuffId": 124006312,
"BuffGroupId": 1005,
- "Type": 4,
- "SkillId": 115005311,
+ "Type": 3,
+ "SkillId": 124006311,
"BuffLevel": 2,
"Quality": 3,
"BuffIcon": "",
@@ -229,48 +229,234 @@
"n": 19
}
},
+ {
+ "BuffId": 144002311,
+ "BuffGroupId": 1006,
+ "Type": 3,
+ "SkillId": 144002311,
+ "BuffLevel": 1,
+ "Quality": 1,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_11",
+ "text": "描述描述描述11"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 20
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 20
+ }
+ },
+ {
+ "BuffId": 144002312,
+ "BuffGroupId": 1006,
+ "Type": 3,
+ "SkillId": 144002311,
+ "BuffLevel": 2,
+ "Quality": 1,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_12",
+ "text": "描述描述描述12"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 21
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 21
+ }
+ },
+ {
+ "BuffId": 151513211,
+ "BuffGroupId": 1007,
+ "Type": 4,
+ "SkillId": 151513211,
+ "BuffLevel": 1,
+ "Quality": 2,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_13",
+ "text": "描述描述描述13"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 22
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 22
+ }
+ },
+ {
+ "BuffId": 151513212,
+ "BuffGroupId": 1007,
+ "Type": 4,
+ "SkillId": 151513211,
+ "BuffLevel": 2,
+ "Quality": 2,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_14",
+ "text": "描述描述描述14"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 23
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 23
+ }
+ },
{
"BuffId": 143002311,
- "BuffGroupId": 1005,
- "Type": 1,
+ "BuffGroupId": 1008,
+ "Type": 4,
+ "SkillId": 143002311,
"BuffLevel": 1,
- "Quality": 3,
+ "Quality": 1,
"BuffIcon": "",
"BuffStory": {
- "key": "stonehenge_buffconfig_BuffStory_9",
- "text": "描述描述描述9"
+ "key": "stonehenge_buffconfig_BuffStory_15",
+ "text": "描述描述描述15"
},
"BuffUpgradeCost": {
- "a": "attr",
- "t": "gold",
- "n": 8
+ "a": "atn",
+ "t": "10000002",
+ "n": 24
},
"BuffSell": {
- "a": "attr",
- "t": "gold",
- "n": 9
+ "a": "atn",
+ "t": "10000002",
+ "n": 24
+ }
+ },
+ {
+ "BuffId": 143002312,
+ "BuffGroupId": 1008,
+ "Type": 4,
+ "SkillId": 143002311,
+ "BuffLevel": 2,
+ "Quality": 1,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_16",
+ "text": "描述描述描述16"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 25
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 25
}
},
{
"BuffId": 115005311,
- "BuffGroupId": 1005,
- "Type": 1,
+ "BuffGroupId": 1009,
+ "Type": 4,
+ "SkillId": 115005311,
+ "BuffLevel": 1,
+ "Quality": 2,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_17",
+ "text": "描述描述描述17"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 26
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 26
+ }
+ },
+ {
+ "BuffId": 115005312,
+ "BuffGroupId": 1009,
+ "Type": 4,
+ "SkillId": 115005311,
+ "BuffLevel": 2,
+ "Quality": 2,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_18",
+ "text": "描述描述描述18"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 27
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 27
+ }
+ },
+ {
+ "BuffId": 143006311,
+ "BuffGroupId": 1010,
+ "Type": 4,
+ "SkillId": 143006311,
+ "BuffLevel": 1,
+ "Quality": 3,
+ "BuffIcon": "",
+ "BuffStory": {
+ "key": "stonehenge_buffconfig_BuffStory_19",
+ "text": "描述描述描述19"
+ },
+ "BuffUpgradeCost": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 28
+ },
+ "BuffSell": {
+ "a": "atn",
+ "t": "10000002",
+ "n": 28
+ }
+ },
+ {
+ "BuffId": 143006312,
+ "BuffGroupId": 1010,
+ "Type": 4,
+ "SkillId": 143006311,
"BuffLevel": 2,
"Quality": 3,
"BuffIcon": "",
"BuffStory": {
- "key": "stonehenge_buffconfig_BuffStory_10",
- "text": "描述描述描述10"
+ "key": "stonehenge_buffconfig_BuffStory_20",
+ "text": "描述描述描述20"
},
"BuffUpgradeCost": {
- "a": "attr",
- "t": "gold",
- "n": 9
+ "a": "atn",
+ "t": "10000002",
+ "n": 29
},
"BuffSell": {
- "a": "attr",
- "t": "gold",
- "n": 10
+ "a": "atn",
+ "t": "10000002",
+ "n": 29
}
}
]
\ No newline at end of file
diff --git a/modules/stonehenge/configure.go b/modules/stonehenge/configure.go
index 7a6fe513e..5848b7eeb 100644
--- a/modules/stonehenge/configure.go
+++ b/modules/stonehenge/configure.go
@@ -60,18 +60,7 @@ type configureComp struct {
SNumE map[int64]int32 // 小组产出数量
// buff 随机
- _group map[int64][]int32 // key 小组ID value cid
- // 类型为1 的数据 该大组中的小组为权重掉落,必定从N个小组中随机出1个小组
- _lotteryType1 map[int32][]int32 // key 大组ID value cid
- // 类型为2 的数据 有多个小组ID
- _lotteryType2 map[int32][]int32 // key 大组ID value 小组ID
- // 小组类型为1
- _groupType1 map[int64][]int32 //value cid
- // 小组类型为2
- _groupType2 map[int64][]int32 //value cid
- Btype map[int32]int32
- Stype map[int64]int32 // subtype
- SNum map[int64]int32 // 小组产出数量
+ buffLottery map[int32]map[int32]*cfg.GameBufflotteryData
}
//组件初始化接口
@@ -458,52 +447,23 @@ func (this *configureComp) GetRoomGroupDataByLottery(lotteryId int32) (buff []in
func (this *configureComp) LoadBUffGroupData() {
if v, err := this.GetConfigure(game_bufflottery); err == nil {
+ this.hlock.Lock()
+ defer this.hlock.Unlock()
+ this.buffLottery = make(map[int32]map[int32]*cfg.GameBufflotteryData, 0)
if configure, ok := v.(*cfg.GameBufflottery); ok {
- this.hlock.Lock()
- defer this.hlock.Unlock()
- this._group = make(map[int64][]int32, 0)
- this._lotteryType1 = make(map[int32][]int32, 0)
- this._lotteryType2 = make(map[int32][]int32, 0)
- this._groupType1 = make(map[int64][]int32, 0)
- this._groupType2 = make(map[int64][]int32, 0)
- this.Btype = make(map[int32]int32, 0)
- this.Stype = make(map[int64]int32, 0)
- this.SNum = make(map[int64]int32, 0)
-
- for _, value := range configure.GetDataList() {
-
- key := int64(value.GroupId)<<31 + int64(value.SubGroupId)
- this._group[key] = append(this._group[key], value.Id)
-
- if _, ok := this.Btype[value.GroupId]; !ok {
- this.Btype[value.GroupId] = value.GroupType
- }
-
- if _, ok := this.Stype[key]; !ok {
- this.Stype[key] = value.SubGroupType
- }
- if _, ok := this.SNum[key]; !ok {
- this.SNum[key] = value.SubGroupNum
- }
- if this.Btype[value.GroupId] == 1 {
- this._lotteryType1[value.GroupId] = append(this._lotteryType1[value.GroupId], value.Id)
- } else if this.Btype[value.GroupId] == 2 {
- this._lotteryType2[value.GroupId] = append(this._lotteryType2[value.GroupId], value.Id)
- }
-
- if this.Stype[key] == 1 { // 小组ID为1
- this._groupType1[key] = append(this._groupType1[key], value.Id)
- } else if this.Stype[key] == 2 {
- this._groupType2[key] = append(this._groupType2[key], value.Id)
+ for _, v := range configure.GetDataList() {
+ if _, ok := this.buffLottery[v.GroupId]; !ok {
+ this.buffLottery[v.GroupId] = make(map[int32]*cfg.GameBufflotteryData)
}
+ this.buffLottery[v.GroupId][v.BuffID] = v
}
- return
}
} else {
log.Errorf("get NewGameBufflottery conf err:%v", err)
}
return
}
+
func (this *configureComp) GetLotterConfById(id int32) (data *cfg.GameBufflotteryData) {
if v, err := this.GetConfigure(game_bufflottery); err == nil {
if configure, ok := v.(*cfg.GameBufflottery); ok {
@@ -515,141 +475,6 @@ func (this *configureComp) GetLotterConfById(id int32) (data *cfg.GameBufflotter
// 实际掉落逻辑 (传入 掉落组ID vip等级 玩家等级 返回获得的道具)
func (this *configureComp) GetBuffGroupDataByLottery(lotteryId int32, addType int32) (buff []int32) {
-
- if _, ok := this._lotteryType1[lotteryId]; !ok {
- if _, ok := this._lotteryType2[lotteryId]; !ok {
- fmt.Printf("not found config lotterId:%d", lotteryId)
- return
- }
- }
- // 优先校验大组ID 的类型
- if this.Btype[lotteryId] == 1 { // 该大组中的小组为权重掉落,必定从N个小组中随机出1个小组
- var (
- szW []int32 // 权重数组
- szID []int32 // 小组ID 数组
- groupID int32
- gourp map[int32]int32 // key 小组ID value 权重
- )
-
- gourp = make(map[int32]int32, 0)
- // 随机小组id
- for _, v := range this._lotteryType1[lotteryId] {
- if _data := this.GetLotterConfById(v); _data != nil {
- if _, ok := gourp[_data.SubGroupId]; !ok {
- gourp[_data.SubGroupId] = _data.SubGroupWt // 小组ID 权重赋值
- szW = append(szW, _data.SubGroupWt)
- szID = append(szID, _data.SubGroupId)
- }
- }
- }
-
- groupID = szID[comm.GetRandW(szW)] // 获得小组ID
- //fmt.Printf("大组类型为1的,获得小组ID :%d,dropID:%d", groupID, lotteryId)
- key := int64(lotteryId)<<31 + int64(groupID)
- // 小组ID 类型判断
- if this.Stype[key] == 1 { // 该小组的道具为权重掉落,必定从N个道具中随机出1个道具
- for i := 0; i < int(this.SNum[key]); i++ {
- szW = make([]int32, 0)
- szID = make([]int32, 0)
- gourp = make(map[int32]int32, 0)
- for _, v := range this._groupType1[key] {
- if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
- curWt := _data.BuffWt
- if _, ok := gourp[_data.SubGroupId]; !ok {
- if buf, ok := this.buff[addType]; ok {
- if _, ok := buf[_data.BuffID]; ok {
- curWt += _data.TypeWt
- }
- }
- szW = append(szW, curWt)
- szID = append(szID, _data.Id)
- }
- }
- }
- index := comm.GetRandW(szW)
- _data := this.GetLotterConfById(szID[index])
- buff = append(buff, _data.BuffID)
- }
- return
- } else if this.Stype[key] == 2 { // 该小组中的道具为概率掉落,每个道具都会随机一次是否会掉落(单位为千分比)
- var wt int32
- for _, v := range this._groupType2[key] {
- if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
- if _data.SubGroupWt != 0 {
- wt = _data.SubGroupWt
- }
- //fmt.Printf("大组类型1小组类型2获得道具 :%v, 该道具Cid:%d", _data.Itemid, v)
- if wt >= comm.GetRandNum(0, 1000) { // 命中
- buff = append(buff, _data.BuffID)
- }
- }
- }
- return
- }
- } else if this.Btype[lotteryId] == 2 { // 该大组中的小组为概率掉落,每个小组都会随机一次是否会掉落(单位为千分比)
- // 每个小组id 都随机取一次
- var szGroupID []int32 // 获得的权重数组
- gourp := make([]*cfg.GameBufflotteryData, 0) // key 小组ID value 权重
- for _, v := range this._lotteryType2[lotteryId] {
- if _data := this.GetLotterConfById(v); _data != nil {
- gourp = append(gourp, _data)
- }
- }
- var wt int32
- // 类型为2 可能会同时获得多个组id
- for _, v := range gourp {
- if v.SubGroupWt != 0 {
- wt = v.SubGroupWt
- }
- k := v.SubGroupId
- //fmt.Printf("大组类型为2的,获得小组ID :%d,dropID:%d", k, v.Id)
- if wt >= comm.GetRandNum(0, 1000) { // 命中
- szGroupID = append(szGroupID, k)
- key := int64(lotteryId)<<31 + int64(k)
- if this.Stype[key] == 1 { // 随机一组数据
- for i := 0; i < int(this.SNum[key]); i++ {
- szW := make([]int32, 0)
- szID := make([]int32, 0)
- gourp := make(map[int32]int32, 0)
- for _, v := range this._groupType1[key] {
- if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
- curWt := _data.BuffWt
- if _, ok := gourp[_data.SubGroupId]; !ok {
- if buf, ok := this.buff[addType]; ok {
- if _, ok := buf[_data.BuffID]; ok {
- curWt += _data.TypeWt
- }
- }
- szW = append(szW, curWt)
- szID = append(szID, _data.Id)
- }
- }
- }
- index := comm.GetRandW(szW)
- _data := this.GetLotterConfById(szID[index])
- buff = append(buff, _data.BuffID)
- }
- } else if this.Stype[key] == 2 {
- for _, v := range this._groupType2[key] {
- var wt int32
- if _data := this.GetLotterConfById(v); _data != nil { // 权重赋值
- if _data.BuffWt != 0 {
- if buf, ok := this.buff[addType]; ok {
- if _, ok := buf[_data.BuffID]; ok {
- wt += _data.TypeWt
- }
- }
- wt += _data.BuffWt
- }
- if wt >= comm.GetRandNum(0, 1000) { // 命中
- buff = append(buff, _data.BuffID)
- }
- }
- }
- }
- }
- }
- }
return
}
diff --git a/sys/configure/structs/Game.BufflotteryData.go b/sys/configure/structs/Game.BufflotteryData.go
index c750c8425..849f163ee 100644
--- a/sys/configure/structs/Game.BufflotteryData.go
+++ b/sys/configure/structs/Game.BufflotteryData.go
@@ -13,12 +13,8 @@ import "errors"
type GameBufflotteryData struct {
Id int32
GroupId int32
- GroupType int32
- SubGroupWt int32
- SubGroupId int32
- SubGroupType int32
BuffID int32
- SubGroupNum int32
+ GroupNum int32
BuffWt int32
TypeWt int32
}
@@ -32,12 +28,8 @@ func (*GameBufflotteryData) GetTypeId() int32 {
func (_v *GameBufflotteryData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Id"].(float64); !_ok_ { err = errors.New("Id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["GroupId"].(float64); !_ok_ { err = errors.New("GroupId error"); return }; _v.GroupId = int32(_tempNum_) }
- { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["GroupType"].(float64); !_ok_ { err = errors.New("GroupType error"); return }; _v.GroupType = int32(_tempNum_) }
- { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SubGroupWt"].(float64); !_ok_ { err = errors.New("SubGroupWt error"); return }; _v.SubGroupWt = int32(_tempNum_) }
- { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SubGroupId"].(float64); !_ok_ { err = errors.New("SubGroupId error"); return }; _v.SubGroupId = int32(_tempNum_) }
- { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SubGroupType"].(float64); !_ok_ { err = errors.New("SubGroupType error"); return }; _v.SubGroupType = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["buffID"].(float64); !_ok_ { err = errors.New("buffID error"); return }; _v.BuffID = int32(_tempNum_) }
- { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SubGroupNum"].(float64); !_ok_ { err = errors.New("SubGroupNum error"); return }; _v.SubGroupNum = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["GroupNum"].(float64); !_ok_ { err = errors.New("GroupNum error"); return }; _v.GroupNum = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffWt"].(float64); !_ok_ { err = errors.New("BuffWt error"); return }; _v.BuffWt = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["TypeWt"].(float64); !_ok_ { err = errors.New("TypeWt error"); return }; _v.TypeWt = int32(_tempNum_) }
return
diff --git a/sys/configure/structs/Game.StroneBuffData.go b/sys/configure/structs/Game.StroneBuffData.go
index ec242408d..3ad0c046e 100644
--- a/sys/configure/structs/Game.StroneBuffData.go
+++ b/sys/configure/structs/Game.StroneBuffData.go
@@ -14,6 +14,7 @@ type GameStroneBuffData struct {
BuffId int32
BuffGroupId int32
Type int32
+ SkillId int32
BuffLevel int32
Quality int32
BuffIcon string
@@ -32,6 +33,7 @@ func (_v *GameStroneBuffData)Deserialize(_buf map[string]interface{}) (err error
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffId"].(float64); !_ok_ { err = errors.New("BuffId error"); return }; _v.BuffId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffGroupId"].(float64); !_ok_ { err = errors.New("BuffGroupId error"); return }; _v.BuffGroupId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Type"].(float64); !_ok_ { err = errors.New("Type error"); return }; _v.Type = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SkillId"].(float64); !_ok_ { err = errors.New("SkillId error"); return }; _v.SkillId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffLevel"].(float64); !_ok_ { err = errors.New("BuffLevel error"); return }; _v.BuffLevel = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Quality"].(float64); !_ok_ { err = errors.New("Quality error"); return }; _v.Quality = int32(_tempNum_) }
{ var _ok_ bool; if _v.BuffIcon, _ok_ = _buf["BuffIcon"].(string); !_ok_ { err = errors.New("BuffIcon error"); return } }
diff --git a/sys/configure/structs/Game.TrendChoseData.go b/sys/configure/structs/Game.TrendChoseData.go
index 83936cc05..728296cc1 100644
--- a/sys/configure/structs/Game.TrendChoseData.go
+++ b/sys/configure/structs/Game.TrendChoseData.go
@@ -12,8 +12,8 @@ import "errors"
type GameTrendChoseData struct {
Key int32
- Lv int32
TaskstarID int32
+ Lv int32
TaskendID int32
Npc []string
Chosetxt string
@@ -22,6 +22,7 @@ type GameTrendChoseData struct {
Get []*Gameatn
Lose []*Gameatn
Jump int32
+ Num int32
}
const TypeId_GameTrendChoseData = -2145177947
@@ -32,8 +33,8 @@ func (*GameTrendChoseData) GetTypeId() int32 {
func (_v *GameTrendChoseData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
- { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lv"].(float64); !_ok_ { err = errors.New("lv error"); return }; _v.Lv = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["taskstarID"].(float64); !_ok_ { err = errors.New("taskstarID error"); return }; _v.TaskstarID = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lv"].(float64); !_ok_ { err = errors.New("lv error"); return }; _v.Lv = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["taskendID"].(float64); !_ok_ { err = errors.New("taskendID error"); return }; _v.TaskendID = int32(_tempNum_) }
{
var _arr_ []interface{}
@@ -81,6 +82,7 @@ func (_v *GameTrendChoseData)Deserialize(_buf map[string]interface{}) (err error
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["jump"].(float64); !_ok_ { err = errors.New("jump error"); return }; _v.Jump = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["num"].(float64); !_ok_ { err = errors.New("num error"); return }; _v.Num = int32(_tempNum_) }
return
}
From 301f4c6af1e0b5129af8829c34d91e5f36bf6495 Mon Sep 17 00:00:00 2001
From: meixiongfeng <766881921@qq.com>
Date: Tue, 25 Jul 2023 20:05:13 +0800
Subject: [PATCH 2/3] update
---
bin/json/game_bufflottery.json | 142 +++++++++++++++---
bin/json/game_stonebattle.json | 62 ++++++++
...me_stronebuff.json => game_stonebuff.json} | 0
..._stroneevent.json => game_stoneevent.json} | 0
...me_stroneroom.json => game_stoneroom.json} | 0
..._stronestage.json => game_stonestage.json} | 0
modules/stonehenge/api_enterlevel.go | 4 +-
modules/stonehenge/api_event.go | 4 +-
modules/stonehenge/configure.go | 42 +++---
sys/configure/structs/Game.StoneBattle.go | 42 ++++++
sys/configure/structs/Game.StoneBattleData.go | 62 ++++++++
sys/configure/structs/Game.StoneBuff.go | 42 ++++++
...troneBuffData.go => Game.StoneBuffData.go} | 14 +-
sys/configure/structs/Game.StoneEvent.go | 42 ++++++
...oneEventData.go => Game.StoneEventData.go} | 14 +-
sys/configure/structs/Game.StoneRoom.go | 42 ++++++
...troneRoomData.go => Game.StoneRoomData.go} | 14 +-
sys/configure/structs/Game.StoneStage.go | 42 ++++++
...oneStageData.go => Game.StoneStageData.go} | 14 +-
sys/configure/structs/Game.StroneBuff.go | 42 ------
sys/configure/structs/Game.StroneEvent.go | 42 ------
sys/configure/structs/Game.StroneRoom.go | 42 ------
sys/configure/structs/Game.StroneStage.go | 42 ------
sys/configure/structs/Tables.go | 31 ++--
24 files changed, 525 insertions(+), 256 deletions(-)
create mode 100644 bin/json/game_stonebattle.json
rename bin/json/{game_stronebuff.json => game_stonebuff.json} (100%)
rename bin/json/{game_stroneevent.json => game_stoneevent.json} (100%)
rename bin/json/{game_stroneroom.json => game_stoneroom.json} (100%)
rename bin/json/{game_stronestage.json => game_stonestage.json} (100%)
create mode 100644 sys/configure/structs/Game.StoneBattle.go
create mode 100644 sys/configure/structs/Game.StoneBattleData.go
create mode 100644 sys/configure/structs/Game.StoneBuff.go
rename sys/configure/structs/{Game.StroneBuffData.go => Game.StoneBuffData.go} (88%)
create mode 100644 sys/configure/structs/Game.StoneEvent.go
rename sys/configure/structs/{Game.StroneEventData.go => Game.StoneEventData.go} (90%)
create mode 100644 sys/configure/structs/Game.StoneRoom.go
rename sys/configure/structs/{Game.StroneRoomData.go => Game.StoneRoomData.go} (89%)
create mode 100644 sys/configure/structs/Game.StoneStage.go
rename sys/configure/structs/{Game.StroneStageData.go => Game.StoneStageData.go} (93%)
delete mode 100644 sys/configure/structs/Game.StroneBuff.go
delete mode 100644 sys/configure/structs/Game.StroneEvent.go
delete mode 100644 sys/configure/structs/Game.StroneRoom.go
delete mode 100644 sys/configure/structs/Game.StroneStage.go
diff --git a/bin/json/game_bufflottery.json b/bin/json/game_bufflottery.json
index 43d6606df..7b3d62558 100644
--- a/bin/json/game_bufflottery.json
+++ b/bin/json/game_bufflottery.json
@@ -2,65 +2,161 @@
{
"Id": 1,
"GroupId": 100001,
- "buffID": 251023111,
+ "buffID": 125004311,
"GroupNum": 3,
"BuffWt": 50,
- "TypeWt": 60
+ "TypeWt": 600
},
{
"Id": 2,
"GroupId": 100001,
- "buffID": 251023112,
- "GroupNum": 0,
+ "buffID": 125004312,
+ "GroupNum": 3,
"BuffWt": 50,
- "TypeWt": 60
+ "TypeWt": 600
},
{
"Id": 3,
"GroupId": 100001,
- "buffID": 200000001,
- "GroupNum": 0,
+ "buffID": 135006211,
+ "GroupNum": 3,
"BuffWt": 50,
- "TypeWt": 60
+ "TypeWt": 600
},
{
"Id": 4,
"GroupId": 100001,
- "buffID": 200000002,
- "GroupNum": 0,
+ "buffID": 135006212,
+ "GroupNum": 3,
"BuffWt": 50,
- "TypeWt": 60
+ "TypeWt": 600
},
{
"Id": 5,
"GroupId": 100001,
- "buffID": 253005111,
- "GroupNum": 0,
+ "buffID": 135006311,
+ "GroupNum": 3,
"BuffWt": 50,
- "TypeWt": 60
+ "TypeWt": 600
},
{
"Id": 6,
"GroupId": 100001,
- "buffID": 253005112,
- "GroupNum": 0,
+ "buffID": 135006312,
+ "GroupNum": 3,
"BuffWt": 50,
- "TypeWt": 60
+ "TypeWt": 600
},
{
"Id": 7,
"GroupId": 100001,
- "buffID": 225002011,
- "GroupNum": 0,
- "BuffWt": 500,
+ "buffID": 144004311,
+ "GroupNum": 3,
+ "BuffWt": 50,
"TypeWt": 600
},
{
"Id": 8,
"GroupId": 100001,
- "buffID": 225002012,
- "GroupNum": 0,
- "BuffWt": 500,
+ "buffID": 144004312,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 9,
+ "GroupId": 100001,
+ "buffID": 124006311,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 10,
+ "GroupId": 100001,
+ "buffID": 124006312,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 11,
+ "GroupId": 100001,
+ "buffID": 144002311,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 12,
+ "GroupId": 100001,
+ "buffID": 144002312,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 13,
+ "GroupId": 100001,
+ "buffID": 151513211,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 14,
+ "GroupId": 100001,
+ "buffID": 151513212,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 15,
+ "GroupId": 100001,
+ "buffID": 143002311,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 16,
+ "GroupId": 100001,
+ "buffID": 143002312,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 17,
+ "GroupId": 100001,
+ "buffID": 115005311,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 18,
+ "GroupId": 100001,
+ "buffID": 115005312,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 19,
+ "GroupId": 100001,
+ "buffID": 143006311,
+ "GroupNum": 3,
+ "BuffWt": 50,
+ "TypeWt": 600
+ },
+ {
+ "Id": 20,
+ "GroupId": 100001,
+ "buffID": 143006312,
+ "GroupNum": 3,
+ "BuffWt": 50,
"TypeWt": 600
}
]
\ No newline at end of file
diff --git a/bin/json/game_stonebattle.json b/bin/json/game_stonebattle.json
new file mode 100644
index 000000000..6a258ef3e
--- /dev/null
+++ b/bin/json/game_stonebattle.json
@@ -0,0 +1,62 @@
+[
+ {
+ "BattleStageId": 110101,
+ "Atk": 0,
+ "Hp": 0,
+ "Def": 0,
+ "SpeedValue": 0,
+ "EffreValue": 0,
+ "BattleReadyID": 118,
+ "FormatList": [
+ 101011
+ ]
+ },
+ {
+ "BattleStageId": 110102,
+ "Atk": 0,
+ "Hp": 0,
+ "Def": 0,
+ "SpeedValue": 0,
+ "EffreValue": 0,
+ "BattleReadyID": 118,
+ "FormatList": [
+ 101012
+ ]
+ },
+ {
+ "BattleStageId": 110103,
+ "Atk": 0,
+ "Hp": 0,
+ "Def": 0,
+ "SpeedValue": 0,
+ "EffreValue": 0,
+ "BattleReadyID": 118,
+ "FormatList": [
+ 101013
+ ]
+ },
+ {
+ "BattleStageId": 110104,
+ "Atk": 0,
+ "Hp": 0,
+ "Def": 0,
+ "SpeedValue": 0,
+ "EffreValue": 0,
+ "BattleReadyID": 118,
+ "FormatList": [
+ 101021
+ ]
+ },
+ {
+ "BattleStageId": 110105,
+ "Atk": 0,
+ "Hp": 0,
+ "Def": 0,
+ "SpeedValue": 0,
+ "EffreValue": 0,
+ "BattleReadyID": 118,
+ "FormatList": [
+ 101022
+ ]
+ }
+]
\ No newline at end of file
diff --git a/bin/json/game_stronebuff.json b/bin/json/game_stonebuff.json
similarity index 100%
rename from bin/json/game_stronebuff.json
rename to bin/json/game_stonebuff.json
diff --git a/bin/json/game_stroneevent.json b/bin/json/game_stoneevent.json
similarity index 100%
rename from bin/json/game_stroneevent.json
rename to bin/json/game_stoneevent.json
diff --git a/bin/json/game_stroneroom.json b/bin/json/game_stoneroom.json
similarity index 100%
rename from bin/json/game_stroneroom.json
rename to bin/json/game_stoneroom.json
diff --git a/bin/json/game_stronestage.json b/bin/json/game_stonestage.json
similarity index 100%
rename from bin/json/game_stronestage.json
rename to bin/json/game_stonestage.json
diff --git a/modules/stonehenge/api_enterlevel.go b/modules/stonehenge/api_enterlevel.go
index 24944cb94..91e0b394b 100644
--- a/modules/stonehenge/api_enterlevel.go
+++ b/modules/stonehenge/api_enterlevel.go
@@ -25,9 +25,9 @@ func (this *apiComp) EnterLevel(session comm.IUserSession, req *pb.StonehengeEnt
update map[string]interface{}
heros []*pb.DBHero
portal int32 // 生成传送门 构造房间数据
- confStage *cfg.GameStroneStageData
+ confStage *cfg.GameStoneStageData
roomlotteryConf *cfg.GameRoomlotteryData
- roomConf *cfg.GameStroneRoomData
+ roomConf *cfg.GameStoneRoomData
szBuff []int32
err error
)
diff --git a/modules/stonehenge/api_event.go b/modules/stonehenge/api_event.go
index 39137eb8d..f87c4b5e1 100644
--- a/modules/stonehenge/api_event.go
+++ b/modules/stonehenge/api_event.go
@@ -22,10 +22,10 @@ func (this *apiComp) Event(session comm.IUserSession, req *pb.StonehengeEventReq
var (
stone *pb.DBStonehenge
update map[string]interface{}
- roomConf *cfg.GameStroneRoomData
+ roomConf *cfg.GameStoneRoomData
err error
newEvent int32 // 是否有新的事件
- eventConf *cfg.GameStroneEventData
+ eventConf *cfg.GameStoneEventData
)
update = make(map[string]interface{})
if errdata = this.EventCheck(session, req); errdata != nil {
diff --git a/modules/stonehenge/configure.go b/modules/stonehenge/configure.go
index 5848b7eeb..b9e4b3195 100644
--- a/modules/stonehenge/configure.go
+++ b/modules/stonehenge/configure.go
@@ -15,10 +15,10 @@ const (
game_bufflottery = "game_bufflottery.json"
game_eventlottery = "game_eventlottery.json"
game_roomlottery = "game_roomlottery.json"
- game_roomconf = "game_stroneroom.json"
- game_stageconf = "game_stronestage.json"
- game_buffconf = "game_stronebuff.json"
- game_eventconf = "game_stroneevent.json"
+ game_roomconf = "game_stoneroom.json"
+ game_stageconf = "game_stonestage.json"
+ game_buffconf = "game_stonebuff.json"
+ game_eventconf = "game_stoneevent.json"
)
///背包配置管理组件
@@ -27,7 +27,7 @@ type configureComp struct {
module *Stonehenge
hlock sync.RWMutex
// stronestage
- stage map[int64]*cfg.GameStroneStageData
+ stage map[int64]*cfg.GameStoneStageData
// buff
buff map[int32]map[int32]struct{} // key buff 类型 value buffid
@@ -76,13 +76,13 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
err = this.LoadConfigure(game_roomlottery, cfg.NewGameRoomlottery)
configure.RegisterConfigure(game_roomlottery, cfg.NewGameRoomlottery, this.LoadRoomGroupData)
- err = this.LoadConfigure(game_stageconf, cfg.NewGameStroneStage)
- err = this.LoadConfigure(game_buffconf, cfg.NewGameStroneBuff)
- err = this.LoadConfigure(game_eventconf, cfg.NewGameStroneEvent)
- err = this.LoadConfigure(game_roomconf, cfg.NewGameStroneRoom)
+ err = this.LoadConfigure(game_stageconf, cfg.NewGameStoneStage)
+ err = this.LoadConfigure(game_buffconf, cfg.NewGameStoneBuff)
+ err = this.LoadConfigure(game_eventconf, cfg.NewGameStoneEvent)
+ err = this.LoadConfigure(game_roomconf, cfg.NewGameStoneRoom)
- configure.RegisterConfigure(game_stageconf, cfg.NewGameStroneStage, this.LoadGameStroneStage)
- configure.RegisterConfigure(game_buffconf, cfg.NewGameStroneBuff, this.LoadGameStroneBuff)
+ configure.RegisterConfigure(game_stageconf, cfg.NewGameStoneStage, this.LoadGameStroneStage)
+ configure.RegisterConfigure(game_buffconf, cfg.NewGameStoneBuff, this.LoadGameStroneBuff)
return
}
@@ -478,12 +478,12 @@ func (this *configureComp) GetBuffGroupDataByLottery(lotteryId int32, addType in
return
}
-func (this *configureComp) GetStoneRoomDataById(roomid int32) (conf *cfg.GameStroneRoomData, err error) {
+func (this *configureComp) GetStoneRoomDataById(roomid int32) (conf *cfg.GameStoneRoomData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_roomconf); err == nil {
- if configure, ok := v.(*cfg.GameStroneRoom); ok {
+ if configure, ok := v.(*cfg.GameStoneRoom); ok {
if conf = configure.Get(roomid); conf != nil {
return
}
@@ -493,12 +493,12 @@ func (this *configureComp) GetStoneRoomDataById(roomid int32) (conf *cfg.GameStr
return
}
-func (this *configureComp) GetStoneBuffDataById(buffid int32) (conf *cfg.GameStroneBuffData, err error) {
+func (this *configureComp) GetStoneBuffDataById(buffid int32) (conf *cfg.GameStoneBuffData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_buffconf); err == nil {
- if configure, ok := v.(*cfg.GameStroneBuff); ok {
+ if configure, ok := v.(*cfg.GameStoneBuff); ok {
if conf = configure.Get(buffid); conf != nil {
return
}
@@ -508,12 +508,12 @@ func (this *configureComp) GetStoneBuffDataById(buffid int32) (conf *cfg.GameStr
return
}
-func (this *configureComp) GetStoneEventDataById(eventid int32) (conf *cfg.GameStroneEventData, err error) {
+func (this *configureComp) GetStoneEventDataById(eventid int32) (conf *cfg.GameStoneEventData, err error) {
var (
v interface{}
)
if v, err = this.GetConfigure(game_eventconf); err == nil {
- if configure, ok := v.(*cfg.GameStroneEvent); ok {
+ if configure, ok := v.(*cfg.GameStoneEvent); ok {
if conf = configure.Get(eventid); conf != nil {
return
}
@@ -527,10 +527,10 @@ func (this *configureComp) GetStoneEventDataById(eventid int32) (conf *cfg.GameS
func (this *configureComp) LoadGameStroneStage() {
if v, err := this.GetConfigure(game_stageconf); err == nil {
- if configure, ok := v.(*cfg.GameStroneStage); ok {
+ if configure, ok := v.(*cfg.GameStoneStage); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
- this.stage = make(map[int64]*cfg.GameStroneStageData, 0)
+ this.stage = make(map[int64]*cfg.GameStoneStageData, 0)
for _, v := range configure.GetDataList() {
key := int64(v.StageId)<<16 + int64(v.RoomId)
this.stage[key] = v
@@ -542,7 +542,7 @@ func (this *configureComp) LoadGameStroneStage() {
}
// 参数1 关卡id 参数2 层数id
-func (this *configureComp) GetStageConfByStageid(stgeid int32, roomid int32) (conf *cfg.GameStroneStageData) {
+func (this *configureComp) GetStageConfByStageid(stgeid int32, roomid int32) (conf *cfg.GameStoneStageData) {
key := int64(stgeid)<<16 + int64(roomid)
return this.stage[key]
}
@@ -550,7 +550,7 @@ func (this *configureComp) GetStageConfByStageid(stgeid int32, roomid int32) (co
func (this *configureComp) LoadGameStroneBuff() {
if v, err := this.GetConfigure(game_buffconf); err == nil {
- if configure, ok := v.(*cfg.GameStroneBuff); ok {
+ if configure, ok := v.(*cfg.GameStoneBuff); ok {
this.hlock.Lock()
defer this.hlock.Unlock()
this.buff = make(map[int32]map[int32]struct{}, 0)
diff --git a/sys/configure/structs/Game.StoneBattle.go b/sys/configure/structs/Game.StoneBattle.go
new file mode 100644
index 000000000..49eb3d7c2
--- /dev/null
+++ b/sys/configure/structs/Game.StoneBattle.go
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+package cfg
+
+type GameStoneBattle struct {
+ _dataMap map[int32]*GameStoneBattleData
+ _dataList []*GameStoneBattleData
+}
+
+func NewGameStoneBattle(_buf []map[string]interface{}) (*GameStoneBattle, error) {
+ _dataList := make([]*GameStoneBattleData, 0, len(_buf))
+ dataMap := make(map[int32]*GameStoneBattleData)
+ for _, _ele_ := range _buf {
+ if _v, err2 := DeserializeGameStoneBattleData(_ele_); err2 != nil {
+ return nil, err2
+ } else {
+ _dataList = append(_dataList, _v)
+ dataMap[_v.BattleStageId] = _v
+ }
+ }
+ return &GameStoneBattle{_dataList:_dataList, _dataMap:dataMap}, nil
+}
+
+func (table *GameStoneBattle) GetDataMap() map[int32]*GameStoneBattleData {
+ return table._dataMap
+}
+
+func (table *GameStoneBattle) GetDataList() []*GameStoneBattleData {
+ return table._dataList
+}
+
+func (table *GameStoneBattle) Get(key int32) *GameStoneBattleData {
+ return table._dataMap[key]
+}
+
+
diff --git a/sys/configure/structs/Game.StoneBattleData.go b/sys/configure/structs/Game.StoneBattleData.go
new file mode 100644
index 000000000..a9c5a540f
--- /dev/null
+++ b/sys/configure/structs/Game.StoneBattleData.go
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+package cfg
+
+import "errors"
+
+type GameStoneBattleData struct {
+ BattleStageId int32
+ Atk int32
+ Hp int32
+ Def int32
+ SpeedValue int32
+ EffreValue int32
+ BattleReadyID int32
+ FormatList []int32
+}
+
+const TypeId_GameStoneBattleData = 469689547
+
+func (*GameStoneBattleData) GetTypeId() int32 {
+ return 469689547
+}
+
+func (_v *GameStoneBattleData)Deserialize(_buf map[string]interface{}) (err error) {
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleStageId"].(float64); !_ok_ { err = errors.New("BattleStageId error"); return }; _v.BattleStageId = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Atk"].(float64); !_ok_ { err = errors.New("Atk error"); return }; _v.Atk = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Hp"].(float64); !_ok_ { err = errors.New("Hp error"); return }; _v.Hp = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Def"].(float64); !_ok_ { err = errors.New("Def error"); return }; _v.Def = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["SpeedValue"].(float64); !_ok_ { err = errors.New("SpeedValue error"); return }; _v.SpeedValue = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EffreValue"].(float64); !_ok_ { err = errors.New("EffreValue error"); return }; _v.EffreValue = int32(_tempNum_) }
+ { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleReadyID"].(float64); !_ok_ { err = errors.New("BattleReadyID error"); return }; _v.BattleReadyID = int32(_tempNum_) }
+ {
+ var _arr_ []interface{}
+ var _ok_ bool
+ if _arr_, _ok_ = _buf["FormatList"].([]interface{}); !_ok_ { err = errors.New("FormatList error"); return }
+
+ _v.FormatList = make([]int32, 0, len(_arr_))
+
+ for _, _e_ := range _arr_ {
+ var _list_v_ int32
+ { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
+ _v.FormatList = append(_v.FormatList, _list_v_)
+ }
+ }
+
+ return
+}
+
+func DeserializeGameStoneBattleData(_buf map[string]interface{}) (*GameStoneBattleData, error) {
+ v := &GameStoneBattleData{}
+ if err := v.Deserialize(_buf); err == nil {
+ return v, nil
+ } else {
+ return nil, err
+ }
+}
diff --git a/sys/configure/structs/Game.StoneBuff.go b/sys/configure/structs/Game.StoneBuff.go
new file mode 100644
index 000000000..0667fedfb
--- /dev/null
+++ b/sys/configure/structs/Game.StoneBuff.go
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+package cfg
+
+type GameStoneBuff struct {
+ _dataMap map[int32]*GameStoneBuffData
+ _dataList []*GameStoneBuffData
+}
+
+func NewGameStoneBuff(_buf []map[string]interface{}) (*GameStoneBuff, error) {
+ _dataList := make([]*GameStoneBuffData, 0, len(_buf))
+ dataMap := make(map[int32]*GameStoneBuffData)
+ for _, _ele_ := range _buf {
+ if _v, err2 := DeserializeGameStoneBuffData(_ele_); err2 != nil {
+ return nil, err2
+ } else {
+ _dataList = append(_dataList, _v)
+ dataMap[_v.BuffId] = _v
+ }
+ }
+ return &GameStoneBuff{_dataList:_dataList, _dataMap:dataMap}, nil
+}
+
+func (table *GameStoneBuff) GetDataMap() map[int32]*GameStoneBuffData {
+ return table._dataMap
+}
+
+func (table *GameStoneBuff) GetDataList() []*GameStoneBuffData {
+ return table._dataList
+}
+
+func (table *GameStoneBuff) Get(key int32) *GameStoneBuffData {
+ return table._dataMap[key]
+}
+
+
diff --git a/sys/configure/structs/Game.StroneBuffData.go b/sys/configure/structs/Game.StoneBuffData.go
similarity index 88%
rename from sys/configure/structs/Game.StroneBuffData.go
rename to sys/configure/structs/Game.StoneBuffData.go
index 3ad0c046e..80b0abd17 100644
--- a/sys/configure/structs/Game.StroneBuffData.go
+++ b/sys/configure/structs/Game.StoneBuffData.go
@@ -10,7 +10,7 @@ package cfg
import "errors"
-type GameStroneBuffData struct {
+type GameStoneBuffData struct {
BuffId int32
BuffGroupId int32
Type int32
@@ -23,13 +23,13 @@ type GameStroneBuffData struct {
BuffSell *Gameatn
}
-const TypeId_GameStroneBuffData = 1812104654
+const TypeId_GameStoneBuffData = -1457644250
-func (*GameStroneBuffData) GetTypeId() int32 {
- return 1812104654
+func (*GameStoneBuffData) GetTypeId() int32 {
+ return -1457644250
}
-func (_v *GameStroneBuffData)Deserialize(_buf map[string]interface{}) (err error) {
+func (_v *GameStoneBuffData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffId"].(float64); !_ok_ { err = errors.New("BuffId error"); return }; _v.BuffId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffGroupId"].(float64); !_ok_ { err = errors.New("BuffGroupId error"); return }; _v.BuffGroupId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Type"].(float64); !_ok_ { err = errors.New("Type error"); return }; _v.Type = int32(_tempNum_) }
@@ -43,8 +43,8 @@ func (_v *GameStroneBuffData)Deserialize(_buf map[string]interface{}) (err error
return
}
-func DeserializeGameStroneBuffData(_buf map[string]interface{}) (*GameStroneBuffData, error) {
- v := &GameStroneBuffData{}
+func DeserializeGameStoneBuffData(_buf map[string]interface{}) (*GameStoneBuffData, error) {
+ v := &GameStoneBuffData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
diff --git a/sys/configure/structs/Game.StoneEvent.go b/sys/configure/structs/Game.StoneEvent.go
new file mode 100644
index 000000000..858c4f1e6
--- /dev/null
+++ b/sys/configure/structs/Game.StoneEvent.go
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+package cfg
+
+type GameStoneEvent struct {
+ _dataMap map[int32]*GameStoneEventData
+ _dataList []*GameStoneEventData
+}
+
+func NewGameStoneEvent(_buf []map[string]interface{}) (*GameStoneEvent, error) {
+ _dataList := make([]*GameStoneEventData, 0, len(_buf))
+ dataMap := make(map[int32]*GameStoneEventData)
+ for _, _ele_ := range _buf {
+ if _v, err2 := DeserializeGameStoneEventData(_ele_); err2 != nil {
+ return nil, err2
+ } else {
+ _dataList = append(_dataList, _v)
+ dataMap[_v.EventId] = _v
+ }
+ }
+ return &GameStoneEvent{_dataList:_dataList, _dataMap:dataMap}, nil
+}
+
+func (table *GameStoneEvent) GetDataMap() map[int32]*GameStoneEventData {
+ return table._dataMap
+}
+
+func (table *GameStoneEvent) GetDataList() []*GameStoneEventData {
+ return table._dataList
+}
+
+func (table *GameStoneEvent) Get(key int32) *GameStoneEventData {
+ return table._dataMap[key]
+}
+
+
diff --git a/sys/configure/structs/Game.StroneEventData.go b/sys/configure/structs/Game.StoneEventData.go
similarity index 90%
rename from sys/configure/structs/Game.StroneEventData.go
rename to sys/configure/structs/Game.StoneEventData.go
index 020cfd55e..c3db52243 100644
--- a/sys/configure/structs/Game.StroneEventData.go
+++ b/sys/configure/structs/Game.StoneEventData.go
@@ -10,7 +10,7 @@ package cfg
import "errors"
-type GameStroneEventData struct {
+type GameStoneEventData struct {
EventId int32
EventTitle string
EventType int32
@@ -24,13 +24,13 @@ type GameStroneEventData struct {
Probability int32
}
-const TypeId_GameStroneEventData = 341060691
+const TypeId_GameStoneEventData = 2058059771
-func (*GameStroneEventData) GetTypeId() int32 {
- return 341060691
+func (*GameStoneEventData) GetTypeId() int32 {
+ return 2058059771
}
-func (_v *GameStroneEventData)Deserialize(_buf map[string]interface{}) (err error) {
+func (_v *GameStoneEventData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EventId"].(float64); !_ok_ { err = errors.New("EventId error"); return }; _v.EventId = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["EventTitle"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.EventTitle error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.EventTitle, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EventType"].(float64); !_ok_ { err = errors.New("EventType error"); return }; _v.EventType = int32(_tempNum_) }
@@ -58,8 +58,8 @@ func (_v *GameStroneEventData)Deserialize(_buf map[string]interface{}) (err erro
return
}
-func DeserializeGameStroneEventData(_buf map[string]interface{}) (*GameStroneEventData, error) {
- v := &GameStroneEventData{}
+func DeserializeGameStoneEventData(_buf map[string]interface{}) (*GameStoneEventData, error) {
+ v := &GameStoneEventData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
diff --git a/sys/configure/structs/Game.StoneRoom.go b/sys/configure/structs/Game.StoneRoom.go
new file mode 100644
index 000000000..83bda4ba3
--- /dev/null
+++ b/sys/configure/structs/Game.StoneRoom.go
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+package cfg
+
+type GameStoneRoom struct {
+ _dataMap map[int32]*GameStoneRoomData
+ _dataList []*GameStoneRoomData
+}
+
+func NewGameStoneRoom(_buf []map[string]interface{}) (*GameStoneRoom, error) {
+ _dataList := make([]*GameStoneRoomData, 0, len(_buf))
+ dataMap := make(map[int32]*GameStoneRoomData)
+ for _, _ele_ := range _buf {
+ if _v, err2 := DeserializeGameStoneRoomData(_ele_); err2 != nil {
+ return nil, err2
+ } else {
+ _dataList = append(_dataList, _v)
+ dataMap[_v.RoomId] = _v
+ }
+ }
+ return &GameStoneRoom{_dataList:_dataList, _dataMap:dataMap}, nil
+}
+
+func (table *GameStoneRoom) GetDataMap() map[int32]*GameStoneRoomData {
+ return table._dataMap
+}
+
+func (table *GameStoneRoom) GetDataList() []*GameStoneRoomData {
+ return table._dataList
+}
+
+func (table *GameStoneRoom) Get(key int32) *GameStoneRoomData {
+ return table._dataMap[key]
+}
+
+
diff --git a/sys/configure/structs/Game.StroneRoomData.go b/sys/configure/structs/Game.StoneRoomData.go
similarity index 89%
rename from sys/configure/structs/Game.StroneRoomData.go
rename to sys/configure/structs/Game.StoneRoomData.go
index 10b14718b..94fcfe839 100644
--- a/sys/configure/structs/Game.StroneRoomData.go
+++ b/sys/configure/structs/Game.StoneRoomData.go
@@ -10,7 +10,7 @@ package cfg
import "errors"
-type GameStroneRoomData struct {
+type GameStoneRoomData struct {
RoomId int32
RoomName string
SceneName string
@@ -24,13 +24,13 @@ type GameStroneRoomData struct {
Condition int32
}
-const TypeId_GameStroneRoomData = -1133628842
+const TypeId_GameStoneRoomData = -108410450
-func (*GameStroneRoomData) GetTypeId() int32 {
- return -1133628842
+func (*GameStoneRoomData) GetTypeId() int32 {
+ return -108410450
}
-func (_v *GameStroneRoomData)Deserialize(_buf map[string]interface{}) (err error) {
+func (_v *GameStoneRoomData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["RoomId"].(float64); !_ok_ { err = errors.New("RoomId error"); return }; _v.RoomId = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["RoomName"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.RoomName error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.RoomName, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; if _v.SceneName, _ok_ = _buf["SceneName"].(string); !_ok_ { err = errors.New("SceneName error"); return } }
@@ -45,8 +45,8 @@ func (_v *GameStroneRoomData)Deserialize(_buf map[string]interface{}) (err error
return
}
-func DeserializeGameStroneRoomData(_buf map[string]interface{}) (*GameStroneRoomData, error) {
- v := &GameStroneRoomData{}
+func DeserializeGameStoneRoomData(_buf map[string]interface{}) (*GameStoneRoomData, error) {
+ v := &GameStoneRoomData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
diff --git a/sys/configure/structs/Game.StoneStage.go b/sys/configure/structs/Game.StoneStage.go
new file mode 100644
index 000000000..b0c457ba5
--- /dev/null
+++ b/sys/configure/structs/Game.StoneStage.go
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+package cfg
+
+type GameStoneStage struct {
+ _dataMap map[int32]*GameStoneStageData
+ _dataList []*GameStoneStageData
+}
+
+func NewGameStoneStage(_buf []map[string]interface{}) (*GameStoneStage, error) {
+ _dataList := make([]*GameStoneStageData, 0, len(_buf))
+ dataMap := make(map[int32]*GameStoneStageData)
+ for _, _ele_ := range _buf {
+ if _v, err2 := DeserializeGameStoneStageData(_ele_); err2 != nil {
+ return nil, err2
+ } else {
+ _dataList = append(_dataList, _v)
+ dataMap[_v.Id] = _v
+ }
+ }
+ return &GameStoneStage{_dataList:_dataList, _dataMap:dataMap}, nil
+}
+
+func (table *GameStoneStage) GetDataMap() map[int32]*GameStoneStageData {
+ return table._dataMap
+}
+
+func (table *GameStoneStage) GetDataList() []*GameStoneStageData {
+ return table._dataList
+}
+
+func (table *GameStoneStage) Get(key int32) *GameStoneStageData {
+ return table._dataMap[key]
+}
+
+
diff --git a/sys/configure/structs/Game.StroneStageData.go b/sys/configure/structs/Game.StoneStageData.go
similarity index 93%
rename from sys/configure/structs/Game.StroneStageData.go
rename to sys/configure/structs/Game.StoneStageData.go
index a2cc14a96..e191592e5 100644
--- a/sys/configure/structs/Game.StroneStageData.go
+++ b/sys/configure/structs/Game.StoneStageData.go
@@ -10,7 +10,7 @@ package cfg
import "errors"
-type GameStroneStageData struct {
+type GameStoneStageData struct {
Id int32
StageId int32
PreviouStage int32
@@ -28,13 +28,13 @@ type GameStroneStageData struct {
StageValue int32
}
-const TypeId_GameStroneStageData = 2146544311
+const TypeId_GameStoneStageData = -431423905
-func (*GameStroneStageData) GetTypeId() int32 {
- return 2146544311
+func (*GameStoneStageData) GetTypeId() int32 {
+ return -431423905
}
-func (_v *GameStroneStageData)Deserialize(_buf map[string]interface{}) (err error) {
+func (_v *GameStoneStageData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Id"].(float64); !_ok_ { err = errors.New("Id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["StageId"].(float64); !_ok_ { err = errors.New("StageId error"); return }; _v.StageId = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["PreviouStage"].(float64); !_ok_ { err = errors.New("PreviouStage error"); return }; _v.PreviouStage = int32(_tempNum_) }
@@ -92,8 +92,8 @@ func (_v *GameStroneStageData)Deserialize(_buf map[string]interface{}) (err erro
return
}
-func DeserializeGameStroneStageData(_buf map[string]interface{}) (*GameStroneStageData, error) {
- v := &GameStroneStageData{}
+func DeserializeGameStoneStageData(_buf map[string]interface{}) (*GameStoneStageData, error) {
+ v := &GameStoneStageData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
diff --git a/sys/configure/structs/Game.StroneBuff.go b/sys/configure/structs/Game.StroneBuff.go
deleted file mode 100644
index 01af4bb77..000000000
--- a/sys/configure/structs/Game.StroneBuff.go
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-package cfg
-
-type GameStroneBuff struct {
- _dataMap map[int32]*GameStroneBuffData
- _dataList []*GameStroneBuffData
-}
-
-func NewGameStroneBuff(_buf []map[string]interface{}) (*GameStroneBuff, error) {
- _dataList := make([]*GameStroneBuffData, 0, len(_buf))
- dataMap := make(map[int32]*GameStroneBuffData)
- for _, _ele_ := range _buf {
- if _v, err2 := DeserializeGameStroneBuffData(_ele_); err2 != nil {
- return nil, err2
- } else {
- _dataList = append(_dataList, _v)
- dataMap[_v.BuffId] = _v
- }
- }
- return &GameStroneBuff{_dataList:_dataList, _dataMap:dataMap}, nil
-}
-
-func (table *GameStroneBuff) GetDataMap() map[int32]*GameStroneBuffData {
- return table._dataMap
-}
-
-func (table *GameStroneBuff) GetDataList() []*GameStroneBuffData {
- return table._dataList
-}
-
-func (table *GameStroneBuff) Get(key int32) *GameStroneBuffData {
- return table._dataMap[key]
-}
-
-
diff --git a/sys/configure/structs/Game.StroneEvent.go b/sys/configure/structs/Game.StroneEvent.go
deleted file mode 100644
index 27e585609..000000000
--- a/sys/configure/structs/Game.StroneEvent.go
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-package cfg
-
-type GameStroneEvent struct {
- _dataMap map[int32]*GameStroneEventData
- _dataList []*GameStroneEventData
-}
-
-func NewGameStroneEvent(_buf []map[string]interface{}) (*GameStroneEvent, error) {
- _dataList := make([]*GameStroneEventData, 0, len(_buf))
- dataMap := make(map[int32]*GameStroneEventData)
- for _, _ele_ := range _buf {
- if _v, err2 := DeserializeGameStroneEventData(_ele_); err2 != nil {
- return nil, err2
- } else {
- _dataList = append(_dataList, _v)
- dataMap[_v.EventId] = _v
- }
- }
- return &GameStroneEvent{_dataList:_dataList, _dataMap:dataMap}, nil
-}
-
-func (table *GameStroneEvent) GetDataMap() map[int32]*GameStroneEventData {
- return table._dataMap
-}
-
-func (table *GameStroneEvent) GetDataList() []*GameStroneEventData {
- return table._dataList
-}
-
-func (table *GameStroneEvent) Get(key int32) *GameStroneEventData {
- return table._dataMap[key]
-}
-
-
diff --git a/sys/configure/structs/Game.StroneRoom.go b/sys/configure/structs/Game.StroneRoom.go
deleted file mode 100644
index 0b198e4bc..000000000
--- a/sys/configure/structs/Game.StroneRoom.go
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-package cfg
-
-type GameStroneRoom struct {
- _dataMap map[int32]*GameStroneRoomData
- _dataList []*GameStroneRoomData
-}
-
-func NewGameStroneRoom(_buf []map[string]interface{}) (*GameStroneRoom, error) {
- _dataList := make([]*GameStroneRoomData, 0, len(_buf))
- dataMap := make(map[int32]*GameStroneRoomData)
- for _, _ele_ := range _buf {
- if _v, err2 := DeserializeGameStroneRoomData(_ele_); err2 != nil {
- return nil, err2
- } else {
- _dataList = append(_dataList, _v)
- dataMap[_v.RoomId] = _v
- }
- }
- return &GameStroneRoom{_dataList:_dataList, _dataMap:dataMap}, nil
-}
-
-func (table *GameStroneRoom) GetDataMap() map[int32]*GameStroneRoomData {
- return table._dataMap
-}
-
-func (table *GameStroneRoom) GetDataList() []*GameStroneRoomData {
- return table._dataList
-}
-
-func (table *GameStroneRoom) Get(key int32) *GameStroneRoomData {
- return table._dataMap[key]
-}
-
-
diff --git a/sys/configure/structs/Game.StroneStage.go b/sys/configure/structs/Game.StroneStage.go
deleted file mode 100644
index 6a21aa81d..000000000
--- a/sys/configure/structs/Game.StroneStage.go
+++ /dev/null
@@ -1,42 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-package cfg
-
-type GameStroneStage struct {
- _dataMap map[int32]*GameStroneStageData
- _dataList []*GameStroneStageData
-}
-
-func NewGameStroneStage(_buf []map[string]interface{}) (*GameStroneStage, error) {
- _dataList := make([]*GameStroneStageData, 0, len(_buf))
- dataMap := make(map[int32]*GameStroneStageData)
- for _, _ele_ := range _buf {
- if _v, err2 := DeserializeGameStroneStageData(_ele_); err2 != nil {
- return nil, err2
- } else {
- _dataList = append(_dataList, _v)
- dataMap[_v.Id] = _v
- }
- }
- return &GameStroneStage{_dataList:_dataList, _dataMap:dataMap}, nil
-}
-
-func (table *GameStroneStage) GetDataMap() map[int32]*GameStroneStageData {
- return table._dataMap
-}
-
-func (table *GameStroneStage) GetDataList() []*GameStroneStageData {
- return table._dataList
-}
-
-func (table *GameStroneStage) Get(key int32) *GameStroneStageData {
- return table._dataMap[key]
-}
-
-
diff --git a/sys/configure/structs/Tables.go b/sys/configure/structs/Tables.go
index 5316d20b4..f8f8ef3b4 100644
--- a/sys/configure/structs/Tables.go
+++ b/sys/configure/structs/Tables.go
@@ -203,10 +203,11 @@ type Tables struct {
Roomlottery *GameRoomlottery
Bufflottery *GameBufflottery
Eventlottery *GameEventlottery
- StroneBuff *GameStroneBuff
- StroneRoom *GameStroneRoom
- StroneStage *GameStroneStage
- StroneEvent *GameStroneEvent
+ StoneBuff *GameStoneBuff
+ StoneRoom *GameStoneRoom
+ StoneStage *GameStoneStage
+ StoneEvent *GameStoneEvent
+ StoneBattle *GameStoneBattle
GameSummaryTab *GameGameSummaryTab
GameSummary *GameGameSummary
CompositeAll *GameCompositeAll
@@ -1369,28 +1370,34 @@ func NewTables(loader JsonLoader) (*Tables, error) {
if tables.Eventlottery, err = NewGameEventlottery(buf) ; err != nil {
return nil, err
}
- if buf, err = loader("game_stronebuff") ; err != nil {
+ if buf, err = loader("game_stonebuff") ; err != nil {
return nil, err
}
- if tables.StroneBuff, err = NewGameStroneBuff(buf) ; err != nil {
+ if tables.StoneBuff, err = NewGameStoneBuff(buf) ; err != nil {
return nil, err
}
- if buf, err = loader("game_stroneroom") ; err != nil {
+ if buf, err = loader("game_stoneroom") ; err != nil {
return nil, err
}
- if tables.StroneRoom, err = NewGameStroneRoom(buf) ; err != nil {
+ if tables.StoneRoom, err = NewGameStoneRoom(buf) ; err != nil {
return nil, err
}
- if buf, err = loader("game_stronestage") ; err != nil {
+ if buf, err = loader("game_stonestage") ; err != nil {
return nil, err
}
- if tables.StroneStage, err = NewGameStroneStage(buf) ; err != nil {
+ if tables.StoneStage, err = NewGameStoneStage(buf) ; err != nil {
return nil, err
}
- if buf, err = loader("game_stroneevent") ; err != nil {
+ if buf, err = loader("game_stoneevent") ; err != nil {
return nil, err
}
- if tables.StroneEvent, err = NewGameStroneEvent(buf) ; err != nil {
+ if tables.StoneEvent, err = NewGameStoneEvent(buf) ; err != nil {
+ return nil, err
+ }
+ if buf, err = loader("game_stonebattle") ; err != nil {
+ return nil, err
+ }
+ if tables.StoneBattle, err = NewGameStoneBattle(buf) ; err != nil {
return nil, err
}
if buf, err = loader("game_gamesummarytab") ; err != nil {
From 91f08811039ec515828a9916e93840070bffa1b6 Mon Sep 17 00:00:00 2001
From: meixiongfeng <766881921@qq.com>
Date: Wed, 26 Jul 2023 10:34:45 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=B7=B2=E6=9C=89buff=20=E8=BF=87=E6=BB=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
modules/stonehenge/configure.go | 56 +++++++++++++++++++++++++++++----
1 file changed, 50 insertions(+), 6 deletions(-)
diff --git a/modules/stonehenge/configure.go b/modules/stonehenge/configure.go
index b9e4b3195..ca821859e 100644
--- a/modules/stonehenge/configure.go
+++ b/modules/stonehenge/configure.go
@@ -81,9 +81,18 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
err = this.LoadConfigure(game_eventconf, cfg.NewGameStoneEvent)
err = this.LoadConfigure(game_roomconf, cfg.NewGameStoneRoom)
- configure.RegisterConfigure(game_stageconf, cfg.NewGameStoneStage, this.LoadGameStroneStage)
- configure.RegisterConfigure(game_buffconf, cfg.NewGameStoneBuff, this.LoadGameStroneBuff)
+ configure.RegisterConfigure(game_stageconf, cfg.NewGameStoneStage, this.LoadGameStoneStage)
+ configure.RegisterConfigure(game_buffconf, cfg.NewGameStoneBuff, this.LoadGameStoneBuff)
+ // sz := make(map[int32]struct{})
+ // sz[125004312] = struct{}{}
+ // sz[135006211] = struct{}{}
+ // sz[135006212] = struct{}{}
+ // sz[135006312] = struct{}{}
+ // sz[144004311] = struct{}{}
+ // sz[144004312] = struct{}{}
+ // sz[124006311] = struct{}{}
+ // this.GetBuffGroupDataByLottery(100001, 1, sz)
return
}
@@ -474,7 +483,42 @@ func (this *configureComp) GetLotterConfById(id int32) (data *cfg.GameBufflotter
}
// 实际掉落逻辑 (传入 掉落组ID vip等级 玩家等级 返回获得的道具)
-func (this *configureComp) GetBuffGroupDataByLottery(lotteryId int32, addType int32) (buff []int32) {
+func (this *configureComp) GetBuffGroupDataByLottery(lotteryId int32, addType int32, ownerbuff map[int32]struct{}) (buff []int32) {
+ var (
+ num int32
+ szW []int32
+ curWt int32 // 是否增加权重
+ sz []*cfg.GameBufflotteryData
+ )
+
+ if v, ok := this.buffLottery[lotteryId]; ok {
+ for i := 1; ; i++ {
+ for k, v1 := range v { // k buffID v1 cfg.GameBufflotteryData
+ curWt = 0
+ if _, ok := ownerbuff[k]; !ok {
+ sz = append(sz, v1)
+ if v2, ok := this.buff[addType]; ok {
+ if _, ok := v2[k]; ok {
+ curWt += v1.TypeWt
+ }
+ }
+ curWt += v1.BuffWt
+ szW = append(szW, curWt)
+ }
+ if num == 0 {
+ num = v1.GroupNum
+ }
+ }
+
+ getbuffid := sz[comm.GetRandW(szW)].BuffID
+ ownerbuff[getbuffid] = struct{}{}
+ buff = append(buff, getbuffid)
+ if i >= int(num) {
+ break
+ }
+ }
+ }
+
return
}
@@ -524,7 +568,7 @@ func (this *configureComp) GetStoneEventDataById(eventid int32) (conf *cfg.GameS
}
//
-func (this *configureComp) LoadGameStroneStage() {
+func (this *configureComp) LoadGameStoneStage() {
if v, err := this.GetConfigure(game_stageconf); err == nil {
if configure, ok := v.(*cfg.GameStoneStage); ok {
@@ -547,7 +591,7 @@ func (this *configureComp) GetStageConfByStageid(stgeid int32, roomid int32) (co
return this.stage[key]
}
-func (this *configureComp) LoadGameStroneBuff() {
+func (this *configureComp) LoadGameStoneBuff() {
if v, err := this.GetConfigure(game_buffconf); err == nil {
if configure, ok := v.(*cfg.GameStoneBuff); ok {
@@ -566,6 +610,6 @@ func (this *configureComp) LoadGameStroneBuff() {
return
}
-func (this *configureComp) GetGameStroneBuff(addType int32) (m map[int32]struct{}) {
+func (this *configureComp) GetGameStoneBuff(addType int32) (m map[int32]struct{}) {
return this.buff[addType]
}