合并代码

This commit is contained in:
kxdd 2024-04-28 18:30:00 +08:00
parent 03a67c3778
commit a2bfdd1d01
8 changed files with 1861 additions and 1502 deletions

Binary file not shown.

View File

@ -737,34 +737,6 @@
"Location": "0",
"Describe": "tienlen游戏记录打出过的牌"
},
{
"Id": 60001,
"Name": "tienlen记牌器",
"ShowLocation": [
1,
1
],
"Classify": [
1,
1,
0
],
"Type": 15,
"Effect0": [
0,
0,
1
],
"Effect": [
0,
0,
1
],
"CompositionMax": 1,
"Time": 12,
"Location": "0",
"Describe": "tienlen游戏记录打出过的牌"
},
{
"Id": 100001,
"Name": "金币",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
// Code generated by xlsx2proto.
// DO NOT EDIT!
@ -6,7 +7,7 @@ package srvdata
import (
"google.golang.org/protobuf/proto"
"mongo.games.com/game/protocol/server"
"mongo.games.com/game/protocol/server"
)
var PBDB_PigBank_DiamondMgr = &DB_PigBank_DiamondMgr{pool: make(map[int32]*server.DB_PigBank_Diamond), Datas: &server.DB_PigBank_DiamondArray{}}
@ -64,5 +65,5 @@ func (this *DB_PigBank_DiamondMgr) GetData(id int32) *server.DB_PigBank_Diamond
}
func init() {
DataMgr.RegisteLoader("DB_PigBank_Diamond.dat", &ProtobufDataLoader{dh: PBDB_PigBank_DiamondMgr})
DataMgr.register("DB_PigBank_Diamond.dat", &ProtobufDataLoader{dh: PBDB_PigBank_DiamondMgr})
}

View File

@ -65,5 +65,5 @@ func (this *DB_Pigbank_PropMgr) GetData(id int32) *server.DB_Pigbank_Prop {
}
func init() {
DataMgr.RegisteLoader("DB_Pigbank_Prop.dat", &ProtobufDataLoader{dh: PBDB_Pigbank_PropMgr})
DataMgr.register("DB_Pigbank_Prop.dat", &ProtobufDataLoader{dh: PBDB_Pigbank_PropMgr})
}

View File

@ -8012,6 +8012,215 @@ func AgcConvertDB_GiftBox(fi,fo string) {
break
}
arr.Arr = append(arr.Arr, data)
}
byteData, err := proto.Marshal(arr)
if err == nil{
err := os.WriteFile(fo, byteData, os.ModePerm)
if err != nil {
fmt.Println(err)
}
}
byteData, err = json.MarshalIndent(arr, "", "\t")
if err == nil {
foJson := strings.Replace(fo, ".dat", ".json", -1)
err := os.WriteFile(foJson, byteData, os.ModePerm)
if err != nil {
fmt.Println(err)
}
}
break //only fetch first sheet
}
}
func AgcConvertDB_GiftCard(fi,fo string) {
xlsxFile, err := xlsx.OpenFile(fi)
if err != nil {
fmt.Println("excel file open error:", err, "filename:", fi)
return
}
if err := recover(); err != nil {
fmt.Println(" panic,error=", err)
var buf [4096]byte
lens := runtime.Stack(buf[:], false)
fmt.Println("stack--->", string(buf[:lens]))
}
for _, sheet := range xlsxFile.Sheets {
arr:=&server.DB_GiftCardArray{
Arr:make([]*server.DB_GiftCard, 0, len(sheet.Rows)),
}
for i, row := range sheet.Rows {
if i <= 1 {
continue
}
if len(row.Cells) == 0 {
break
}
temp := int64(0)
var arrInt []int32
var arrInt64 []int64
var arrStr []string
var _ = arrInt
var _ = arrStr
var _ = arrInt64
temp, _ = strconv.ParseInt(row.Cells[0].String(), 10, 32)
data := &server.DB_GiftCard{}
for {
if len(row.Cells)<0+1{
break
}
temp, _ = strconv.ParseInt(row.Cells[0].String(), 10, 32)
data.Id = int32(temp)
if len(row.Cells)<1+1{
break
}
temp, _ = strconv.ParseInt(row.Cells[1].String(), 10, 32)
data.ShopID = int32(temp)
if len(row.Cells)<2+1{
break
}
data.Name = row.Cells[2].String()
if len(row.Cells)<3+1{
break
}
if row.Cells[3].String() != ""{
pairs := strings.Split(row.Cells[3].String(), ";")
resultMap := make(map[int64]int64)
for _, pair := range pairs {
kv := strings.Split(pair, ",")
key, err := strconv.ParseInt(kv[0], 10, 64)
if err != nil {
// 错误处理
fmt.Println("无法转换为int64:", kv[0])
continue
}
value, err := strconv.ParseInt(kv[1], 10, 64)
if err != nil {
// 错误处理
fmt.Println("无法转换为int64:", kv[1])
continue
}
resultMap[key] = value
}
data.Rewards = resultMap
}
if len(row.Cells)<4+1{
break
}
if row.Cells[4].String() != ""{
pairs := strings.Split(row.Cells[4].String(), ";")
resultMap := make(map[int64]int64)
for _, pair := range pairs {
kv := strings.Split(pair, ",")
key, err := strconv.ParseInt(kv[0], 10, 64)
if err != nil {
// 错误处理
fmt.Println("无法转换为int64:", kv[0])
continue
}
value, err := strconv.ParseInt(kv[1], 10, 64)
if err != nil {
// 错误处理
fmt.Println("无法转换为int64:", kv[1])
continue
}
resultMap[key] = value
}
data.DayRewards = resultMap
}
if len(row.Cells)<5+1{
break
}
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
data.Time = int32(temp)
if len(row.Cells)<6+1{
break
}
arrStr = strings.Split(row.Cells[6].String(), "|")
arrInt = nil
if len(arrStr) > 0 && row.Cells[6].String() != "" {
arrInt = make([]int32, len(arrStr), len(arrStr))
for i, v := range arrStr {
temp, _ = strconv.ParseInt(strings.TrimSpace(v), 10, 32)
arrInt[i] = int32(temp)
}
}
data.Equity = arrInt
break
}
arr.Arr = append(arr.Arr, data)
@ -12026,12 +12235,12 @@ func AgcConvertDB_Task(fi,fo string) {
if len(row.Cells)<3+1{
if len(row.Cells)<1+1{
break
}
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
data.ActivityType = int32(temp)
temp, _ = strconv.ParseInt(row.Cells[1].String(), 10, 32)
data.Order = int32(temp)
@ -12045,7 +12254,7 @@ func AgcConvertDB_Task(fi,fo string) {
}
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
data.TaskType = int32(temp)
data.ActivityType = int32(temp)
@ -12058,9 +12267,9 @@ func AgcConvertDB_Task(fi,fo string) {
break
}
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
data.TaskType = int32(temp)
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 64)
data.TargetTimes = int64(temp)
@ -12074,7 +12283,7 @@ func AgcConvertDB_Task(fi,fo string) {
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 64)
data.FinishTimes = int64(temp)
data.TargetTimes = int64(temp)
@ -12086,14 +12295,28 @@ func AgcConvertDB_Task(fi,fo string) {
break
}
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 64)
data.FinishTimes = int64(temp)
if row.Cells[7].String() != ""{
pairs := strings.Split(row.Cells[7].String(), ";")
if len(row.Cells)<8+1{
break
}
if row.Cells[8].String() != ""{
pairs := strings.Split(row.Cells[8].String(), ";")
resultMap := make(map[int64]int64)
for _, pair := range pairs {
kv := strings.Split(pair, ",")
@ -12115,11 +12338,11 @@ func AgcConvertDB_Task(fi,fo string) {
}
if len(row.Cells)<8+1{
if len(row.Cells)<9+1{
break
}
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
data.GameType = int32(temp)
@ -12129,16 +12352,16 @@ func AgcConvertDB_Task(fi,fo string) {
if len(row.Cells)<9+1{
if len(row.Cells)<10+1{
break
}
arrStr = strings.Split(row.Cells[9].String(), "|")
arrStr = strings.Split(row.Cells[10].String(), "|")
arrInt = nil
if len(arrStr) > 0 && row.Cells[9].String() != "" {
if len(arrStr) > 0 && row.Cells[10].String() != "" {
arrInt = make([]int32, len(arrStr), len(arrStr))
for i, v := range arrStr {
temp, _ = strconv.ParseInt(strings.TrimSpace(v), 10, 32)
@ -12941,6 +13164,8 @@ func main(){
AgcConvertDB_GiftBox(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GiftBox.xlsx`,`..\..\data\DB_GiftBox.dat`)
AgcConvertDB_GiftCard(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GiftCard.xlsx`,`..\..\data\DB_GiftCard.dat`)
AgcConvertDB_IceAgeElementRate(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_IceAgeElementRate.xlsx`,`..\..\data\DB_IceAgeElementRate.dat`)
AgcConvertDB_Legend_Odds(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Legend_Odds.xlsx`,`..\..\data\DB_Legend_Odds.dat`)

Binary file not shown.