Skip to content

Commit

Permalink
update: 一些修改
Browse files Browse the repository at this point in the history
  • Loading branch information
flxxyz committed Jun 13, 2020
1 parent e753a6e commit e9f1082
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,20 @@ room.run()
| ggbb | 房间用户抢红包 |
| rankup | 房间内top10变化消息 |
| ranklist | 广播排行榜消息 |
| mrkl | 心跳 |
| erquizisn | 鱼丸预言 |
| blab | 粉丝等级升级 |
| rri | 未知的消息事件 |
| synexp | 未知的消息事件 |
| noble_num_info | 未知的消息事件 |
| gbroadcast | 未知的消息事件 |
| qausrespond | 未知的消息事件 |
| wiru | 未知的消息事件 |
| wirt | 未知的消息事件 |
| mcspeacsite | 未知的消息事件 |
| rank_change | 未知的消息事件 |
| srres | 未知的消息事件 |
| anbc | 未知的消息事件 |
| mrkl | 心跳 |
| rquizisn | 鱼丸预言 |
| blab | 粉丝等级升级 |
| rri | 未知的消息事件 |
| synexp | 未知的消息事件 |
| noble_num_info | 未知的消息事件 |
| gbroadcast | 未知的消息事件 |
| qausrespond | 未知的消息事件 |
| wiru | 未知的消息事件 |
| wirt | 未知的消息事件 |
| mcspeacsite | 未知的消息事件 |
| rank_change | 未知的消息事件 |
| srres | 未知的消息事件 |
| anbc | 未知的消息事件 |

## 斗鱼STT序列化反序列化库
```javascript
Expand Down
2 changes: 1 addition & 1 deletion src/bufferCoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ BufferCoder.prototype.encode = function (str, LE) {
*/
BufferCoder.prototype.blob2ab = function (blob) {
return new Promise((resolve, reject) => {
let reader = new FileReader()
const reader = new FileReader()
reader.onload = function (e) {
resolve(e.target.result)
}
Expand Down
1 change: 0 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class Client {
messageHandle(m) {
bufferCoder.decode(m, (e) => {
const r = stt.deserialize(e)
console.log('[message]', e)

if (Object.keys(this.messageEvent).filter(v => {
return !this.ignore.includes(v)
Expand Down
2 changes: 1 addition & 1 deletion src/clientEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function close() {
function message(data) {
if (typeof MessageEvent !== 'undefined') {
//无MessageEvent类型判断为node环境,转换数据为arraybuffer类型
let reader = new FileReader()
const reader = new FileReader()
reader.onload = e => this.messageHandle(e.target.result)
reader.readAsArrayBuffer(data.data)
} else {
Expand Down

0 comments on commit e9f1082

Please sign in to comment.