steamutils 1.4.15 → 1.4.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/package.json +1 -1
- package/test_steamclient.js +1 -1
- package/utils.js +13 -0
package/package.json
CHANGED
package/test_steamclient.js
CHANGED
@@ -13,7 +13,7 @@ import SteamID from "steamid";
|
|
13
13
|
// console.log(loginResult.cookie);
|
14
14
|
// const user = new SteamUser(loginResult.cookie)
|
15
15
|
|
16
|
-
const cookie = "
|
16
|
+
const cookie = "";
|
17
17
|
const steamClient = new SteamClient({
|
18
18
|
cookie,
|
19
19
|
isAutoPlay: true,
|
package/utils.js
CHANGED
@@ -153,3 +153,16 @@ export const secretAsBuffer = (sharedSecret) => {
|
|
153
153
|
// It must be base64
|
154
154
|
return Buffer.from(sharedSecret, "base64");
|
155
155
|
};
|
156
|
+
|
157
|
+
export function decodeLoginQrUrl(qrUrl) {
|
158
|
+
if (!qrUrl || typeof qrUrl !== "string") {
|
159
|
+
return null;
|
160
|
+
}
|
161
|
+
const match = qrUrl.match(/^https?:\/\/s\.team\/q\/(\d+)\/(\d+)(\?|$)/);
|
162
|
+
if (!match) {
|
163
|
+
console.log("Invalid QR code URL");
|
164
|
+
return null;
|
165
|
+
}
|
166
|
+
|
167
|
+
return { clientId: match[2], version: parseInt(match[1], 10) };
|
168
|
+
}
|