版本同步

This commit is contained in:
hahwu 2024-11-21 19:40:02 +08:00
commit 676150abe0
38 changed files with 104380 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/tool/out
/config/~*
tool/tool.ipynb

15
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python 调试程序: 当前文件",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"workbench.colorTheme":"Atom One Dark",
}

BIN
config/Activity.xlsx Normal file

Binary file not shown.

BIN
config/Avatar.xlsx Normal file

Binary file not shown.

BIN
config/Base.xlsx Normal file

Binary file not shown.

BIN
config/Champship.xlsx Normal file

Binary file not shown.

BIN
config/Charge.xlsx Normal file

Binary file not shown.

BIN
config/DailyTask.xlsx Normal file

Binary file not shown.

BIN
config/DecorateCost.xlsx Normal file

Binary file not shown.

BIN
config/Endless.xlsx Normal file

Binary file not shown.

BIN
config/Face.xlsx Normal file

Binary file not shown.

BIN
config/IndoorProgress.xlsx Normal file

Binary file not shown.

BIN
config/Item.xlsx Normal file

Binary file not shown.

Binary file not shown.

BIN
config/MergeData.xlsx Normal file

Binary file not shown.

BIN
config/OrderData.xlsx Normal file

Binary file not shown.

BIN
config/SevenLoginCfg.xlsx Normal file

Binary file not shown.

BIN
config/StartMerge.xlsx Normal file

Binary file not shown.

BIN
config/StartOrder.xlsx Normal file

Binary file not shown.

BIN
config/UserData.xlsx Normal file

Binary file not shown.

BIN
config/card.xlsx Normal file

Binary file not shown.

BIN
config/guild.xlsx Normal file

Binary file not shown.

986
makedown/optimization.md Normal file
View File

@ -0,0 +1,986 @@
# 项目
## 玩家数据
```protobuf
// 玩家资产
message ResPlayerAsset{
int32 dwUin = 1;
int32 energy = 2;
int32 star = 3;
int32 recover_time = 4;
int32 diamond = 5;
int32 level = 6;
int32 exp = 7;
}
// 存储客户端信息
message ReqKv{
int32 key = 1;
string value = 2;
}
message ResKv{
map<int32, string> kv = 1;
}
```
## 棋盘交互
同步逻辑:
每次更新棋盘信息时将玩家操作也一起发送,校验棋子的数量和类型以及能量的消耗是否一致。操作逻辑使用消息队列,每隔一段时间进行同步,服务端根据操作操作队列更新棋子池,客户端同步数据时会校验地图上的棋子和池子中棋子的种类和个数一致,否则无法更新地图信息
### 需要同步的情况
- 登录时校验棋子种类和数量,以服务端数据为准
- 获得新棋子
- 能量消耗少于上限
- 出售棋子
- 购买棋子
- 订单完成时
- 获得新棋子
**不需要额外调用ADD的接口`ReqChessEx`,`ReqGetChessFromBuff`, `ReqTakeChessOutBag`**
**不需要额外调用REMOVE的接口`ReqPutChessInBag`**
```protobuf
enum HANDLE_TYPE {
ADD = 0; //增加棋子
COMPOSE = 1; //合成棋子
BUY = 2; //购买棋子
SELL = 3; //出售棋子
REMOVE = 4; //移除棋子
}
enum RES_CODE {
FAIL = 0;
SUCCESS = 1;
}
message ChessHandle{
HANDLE_TYPE type = 1; //操作类型
int32 Emit = 2; //发射器id
int32 ChessId = 3; //棋子id
int32 Id = 4; //排序id
}
message UpdatePlayerChessData{
int32 dwUin = 1;
map<string, int32> mChessData = 2;
repeated ChessHandle handleList = 3; //操作列表
}
message ResUpdatePlayerChessData{
RES_CODE code = 1;
string msg = 2;
}
///响应棋盘数据
message ResPlayerChessData{
int32 dwUin = 1;
map<string, int32> mChessData = 2;
repeated int32 ChessList = 3;
repeated int32 ChessBuff = 4;
map<string, int32> mChessData = 5;
}
message ResPlayerChessInfo{
repeated int32 ChessList = 1;
repeated int32 ChessBuff = 2;
ChessBag ChessBag = 3;
}
// 棋子转换 用于气泡和宝箱解锁
message ReqChessEx{
int32 OldChessId = 1;
int32 NewChessId = 2;
int32 CostDia = 3;
int32 Type = 4; //1 气泡 2 宝箱解锁 3 快捷购买
map<string, int32> mChessData = 5;
}
message ResChessEx{
RES_CODE code = 1;
string msg = 2;
}
// 从缓存中获取棋子
message ReqGetChessFromBuff{
int32 ChessId = 1;
map<string, int32> mChessData = 2;
}
message ResGetChessFromBuff{
RES_CODE code = 1;
string msg = 2;
}
// 棋盘背包
message ChessBag{
repeated ChessBagGrid ChessBagGrids = 1; //已解锁棋盘背包格子
int32 ChessBuyCnt = 2; //已购买棋盘格子数
int32 ChessFreeCnt = 3; //剩余免费解锁次数
}
message ChessBagGrid{
int32 Id = 1; //格子ID
int32 ChessId = 2; //棋子ID
int32 EmitId = 3; //发射器ID
}
// 放置棋子进背包
message ReqPutChessInBag{
int32 ChessId = 1;
int32 BagId = 2;
int32 EmitId = 3; //发射器ID
map<string, int32> mChessData = 4;
}
message ResPutChessInBag{
RES_CODE code = 1;
string msg = 2;
}
// 从背包取出棋子
message ReqTakeChessOutBag{
int32 BagId = 1;
map<string, int32> mChessData = 2;
}
message ResTakeChessOutBag{
RES_CODE code = 1;
string msg = 2;
}
// 购买棋盘格子
message ReqBuyChessBagGrid{
}
message ResBuyChessBagGrid{
RES_CODE code = 1;
string msg = 2;
}
```
## 设置能量发射倍数
```protobuf
// 设置
message ReqSetEnergyMul{
int32 EnergyMul = 1; //能量倍数123
}
// 返回
message ResSetEnergyMul{
RES_CODE ResultCode = 1;
string Msg = 2;
}
// 基础信息
message BaseInfo {
int32 EenegyMul = 1;
bool IsFirstBuy = 2; // 是否已第一次购买体力商店
int32 EnergyBuy = 3; // 今日体力商店购买次数
}
//体力商店购买体力
message ReqBuyEnergy{
int32 Energy = 1; // 购买体力
}
message ResBuyEnergy{
RES_CODE ResultCode = 1;
string Msg = 2;
}
```
## 图鉴
### 领取图鉴奖励
```protobuf
message ReqGetHandbookReward {
int32 ChessId = 1; //棋子id
}
message ResGetHandbookReward{
RES_CODE Code = 1;
string Msg = 2;
}
message HandbookInfo {
int32 ChessId = 1;
int32 Status = 2; //图鉴领取状态 0 未领取 1已领取
}
message Handbook {
repeated HandbookInfo Handbooks = 1; //图鉴列表 不在列表中未解锁
}
```
## 装饰
```protobuf
message ReqDecorate{
int32 AreaId = 1; // 区域id
int32 DecorateId = 2; //装饰唯一id
}
message ResDecorate{
RES_CODE Code = 1;
string Msg = 2;
}
message ResDecorateInfo {
int32 AreaId = 1; // 区域id
repeated int32 mFinishList = 2; //当前区域已完成装饰id
}
```
## 订单
```protobuf
message ReqRewardOrder{
int32 OrderId = 1;
}
message ResRewardOrder{
RES_CODE Code = 1;
string Msg = 2;
}
message Order{
int32 Id = 1; // 订单id 自增唯一
repeated int32 ChessId = 2; //订单所需棋子
int32 type = 3; // 订单类型 1普通2额外 3超级 4预热
}
message ResOrderList{
repeated Order OrderList = 1;
}
```
## gm命令
```protobuf
message ReqGmCommand{
string Command = 1; //gm指令
string args = 2;
}
// GM Command
// additem 2 1000 : additem 道具id 道具数量
// zeroUpdate 0点更新
// pay 1 : pay ChargeId 充值
// subitem 2 1000 : 扣除道具
// reset_order : 重置订单
// add_card_star 1 : 增加卡牌兑换星星
// addexp 1 : 增加玩家经验
// setlv 1 : 设置玩家等级
// setSevenLoginActive 1 设置七天登录进度
// resetCardReq 重置卡牌请求
```
## 卡牌收集类
### 卡牌交换
卡牌交换一天可以请求交换五次请求24小时到期
- A向B发送交换卡牌请求扣除A的卡牌,扣除发送次数
- B 拒绝A重新加上自己卡牌增加A的发送次数
- B 接收可以选择需要带的卡牌扣除B的卡牌
- A 拒绝A和B都加上自己的卡牌
- A 接受A和B都加上对方的卡牌
```protobuf
message Card {
int32 Id = 1;
int32 Count = 2;
}
message ResCardInfo{
repeated Card CardList = 1; // 卡牌列表
int32 ExStar = 2; // 额外星级
int32 Status = 3; // 全收集奖励0:未领取 1:已领取
repeated int32 CollectId = 4; // 已领取的收集奖励
int32 ExTimes = 5; //剩余兑换次数
int32 ReqTimes = 6; //剩余请求次数
map<int32, int32> AllCard = 7; // 万能卡牌
int32 EndTime = 8; //周期结束时间
repeated int32 ReqUid = 9; // 今日已请求的Uid
repeated int32 ExUid = 10; // 今日已置换的Uid
}
// 领取卡牌系列收集奖励
message ReqCardCollectReward{
int32 Color = 1;
}
message ResCardCollectReward{
RES_CODE Code = 1;
string Msg = 2;
}
// 兑换收集星星奖励
message ReqExStarReward{
int32 Id = 1;
}
message ResExStarReward{
RES_CODE Code = 1;
string Msg = 2;
}
// 领取全收集奖励
message ReqAllCollectReward{
}
message ResAllCollectReward{
RES_CODE Code = 1;
string Msg = 2;
}
// 请求赠送卡片
message ReqCardGive{
int32 Uid = 1;
int32 CardId = 2;
}
message ResCardGive{
RES_CODE Code = 1;
string Msg = 2;
}
// 同意请求卡牌
message ReqAgreeCardGive{
int32 Uid = 1;
}
message ResAgreeCardGive{
RES_CODE Code = 1;
string Msg = 2;
}
// 拒绝请求卡牌
message ReqRefuseCardGive{
int32 Uid = 1;
}
message ResRefuseCardGive{
RES_CODE Code = 1;
string Msg = 2;
}
message ReqCardExchange{
int32 Uid = 1;
int32 CardId = 2;
int32 Type = 3; // 0 白送 1 交换
}
message ResCardExchange{
RES_CODE Code = 1;
string Msg = 2;
}
// 选择交换的卡牌
message ReqSelectCardExchange{
int32 Uid = 1;
int32 CardId = 2;
}
message ResSelectCardExchange{
RES_CODE Code = 1;
string Msg = 2;
}
// 同意卡牌交换
message ReqAgreeCardExchange{
int32 Uid = 1;
}
message ResAgreeCardExchange{
RES_CODE Code = 1;
string Msg = 2;
}
// 拒绝卡牌交换
message ReqRefuseCardExchange{
int32 Uid = 1;
}
message ResRefuseCardExchange{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 引导
```protobuf
// 领取引导奖励
message ReqGuideReward{
int32 Id = 1; //奖励id
}
message ResGuideReward{
RES_CODE Code = 1;
string Msg = 2;
}
message ResGuildInfo{
map<int32, int32> Reward = 1;
}
// 弹窗
message ResItemPop{
int32 Id = 1;
repeated ItemInfo Items = 2; // 道具
repeated CardPack CardPacks = 3; // 卡包
string Lable = 4; // 标签
}
message ItemInfo{
int32 Id = 1;
int32 Num = 2;
}
message CardPack{
int32 Id = 1; //卡包id
repeated int32 Card = 2;
}
```
## 日常任务
```protobuf
message ResDailyTask{
map<int32, DailyWeek> WeekReward = 1; //周奖励
map<int32, DailyTask> DailyTask = 2; //任务进度
int32 Active = 3; //活跃度
int32 DayEnd = 4; // 日结束时间戳
int32 WeekEnd = 5; //周结束时间戳
}
message DailyWeek{
repeated ItemInfo Items = 1; //奖励
bool Status = 2; //状态 0:未领取 1:已领取
int32 NeedActive = 3; //需要的活跃度
}
message DailyTask{
int32 Status = 1; //状态 0:未完成, 1已完成 2已领取
bool UnLock = 2; //是否解锁 0:未解锁 1:已解锁
QuestProgress Progress = 3; //任务进度
repeated ItemInfo Items = 4; //奖励
}
message QuestProgress{
string Label = 1; //任务标签
int32 Num = 2; //当前进度
int32 Target = 3; //目标
bool Status = 4; //状态 0:未完成, 1已完成
int32 Param = 5; //参数
}
// 领取日常任务奖励
message ReqGetDailyTaskReward{
int32 Id = 1;
}
message ResGetDailyTaskReward{
RES_CODE Code = 1;
string Msg = 2;
}
// 领取日常周奖励
message ReqGetDailyWeekReward{
int32 Id = 1;
}
message ResGetDailyWeekReward{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 头像
```protobuf
message ResFaceInfo{
repeated int32 FaceList = 1; // 头像列表
int32 CurFace = 2; // 设置的头像
}
// 设置头像
message ReqSetFace{
int32 Face = 1;
}
message ResSetFace{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 头像框
```protobuf
message ResAvatarInfo{
repeated AvatarInfo AvatarList = 1; // 头像框列表
int32 CurAvatar = 2; // 设置的头像
}
message AvatarInfo{
int32 Id = 1;
int64 EndTime = 2;
}
// 设置头像框
message ReqSetAvatar{
int32 Avatar = 1;
}
message ResSetAvatar{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 七日签到
```protobuf
// 七日签到
message ResSevenLogin{
repeated SevenLoginReward WeekReward = 1; //周奖励
repeated SevenLoginReward MonthReward = 2; //月奖励
int32 Active = 3; //活跃度
bool IsBack = 4; //是否召回
}
message SevenLoginReward{
repeated ItemInfo Item1 = 1; //奖励1
repeated ItemInfo Item2 = 2; //奖励2
repeated ItemInfo Item3 = 3; //奖励3
int32 Status = 4; //状态 0:未领取 1:可领取 2已领取
int32 Id = 5; //id
}
// 领取周奖励
message ReqGetSevenLoginReward{
int32 Id = 1;
}
message ResGetSevenLoginReward{
RES_CODE Code = 1;
string Msg = 2;
}
// 领取月奖励
message ReqGetMonthLoginReward{
int32 Id = 1;
}
message ResGetMonthLoginReward{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 限时事件
```protobuf
// 限时事件
message ReqLimitEvent{}
message ResLimitEvent{
map<int32, LimitEvent> LimitEventList = 1;
}
message ResLimitEventProgress{
int32 Progress = 2; //进度
map<int32, int32> ProgressReward = 3; //奖励 可以选择的奖励 Id =》 RewardId
}
message LimitEvent {
int32 EndTime = 1; //结束时间
int32 Cd = 2; //cd
}
message LimitEventNotify {
int32 Id = 1; // 限时事件类型
int32 Type = 2; // 0 开始 1 结束
int32 EndTime = 3; //结束时间
int32 Cd = 4; //cd
}
message ReqLimitSenceReward{}
message ResLimitSenceReward{
RES_CODE Code = 1;
string Msg = 2;
}
message ResChessRainReward{
int32 Chest = 1; // 宝箱id
}
message ReqLimitEventReward{ // 领取限时事件奖励
int32 Id = 1;
}
message ResLimitEventReward{
RES_CODE Code = 1;
string Msg = 2;
}
// 连技快手奖励
message ReqFastProduceReward{
int32 Energy = 1;
}
message ResFastProduceReward{
RES_CODE Code = 1;
string Msg = 2;
}
```
### 事件类型
```golang
const (
EVENT_TYPE_HIGH_ROLLER = 1 // high roller
EVENT_TYPE_SUPER_EMIT = 2 // 超级发射器
EVENT_TYPE_METEOR_SHOW = 3 // 流星雨
EVENT_TYPE_CHEST_RAIN = 4 // 宝箱雨
EVENT_TYPE_SUPER_ORDER = 5 // 超级订单
EVENT_TYPE_SENCE_DASH = 6 // 场景冲刺
EVENT_TYPE_CARD_FESTIVAL = 7 // 卡牌节
EVENT_TYPE_GOLDCARD_EX = 8 // 金卡交换
EVENT_TYPE_PET_THIEF = 9 // 宠物小偷
EVENT_TYPE_FAST_PRODUCE = 10 // 连击快手
)
```
## 好友
```protobuf
// 好友
// 搜索好友
message ReqSearchPlayer{
int32 Uid = 1;
}
message ResSearchPlayer{
RES_CODE Code = 1;
string Msg = 2;
}
// 好友推荐
message ReqFriendRecommend{}
// 好友推荐
message ResFriendRecommend{
repeated ResPlayerSimple List = 1;
}
// 隐藏
message ReqFriendIgnore{
int32 Uid = 1;
}
message ResFriendIgnore{
RES_CODE Code = 1;
string Msg = 2;
}
// 好友基础信息
message ResPlayerSimple{
int32 Uid = 1;
string Name = 2;
int32 Face = 3;
int32 Avatar = 4;
int32 Level = 5;
}
// 好友日志
message ResFriendLog{
int32 Uid = 1;
string Name = 2;
int32 Face = 3;
int32 Avatar = 4;
int32 Level = 5;
int32 Type =6;
int32 Time = 7;
}
// 好友卡牌申请
message ResFriendCard{
int32 Uid = 1;
string Name = 2;
int32 Face = 3;
int32 Avatar = 4;
int32 Level = 5;
int32 Type =6;
int32 Time = 7;
int32 CardId = 8;
}
// 好友基础信息
message ResFriendList{
repeated ResPlayerSimple FriendList = 1;
repeated ResPlayerSimple ApplyList = 2;
repeated ResFriendCard MsgList = 3;
}
message ResFriendLogList{
repeated ResFriendLog Log = 1;
}
// 申请好友
message ReqApplyFriend{
int32 Uid = 1;
}
message ResApplyFriend{
RES_CODE Code = 1;
string Msg = 2;
}
// 同意申请
message ReqAgreeFriend{
int32 Uid = 1;
}
message ResAgreeFriend{
RES_CODE Code = 1;
string Msg = 2;
}
// 拒绝申请
message ReqRefuseFriend{
int32 Uid = 1;
}
message ResRefuseFriend{
RES_CODE Code = 1;
string Msg = 2;
}
// 删除好友
message ReqDeleteFriend{
int32 Uid = 1;
}
message ResDeleteFriend{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 邮件
```protobuf
// 邮件列表
message ReqMailList{}
message ResMailList{
map<int32, MailInfo> MailList = 1;
}
message MailInfo{
string Title = 2; // 标题
string Content = 3; // 内容
int32 Time = 4; // 时间
int32 Status = 5; // 0 未读 1 已读 2 已领取 3 已删除
repeated ItemInfo Items = 6; // 奖励
}
// 读邮件
message ReqReadMail{
int32 Id = 1;
}
message ResReadMail{
RES_CODE Code = 1;
string Msg = 2;
}
// 领取邮件
message ReqGetMailReward{
int32 Id = 1;
}
message ResGetMailReward{
RES_CODE Code = 1;
string Msg = 2;
}
// 删除邮件
message ReqDeleteMail{
int32 Id = 1;
}
message ResDeleteMail{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 充值礼包
```protobuf
// 充值
测试充值
GM "pay 1" // pay ChargeId
message ResCharge{
float Charge = 1; // 总充值金额
int32 Total = 2; // 总充值次数
repeated int32 First = 3; //已首充档次
map<int32, ResSpecialShop> SpecialShop = 4; // 特惠礼包
int32 FreeShop = 5; // 已领取免费礼包档次
map<int32, ResChessShop> ChessShop = 6; // 棋子商店
map<int32, int32> Gift = 7; // 礼包 礼包id =》 礼包数量
bool Ad = 8; // 是否有广告礼包
}
message ResSpecialShop {
int32 Grade = 1; //挡位
int32 Count = 2; //剩余购买次数
}
message ResChessShop {
int32 Diamond = 1; // 需要花费钻石
int32 Count = 2; // 剩余购买数量
}
message ReqFreeShop{} // 领取免费奖励
message ResFreeShop{
RES_CODE Code = 1;
string Msg = 2;
}
// 商店购买棋子
message ReqBuyChessShop{
int32 Id = 1;
}
message ResBuyChessShop{
RES_CODE Code = 1;
string Msg = 2;
}
// 刷新棋子商店
message ReqRefreshChessShop{}
message ResRefreshChessShop{
RES_CODE Code = 1;
string Msg = 2;
}
// 请求无尽礼包数据
message ReqEndless{}
message ResEndless{
int32 Id = 1; // 当前解锁的id
map<int32, ResEndlessInfo> EndlessList = 2; // 礼包列表 id自增
}
message ResEndlessInfo{
int32 ChargeId = 1; // 充值id
int32 Type = 2; // 礼包类型 1 AD礼包 2 充值礼包 3 免费礼包
repeated ItemInfo Items = 3; // 礼包道具
}
// 领取免费和AD礼包
message ReqEndlessReward{}
message ResEndlessReward{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 小猪存钱罐
```protobuf
message ResPiggyBank{
int32 Type = 1; // 存钱罐类型 1充值 2广告
int32 Diamond = 2; // 存钱罐中的钻石
int32 Count = 3; // 剩余可以触发的次数
int32 EndTime = 4; // 结束时间 当前存钱罐结束时间
}
message ReqPiggyBankReward{} // 领取猪猪银行奖励
message ResPiggyBankReward{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 锦标赛
```protobuf
message ReqChampship{}
message ResChampship{
int32 Score = 1; // 获得的总积分
int32 Reward = 2; // 当前已领取的档次
int32 EndTime = 3; // 结束时间
}
message ReqChampshipReward{}
message ResChampshipReward{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 活动类
## 玩家日志
## 支付订单处理
```protobuf
message ReqCreateOrderSn{
int32 ChargeId = 1;
string PlatForm = 2; // 平台标识 测试用test
string channel = 3; // 支付渠道标识 测试用test
}
message ResCreateOrderSn{
string OrderSn = 1; // 订单号
}
message ReqShippingOrder{
string OrderSn = 1; // 订单号
string PayOrderSn = 2; // 支付订单号
int32 Status = 3; // 1 成功 2 失败
}
message ResShippingOrder{
RES_CODE Code = 1;
string Msg = 2;
}
```
## 后台
## SDK

13
makedown/生成C#proto.md Normal file
View File

@ -0,0 +1,13 @@
# 生成c#proto文件
## 安装choco
- 使用管理员方式打开 PowerShell
- 输入 Set-ExecutionPolicy RemoteSigned输入 Y
- 输入 iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
- 查看是否安装完成 choco -v
## 安装protobuf
- choco install protobuf
## 生成.cs文件
- protoc --csharp_out=../msg Gameapi.proto

99543
msg/Gameapi.cs Normal file

File diff suppressed because it is too large Load Diff

3021
proto/Gameapi.proto Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
proto/lib/protobuf-net.dll Normal file

Binary file not shown.

4
proto/protoToCS.bat Normal file
View File

@ -0,0 +1,4 @@
@echo off
REM 设置cs文件的输出目录
set outDir=F:\Github\aplus-b_-pet_-c_nation\Assets\GameMain\Scripts\Hotfix\CS\Proto
protoc.exe --csharp_out=%outDir% *.proto

BIN
proto/protoc.exe Normal file

Binary file not shown.

1
proto/readme.md Normal file
View File

@ -0,0 +1 @@
protoc version 28.2

286
sql/Merge_Pet.sql Normal file
View File

@ -0,0 +1,286 @@
/*==============================================================*/
/* Database name: sg_gamedb */
/* DBMS name: MySQL 5.5.17 */
/* Created on: 2014-10-16 10:00:00 */
/*==============================================================*/
create database if not exists Merge_Pet CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
use Merge_Pet;
-- ----------------------------
-- Table structure for db_version 版本号,每次更新数据库要改这个地方
-- ----------------------------
CREATE TABLE IF NOT EXISTS `db_version` (
`version_2018_02_06_13` int unsigned NOT NULL COMMENT 'version'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据库版本号';
/*==============================================================*/
/* Table: t_account 账号表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_account
(
`user_name` varchar(50) NOT NULL,
`user_password` varchar(128) NOT NULL,
`login_time` int unsigned DEFAULT '0' COMMENT '上次登录时间',
`logout_time` int unsigned DEFAULT '0' COMMENT '上次下线时间',
`ip_address` char(24) DEFAULT '' COMMENT '上次登录的ip地址',
`gm_level` int DEFAULT '0' COMMENT 'gm等级',
`platform` varchar(50) DEFAULT '' COMMENT '平台',
`is_online` int unsigned DEFAULT '0' COMMENT '角色是否在线',
`channel` varchar(50) DEFAULT '' COMMENT '渠道号',
`device_id` varchar(256) DEFAULT '' COMMENT '是否为刷榜账号',
`auto_id` bigint NOT NULL auto_increment COMMENT '自增id',
PRIMARY KEY (`auto_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='账号密码对照表';
/*==============================================================*/
/* Table: t_gameserver GameServer表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_gameserver
(
`id` int unsigned COMMENT '服务器id',
`start_time` int unsigned COMMENT '开服时间',
`close_time` int unsigned COMMENT '关服时间',
`is_close` int unsigned COMMENT '是否关服',
primary key(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='服务器设置';
/*==============================================================*/
/* Table: t_gameserver_info GameServer信息表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_gameserver_info
(
`id` int unsigned COMMENT '服务器id',
`growthfund_buynum` int unsigned NOT NULL DEFAULT '0' COMMENT '全服购买成长基金数量',
`open_servertime` int unsigned NOT NULL DEFAULT '0' COMMENT '开服时间',
`open_activeflag` int unsigned NOT NULL DEFAULT '0' COMMENT '开服活动完成发放奖励标示',
`DailyRenewTime` int unsigned NOT NULL DEFAULT '0' COMMENT '日常刷新时间',
primary key(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='全服全局数据';
/*==============================================================*/
/* Table: t_player_emit_unlock 发射器信息表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_player_emit_unlock
(
`dwUin` int unsigned COMMENT '玩家uid',
`EmitUnlockDat` varchar(1024) DEFAULT NULL COMMENT '发射器数据',
`RenewTime` int unsigned NOT NULL DEFAULT '0' COMMENT '每日刷新时间',
primary key(`dwUin`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='发射器信息';
-- ----------------------------
-- Table structure for t_player_baseinfo
-- ----------------------------
CREATE TABLE IF NOT EXISTS `t_player_baseinfo` (
`dwUin` int unsigned NOT NULL COMMENT '对应玩家account表中的dwUin',
`energy` int unsigned NOT NULL DEFAULT '0' COMMENT '能量',
`star` int unsigned NOT NULL DEFAULT '0' COMMENT '星星',
`recover_time` int unsigned NOT NULL DEFAULT '0' COMMENT '能量开始恢复时间',
`diamond` int unsigned NOT NULL DEFAULT '1' COMMENT '钻石',
`level` int unsigned NOT NULL DEFAULT '0' COMMENT '玩家等级',
`exp` int unsigned zerofill NOT NULL DEFAULT '0' COMMENT '玩家经验',
`start_order_id` varchar(50) DEFAULT NULL COMMENT '配置订单进度',
`music_code` int unsigned NOT NULL DEFAULT '0' COMMENT '音效状态码改为GUID免费改名状态',
`guild` int unsigned NOT NULL DEFAULT '0' COMMENT '引导进度 ',
`pack_unlock_count` int unsigned NOT NULL DEFAULT '0' COMMENT '背包解锁数量',
`last_play_time` int NOT NULL DEFAULT '0' COMMENT '广告能量购买时间',
`EnergyBuyCount` int NOT NULL DEFAULT '0' COMMENT '能量购买次数',
`user_name` varchar(50) NOT NULL COMMENT '玩家账号',
`login_time` int unsigned NOT NULL DEFAULT '0' COMMENT '上次登录时间',
`logout_time` int unsigned NOT NULL DEFAULT '0' COMMENT '上次下线时间',
`todayolinetime` int unsigned NOT NULL DEFAULT '0' COMMENT '当天的累计在线时间',
`rolecreatetime` int unsigned NOT NULL DEFAULT '0' COMMENT '注册帐号时间',
`EmitOrderCnt` int unsigned NOT NULL DEFAULT '0' COMMENT '注册帐号时间',
`DailyRenewTime` int unsigned NOT NULL DEFAULT '0' COMMENT '注册帐号时间',
`NoAd` int unsigned NOT NULL DEFAULT '0' COMMENT '注册帐号时间',
`ChampshipsGroupID` int unsigned NOT NULL DEFAULT '0' COMMENT '注册帐号时间',
`LastChampGroupID` int unsigned NOT NULL DEFAULT '0' COMMENT '注册帐号时间',
`FaceBookId` varchar(128) DEFAULT '' COMMENT '玩家账号',
PRIMARY KEY (`dwUin`),
KEY `user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='存储玩家基本信息';
-- ----------------------------
-- Table: t_player_auto_pup 客户端数据持久化表
-- ----------------------------
CREATE TABLE IF NOT EXISTS `t_player_auto_pup` (
`dwUin` int unsigned NOT NULL COMMENT 'uid',
`ReqKeys` varchar(2048) DEFAULT '' COMMENT 'key',
`ReqVals` varchar(2048) DEFAULT '' COMMENT 'value',
PRIMARY KEY (`dwUin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='存储玩家基本信息';
/*==============================================================*/
/* Table: t_player_data 玩家模块表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_player_mod
(
`dwUin` int unsigned COMMENT '玩家uid',
`mData` blob DEFAULT NULL COMMENT '数据',
`updateTime` int unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
primary key(`dwUin`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='玩家模块表';
/*==============================================================*/
/* Table: t_player_data 玩家模块表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_player_client_data
(
`dwUin` int unsigned COMMENT '玩家uid',
`mData` blob DEFAULT NULL COMMENT '数据',
`updateTime` int unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
primary key(`dwUin`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='玩家客户端数据表';
/*==============================================================*/
/* Table: t_player_data 玩家订单表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_player_charge
(
`id`int unsigned AUTO_INCREMENT COMMENT '订单id',
`Uid` int unsigned NOT NULL COMMENT '玩家id',
`OrderId` varchar(128) DEFAULT '' COMMENT '订单号',
`ProductId` int unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
`ProductName` varchar(128) DEFAULT '' COMMENT '商品名称',
`ProductDesc` varchar(128) DEFAULT '' COMMENT '商品描述',
`Price` float NOT NULL DEFAULT '0' COMMENT '价格',
`Currency` varchar(128) DEFAULT '' COMMENT '货币',
`CreateTime` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`PayTime` int unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',
`PayStatus` int unsigned NOT NULL DEFAULT '0' COMMENT '支付状态 0 未支付 1 已支付 2 支付失败 3 已发货',
`PayType` int unsigned NOT NULL DEFAULT '0' COMMENT '支付类型',
`PayPlatform` varchar(128) DEFAULT '' COMMENT '支付平台',
`PayChannel` varchar(128) DEFAULT '' COMMENT '支付渠道',
`PayChannelOrderId` varchar(128) DEFAULT '' COMMENT '支付渠道订单号',
`PayChannelUserId` varchar(128) DEFAULT '' COMMENT '支付渠道用户id',
`PayChannelExtra` varchar(128) DEFAULT '' COMMENT '支付渠道额外信息',
primary key(`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='玩家订单表';
/*==============================================================*/
/* Table: t_gameserver_info GameServer信息表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_player_chest_data
(
`dwUin` int unsigned COMMENT '玩家uid',
`ChestID` int unsigned COMMENT '玩家uid',
`UnlockStartTime` int unsigned COMMENT '玩家uid',
primary key(`dwUin`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='发射器信息';
/*==============================================================*/
/* Table: t_gameserver_info GameServer信息表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_player_chess_data
(
`dwUin` int unsigned COMMENT '玩家uid',
`mChessData` varchar(4096) DEFAULT NULL COMMENT '发射器数据',
`mChessColorData` varchar(2048) DEFAULT NULL COMMENT '发射器数据',
primary key(`dwUin`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='发射器信息';
/*==============================================================*/
/* Table: t_gameserver_info GameServer信息表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_Emit_detail_data
(
`dwUin` int unsigned COMMENT '玩家uid',
`mEmitMergeData` varchar(1024) DEFAULT NULL COMMENT '发射器数据',
`mEmitCountData` varchar(1024) DEFAULT NULL COMMENT '发射器数据',
`mEmitTimeData` varchar(1024) DEFAULT NULL COMMENT '发射器数据',
primary key(`dwUin`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='发射器信息';
-- ----------------------------
-- Table structure for system_mail_info
-- ----------------------------
CREATE TABLE IF NOT EXISTS `system_mail_info` (
`mail_id` bigint NOT NULL AUTO_INCREMENT COMMENT '邮件ID',
`title` varchar(128) DEFAULT "" COMMENT '邮件标题',
`content` varchar(2048) DEFAULT "" COMMENT '邮件内容',
`items` varchar(2048) DEFAULT "{}" COMMENT '邮件附件',
`start_time` int unsigned NOT NULL DEFAULT '0' COMMENT '开始时间',
`register_time` int unsigned NOT NULL DEFAULT '0' COMMENT '注册时间',
`end_time` int unsigned NOT NULL DEFAULT '0' COMMENT '结束时间',
`mail_type` int unsigned NOT NULL DEFAULT '0' COMMENT '邮件类型',
`to_uids` varchar(2048) DEFAULT "" COMMENT '发送者ID',
PRIMARY KEY (`mail_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='系统邮件';
-- ----------------------------
-- Table structure for t_player_daily_task_data
-- ----------------------------
CREATE TABLE IF NOT EXISTS `t_server_global_data` (
`Id` int unsigned NOT NULL COMMENT '对应玩家account表中的dwUin',
`StartMileStoneSvrTime` int unsigned NOT NULL DEFAULT '0' COMMENT '里程碑时间',
`StartChampshipsSvrTime` int unsigned NOT NULL DEFAULT '0' COMMENT '锦标赛时间',
`InsertChampshipsSvrTime` int unsigned NOT NULL DEFAULT '0' COMMENT '每半小时插入玩家排行锦标赛时间',
`WaitToRank` text COMMENT '排名数据',
`Limit4CardExclude` text COMMENT '排名数据',
`Limit5CardExclude` text COMMENT '排名数据',
`CurChampshipsId` int unsigned NOT NULL DEFAULT '0' COMMENT '锦标赛全局Id',
`LastChampshipsId` int unsigned NOT NULL DEFAULT '0' COMMENT '锦标赛全局Id',
`Limit4Card` int unsigned NOT NULL DEFAULT '0' COMMENT '限时4星金卡ID',
`Limit5Card` int unsigned NOT NULL DEFAULT '0' COMMENT '限时5星金卡ID',
`LimitCardSwapTime` int unsigned NOT NULL DEFAULT '0' COMMENT '限时5星金卡ID',
`OpenSvrTime` int unsigned NOT NULL DEFAULT '0' COMMENT '锦标赛全局Id',
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='存储玩家基本信息';
/*==============================================================*/
/* Table: t_player_data 系统模块表 */
/*==============================================================*/
CREATE TABLE IF NOT EXISTS t_server_mod
(
`id` int NOT NULL AUTO_INCREMENT primary key,
`key` varchar(128) DEFAULT '' COMMENT '模块key',
`mData` blob DEFAULT NULL COMMENT '数据',
`updateTime` int unsigned NOT NULL DEFAULT '0' COMMENT '更新时间'
) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='系统模块表';
CREATE TABLE IF NOT EXISTS `t_log_login` (
`id` int NOT NULL AUTO_INCREMENT primary key,
`dwUin` int unsigned NOT NULL COMMENT '对应玩家account表中的dwUin',
`type` int unsigned NOT NULL DEFAULT '0' COMMENT '日志类型',
`event` varchar(512) DEFAULT '' COMMENT '事件名',
`timestamp` int DEFAULT 0 COMMENT '时间错',
KEY (`dwUin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家日志';
CREATE TABLE IF NOT EXISTS `t_log_evnet` (
`id` int NOT NULL AUTO_INCREMENT primary key,
`dwUin` int unsigned NOT NULL COMMENT '对应玩家account表中的dwUin',
`type` int unsigned NOT NULL DEFAULT '0' COMMENT '日志类型',
`event` varchar(512) DEFAULT '' COMMENT '事件名',
`param` varchar(512) DEFAULT '' COMMENT '参数',
`timestamp` int DEFAULT 0 COMMENT '时间错',
KEY (`dwUin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家日志';
CREATE TABLE IF NOT EXISTS `t_log_item` (
`dwUin` int unsigned NOT NULL COMMENT '对应玩家account表中的dwUin',
`type` int unsigned NOT NULL DEFAULT '0' COMMENT '日志类型',
`event` varchar(512) DEFAULT '' COMMENT '事件名',
`timestamp` int DEFAULT 0 COMMENT '时间错',
KEY (`dwUin`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='玩家日志';

30
tool/cfg/cfg.json Normal file
View File

@ -0,0 +1,30 @@
{
"target_dir": "src/server/gamedata/config",
"source_dir": "csv_output",
"file_list": [
{
"in_file": "Item.csv",
"out_file": "Item.json",
"key": "Id",
"fields" :["Id", "Name", "IType", "I"]
},
{
"in_file": "StartMerge.csv",
"out_file": "StartMerge.json",
"key": "Id",
"fields" :["Id", "MergeId"]
},
{
"in_file": "MergeData.csv",
"out_file": "MergeData.json",
"key": "Id",
"fields" :["Id", "Lv", "MaxLv", "MergeId", "SellType", "SellNum", "SellDiamond", "CoolTime"]
},
{
"in_file": "StartOrder.csv",
"out_file": "StartOrder.json",
"key": "Id",
"fields" :["Id", "merge_id_list"]
}
]
}

336
tool/cfg/cfg_xlsx.json Normal file
View File

@ -0,0 +1,336 @@
{
"target_dir": "tool/out",
"source_dir": "config",
"file_list": [
{
"in_file": "MergeData.xlsx",
"out_file": "MergeData.json",
"key": "Id",
"sheet_name" :"MergeData",
"fields" :["Id", "Lv", "MaxLv", "MergeId", "SellType", "SellNum", "SellDiamond", "CoolTime", "Star", "Type", "Emit_Product", "Color", "Emit_ID", "PType"]
},
{
"in_file": "MergeData.xlsx",
"out_file": "MergeDataConst.json",
"key": "Id",
"sheet_name" :"Const",
"fields" :["Key", "Value"]
},
{
"in_file": "StartMerge.xlsx",
"out_file": "StartMerge.json",
"key": "Id",
"sheet_name" :"StartMerge",
"fields" :["MergeId", "Lock"]
},
{
"in_file": "OrderData.xlsx",
"out_file": "OrderData.json",
"key": "Id",
"sheet_name" :"Order",
"fields" :["EnergyMul", "LvMin"]
},
{
"in_file": "OrderData.xlsx",
"out_file": "OrderChessData.json",
"key": "Id",
"sheet_name" :"OrderChess",
"fields" :["EnergyMul", "MinN" , "MaxN", "MaxLv"]
},
{
"in_file": "UserData.xlsx",
"out_file": "UserData.json",
"key": "Id",
"sheet_name" :"UserData",
"fields" :["Lv", "Item", "Emit", "EnergyMul", "MaxEnergy", "Exp", "UnlockPack", "SevenLogin", "Recover"]
},
{
"in_file": "IndoorProgress.xlsx",
"out_file": "IndoorProgress.json",
"key": "Id",
"sheet_name" :"IndoorProgress",
"fields" :["Id", "Scene", "Lv", "Item", "Emit"]
},
{
"in_file": "DecorateCost.xlsx",
"out_file": "DecorateCost.json",
"key": "Id",
"sheet_name" :"DecorateCost",
"fields" :["Id", "AreaId", "CostCount", "SortId"]
},
{
"in_file": "StartOrder.xlsx",
"out_file": "StartOrder.json",
"key": "Id",
"sheet_name" :"StartOrder",
"fields" :["Id", "merge_id_list", "step"]
},
{
"in_file": "Item.xlsx",
"out_file": "Item.json",
"key": "Id",
"sheet_name" :"Item",
"fields" :["Id", "IType", "Effect"]
},
{
"in_file": "Card.xlsx",
"out_file": "CardConst.json",
"key": "key",
"sheet_name" :"CardConst",
"fields" :["Key", "Value"]
},
{
"in_file": "Card.xlsx",
"out_file": "CardDetail.json",
"key": "Id",
"sheet_name" :"CardDetail",
"fields" :["Id", "PictureAlbum", "Star", "IsGold"]
},
{
"in_file": "Card.xlsx",
"out_file": "CardPack.json",
"key": "Id",
"sheet_name" :"CardPack",
"fields" :["Id", "RewardCnt", "MustHave", "RandRate"]
},
{
"in_file": "Card.xlsx",
"out_file": "CardCollect.json",
"key": "Id",
"sheet_name" :"CardCollect",
"fields" :["Id", "Color", "Item", "Chess"]
},
{
"in_file": "Card.xlsx",
"out_file": "CardExchange.json",
"key": "Id",
"sheet_name" :"CardExchange",
"fields" :["Id", "CostStar", "Item", "CardPack"]
},
{
"in_file": "DailyTask.xlsx",
"out_file": "DailyTaskConst.json",
"key": "Key",
"sheet_name" :"Const",
"fields" :["Value"]
},
{
"in_file": "DailyTask.xlsx",
"out_file": "DailyTask.json",
"key": "Key",
"sheet_name" :"DailyTask",
"fields" :["Task", "Lv"]
},
{
"in_file": "DailyTask.xlsx",
"out_file": "DailyTaskActive.json",
"key": "Id",
"sheet_name" :"DailyTaskActive",
"fields" :["Num", "Reward"]
},
{
"in_file": "DailyTask.xlsx",
"out_file": "DailyTaskJackpot.json",
"key": "Id",
"sheet_name" :"DailyTaskJackpot",
"fields" :["Items", "CardPack"]
},
{
"in_file": "guild.xlsx",
"out_file": "GuildReward.json",
"key": "Id",
"sheet_name" :"GuildReward",
"fields" :["Items", "Num"]
},
{
"in_file": "Face.xlsx",
"out_file": "Face.json",
"key": "Id",
"sheet_name" :"Face",
"fields" :["Init"]
},
{
"in_file": "Avatar.xlsx",
"out_file": "Avatar.json",
"key": "Id",
"sheet_name" :"Avatar",
"fields" :["Init"]
},
{
"in_file": "SevenLoginCfg.xlsx",
"out_file": "SevenLogin.json",
"key": "Id",
"sheet_name" :"SevenLogin",
"fields" :["Diamond", "RewardNum"]
},
{
"in_file": "SevenLoginCfg.xlsx",
"out_file": "SevenLoginJackpot.json",
"key": "Id",
"sheet_name" :"Jackpot",
"fields" :["Diamond", "Item", "Month", "Type"]
},
{
"in_file": "SevenLoginCfg.xlsx",
"out_file": "SevenLoginMonth.json",
"key": "Id",
"sheet_name" :"Month",
"fields" :["Active", "Diamond", "RewardNum"]
},
{
"in_file": "Base.xlsx",
"out_file": "Base.json",
"key": "Key",
"sheet_name" :"Const",
"fields" :["Value"]
},
{
"in_file": "Activity.xlsx",
"out_file": "Activity.json",
"key": "Id",
"sheet_name" :"Activity",
"fields" :["Type", "StartTime", "EndTime", "Name", "Title", "Mail", "Reward"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEvent.json",
"key": "Id",
"sheet_name" :"Trigger",
"fields" :["EventId", "WeekDay", "StartTime", "EndTime", "Duration"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEventMeteor.json",
"key": "Id",
"sheet_name" :"Meteor",
"fields" :["Add"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEventChest.json",
"key": "Id",
"sheet_name" :"Chest",
"fields" :["Min", "Max", "Items"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEventOrder.json",
"key": "Id",
"sheet_name" :"Order",
"fields" :["Min", "Max", "Items"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEventSence.json",
"key": "Id",
"sheet_name" :"Sence",
"fields" :["Sence", "Progress", "Items"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEventSenceJackpot.json",
"key": "Id",
"sheet_name" :"SenceJackpot",
"fields" :["Items", "Prob"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEventJackpot.json",
"key": "Id",
"sheet_name" :"Jackpot",
"fields" :["Items", "Min", "Max", "Prob"]
},
{
"in_file": "LimitedTimeEvent.xlsx",
"out_file": "LimitedTimeEventConst.json",
"key": "Key",
"sheet_name" :"Const",
"fields" :["Value"]
},
{
"in_file": "Charge.xlsx",
"out_file": "Charge.json",
"key": "Id",
"sheet_name" :"Charge",
"fields" :["Money", "Diamond", "Unit", "Type"]
},
{
"in_file": "Charge.xlsx",
"out_file": "DiamondShop.json",
"key": "Id",
"sheet_name" :"DiamondShop",
"fields" :["ChargeId", "Diamond"]
},
{
"in_file": "Charge.xlsx",
"out_file": "EnergyShop.json",
"key": "Id",
"sheet_name" :"EnergyShop",
"fields" :["ChargeId", "Energy", "FirstCharge"]
},
{
"in_file": "Charge.xlsx",
"out_file": "SpecialShop.json",
"key": "Id",
"sheet_name" :"SpecialShop",
"fields" :["ChargeId", "Type", "Items", "Grade"]
},
{
"in_file": "Charge.xlsx",
"out_file": "FreeShop.json",
"key": "Id",
"sheet_name" :"FreeShop",
"fields" :["Items"]
},
{
"in_file": "Charge.xlsx",
"out_file": "ChargeConst.json",
"key": "Key",
"sheet_name" :"Const",
"fields" :["Value"]
},
{
"in_file": "Charge.xlsx",
"out_file": "ChargeGift.json",
"key": "Id",
"sheet_name" :"Gift",
"fields" :["ChargeId", "Items", "Count"]
},
{
"in_file": "Endless.xlsx",
"out_file": "Endless.json",
"key": "Id",
"sheet_name" :"Endless",
"fields" :["ChargeId", "Money", "Diamond", "NextMoney"]
},
{
"in_file": "Endless.xlsx",
"out_file": "EndlessJackpot.json",
"key": "Id",
"sheet_name" :"Jackpot",
"fields" :["ItemId", "Type", "Diamond"]
},
{
"in_file": "Champship.xlsx",
"out_file": "ChampshipScore.json",
"key": "Lv",
"sheet_name" :"Score",
"fields" :["Score"]
},
{
"in_file": "Champship.xlsx",
"out_file": "ChampshipJackpot.json",
"key": "Id",
"sheet_name" :"Jackpot",
"fields" :["Total", "Score", "Items"]
},
{
"in_file": "Champship.xlsx",
"out_file": "ChampshipRank.json",
"key": "Id",
"sheet_name" :"Rank",
"fields" :["Min", "Max", "Items"]
}
]
}

32
tool/cfg/shell.py Normal file
View File

@ -0,0 +1,32 @@
import os
import csv
# 设置要遍历的目录
source_directory = 'config'
target_directory = 'csv_output'
# 确保目标目录存在
os.makedirs(target_directory, exist_ok=True)
# 遍历源目录及其子目录
for root, dirs, files in os.walk(source_directory):
for file in files:
if file.endswith('.txt'):
source_file_path = os.path.join(root, file)
target_file_name = os.path.splitext(file)[0] + '.csv'
target_file_path = os.path.join(target_directory, target_file_name)
# 读取TXT文件并写入CSV文件
try:
with open(source_file_path, 'r', encoding='utf-8') as txt_file, open(target_file_path, 'w', newline='', encoding='utf-8') as csv_file:
txt_reader = csv.reader(txt_file, delimiter='\t')
csv_writer = csv.writer(csv_file)
# 跳过第一行
next(txt_reader, None)
for row in txt_reader:
# 去掉每行的第一列
csv_writer.writerow(row[1:])
except Exception as e:
print(f"Failed to convert: {source_file_path} to {target_file_path}")
print(e)

53
tool/cfg/tool_cfg copy.py Normal file
View File

@ -0,0 +1,53 @@
import os
import json
import openpyxl
current_dir = os.getcwd()
# 读取配置文件
with open(os.path.join(current_dir, 'tool/cfg/cfg_xlsx.json'), 'r', encoding='utf-8-sig') as f:
cfg = json.load(f)
file_list = cfg['file_list']
target_dir = cfg['target_dir']
source_dir = cfg['source_dir']
fields_to_remove = cfg.get('fields_to_remove', [])
# 确保目标目录存在
os.makedirs(target_dir, exist_ok=True)
# 遍历文件列表并转换文件
for file_cfg in file_list:
source_file_path = os.path.join(current_dir, source_dir, file_cfg["in_file"])
target_file_path = os.path.join(current_dir, target_dir, file_cfg["out_file"])
sheet_name = file_cfg["sheet_name"]
# 读取XLSX文件
workbook = openpyxl.load_workbook(source_file_path)
sheet = workbook[sheet_name] if sheet_name else workbook.active
# 获取字段名
fieldnames = [cell.value for cell in sheet[1]]
# 读取数据并去掉第一行
rows = list(sheet.iter_rows(values_only=True))[2:]
# 以第一列的值作为索引,并移除第一列
indexed_data = {}
for row in rows:
row_dict = {fieldnames[i]: row[i] for i in range(len(fieldnames))}
index = row_dict.pop(fieldnames[0]) # 获取第一列的值作为索引并移除第一列
# 仅保留需要的字段
row_dict = {field: row_dict[field] for field in file_cfg['fields'] if field in row_dict}
for key, value in row_dict.items():
try:
row_dict[key] = json.loads(value)
except (json.JSONDecodeError, TypeError):
pass # 如果解析失败,则保持原值
indexed_data[index] = row_dict
# 将JSON写入目标文件
with open(target_file_path, 'w', encoding='utf-8-sig') as json_file:
json.dump(indexed_data, json_file, ensure_ascii=False, indent=4)
print(f"Converted: {source_file_path} to {target_file_path}")

53
tool/cfg/tool_cfg.py Normal file
View File

@ -0,0 +1,53 @@
import os
import json
import openpyxl
current_dir = os.getcwd()
# 读取配置文件
with open(os.path.join(current_dir, 'tool/cfg/cfg_xlsx.json'), 'r', encoding='utf-8') as f:
cfg = json.load(f)
file_list = cfg['file_list']
target_dir = cfg['target_dir']
source_dir = cfg['source_dir']
fields_to_remove = cfg.get('fields_to_remove', [])
# 确保目标目录存在
os.makedirs(target_dir, exist_ok=True)
# 遍历文件列表并转换文件
for file_cfg in file_list:
source_file_path = os.path.join(current_dir, source_dir, file_cfg["in_file"])
target_file_path = os.path.join(current_dir, target_dir, file_cfg["out_file"])
sheet_name = file_cfg["sheet_name"]
# 读取XLSX文件
workbook = openpyxl.load_workbook(source_file_path)
sheet = workbook[sheet_name] if sheet_name else workbook.active
# 获取字段名
fieldnames = [cell.value for cell in sheet[1]]
# 读取数据并去掉第一行
rows = list(sheet.iter_rows(values_only=True))[2:]
# 以第一列的值作为索引,并移除第一列
indexed_data = {}
for row in rows:
row_dict = {fieldnames[i]: row[i] for i in range(len(fieldnames))}
index = row_dict.pop(fieldnames[0]) # 获取第一列的值作为索引并移除第一列
# 仅保留需要的字段
row_dict = {field: row_dict[field] for field in file_cfg['fields'] if field in row_dict}
for key, value in row_dict.items():
try:
row_dict[key] = json.loads(value)
except (json.JSONDecodeError, TypeError):
pass # 如果解析失败,则保持原值
indexed_data[index] = row_dict
# 将JSON写入目标文件
with open(target_file_path, 'w', encoding='utf-8') as json_file:
json.dump(indexed_data, json_file, ensure_ascii=False, indent=4)
print(f"Converted: {source_file_path} to {target_file_path}")