12906 lines
218 KiB
Go
12906 lines
218 KiB
Go
|
|
// Code generated by xlsx2proto.
|
|
// DO NOT EDIT!
|
|
|
|
package main
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"os"
|
|
"runtime"
|
|
"strconv"
|
|
"strings"
|
|
|
|
"github.com/tealeg/xlsx"
|
|
"google.golang.org/protobuf/proto"
|
|
|
|
"mongo.games.com/game/protocol/server"
|
|
)
|
|
|
|
var _ = strings.Split
|
|
|
|
|
|
func AgcConvertDB_ActSign(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_ActSignArray{
|
|
Arr:make([]*server.DB_ActSign, 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_ActSign{}
|
|
|
|
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.Type = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Name = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Item_Id = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Grade = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Activity1(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_Activity1Array{
|
|
Arr:make([]*server.DB_Activity1, 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_Activity1{}
|
|
|
|
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.Parameter = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Turn = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Title = row.Cells[3].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Costype = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Costp = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Cost = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.Typee = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.Propid = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.Value = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.Getype = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_AnimalColor(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_AnimalColorArray{
|
|
Arr:make([]*server.DB_AnimalColor, 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_AnimalColor{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Desc = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[2].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[2].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.ColorChance = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_ArtilleryRate(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_ArtilleryRateArray{
|
|
Arr:make([]*server.DB_ArtilleryRate, 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_ArtilleryRate{}
|
|
|
|
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.Shell = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Level = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Desc = row.Cells[3].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_ArtillerySkin(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_ArtillerySkinArray{
|
|
Arr:make([]*server.DB_ArtillerySkin, 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_ArtillerySkin{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.CannonId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Type = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.ExprieTime = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Show = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Order = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.NameIcon = row.Cells[7].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.PicIcon = row.Cells[8].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.BaseIcon = row.Cells[9].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.ShellIcon = row.Cells[10].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.NetIcon = row.Cells[11].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[12].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[12].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.Vip = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[13].String(), 10, 32)
|
|
data.Gold = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[14].String(), 10, 32)
|
|
data.Diamond = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[15].String(), 10, 32)
|
|
data.Income = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[16].String(), 10, 32)
|
|
data.Speed = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<17+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[17].String(), 10, 32)
|
|
data.Caught = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<18+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[18].String(), 10, 32)
|
|
data.Introduce = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<19+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Source = row.Cells[19].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_BlackWhite(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_BlackWhiteArray{
|
|
Arr:make([]*server.DB_BlackWhite, 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_BlackWhite{}
|
|
|
|
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)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[2].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[2].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.BlackOdds = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.WhiteOdds = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_CardsJD(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_CardsJDArray{
|
|
Arr:make([]*server.DB_CardsJD, 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_CardsJD{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Card1 = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Card1Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Card1HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change1Cards = row.Cells[4].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Card2 = row.Cells[5].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Card2Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.Card2HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change2Cards = row.Cells[8].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Card3 = row.Cells[9].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.Card3Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.Card3HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change3Cards = row.Cells[12].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Card4 = row.Cells[13].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[14].String(), 10, 32)
|
|
data.Card4Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[15].String(), 10, 32)
|
|
data.Card4HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change4Cards = row.Cells[16].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_CardsYuLe(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_CardsYuLeArray{
|
|
Arr:make([]*server.DB_CardsYuLe, 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_CardsYuLe{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Card1 = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Card1Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Card1HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change1Cards = row.Cells[4].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Card2 = row.Cells[5].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Card2Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.Card2HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change2Cards = row.Cells[8].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Card3 = row.Cells[9].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.Card3Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.Card3HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change3Cards = row.Cells[12].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Card4 = row.Cells[13].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[14].String(), 10, 32)
|
|
data.Card4Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[15].String(), 10, 32)
|
|
data.Card4HandNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Change4Cards = row.Cells[16].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_ChessBilledRules(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_ChessBilledRulesArray{
|
|
Arr:make([]*server.DB_ChessBilledRules, 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_ChessBilledRules{}
|
|
|
|
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.TypeId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.WinScore = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.LoseScore = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.DrawScore = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.WinTimes = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.OtherScore = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_ChessMatchRules(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_ChessMatchRulesArray{
|
|
Arr:make([]*server.DB_ChessMatchRules, 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_ChessMatchRules{}
|
|
|
|
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.ScoreMin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.ScoreMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.MatchScoreMin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.MatchScoreMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[5].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[5].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.MatchScoreLowStep = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
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.MatchScoreHightStep = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_ChessRank(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_ChessRankArray{
|
|
Arr:make([]*server.DB_ChessRank, 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_ChessRank{}
|
|
|
|
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.Score = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].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_ClientVer(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_ClientVerArray{
|
|
Arr:make([]*server.DB_ClientVer, 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_ClientVer{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.PackageFlag = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.PackVers = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.GameVers = row.Cells[3].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_CollectBox(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_CollectBoxArray{
|
|
Arr:make([]*server.DB_CollectBox, 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_CollectBox{}
|
|
|
|
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.Rate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if row.Cells[2].String() != ""{
|
|
pairs := strings.Split(row.Cells[2].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.ItemID = resultMap
|
|
}
|
|
|
|
|
|
|
|
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_CollectBoxGain(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_CollectBoxGainArray{
|
|
Arr:make([]*server.DB_CollectBoxGain, 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_CollectBoxGain{}
|
|
|
|
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.Rate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_CrashSearch(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_CrashSearchArray{
|
|
Arr:make([]*server.DB_CrashSearch, 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_CrashSearch{}
|
|
|
|
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.Time = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Price = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Createroom(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_CreateroomArray{
|
|
Arr:make([]*server.DB_Createroom, 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_Createroom{}
|
|
|
|
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.GameId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.GameSite = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.GoldRange = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[4].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[4].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.BetRange = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Fish(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_FishArray{
|
|
Arr:make([]*server.DB_Fish, 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_Fish{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.NameE = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.Gold = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Icon = row.Cells[4].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Speed = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Exp = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.FrameCnt = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.FrameDelay = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.Rate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.ShowType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.Show = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[12].String(), 10, 32)
|
|
data.ShowScale = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[13].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[13].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.ShowPos = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.DieSound = row.Cells[14].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[15].String(), 10, 32)
|
|
data.DieFrame = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[16].String(), 10, 32)
|
|
data.DieRotate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<17+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[17].String(), 10, 32)
|
|
data.DieEffect = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<18+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[18].String(), 10, 32)
|
|
data.DieShake = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<19+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[19].String(), 10, 32)
|
|
data.ShakeRange = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<20+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Shape = row.Cells[20].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<21+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[21].String(), 10, 32)
|
|
data.IsBoss = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<22+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[22].String(), 10, 32)
|
|
data.ResId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<23+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.DieParticle = row.Cells[23].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<24+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[24].String(), 10, 32)
|
|
data.GroupShape = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<25+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[25].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[25].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.GroupFishes = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<26+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[26].String(), 10, 32)
|
|
data.Zorder = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<27+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.ResPng = row.Cells[27].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<28+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.ResPlist = row.Cells[28].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<29+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.ExportJson = row.Cells[29].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<30+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.AimIcon = row.Cells[30].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<31+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[31].String(), 10, 32)
|
|
data.GameId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<32+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[32].String(), 10, 32)
|
|
data.Sort = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<33+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[33].String(), 10, 32)
|
|
data.FishType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<34+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.RandomCoin = row.Cells[34].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_FishOut(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_FishOutArray{
|
|
Arr:make([]*server.DB_FishOut, 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_FishOut{}
|
|
|
|
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.SceneType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Exp = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[4].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[4].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.Multiple = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[5].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[5].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.Path = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
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.Count = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.RefreshInterval = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.Speed = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.Event = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_FishPath(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_FishPathArray{
|
|
Arr:make([]*server.DB_FishPath, 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_FishPath{}
|
|
|
|
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.AppearTime = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.DisappearTime = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_FishRoom(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_FishRoomArray{
|
|
Arr:make([]*server.DB_FishRoom, 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_FishRoom{}
|
|
|
|
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.RoomId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.SumGold1 = row.Cells[3].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.SumGold2 = row.Cells[4].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.SumGold3 = row.Cells[5].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.SumGold4 = row.Cells[6].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.SumGold5 = row.Cells[7].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.BossCDTime = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.LittleBossCDTime = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.EnableBoss = row.Cells[10].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.EnableLittleBoss = row.Cells[11].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_FishSkill(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_FishSkillArray{
|
|
Arr:make([]*server.DB_FishSkill, 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_FishSkill{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Vip = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Consume = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[4].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[4].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.Item = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[5].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[5].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.OtherConsumer = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Multiple = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.Duration = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.SkillGroups = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.GCD = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.Cooldown = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Hidden = row.Cells[11].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Describe = row.Cells[12].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Boss = row.Cells[13].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[14].String(), 10, 32)
|
|
data.Type = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[15].String(), 10, 32)
|
|
data.Limit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[16].String(), 10, 32)
|
|
data.Mutex = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<17+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[17].String(), 10, 32)
|
|
data.MutexTime = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<18+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[18].String(), 10, 32)
|
|
data.Fury = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_FortuneGod_Odds(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_FortuneGod_OddsArray{
|
|
Arr:make([]*server.DB_FortuneGod_Odds, 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_FortuneGod_Odds{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Rateodds3 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Rateodds4 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Rateodds5 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_FortuneGod_TurnRate(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_FortuneGod_TurnRateArray{
|
|
Arr:make([]*server.DB_FortuneGod_TurnRate, 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_FortuneGod_TurnRate{}
|
|
|
|
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.ReturnRateMin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.ReturnRateMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.Chance = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_FortuneGod_Weight(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_FortuneGod_WeightArray{
|
|
Arr:make([]*server.DB_FortuneGod_Weight, 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_FortuneGod_Weight{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[2].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[2].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.Weight = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_FortuneGod_WeightCondition(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_FortuneGod_WeightConditionArray{
|
|
Arr:make([]*server.DB_FortuneGod_WeightCondition, 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_FortuneGod_WeightCondition{}
|
|
|
|
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.IsNew = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[2].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[2].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.BetScope = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.TrueCalcRate = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.WeightId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_GamMatchLV(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_GamMatchLVArray{
|
|
Arr:make([]*server.DB_GamMatchLV, 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_GamMatchLV{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[1].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[1].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.Star = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Star2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.AwardType1 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.AwardId1 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Number1 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.AwardType2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.AwardId2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.Number2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.AwardType3 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.AwardId3 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[12].String(), 10, 32)
|
|
data.Number3 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_GameCoinPool(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_GameCoinPoolArray{
|
|
Arr:make([]*server.DB_GameCoinPool, 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_GameCoinPool{}
|
|
|
|
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)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 64)
|
|
data.InitValue = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 64)
|
|
data.LowerLimit = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 64)
|
|
data.UpperLimit = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 64)
|
|
data.QuDu = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.UpperOdds = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.UpperOddsMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.LowerOdds = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.LowerOddsMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.ProfitRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[12].String(), 10, 32)
|
|
data.CtrlRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[13].String(), 10, 64)
|
|
data.InitNovicValue = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_GameFree(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_GameFreeArray{
|
|
Arr:make([]*server.DB_GameFree, 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_GameFree{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Title = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.GameId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.GameMode = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.FreeMode = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.GameRule = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.GameType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.SceneType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.RankType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.SceneAdd = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Desc = row.Cells[11].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[12].String(), 10, 32)
|
|
data.ShowType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[13].String(), 10, 32)
|
|
data.SubShowType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[14].String(), 10, 32)
|
|
data.Flag = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[15].String(), 10, 32)
|
|
data.TestTakeCoin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[16].String(), 10, 32)
|
|
data.ShowId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<17+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[17].String(), 10, 64)
|
|
data.LimitCoin = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<18+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[18].String(), 10, 64)
|
|
data.MaxCoinLimit = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<19+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[19].String(), 10, 32)
|
|
data.ServiceFee = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<20+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[20].String(), 10, 64)
|
|
data.LowerThanKick = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<21+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[21].String(), 10, 32)
|
|
data.BaseScore = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<22+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[22].String(), 10, 32)
|
|
data.Turn = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<23+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.BetDec = row.Cells[23].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<24+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[24].String(), 10, 32)
|
|
data.Bot = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<25+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[25].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[25].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.Ai = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<26+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[26].String(), 10, 32)
|
|
data.Banker = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<27+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[27].String(), 10, 32)
|
|
data.MaxChip = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<28+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[28].String(), "|")
|
|
arrInt64 = nil
|
|
if len(arrStr) > 0 && row.Cells[28].String() != "" {
|
|
arrInt64 = make([]int64, len(arrStr), len(arrStr))
|
|
for i, v := range arrStr {
|
|
temp, _ = strconv.ParseInt(strings.TrimSpace(v), 10, 64)
|
|
arrInt64[i] = int64(temp)
|
|
}
|
|
}
|
|
data.OtherIntParams = arrInt64
|
|
|
|
|
|
|
|
if len(row.Cells)<29+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[29].String(), "|")
|
|
arrInt64 = nil
|
|
if len(arrStr) > 0 && row.Cells[29].String() != "" {
|
|
arrInt64 = make([]int64, len(arrStr), len(arrStr))
|
|
for i, v := range arrStr {
|
|
temp, _ = strconv.ParseInt(strings.TrimSpace(v), 10, 64)
|
|
arrInt64[i] = int64(temp)
|
|
}
|
|
}
|
|
data.ChessScoreParams = arrInt64
|
|
|
|
|
|
|
|
if len(row.Cells)<30+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[30].String(), "|")
|
|
arrInt64 = nil
|
|
if len(arrStr) > 0 && row.Cells[30].String() != "" {
|
|
arrInt64 = make([]int64, len(arrStr), len(arrStr))
|
|
for i, v := range arrStr {
|
|
temp, _ = strconv.ParseInt(strings.TrimSpace(v), 10, 64)
|
|
arrInt64[i] = int64(temp)
|
|
}
|
|
}
|
|
data.RankScoreParams = arrInt64
|
|
|
|
|
|
|
|
if len(row.Cells)<31+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[31].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[31].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.Jackpot = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<32+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[32].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[32].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.RobotNumRng = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<33+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[33].String(), "|")
|
|
arrInt64 = nil
|
|
if len(arrStr) > 0 && row.Cells[33].String() != "" {
|
|
arrInt64 = make([]int64, len(arrStr), len(arrStr))
|
|
for i, v := range arrStr {
|
|
temp, _ = strconv.ParseInt(strings.TrimSpace(v), 10, 64)
|
|
arrInt64[i] = int64(temp)
|
|
}
|
|
}
|
|
data.RobotTakeCoin = arrInt64
|
|
|
|
|
|
|
|
if len(row.Cells)<34+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[34].String(), "|")
|
|
arrInt64 = nil
|
|
if len(arrStr) > 0 && row.Cells[34].String() != "" {
|
|
arrInt64 = make([]int64, len(arrStr), len(arrStr))
|
|
for i, v := range arrStr {
|
|
temp, _ = strconv.ParseInt(strings.TrimSpace(v), 10, 64)
|
|
arrInt64[i] = int64(temp)
|
|
}
|
|
}
|
|
data.RobotLimitCoin = arrInt64
|
|
|
|
|
|
|
|
if len(row.Cells)<35+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[35].String(), 10, 32)
|
|
data.BetLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<36+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[36].String(), 10, 32)
|
|
data.TaxRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<37+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[37].String(), 10, 32)
|
|
data.SameIpLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<38+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[38].String(), 10, 32)
|
|
data.SamePlaceLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<39+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.GameDif = row.Cells[39].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<40+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[40].String(), 10, 32)
|
|
data.GameClass = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<41+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.PlatformName = row.Cells[41].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<42+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[42].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[42].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.MaxBetCoin = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<43+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[43].String(), 10, 32)
|
|
data.PlayNumLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<44+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[44].String(), 10, 32)
|
|
data.CreateRoomNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<45+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[45].String(), 10, 32)
|
|
data.MatchTrueMan = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<46+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[46].String(), 10, 32)
|
|
data.PlayerWaterRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<47+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[47].String(), 10, 32)
|
|
data.MatchMode = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<48+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[48].String(), 10, 32)
|
|
data.KillingRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<49+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[49].String(), 10, 32)
|
|
data.BetWaterRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<50+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[50].String(), 10, 32)
|
|
data.Lottery = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<51+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.LotteryConfig = row.Cells[51].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<52+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[52].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[52].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.BalanceLine = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<53+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[53].String(), 10, 32)
|
|
data.JackpotRatio = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<54+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[54].String(), 10, 32)
|
|
data.JackpotMin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<55+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[55].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[55].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.ChessGradeLimit = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<56+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[56].String(), 10, 32)
|
|
data.LeaveDeduct = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<57+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[57].String(), 10, 32)
|
|
data.LeaveCombat = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<58+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[58].String(), 10, 32)
|
|
data.IntuseCannonMin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<59+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[59].String(), 10, 32)
|
|
data.IntuseCannonMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<60+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[60].String(), 10, 32)
|
|
data.BossDrainageBet = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<61+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[61].String(), 10, 32)
|
|
data.Draw = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<62+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[62].String(), 10, 64)
|
|
data.Fluctuate = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<63+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.FluctuateMax = row.Cells[63].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<64+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[64].String(), 10, 32)
|
|
data.Ratio = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<65+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[65].String(), 10, 64)
|
|
data.MinValue = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<66+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[66].String(), 10, 64)
|
|
data.MaxValue = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<67+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[67].String(), 10, 32)
|
|
data.DrainageBet = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<68+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[68].String(), 10, 32)
|
|
data.DiamondDrop = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<69+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[69].String(), 10, 32)
|
|
data.NegativeMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<70+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[70].String(), 10, 32)
|
|
data.RatioMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_GameItem(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_GameItemArray{
|
|
Arr:make([]*server.DB_GameItem, 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_GameItem{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[2].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[2].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.ShowLocation = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.Classify = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Type = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[5].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[5].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.Effect0 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
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.Effect = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.SaleType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.SaleGold = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.Composition = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.CompositionMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.Time = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Location = row.Cells[12].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Describe = row.Cells[13].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[14].String(), 10, 64)
|
|
data.Num = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Value = row.Cells[15].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_GameMatchLevel(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_GameMatchLevelArray{
|
|
Arr:make([]*server.DB_GameMatchLevel, 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_GameMatchLevel{}
|
|
|
|
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.GameFreeId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.MatchLevel = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.RobotUpRatio = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[4].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[4].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.UpGrade = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[5].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[5].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.UpGradeOdds = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
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.DownGrade = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[7].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[7].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.DownGradeOdds = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_GameRule(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_GameRuleArray{
|
|
Arr:make([]*server.DB_GameRule, 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_GameRule{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.GameId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.GameMode = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[4].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[4].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.Params = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.RuleDesc = row.Cells[5].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.GameDif = row.Cells[6].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_GameSubsidy(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_GameSubsidyArray{
|
|
Arr:make([]*server.DB_GameSubsidy, 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_GameSubsidy{}
|
|
|
|
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.LimitNum = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Get = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Times = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Game_Drop(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_Game_DropArray{
|
|
Arr:make([]*server.DB_Game_Drop, 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_Game_Drop{}
|
|
|
|
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.GameId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Bet = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.ItemName1 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.ItemId1 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Rate1 = 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.Amount1 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Game_Introduction(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_Game_IntroductionArray{
|
|
Arr:make([]*server.DB_Game_Introduction, 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_Game_Introduction{}
|
|
|
|
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.Type = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Story = row.Cells[3].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.AwardTitle = row.Cells[4].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.LevelMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Game_Pet(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_Game_PetArray{
|
|
Arr:make([]*server.DB_Game_Pet, 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_Game_Pet{}
|
|
|
|
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.PetId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Grade = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Level = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Fragment = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Amount = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.AwardType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.Award = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.AwardRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Game_Role(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_Game_RoleArray{
|
|
Arr:make([]*server.DB_Game_Role, 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_Game_Role{}
|
|
|
|
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.RoleId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Grade = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Level = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Fragment = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Amount = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.AwardType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.Award = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.AwardRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_GiftBox(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_GiftBoxArray{
|
|
Arr:make([]*server.DB_GiftBox, 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_GiftBox{}
|
|
|
|
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.Rate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if row.Cells[2].String() != ""{
|
|
pairs := strings.Split(row.Cells[2].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.ItemID = resultMap
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
}
|
|
|
|
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_IceAgeElementRate(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_IceAgeElementRateArray{
|
|
Arr:make([]*server.DB_IceAgeElementRate, 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_IceAgeElementRate{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.ModeName = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.ModeType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.Params = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Legend_Odds(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_Legend_OddsArray{
|
|
Arr:make([]*server.DB_Legend_Odds, 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_Legend_Odds{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Rateodds3 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Rateodds4 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Rateodds5 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Legend_TurnRate(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_Legend_TurnRateArray{
|
|
Arr:make([]*server.DB_Legend_TurnRate, 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_Legend_TurnRate{}
|
|
|
|
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.ReturnRateMin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.ReturnRateMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.Chance = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Legend_Weight(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_Legend_WeightArray{
|
|
Arr:make([]*server.DB_Legend_Weight, 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_Legend_Weight{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[2].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[2].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.Weight = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Legend_WeightCondition(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_Legend_WeightConditionArray{
|
|
Arr:make([]*server.DB_Legend_WeightCondition, 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_Legend_WeightCondition{}
|
|
|
|
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.IsNew = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[2].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[2].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.BetScope = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.TrueCalcRate = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.WeightId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_MatchRank(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_MatchRankArray{
|
|
Arr:make([]*server.DB_MatchRank, 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_MatchRank{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[1].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[1].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.RankStar = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Name(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_NameArray{
|
|
Arr:make([]*server.DB_Name, 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_Name{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].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_NameBoy(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_NameBoyArray{
|
|
Arr:make([]*server.DB_NameBoy, 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_NameBoy{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].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_NameGirl(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_NameGirlArray{
|
|
Arr:make([]*server.DB_NameGirl, 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_NameGirl{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].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_NewPlayer(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_NewPlayerArray{
|
|
Arr:make([]*server.DB_NewPlayer, 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_NewPlayer{}
|
|
|
|
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)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Condition1 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 64)
|
|
data.ConditionValue1 = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Condition2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 64)
|
|
data.ConditionValue2 = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Bond = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.AddType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 64)
|
|
data.AddMax = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 64)
|
|
data.AddMin = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.TianHuRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_PhoneLottery(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_PhoneLotteryArray{
|
|
Arr:make([]*server.DB_PhoneLottery, 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_PhoneLottery{}
|
|
|
|
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.Type = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Name = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Item_Id = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Grade = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Odd = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Oddrate1 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.Odd2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.Oddrate2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.Odd3 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.Oddrate3 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.Oddrate4 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_PigBank_Diamond(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_PigBank_DiamondArray{
|
|
Arr:make([]*server.DB_PigBank_Diamond, 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_PigBank_Diamond{}
|
|
|
|
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.BuyCountMin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.BuyCountMax = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.CostDiamond = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Pigbank_Prop(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_Pigbank_PropArray{
|
|
Arr:make([]*server.DB_Pigbank_Prop, 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_Pigbank_Prop{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.PorpName = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.PropValue = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_PlayerExp(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_PlayerExpArray{
|
|
Arr:make([]*server.DB_PlayerExp, 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_PlayerExp{}
|
|
|
|
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.Exp = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_PlayerInfo(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_PlayerInfoArray{
|
|
Arr:make([]*server.DB_PlayerInfo, 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_PlayerInfo{}
|
|
|
|
for {
|
|
|
|
if len(row.Cells)<0+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.City = row.Cells[0].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<1+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[1].String(), 10, 32)
|
|
data.Head = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Sex = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Id = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_PlayerType(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_PlayerTypeArray{
|
|
Arr:make([]*server.DB_PlayerType, 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_PlayerType{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.GameFreeId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.PayLowerLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.PayUpperLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.GameTimeLowerLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.GameTimeUpperLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.TotalInLowerLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.TotalInUpperLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.OddsLowerLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.OddsUpperLimit = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[11].String(), 10, 32)
|
|
data.LuckyRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[12].String(), 10, 32)
|
|
data.ChangeCardRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[13].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[13].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.CardValueRange = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[14].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[14].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.MatchPriority = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[15].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[15].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.ExcludeMatch = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[16].String(), 10, 32)
|
|
data.CardLibRate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<17+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[17].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[17].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.CardLibArr = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_PotOdd(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_PotOddArray{
|
|
Arr:make([]*server.DB_PotOdd, 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_PotOdd{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Title = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.VipOdd = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_PropExchange(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_PropExchangeArray{
|
|
Arr:make([]*server.DB_PropExchange, 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_PropExchange{}
|
|
|
|
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.Group = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if row.Cells[2].String() != ""{
|
|
pairs := strings.Split(row.Cells[2].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.Cost = resultMap
|
|
}
|
|
|
|
|
|
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.Gain = resultMap
|
|
}
|
|
|
|
|
|
|
|
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_RankCycle(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_RankCycleArray{
|
|
Arr:make([]*server.DB_RankCycle, 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_RankCycle{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Start = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.End = row.Cells[2].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_RankLevel(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_RankLevelArray{
|
|
Arr:make([]*server.DB_RankLevel, 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_RankLevel{}
|
|
|
|
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.RankType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Level = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[3].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 64)
|
|
data.Score = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_RankReward(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_RankRewardArray{
|
|
Arr:make([]*server.DB_RankReward, 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_RankReward{}
|
|
|
|
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.RankType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Level = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Award1Id = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Award1Num = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.Award2Id = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.Award2Num = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 32)
|
|
data.Award3Id = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.Award3Num = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Sensitive_Words(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_Sensitive_WordsArray{
|
|
Arr:make([]*server.DB_Sensitive_Words, 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_Sensitive_Words{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Sensitive_Words = row.Cells[1].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_SlotRateWeight(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_SlotRateWeightArray{
|
|
Arr:make([]*server.DB_SlotRateWeight, 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_SlotRateWeight{}
|
|
|
|
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.GameFreeId = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Pos = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[3].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[3].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.NormCol1 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[4].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[4].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.NormCol2 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[5].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[5].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.NormCol3 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
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.NormCol4 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[7].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[7].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.NormCol5 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[8].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[8].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.FreeCol1 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[9].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[9].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.FreeCol2 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[10].String(), "|")
|
|
arrInt = nil
|
|
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)
|
|
arrInt[i] = int32(temp)
|
|
}
|
|
}
|
|
data.FreeCol3 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[11].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[11].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.FreeCol4 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[12].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[12].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.FreeCol5 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[13].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[13].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.MaryOut = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[14].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[14].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.MaryMid = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[15].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[15].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.JackPot = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_SystemChance(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_SystemChanceArray{
|
|
Arr:make([]*server.DB_SystemChance, 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_SystemChance{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Desc = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.ChanceType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.Coin = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.Rate = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Task(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_TaskArray{
|
|
Arr:make([]*server.DB_Task, 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_Task{}
|
|
|
|
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.Order = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[4].String(), 10, 32)
|
|
data.ActivityType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.TaskType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 64)
|
|
data.TargetTimes = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[7].String(), 10, 64)
|
|
data.FinishTimes = int64(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, ",")
|
|
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.Award = resultMap
|
|
}
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.GameType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[10].String(), "|")
|
|
arrInt = nil
|
|
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)
|
|
arrInt[i] = int32(temp)
|
|
}
|
|
}
|
|
data.Position = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_ThirdPlatformGameMapping(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_ThirdPlatformGameMappingArray{
|
|
Arr:make([]*server.DB_ThirdPlatformGameMapping, 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_ThirdPlatformGameMapping{}
|
|
|
|
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.SystemGameID = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.ThirdPlatformName = row.Cells[2].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.ThirdGameID = row.Cells[3].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Desc = row.Cells[4].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[5].String(), 10, 32)
|
|
data.ScreenOrientationType = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.ThirdID = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Tips(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_TipsArray{
|
|
Arr:make([]*server.DB_Tips, 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_Tips{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[1].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[1].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.GameId = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
data.Des = row.Cells[2].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_VIP(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_VIPArray{
|
|
Arr:make([]*server.DB_VIP, 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_VIP{}
|
|
|
|
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
|
|
}
|
|
|
|
|
|
|
|
data.Name = row.Cells[1].String()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<2+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[2].String(), 10, 32)
|
|
data.Count = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<3+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[3].String(), 10, 32)
|
|
data.VipExp = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<4+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[4].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[4].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.Privilege1 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<5+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[5].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[5].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.Privilege2 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<6+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[6].String(), 10, 32)
|
|
data.ShopId2 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<7+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[7].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[7].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.Privilege3 = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<8+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[8].String(), 10, 32)
|
|
data.Privilege4 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<9+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[9].String(), 10, 32)
|
|
data.Privilege5 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<10+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[10].String(), 10, 32)
|
|
data.Privilege6 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<11+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if row.Cells[11].String() != ""{
|
|
pairs := strings.Split(row.Cells[11].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.Privilege7 = resultMap
|
|
}
|
|
|
|
|
|
if len(row.Cells)<12+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[12].String(), 10, 32)
|
|
data.Privilege7Price = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<13+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[13].String(), 10, 32)
|
|
data.ShopId7 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<14+1{
|
|
break
|
|
}
|
|
|
|
temp, _ = strconv.ParseInt(row.Cells[14].String(), 10, 32)
|
|
data.Privilege8 = int32(temp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<15+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[15].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[15].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.Param = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<16+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
arrStr = strings.Split(row.Cells[16].String(), "|")
|
|
arrInt = nil
|
|
if len(arrStr) > 0 && row.Cells[16].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.RewardOutlineID = arrInt
|
|
|
|
|
|
|
|
|
|
|
|
if len(row.Cells)<17+1{
|
|
break
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if row.Cells[17].String() != ""{
|
|
pairs := strings.Split(row.Cells[17].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.Award = resultMap
|
|
}
|
|
|
|
|
|
|
|
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 main(){
|
|
|
|
AgcConvertDB_ActSign(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ActSign.xlsx`,`..\..\data\DB_ActSign.dat`)
|
|
|
|
AgcConvertDB_Activity1(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Activity1.xlsx`,`..\..\data\DB_Activity1.dat`)
|
|
|
|
AgcConvertDB_AnimalColor(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_AnimalColor.xlsx`,`..\..\data\DB_AnimalColor.dat`)
|
|
|
|
AgcConvertDB_ArtilleryRate(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ArtilleryRate.xlsx`,`..\..\data\DB_ArtilleryRate.dat`)
|
|
|
|
AgcConvertDB_ArtillerySkin(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ArtillerySkin.xlsx`,`..\..\data\DB_ArtillerySkin.dat`)
|
|
|
|
AgcConvertDB_BlackWhite(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_BlackWhite.xlsx`,`..\..\data\DB_BlackWhite.dat`)
|
|
|
|
AgcConvertDB_CardsJD(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_CardsJD.xlsx`,`..\..\data\DB_CardsJD.dat`)
|
|
|
|
AgcConvertDB_CardsYuLe(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_CardsYuLe.xlsx`,`..\..\data\DB_CardsYuLe.dat`)
|
|
|
|
AgcConvertDB_ChessBilledRules(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ChessBilledRules.xlsx`,`..\..\data\DB_ChessBilledRules.dat`)
|
|
|
|
AgcConvertDB_ChessMatchRules(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ChessMatchRules.xlsx`,`..\..\data\DB_ChessMatchRules.dat`)
|
|
|
|
AgcConvertDB_ChessRank(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ChessRank.xlsx`,`..\..\data\DB_ChessRank.dat`)
|
|
|
|
AgcConvertDB_ClientVer(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ClientVer.xlsx`,`..\..\data\DB_ClientVer.dat`)
|
|
|
|
AgcConvertDB_CollectBox(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_CollectBox.xlsx`,`..\..\data\DB_CollectBox.dat`)
|
|
|
|
AgcConvertDB_CollectBoxGain(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_CollectBoxGain.xlsx`,`..\..\data\DB_CollectBoxGain.dat`)
|
|
|
|
AgcConvertDB_CrashSearch(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_CrashSearch.xlsx`,`..\..\data\DB_CrashSearch.dat`)
|
|
|
|
AgcConvertDB_Createroom(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Createroom.xlsx`,`..\..\data\DB_Createroom.dat`)
|
|
|
|
AgcConvertDB_Fish(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Fish.xlsx`,`..\..\data\DB_Fish.dat`)
|
|
|
|
AgcConvertDB_FishOut(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FishOut.xlsx`,`..\..\data\DB_FishOut.dat`)
|
|
|
|
AgcConvertDB_FishPath(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FishPath.xlsx`,`..\..\data\DB_FishPath.dat`)
|
|
|
|
AgcConvertDB_FishRoom(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FishRoom.xlsx`,`..\..\data\DB_FishRoom.dat`)
|
|
|
|
AgcConvertDB_FishSkill(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FishSkill.xlsx`,`..\..\data\DB_FishSkill.dat`)
|
|
|
|
AgcConvertDB_FortuneGod_Odds(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FortuneGod_Odds.xlsx`,`..\..\data\DB_FortuneGod_Odds.dat`)
|
|
|
|
AgcConvertDB_FortuneGod_TurnRate(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FortuneGod_TurnRate.xlsx`,`..\..\data\DB_FortuneGod_TurnRate.dat`)
|
|
|
|
AgcConvertDB_FortuneGod_Weight(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FortuneGod_Weight.xlsx`,`..\..\data\DB_FortuneGod_Weight.dat`)
|
|
|
|
AgcConvertDB_FortuneGod_WeightCondition(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_FortuneGod_WeightCondition.xlsx`,`..\..\data\DB_FortuneGod_WeightCondition.dat`)
|
|
|
|
AgcConvertDB_GamMatchLV(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GamMatchLV.xlsx`,`..\..\data\DB_GamMatchLV.dat`)
|
|
|
|
AgcConvertDB_GameCoinPool(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GameCoinPool.xlsx`,`..\..\data\DB_GameCoinPool.dat`)
|
|
|
|
AgcConvertDB_GameFree(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GameFree.xlsx`,`..\..\data\DB_GameFree.dat`)
|
|
|
|
AgcConvertDB_GameItem(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GameItem.xlsx`,`..\..\data\DB_GameItem.dat`)
|
|
|
|
AgcConvertDB_GameMatchLevel(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GameMatchLevel.xlsx`,`..\..\data\DB_GameMatchLevel.dat`)
|
|
|
|
AgcConvertDB_GameRule(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GameRule.xlsx`,`..\..\data\DB_GameRule.dat`)
|
|
|
|
AgcConvertDB_GameSubsidy(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_GameSubsidy.xlsx`,`..\..\data\DB_GameSubsidy.dat`)
|
|
|
|
AgcConvertDB_Game_Drop(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Game_Drop.xlsx`,`..\..\data\DB_Game_Drop.dat`)
|
|
|
|
AgcConvertDB_Game_Introduction(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Game_Introduction.xlsx`,`..\..\data\DB_Game_Introduction.dat`)
|
|
|
|
AgcConvertDB_Game_Pet(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Game_Pet.xlsx`,`..\..\data\DB_Game_Pet.dat`)
|
|
|
|
AgcConvertDB_Game_Role(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Game_Role.xlsx`,`..\..\data\DB_Game_Role.dat`)
|
|
|
|
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`)
|
|
|
|
AgcConvertDB_Legend_TurnRate(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Legend_TurnRate.xlsx`,`..\..\data\DB_Legend_TurnRate.dat`)
|
|
|
|
AgcConvertDB_Legend_Weight(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Legend_Weight.xlsx`,`..\..\data\DB_Legend_Weight.dat`)
|
|
|
|
AgcConvertDB_Legend_WeightCondition(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Legend_WeightCondition.xlsx`,`..\..\data\DB_Legend_WeightCondition.dat`)
|
|
|
|
AgcConvertDB_MatchRank(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_MatchRank.xlsx`,`..\..\data\DB_MatchRank.dat`)
|
|
|
|
AgcConvertDB_Name(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Name.xlsx`,`..\..\data\DB_Name.dat`)
|
|
|
|
AgcConvertDB_NameBoy(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_NameBoy.xlsx`,`..\..\data\DB_NameBoy.dat`)
|
|
|
|
AgcConvertDB_NameGirl(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_NameGirl.xlsx`,`..\..\data\DB_NameGirl.dat`)
|
|
|
|
AgcConvertDB_NewPlayer(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_NewPlayer.xlsx`,`..\..\data\DB_NewPlayer.dat`)
|
|
|
|
AgcConvertDB_PhoneLottery(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_PhoneLottery.xlsx`,`..\..\data\DB_PhoneLottery.dat`)
|
|
|
|
AgcConvertDB_PigBank_Diamond(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_PigBank_Diamond.xlsx`,`..\..\data\DB_PigBank_Diamond.dat`)
|
|
|
|
AgcConvertDB_Pigbank_Prop(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Pigbank_Prop.xlsx`,`..\..\data\DB_Pigbank_Prop.dat`)
|
|
|
|
AgcConvertDB_PlayerExp(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_PlayerExp.xlsx`,`..\..\data\DB_PlayerExp.dat`)
|
|
|
|
AgcConvertDB_PlayerInfo(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_PlayerInfo.xlsx`,`..\..\data\DB_PlayerInfo.dat`)
|
|
|
|
AgcConvertDB_PlayerType(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_PlayerType.xlsx`,`..\..\data\DB_PlayerType.dat`)
|
|
|
|
AgcConvertDB_PotOdd(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_PotOdd.xlsx`,`..\..\data\DB_PotOdd.dat`)
|
|
|
|
AgcConvertDB_PropExchange(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_PropExchange.xlsx`,`..\..\data\DB_PropExchange.dat`)
|
|
|
|
AgcConvertDB_RankCycle(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_RankCycle.xlsx`,`..\..\data\DB_RankCycle.dat`)
|
|
|
|
AgcConvertDB_RankLevel(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_RankLevel.xlsx`,`..\..\data\DB_RankLevel.dat`)
|
|
|
|
AgcConvertDB_RankReward(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_RankReward.xlsx`,`..\..\data\DB_RankReward.dat`)
|
|
|
|
AgcConvertDB_Sensitive_Words(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Sensitive_Words.xlsx`,`..\..\data\DB_Sensitive_Words.dat`)
|
|
|
|
AgcConvertDB_SlotRateWeight(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_SlotRateWeight.xlsx`,`..\..\data\DB_SlotRateWeight.dat`)
|
|
|
|
AgcConvertDB_SystemChance(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_SystemChance.xlsx`,`..\..\data\DB_SystemChance.dat`)
|
|
|
|
AgcConvertDB_Task(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Task.xlsx`,`..\..\data\DB_Task.dat`)
|
|
|
|
AgcConvertDB_ThirdPlatformGameMapping(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_ThirdPlatformGameMapping.xlsx`,`..\..\data\DB_ThirdPlatformGameMapping.dat`)
|
|
|
|
AgcConvertDB_Tips(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_Tips.xlsx`,`..\..\data\DB_Tips.dat`)
|
|
|
|
AgcConvertDB_VIP(`G:\work\server\trunk\src\mongo.games.com\game\xlsx\DB_VIP.xlsx`,`..\..\data\DB_VIP.dat`)
|
|
|
|
}
|