Compare commits
No commits in common. "db8b33299c1dfa7697066453f167e04f2b1a18e6" and "3dd7e0fa0f79b20a4d066f17e4d615abb0176a9a" have entirely different histories.
db8b33299c
...
3dd7e0fa0f
25
README.md
25
README.md
@ -1,27 +1,14 @@
|
|||||||
# webRTC
|
# webRTC
|
||||||
webrtc 实现的 p2p 信道
|
webrtc 实现的 p2p 信道
|
||||||
|
|
||||||
* 不要将 JS 文件编译, 使用便于阅读的源码发布
|
rtc rtc rtc: 稳定, 多重连接
|
||||||
* 避免依赖服务器提供静态文件, 使用WEBRTC在浏览器之间共享
|
channel channel channel: 细流
|
||||||
* 内核策略, 在浏览器中查看和编辑文件
|
part-server: 调谐, 从不同服务器请求资源分片
|
||||||
|
webrtc://用户@域名:端口/信道标识/资源ID
|
||||||
|
|
||||||
```
|
封包格式
|
||||||
# 使用 git 克隆到本地或者直接下载zip压缩包
|
资源ID 分片信息(位置) 分片数据
|
||||||
git clone git@git.satori.love:LaniakeaSupercluster/webrtc.git
|
|
||||||
cd webrtc
|
|
||||||
|
|
||||||
# 安装依赖
|
|
||||||
npm i
|
|
||||||
|
|
||||||
# 编译
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
# 运行服务
|
|
||||||
npm run start
|
|
||||||
|
|
||||||
# 或者使用 pm2 作为守护进程
|
|
||||||
pm2 start npm --name webrtc -- run start
|
|
||||||
```
|
|
||||||
|
|
||||||
插件市场
|
插件市场
|
||||||
1. 从浏览器创建插件(单文件)
|
1. 从浏览器创建插件(单文件)
|
||||||
|
@ -162,6 +162,17 @@ export class Chessboard {
|
|||||||
context.lineTo(边距, 边距)
|
context.lineTo(边距, 边距)
|
||||||
context.stroke()
|
context.stroke()
|
||||||
|
|
||||||
|
//// 绘制棋子们
|
||||||
|
//context.font = '20px serif'
|
||||||
|
//context.fillStyle = 'red'
|
||||||
|
//context.fillText('車', 0+边距-(比例/5), 20+边距-(比例/5))
|
||||||
|
//context.stroke()
|
||||||
|
//// 绘制棋子们
|
||||||
|
//context.font = '20px serif'
|
||||||
|
//context.fillStyle = 'red'
|
||||||
|
//context.fillText('馬', 0+边距-(比例/5) + (比例*1), 20+边距-(比例/5))
|
||||||
|
//context.stroke()
|
||||||
|
|
||||||
// 单独保存绘制好的棋盘
|
// 单独保存绘制好的棋盘
|
||||||
const chessboard = canvas.toDataURL()
|
const chessboard = canvas.toDataURL()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user