File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,12 @@ class Client {
30
30
});
31
31
32
32
const stream = new BufferedStream(socket);
33
-
34
- const credentials = `${clientId}:${clientSecret}`;
35
- stream.writeUint8(credentials.length);
36
- stream.writeAll(Buffer.from(credentials, 'ascii'));
33
+ stream.writeUint8(clientId.length);
34
+ stream.writeAll(Buffer.from(clientId, 'ascii'));
35
+ stream.writeUint8(clientSecret.length);
36
+ stream.writeAll(Buffer.from(clientSecret, 'ascii'));
37
+ stream.writeUint8(4);
38
+ stream.writeAll(Buffer.from([192, 168, 0, 1]));
37
39
38
40
const result = await stream.readUint8();
39
41
@@ -62,7 +64,7 @@ class Client {
62
64
const achievements = [];
63
65
64
66
for (let i = 0; i < numAchievements; ++i) {
65
- achievements.push(await this.stream.readExact(20 ));
67
+ achievements.push(await this.stream.readExact(16 ));
66
68
}
67
69
68
70
return achievements;
@@ -74,6 +76,7 @@ class Client {
74
76
}
75
77
76
78
public disconnect() : void {
79
+ this.stream.writeUint8(0x03);
77
80
this.stream.close();
78
81
}
79
82
}
You can’t perform that action at this time.
0 commit comments