birdpack 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core.js +0 -1
- package/lib/websocket.js +11 -1
- package/package.json +1 -1
package/lib/core.js
CHANGED
package/lib/websocket.js
CHANGED
|
@@ -28,6 +28,8 @@ module.exports = class{
|
|
|
28
28
|
})
|
|
29
29
|
.on('close', () => {
|
|
30
30
|
this.userOut();
|
|
31
|
+
this.callOut();
|
|
32
|
+
this.callOut = ()=>{};
|
|
31
33
|
this.callback(this, 'close');
|
|
32
34
|
})
|
|
33
35
|
.on('error', (e) => {
|
|
@@ -226,7 +228,10 @@ module.exports = class{
|
|
|
226
228
|
}
|
|
227
229
|
});
|
|
228
230
|
}
|
|
229
|
-
|
|
231
|
+
callOut(){
|
|
232
|
+
|
|
233
|
+
}
|
|
234
|
+
async start(uid){
|
|
230
235
|
let seckey = this.get('sec-websocket-key');
|
|
231
236
|
let protocol = this.get('sec-websocket-protocol');
|
|
232
237
|
let version = parseInt(this.get('sec-websocket-version') || 0);
|
|
@@ -240,6 +245,11 @@ module.exports = class{
|
|
|
240
245
|
if(checkUser !== false){
|
|
241
246
|
checkUser.userOut();
|
|
242
247
|
checkUser.stop();
|
|
248
|
+
await new Promise((resolve)=>{
|
|
249
|
+
checkUser.callOut = ()=>{
|
|
250
|
+
resolve();
|
|
251
|
+
};
|
|
252
|
+
});
|
|
243
253
|
}
|
|
244
254
|
|
|
245
255
|
this.uid = uid;
|