Skip to content

Commit 6d596dd

Browse files
committed
wip
1 parent 2cab8c6 commit 6d596dd

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

src/matches/match-relay/match-relay.service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export class MatchRelayService {
7272
) {
7373
const broadcast = this.broadcasts[matchId];
7474
if (!broadcast) {
75-
this.logger.error(`Broadcast not found for matchId ${matchId}`);
7675
this.relayError(
7776
response,
7877
404,
@@ -102,7 +101,6 @@ export class MatchRelayService {
102101

103102
const broadcast = this.broadcasts[matchId];
104103
if (!broadcast) {
105-
this.logger.error(`Broadcast not found for matchId ${matchId}`);
106104
this.relayError(
107105
response,
108106
404,
@@ -198,7 +196,6 @@ export class MatchRelayService {
198196
fragmentIndex: number,
199197
): void {
200198
if (!this.broadcasts[matchId]) {
201-
this.logger.log(`Creating new match broadcast for matchId ${matchId}`);
202199
this.broadcasts[matchId] = [];
203200
}
204201

@@ -250,7 +247,7 @@ export class MatchRelayService {
250247
})
251248
.catch((error: Error) => {
252249
this.logger.error(
253-
`Cannot gzip ${totalBuffer.length} bytes: ${error}`,
250+
`cannot gzip: ${error}`,
254251
);
255252
broadcast[fragmentIndex][field].gipped = false;
256253
broadcast[fragmentIndex][field].data = totalBuffer;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export type StartFieldData = {
2+
data?: Buffer;
3+
gipped?: boolean;
4+
signup_fragment?: number;
5+
tick?: number;
6+
tps?: number;
7+
map?: string;
8+
keyframe_interval?: number;
9+
protocol?: number;
10+
[key: string]: any;
11+
};
12+
13+
export type FullFieldData = {
14+
data?: Buffer;
15+
gipped?: boolean;
16+
tick?: number;
17+
[key: string]: any;
18+
};
19+
20+
export type DeltaFieldData = {
21+
data?: Buffer;
22+
gipped?: boolean;
23+
timestamp?: number;
24+
endtick?: number;
25+
[key: string]: any;
26+
};
27+
28+
export type Fragment = {
29+
start?: StartFieldData;
30+
full?: FullFieldData;
31+
delta?: DeltaFieldData;
32+
[key: string]: any;
33+
};
34+
35+
export type Broadcast = Fragment[];
36+

0 commit comments

Comments
 (0)