Merge branch 'sdk' into online
This commit is contained in:
commit
c4d0cf3b8d
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -74,6 +74,8 @@ enum ITEM_POP_LABEL { // item弹窗标签
|
||||
DecorateReward = 66; // 装饰奖励
|
||||
CatnipReward = 67; // 猫草大作战奖励
|
||||
CatnipGrandReward = 68; // 猫草大作战大奖奖励
|
||||
CatnipPlay = 69; // 猫草大作战玩法奖励
|
||||
FriendTReward = 70; // 好友时间线奖励
|
||||
}
|
||||
enum HANDLE_TYPE {
|
||||
ADD = 0;
|
||||
@ -921,6 +923,7 @@ message ResRefuseCardGive{
|
||||
message ReqCardSend{
|
||||
int64 Uid = 1;
|
||||
int32 CardId = 2;
|
||||
int32 Emoji = 3; // 表情Id
|
||||
}
|
||||
|
||||
message ResCardSend{
|
||||
@ -932,6 +935,7 @@ message ResCardSend{
|
||||
message ReqCardExchange{
|
||||
int64 Uid = 1;
|
||||
int32 CardId = 2;
|
||||
int32 Emoji = 3; // 表情Id
|
||||
}
|
||||
|
||||
message ResCardExchange{
|
||||
@ -960,6 +964,7 @@ message ResAgreeCardExchange{
|
||||
RES_CODE Code = 1;
|
||||
string Msg = 2;
|
||||
string Id = 3;
|
||||
int32 Emoji = 4; // 表情Id
|
||||
}
|
||||
// 拒绝选择卡牌进行交换
|
||||
message ReqRefuseCardSelect{
|
||||
@ -990,6 +995,7 @@ message ResGetFriendCard{
|
||||
string Msg = 2;
|
||||
string Id = 3;
|
||||
int32 CardId = 4;
|
||||
int32 Emoji = 5; // 表情Id
|
||||
}
|
||||
|
||||
// 获取可以交换的金卡
|
||||
@ -1379,6 +1385,12 @@ message ResFriendLog{
|
||||
|
||||
message NotifyFriendLog{
|
||||
ResFriendLog info = 1;
|
||||
FriendBubbleInfo Bubble = 2; // 气泡
|
||||
}
|
||||
|
||||
message FriendBubbleInfo{
|
||||
int32 Id = 1; // 气泡id
|
||||
int32 Type = 2; // 气泡类型 1:普通 2:
|
||||
}
|
||||
|
||||
message NotifyFriendCard{
|
||||
@ -1397,6 +1409,7 @@ message ResFriendCard{
|
||||
int32 ExCardId = 9;
|
||||
int32 Status = 10;
|
||||
string Id = 11;
|
||||
int32 Emoji = 12; // 表情Id
|
||||
}
|
||||
|
||||
message ReqKv{
|
||||
@ -1491,6 +1504,10 @@ message ResFriendTimeLine{
|
||||
repeated ResFriendLog Log = 1;
|
||||
}
|
||||
|
||||
message ResFriendBubble{
|
||||
repeated FriendBubbleInfo Bubble = 1; // 气泡
|
||||
}
|
||||
|
||||
// 时间线点赞
|
||||
message ReqFriendTLUpvote{
|
||||
int32 Id = 1;
|
||||
@ -1502,6 +1519,17 @@ message ResFriendTLUpvote{
|
||||
int32 Id = 3;
|
||||
}
|
||||
|
||||
// 时间线领奖
|
||||
message ReqFriendTReward{
|
||||
int32 Id = 1;
|
||||
}
|
||||
|
||||
message ResFriendTReward{
|
||||
RES_CODE Code = 1;
|
||||
string Msg = 2;
|
||||
int32 Id = 3;
|
||||
}
|
||||
|
||||
message ResFriendApplyNotify{
|
||||
ResPlayerSimple Player = 1;
|
||||
int32 Type = 2; // 1:申请 2:同意 3:拒绝 4:删除
|
||||
@ -2041,6 +2069,7 @@ message ResPlayroom{
|
||||
int32 InteractNum = 25; // 互动次数
|
||||
int32 Kiss = 26; // 亲吻次数
|
||||
int64 Revenge = 27; // 复仇Uid
|
||||
repeated AdItem AdItem = 28; // 广告奖励信息
|
||||
}
|
||||
|
||||
message NotifyPlayroomTask{
|
||||
@ -2140,6 +2169,13 @@ message NotifyPlayroomMood{
|
||||
int32 AllMood = 1; // 总心情
|
||||
map<int32, int32> Mood = 2; // 心情 <位置, 心情>
|
||||
map<int32, int32> Physiology = 3; // 生理 <位置, 生理>
|
||||
repeated AdItem AdItem = 4; // 广告奖励
|
||||
}
|
||||
|
||||
message AdItem {
|
||||
int32 Watch = 1; // 今日观看次数
|
||||
int32 LastWatch = 2; // 上次观看时间
|
||||
int32 ItemId = 3; // 道具id
|
||||
}
|
||||
|
||||
message NotifyPlayroomKiss{
|
||||
@ -2530,4 +2566,10 @@ message ReqReload{}
|
||||
message ReqAdminGm{
|
||||
int64 Uid = 1; // uid
|
||||
string Command = 2; // 命令
|
||||
}
|
||||
|
||||
message ReqAdminBan{
|
||||
int64 Uid = 1; // uid
|
||||
int64 Time = 2; // 禁止时间
|
||||
string Reason = 3; // 禁止原因
|
||||
}
|
||||
@ -56,12 +56,24 @@
|
||||
"sheet_name":"IndoorProgress",
|
||||
"coloum_type":["int","int","int","string","string","string","string","string"]
|
||||
},
|
||||
{
|
||||
"in_file":"LanguageData.xlsx",
|
||||
"out_file":"DialogData.txt",
|
||||
"sheet_name":"DialogData",
|
||||
"coloum_type":["int","string","int","string","string","string","string","string","string"]
|
||||
},
|
||||
{
|
||||
"in_file":"LanguageData.xlsx",
|
||||
"out_file":"LanguageData.txt",
|
||||
"sheet_name":"LanguageData",
|
||||
"coloum_type":["int","string","string","string"]
|
||||
},
|
||||
{
|
||||
"in_file":"LanguageData.xlsx",
|
||||
"out_file":"LanguageDataTwo.txt",
|
||||
"sheet_name":"LanguageDataTwo",
|
||||
"coloum_type":["int","string","string","string"]
|
||||
},
|
||||
{
|
||||
"in_file":"LimitedTimeEvent.xlsx",
|
||||
"out_file":"LuckyCatProbability.txt",
|
||||
|
||||
@ -80,6 +80,13 @@
|
||||
"sheet_name" :"UserData",
|
||||
"fields" :["Lv", "Item", "Emit", "EnergyMul", "MaxEnergy", "Exp", "PExp", "UnlockPack", "SevenLogin", "Recover", "Unlock_1","Unlock_2", "OrderN"]
|
||||
},
|
||||
{
|
||||
"in_file": "UserData.xlsx",
|
||||
"out_file": "UserDataConst.json",
|
||||
"key": "Key",
|
||||
"sheet_name" :"Const",
|
||||
"fields" :["Key", "Value"]
|
||||
},
|
||||
{
|
||||
"in_file": "IndoorProgress.xlsx",
|
||||
"out_file": "IndoorProgress.json",
|
||||
@ -484,7 +491,7 @@
|
||||
"out_file": "CatnipJackpot.json",
|
||||
"key": "Id",
|
||||
"sheet_name" :"Jackpot",
|
||||
"fields" :["Items", "Growth"]
|
||||
"fields" :["Items", "Growth", "Type"]
|
||||
},
|
||||
{
|
||||
"in_file": "Catnip.xlsx",
|
||||
@ -603,7 +610,7 @@
|
||||
"out_file": "PlayroomShop.json",
|
||||
"key": "Id",
|
||||
"sheet_name" :"Shop",
|
||||
"fields" :["Type", "ItemId", "Cost","Wish"]
|
||||
"fields" :["Type", "ItemId", "Cost","Wish", "Cooldown", "Dailystorage"]
|
||||
},
|
||||
{
|
||||
"in_file": "Playroom.xlsx",
|
||||
|
||||
@ -1,12 +1,43 @@
|
||||
import os
|
||||
import json
|
||||
import openpyxl
|
||||
import csv
|
||||
|
||||
current_dir = os.getcwd()
|
||||
# 读取配置文件
|
||||
with open(os.path.join(current_dir, 'tool/cfg/cfg_xlsx.json'), 'r', encoding='utf-8') as f:
|
||||
cfg_path = os.path.join(current_dir, 'tool/cfg/cfg_xlsx.json')
|
||||
with open(cfg_path, 'r', encoding='utf-8') as f:
|
||||
cfg = json.load(f)
|
||||
|
||||
def read_table(file_path, sheet_name=None):
|
||||
if file_path.lower().endswith('.xlsx'):
|
||||
workbook = openpyxl.load_workbook(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:]
|
||||
elif file_path.lower().endswith('.csv'):
|
||||
# 尝试多种编码格式
|
||||
encodings = ['utf-8', 'gbk', 'gb2312', 'cp936', 'utf-8-sig']
|
||||
data = None
|
||||
|
||||
for encoding in encodings:
|
||||
try:
|
||||
with open(file_path, 'r', encoding=encoding) as csvfile:
|
||||
reader = csv.reader(csvfile)
|
||||
data = list(reader)
|
||||
break
|
||||
except UnicodeDecodeError:
|
||||
continue
|
||||
|
||||
if data is None:
|
||||
raise ValueError(f"Unable to decode CSV file {file_path} with any of the attempted encodings: {encodings}")
|
||||
|
||||
fieldnames = data[0]
|
||||
rows = data[2:]
|
||||
else:
|
||||
raise ValueError("Unsupported file type")
|
||||
return fieldnames, rows
|
||||
|
||||
file_list = cfg['file_list']
|
||||
target_dir = cfg['target_dir']
|
||||
source_dir = cfg['source_dir']
|
||||
@ -19,17 +50,10 @@ 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"]
|
||||
sheet_name = file_cfg.get("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:]
|
||||
# 使用 read_table 函数读取文件
|
||||
fieldnames, rows = read_table(source_file_path, sheet_name)
|
||||
|
||||
# 以第一列的值作为索引,并移除第一列
|
||||
indexed_data = {}
|
||||
|
||||
@ -1,13 +1,31 @@
|
||||
import os
|
||||
import json
|
||||
import openpyxl
|
||||
import csv
|
||||
|
||||
current_dir = os.getcwd()
|
||||
print(current_dir)
|
||||
# 读取配置文件
|
||||
with open(os.path.join(current_dir, 'tool/cfg/cfg_txt.json'), 'r', encoding='utf-8-sig') as f:
|
||||
cfg_path = os.path.join(current_dir, 'tool/cfg/cfg_txt.json')
|
||||
with open(cfg_path, 'r', encoding='utf-8') as f:
|
||||
cfg = json.load(f)
|
||||
|
||||
def read_table(file_path, sheet_name=None):
|
||||
if file_path.lower().endswith('.xlsx'):
|
||||
workbook = openpyxl.load_workbook(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:]
|
||||
elif file_path.lower().endswith('.csv'):
|
||||
with open(file_path, 'r', encoding='utf-8') as csvfile:
|
||||
reader = csv.reader(csvfile)
|
||||
data = list(reader)
|
||||
fieldnames = data[0]
|
||||
rows = data[2:]
|
||||
else:
|
||||
raise ValueError("Unsupported file type")
|
||||
return fieldnames, rows
|
||||
|
||||
file_list = cfg['file_list']
|
||||
target_dir = cfg['target_dir']
|
||||
source_dir = cfg['source_dir']
|
||||
|
||||
Loading…
Reference in New Issue
Block a user