交互式创建TSRPC项目
npx create-tsrpc-app@latest
如果提示错误,
PS C:\Users\Administrator\Tsrpc> npx create-tsrpc-app@latest --help
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\Administrator\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\Administrator\AppData\Roaming\npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-02-27T02_27_03_736Z-debug-0.log
就新建这个空文件夹:C:\Users\Administrator\AppData\Roaming\npm
PS C:\Users\Administrator\Tsrpc> npx create-tsrpc-app@latest --help
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\Administrator\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\Administrator\AppData\Roaming\npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-02-27T02_27_03_736Z-debug-0.log
Need to install the following packages:
create-tsrpc-app@1.3.1
Ok to proceed? (y) y
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated figgy-pudding@3.5.2: This module is no longer supported.
npm WARN deprecated libnpmconfig@1.2.1: This module is not used anymore. npm config is parsed by npm itself and by @npmcli/config
create-tsrpc-app <项目目录> [选项]
选项:
-h, --help 查看帮助信息
-v, --version 查看版本号
-p, --preset <预设名> 使用预设配置(跳过交互式配置)
可选 browser, react, vue2, vue3, server
PS C:\Users\Administrator\Tsrpc>
Cocos Creator网页浏览器游戏
安装TSRPC客户端库
npm install tsrpc-browser
zum/ts-gameframework - 码云 - 开源中国 (gitee.com)
这是用TsRpc做的游戏服务器框架,带集群可横向扩展,带数据库Redis
可以配置多个配置文件启动多个进程(命令行传入不同的配置文件),可以横向增加房间。
没有Gate也没有软路由层,WebSocket和普通Http完全暴露在外网,防火墙要做好。
能实现快速开发,分布式架构,前后端都用TS语言。
从2023年春季就停止维护了,不知道作者去哪里了。