1 Star 0 Fork 39

shengyihua88/ccc-tnt-framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cs.d.ts 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
伍拾陆 提交于 2023-10-20 10:46 . net-mgr
declare global{
namespace cs{
interface Pack{
id?: number;
data?: ArrayBuffer;
}
interface C2S_HeartBeat{
}
interface S2C_HeartBeat{
}
interface C2S_SyncTime{
}
interface S2C_SyncTime{
ret?: number;
serverTime?: number;
}
interface C2S_Bag_GetInfo{
}
interface S2C_Bag_GetInfo{
ret?: number;
items: Item[];
ob?: UserObject;
}
interface UserObject{
}
interface Item{
type?: number;
value?: number;
count?: number;
}
interface Player{
id?: number;
name?: string;
enterTime?: number;
}
interface C2S_User{
username?: number;
password?: string;
}
interface S2C_User{
time?: number;
player?: Player;
}
}
interface ProtoType {
"HeartBeat": {
req: cs.C2S_HeartBeat,
res: cs.S2C_HeartBeat
},
"SyncTime": {
req: cs.C2S_SyncTime,
res: cs.S2C_SyncTime
},
"User": {
req: cs.C2S_User,
res: cs.S2C_User
},
"Bag_GetInfo": {
req: cs.C2S_Bag_GetInfo,
res: cs.S2C_Bag_GetInfo
},
}
type Keyof_ProtoType = keyof ProtoType;
// 客户端请求
type ProtoTypeReq <T extends Keyof_ProtoType> = ProtoType[T]["req"];
// 服务端响应
type ProtoTypeRes <T extends Keyof_ProtoType> = ProtoType[T]["res"];
}
export {};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shengyihua/ccc-tnt-framework.git
git@gitee.com:shengyihua/ccc-tnt-framework.git
shengyihua
ccc-tnt-framework
ccc-tnt-framework
master

搜索帮助