# CCCET **Repository Path**: cccetstudy/cccet ## Basic Information - **Project Name**: CCCET - **Description**: 使用CocosCreator学习ET框架开发 - **Primary Language**: TypeScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2024-06-05 - **Last Updated**: 2025-06-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ET https://github.com/egametang/ET X-ET7 https://github.com/IcePower/X-ET7 moye https://github.com/Alistairot/moye tsrpc https://github.com/k8w/tsrpc tsbuffer https://github.com/k8w/tsbuffer tsbuffer-schema https://github.com/k8w/tsbuffer-schema # 山寨版玩具ET 注意!!!本项目代码只为学习ET框架,很多临时测试代码,请勿用于实际项目 Cocos2 Cocos3 都是在 Codes 的基础上,去掉了Server相关代码,并且针对ET7,ET8通讯协议做了处理。 但是都不提供任何工具生成,如需使用,可以自行实现。 # Codes Cocos Server CocosCreator 2.4.12 与 nodejs 仿 ET 的全栈玩具 1,当前目录执行 npm install 2,通讯使用tsbuffer,需要在 Cocos 目录下执行 npm install 3,运行 Clean.bat 清理 Cocos 与 Server 目录下的 link 4,使用管理员模式运行 Init.bat 生成对应的 link 5, 运行 BuildCode.bat 生成服务器预加载代码清单 6,运行 Startup.bat 启动服务器 7,使用 CocosCreator 2.4.12 打开 Cocos 工程 # Cocos2 CocosCreator 2.4.12 使用 protobuf 连接 ET7 WebSocket 服务器 1,执行 BuildProtobuf.bat 可以根据 OuterMessage_C_10001.proto 生成对应 OuterMessage_C_10001.json 2,手动将 OuterMessage_C_10001.json 的内容覆盖 Cocos2\assets\resources\Config\Proto\OuterMessage_C_10001.json 3,使用 CocosCreator 2.4.12 打开 Cocos2 工程 # Cocos3 CocosCreator 3.8.3 使用 MemoryPack 连接 ET8 WebSocket 服务器 1,CocosCreator 3.8.3 要使用 FairyGUI,需要在 Cocos3 目录下执行 npm install 2,根据使用到的类型,手动补全 MemoryPackSerializeHelper 的 SerializeMember 和 DeserializeMember 方法 3,使用 CocosCreator 3.8.3 打开 Cocos3 工程 # Proto InnerMessage_S_20001.ts OuterMessage_C_10001.ts tsbuffer 根据接口生成对应的协议描述,以上文件就是定义的接口协议 # Tools BuildCode BuildProto BuildExcel 自行查看代码 # Eslint EslintCode Eslint脚本源码 EslintRules Eslint规则(EslintCode生成的) .eslintignore Eslint忽略规则 .eslintrc.js Eslint配置 # VSCodePlugin 需要先安装 [text](VSCodePlugin) 的插件 ctetgencode-0.0.1.vsix,可以自行修改调整重新发布 1,自动补全扩展方法描述,在 SessionSystem 上添加Decorator ExpandOf(Session),选取 SessionSystem,右键使用 生成扩展申明,即可生成对应的 declare 描述 declare module "./Session" { interface Session { } } @ExpandOf(Session) export class SessionSystem { } 2,自动补全System,输入需要生成System的组件 Session,选取 Session,右键使用 生成系统代码,即可生成对应的 System 类,以及对应的方法 @FriendOf(Session) @ObjectSystemAttribute() export class SessionAwakeSystem extends Awake1System { Awake(self: Session, serviceId: number): void { } } @FriendOf(Session) @ObjectSystemAttribute() export class SessionDestroySystem extends DestroySystem { Destroy(self: Session): void { } } # FairyGUI 里面有一些关联的插件,可以自行修改