npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pixelstream-cn

v1.1.2

Published

基于虚幻引擎的像素流平台

Downloads

19

Readme

说明

基于虚幻引擎开发的像素流平台,可实现UE进程动态管理; 也可实现UE场景的多渲染主机负载均衡; 可私有化部署,详情联系微信公众号PixelStreamCN

第一步 注册账号(免费)

前往pixelstream平台注册账号

https://www.pixelstream.cn/


第二步

创建渲染编号 (一个账号目前最多可以创建5个)


第三步 下载渲染管理端和用例

启动渲染管理端 填写渲染编号 选择用例目录 设置最大启动进程数


第四步 接入jssdk

导入
import pixelStream from "pixelstream-cn";

初始化
let ps = new pixelStream({
  element:document.getElementById("render"),    //设定渲染容器
  keyboard:["a","s","d","w","q","e","F1"," "]    //开放的键盘
});
初始化参数包含

| 配置项 | 类型 | 说明 | | ----: | --- | :---- | | encodeKey | string | 密钥 | | element | dom | 渲染容器 | | keyboard | array | 开放的键盘按键 默认全部开放 | | tools | bool | 是否开启工具条 默认关闭 | | baseHost | string | 基础地址 私有云部署用 |


监听客户端交互事件
ps.message.responseHandel = (response)=>{
  console.log("收到UE发来的消息",response);
};

排队时触发
ps.message.waitHandel = (num)=>{
  console.log("前面还有" + num + "人排队");
};

错误触发
ps.message.errorHandel = (message)=>{
  console.log("错误消息:" + message);
};

流畅度
ps.message.speedHandel = (speed)=>{
  console.log("当前流畅值:" + speed);
};

执行渲染
ps.render("你的渲染编号","画面名称").then(()=>{
  console.log("渲染画面接入完成");
});

发送消息
let data={};    //发送的data结构信息
ps.send(new pixelStream.action("action值",data,false))

发送异步消息
let data={};    //发送的data结构信息
ps.send(new pixelStream.action("action值",data,true)).then(response=>{
  console.log("收到消息回复",response);   //response为UE回复的内容 会将字符串解析为json对象
});
发送字符串消息
ps.sendUIInteraction("发送的内容")
封装自定义动作类 并发送
class MyAction extends pixelStream.action{
  callback=true;    //是否需要回调
  $action="my_action";    //action信息
  $data={message:"hello world"}   //data信息
}
ps.send(new MyAction()).then(response=>{});

结构化设计
  • 为了消除ue4开发人员和web开发人员对一些事物理解上的偏差,本JSSDK提供部分兼容性封装。后续会持续更新;
  • 例如:颜色色值设定,因为UE针对RGB色值采用0-1的范围设定,而web开发普遍以0-255为范围设定,因此pixelStream.structure.Color作为JSSDK提供的色值封装来消除2边的理解误差
let data = new pixelStream.structure.Color(255,0,0,1);
ps.send(new pixelStream.action("setColor",data,false))

关闭(如果没有其他客户端接入该画面,系统将于10秒后回收渲染程序)
ps.close()