Detalhes do pacote

zona-x

zoonai7ISC1.27.0

Zona X MOD

Zona, X, MOD

readme (leia-me)

Actions Status

官方网站:https://pinus.io 欢迎加Pinus官方QQ群:102530089

示例工程请参见:https://github.com/node-pinus/pinus/tree/master/examples/simple-example

手动安装: npm install pinus -g

mkdir testProject cd testProject 初始化项目 pinus init

与Pomelo的关系

  1. pinus是pomelo的TS版本,框架内部把回调改为了Promise。
  2. 框架与pomelo一样,所以可以看pomelo的相关教程。
  3. 协议与pomelo一样,所以pomelo的客户端代码可以直接对接上pinus服务端。

框架编译方法

git clone https://github.com/node-pinus/pinus.git
cd pinus
yarn
yarn run build

编译好以后可以使用 yarn link 或者 npm link 软链接到自己的项目。 也可以用 yarn 的 workspace

查看pinus CHANGELOG

Pinus -- a fast, scalable game server framework for node.js

Pinus is a fast, scalable game server framework for node.js. It provides the basic development framework and many related components, including libraries and tools. Pinus is also suitable for real-time web applications; its distributed architecture makes pinus scale better than other real-time web frameworks.

Features

Complete support of game server and realtime application server architecture

  • Multiple-player game: mobile, social, web, MMO rpg(middle size)
  • Realtime application: chat, message push, etc.

Fast, scalable

  • Distributed (multi-process) architecture, can be easily scale up
  • Flexible server extension
  • Full performance optimization and test

Easy

  • Simple API: request, response, broadcast, etc.
  • Lightweight: high development efficiency based on node.js
  • Convention over configuration: almost zero config

Powerful

  • Many clients support, including javascript, flash, android, iOS, cocos2d-x, C
  • Many libraries and tools, including command line tool, admin tool, performance test tool, AI, path finding etc.
  • Good reference materials: full docs, many examples and an open-source MMO RPG demo

Extensible

  • Support plugin architecture, easy to add new features through plugins. We also provide many plugins like online status, master high availability.
  • Custom features, users can define their own network protocol, custom components very easy.

Why should I use pinus?

Fast, scalable, real-time game server development is not an easy job, and a good container or framework can reduce its complexity. Unfortunately, unlike web, finding a game server framework solution is difficult, especially an open source solution. Pinus fills this gap, providing a full solution for building game server frameworks.

changelog (log de mudanças)

1.7.1

[pinus] context,routeContext改为如果有传递则使用传递对象 #673

[pinus-admin][pinus-rpc] 为了服务器健壮性,保证monitorAgent始终会进行健康及重连处理 #677

[pinus-rpc]rpc模块增加父类方法路由支持 #684

[pinus]修复typescript5.2.x版本clearTimeout,clearInterval编译错误 #794

[pinus]fix: lerna run lint 报错 #880

[pinus]fix: 修复单元测试 #901

[package] Update yarn.lock fix yarn error.

[pinus] 修复模板项目的 依赖版本号.

[pinus-robot]修复 node依赖版本

[ci] remove ci node 12, add node 20.

[package] 更新依赖版本

1.7.0

[pinus-rpc] 修复mqtt的rpc-client概率自动断开连接问题 #650

[pinus] 增加remote相对路径功能支持,可以让项目打成可执行程序或直接部署到不同服务器的不同路径 #651

[pinus-rpc] 修复typescript 5.x编译错误 #652

[pinus-protobuf] 新增对map和object的编码和解码支持 #653

1.6.5

[chore] 更新部分依赖版本

[ci] 添加进程正常启动测试

[ci] add node 12,14,16,18 env test

[examples]: websocket-chat-ts-run 改造成 nestjs示例

[examples]: chat-ts-run 添加 逻辑模块依赖注入示例 #19

[ci] add nestjs examples test

FEA: 用 pretty-columns 替代 cliff #598

[tools] 限制pinus-robot的socket.io-client版本 #613

[pinus] 对backendSessionService KickBySid 添加参数签名 #616

[pinus][examples] SSL 证书重载 功能,并添加示例 (热更新SSL证书) #630

[ci] add ssl-connector example ci-test.

1.6.4

[template] optimize preload.ts handle error.

[template] fix simple-example web-server.

[pinus]nginx代理hybrid、ws获取客户端真实IP,port.#532

1.6.2

[pinus] 修复命令行工具失效问题 #388

1.6.1

[pinus-logger] fix: 已知 logger 存在内存泄漏的问题 #167

更新部分依赖版本

1.4.12

[pinus-robot-plugin] Update PinusWSClient.ts 打开服务器消息回调调用的注释

[pinus-robot-plugin] 修改机器人中对protobuf嵌套类型的解析,打开机器人对服务器推送的监听

[pinus]: template tsconfig.json 配置调整.

[pinus]: template remove skip lib check.

[examples]: cron 示例

Bump elliptic from 6.5.3 to 6.5.4

Bump y18n from 3.2.1 to 3.2.2

1.4.11

[template] 添加了打包时对配置文件的复制处理

[pinus] DictionaryComponent 添加选项 ignoreAutoRouter

可以自主控制dict的序号id.

// app.set('dictionaryConfig',{dict,ignoreAutoRouter})
export interface DictionaryComponentOptions {
    dict?: string;
    // 不自动按照路由生成router,仅使用 config/dictionary 内的路由.
    // 这样路由的 id 就可以通过dictionary的顺序来控制了,方便proto变更不影响原顺序id (为也热更新考虑)
    // 另外这样也少一次load handler
    ignoreAutoRouter?: boolean;
}

[pinus-rpc] origin基本是Error或其它扩展过的Error对象,cloneError会导致message等其它信息丢失

[examples] : component 示例.

[pinus] fix for lower typescript version.

[all] 统一跨平台下编译文件的换行符"LF"

1.4.10

[pinus] 修复win10 mqtt 超时问题

1.4.9

[pinus-protobuf]: 在开启encode缓存时,优化protobuf encode性能. (提升1倍)

 test Protobuf time: 914.453ms
 Protobuf length total: 1780000

 test ProtobufCache time: 416.399ms
 ProtobufCache length total: 1780000

[pinus]: fixed bug:指定服务配置auto-restart失效

[Example]: add nodejs ts client.

1.4.8

fix #128 https://github.com/node-pinus/pinus/issues/128 解决 mqtt-connection

1.4.7

fix #129 https://github.com/node-pinus/pinus/issues/129

1.4.6

revert 1.4.5 -> 1 revert 1.4.5 -> 3

1.4.5

  1. 更新 package.json,转移不需要的包到dev依赖. d58657d523c6ca1782dba1ec4c7d7d5cc62e5e22 https://github.com/node-pinus/pinus/issues/128

  2. [pinus]: manualReloadCrons 添加重载前清除选项. 8c1708ee74f68a9ef583827882a36cb0e59ead28

  3. tsconfig.json add opition skipLibCheck 解决新建的模板项目编译报错问题

1.4.4

修复NPM没有编译dist的问题.

1.4.3

pinus-rpc 修复mqtt调用延迟40~80ms的bug https://github.com/NetEase/pomelo-rpc/pull/33

分布式部署时,servers 配置有 args参数时,自动添加空格。

Merge pull request #125 from lowkeywx/master Modify the log description in the application.start function

Merge pull request #126 from wjt382063576/fix_dict fix(dict): Fix the problem of duplicate handler routing in the dictio…

pinus-protobuf Encoder可选性能优化,添加Encoder缓存选项。 不优化时的逻辑是,对msg进行JSON.stringify 获取长度*2,再分配Buffer。 使用优化时的逻辑是,使用指定大小的预分配Buffer。

// 指定 pinus-protobuf encode使用 buffer缓存大小
// 使用方法  在 connector配置参数
 app.set('protobufConfig', {
    // protobuf Encoder 使用 5m 的缓存 需要保证每个消息不会超过指定的缓存大小,超过了就会抛出异常
    encoderCacheSize: 5 * 1024 * 1024
 });
// 如果缓存大小不够就会有错误日志
// 缓存大小不够 日志示例
 [2020-03-27T10:44:48.752] [ERROR] pinus - [chat-server-1 channelService.js] [pushMessage] fail to dispatch msg to serverId: connector-server-1, err:RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 0. Received 1
 at boundsError (internal/buffer.js:53:9)
 at writeU_Int8 (internal/buffer.js:562:5)
 at Buffer.writeUInt8 (internal/buffer.js:569:10)
 at Encoder.writeBytes (F:\develop\gong4-server\logicServer\pinus\packages\pinus-protobuf\lib\encoder.ts:195:20)

pinus-protobuf protobufConfig 配置添加一个选项 decodeCheckMsg.

解析客户端消息时校验客户端消息字段是否符合protobuf定义

因为目前发现,有的客户端encode消息没有校验消息字段是否完整,导致服务端收到消息以后字段缺失,会出现逻辑问题.

所以添加了这个选项.

examples/websocket-chat-ts-run 添加开启 选项 decodeCheckMsg 的示例. 并使用 globalBefore 进行捕获.

1.4.2

修复web-server 更新express依赖出现的configure问题。

fix #118 #119

回退 web-server express版本

fix pinus-cli lost dependency.

1.4.1

try fix #63 运行目录问题,先与pomelo的代码行为保持一致。

添加 error handler 和 globalfilter示例 examples/websocket-chat-ts-run/game-server/app.ts

修复 因为修复 #110 导致的 所有日志级别都变为INFO的问题。

1.4.0

更新所有依赖库版本,并修复编译错误。 typescript 版本 3.7.2

fix #110 pinus-logger 的logger对象换成原始的 log4js 对象。

1.3.14

fix #104