|
@@ -135,23 +135,23 @@ export class MetaGateway
|
|
|
console.log('gameChanel', this.gameChanel.isOpen());
|
|
|
this.sendWertcHeartPack(this.gameChanel);
|
|
|
}
|
|
|
- // this.timer = setInterval(() => {
|
|
|
- // if (i < 9) {
|
|
|
- // const steam = createReadStream(paths + `/${i}.h264`);
|
|
|
- // // const steam = createReadStream(paths + `/test2`);
|
|
|
- // steam.on('data', (data: Buffer) => {
|
|
|
- // // console.log(data.buffer);
|
|
|
- // const frame = new DataView(data.buffer);
|
|
|
- // // frame.setUint32(0, 1437227610);
|
|
|
- // // frame.setUint16(6, 36);
|
|
|
- // // frame.setUint16(24, 0);
|
|
|
- // // frame.setUint16(26, 0);
|
|
|
- // // frame.setUint32(28, 0);
|
|
|
- // this.gameChanel.sendMessageBinary(Buffer.from(frame.buffer));
|
|
|
- // });
|
|
|
- // }
|
|
|
- // i++;
|
|
|
- // }, 10);
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (i < 30) {
|
|
|
+ const steam = createReadStream(paths + `/${i}.h264`);
|
|
|
+ // const steam = createReadStream(paths + `/test2`);
|
|
|
+ steam.on('data', (data: Buffer) => {
|
|
|
+ // console.log(data.buffer);
|
|
|
+ const frame = new DataView(data.buffer);
|
|
|
+ frame.setUint32(0, 1437227610);
|
|
|
+ frame.setUint16(6, 36);
|
|
|
+ frame.setUint16(24, 0);
|
|
|
+ frame.setUint16(26, 0);
|
|
|
+ frame.setUint32(28, 0);
|
|
|
+ this.gameChanel.sendMessageBinary(Buffer.from(frame.buffer));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }, 10);
|
|
|
});
|
|
|
this.gameChanel.onClosed(() => {
|
|
|
console.log('gameChanel close');
|