steamutils 1.4.74 → 1.4.76
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/SteamClient.js +181 -126
- package/full_steamproto.js +35 -0
- package/package.json +1 -1
- package/steamproto.js +2 -2
package/SteamClient.js
CHANGED
|
@@ -109,6 +109,9 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
109
109
|
let _cleanNodeSteamLicensesTimeout = null;
|
|
110
110
|
let _cleanNodeSteamFriendTimeout = null;
|
|
111
111
|
|
|
112
|
+
let _appLaunchedTimeout = null;
|
|
113
|
+
let _appQuitTimeout = null;
|
|
114
|
+
|
|
112
115
|
let _clientWelcome = null;
|
|
113
116
|
let _clientHello = null;
|
|
114
117
|
|
|
@@ -923,19 +926,17 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
923
926
|
steamClient.webSession = webSession;
|
|
924
927
|
callEvent(events.webSession, webSession);
|
|
925
928
|
},
|
|
926
|
-
receivedFromGC: async function (
|
|
929
|
+
receivedFromGC: async function (appId, msgType, payload) {
|
|
927
930
|
const key = getECsgoGCMsgKey(msgType);
|
|
928
|
-
|
|
929
|
-
|
|
931
|
+
const handleGC = {
|
|
932
|
+
async [ESteamProto.EMsg.k_EMsgClientChatInvite]({ appId, msgType, payload }) {
|
|
930
933
|
log(payload);
|
|
931
|
-
|
|
932
|
-
}
|
|
933
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgClientMMSJoinLobbyResponse: {
|
|
934
|
+
},
|
|
935
|
+
async [ESteamProto.ECsgoGCMsg.k_EMsgClientMMSJoinLobbyResponse]({ appId, msgType, payload }) {
|
|
934
936
|
const msg = new SteamProto(SteamProtoType.CMsgClientMMSJoinLobbyResponse).protoDecode(payload);
|
|
935
937
|
log(msg);
|
|
936
|
-
|
|
937
|
-
}
|
|
938
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Invite: {
|
|
938
|
+
},
|
|
939
|
+
async [ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Invite]({ appId, msgType, payload }) {
|
|
939
940
|
const msg = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_Party_Invite).protoDecode(payload);
|
|
940
941
|
const sid64 = SteamID.fromIndividualAccountID(msg.accountid).getSteamID64();
|
|
941
942
|
if (events.partyInvite?.length) {
|
|
@@ -948,9 +949,8 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
948
949
|
}
|
|
949
950
|
// log(player_name, `https://steamcommunity.com/profiles/${sid64}`);
|
|
950
951
|
// joinLobby(msg.lobbyid, msg.accountid)
|
|
951
|
-
|
|
952
|
-
}
|
|
953
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Account_RequestCoPlays: {
|
|
952
|
+
},
|
|
953
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Account_RequestCoPlays]({ appId, msgType, payload }) {
|
|
954
954
|
callGCCallback({
|
|
955
955
|
name: gcEvents.requestCoPlays,
|
|
956
956
|
data() {
|
|
@@ -958,9 +958,8 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
958
958
|
return msg.players.map((p) => SteamID.fromIndividualAccountID(p.accountid));
|
|
959
959
|
},
|
|
960
960
|
});
|
|
961
|
-
|
|
962
|
-
}
|
|
963
|
-
case ESteamProto.EGCBaseClientMsg.k_EMsgGCClientWelcome: {
|
|
961
|
+
},
|
|
962
|
+
[ESteamProto.EGCBaseClientMsg.k_EMsgGCClientWelcome]({ appId, msgType, payload }) {
|
|
964
963
|
prime = false;
|
|
965
964
|
const CMsgClientWelcome = new SteamProto(SteamProtoType.CMsgClientWelcome).protoDecode(payload);
|
|
966
965
|
const obj = {};
|
|
@@ -1019,12 +1018,12 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1019
1018
|
}
|
|
1020
1019
|
|
|
1021
1020
|
case 35: {
|
|
1022
|
-
// const result =protoDecode(SteamProtoType.CSOSelectedItemPreset, object_data);
|
|
1021
|
+
// const result = protoDecode(SteamProtoType.CSOSelectedItemPreset, object_data);
|
|
1023
1022
|
break;
|
|
1024
1023
|
}
|
|
1025
1024
|
|
|
1026
1025
|
case 36: {
|
|
1027
|
-
// const result =protoDecode(SteamProtoType.CSOEconItemPresetInstance, object_data);
|
|
1026
|
+
// const result = protoDecode(SteamProtoType.CSOEconItemPresetInstance, object_data);
|
|
1028
1027
|
break;
|
|
1029
1028
|
}
|
|
1030
1029
|
case 38: {
|
|
@@ -1044,7 +1043,7 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1044
1043
|
break;
|
|
1045
1044
|
}
|
|
1046
1045
|
case 42: {
|
|
1047
|
-
// const result =protoDecode(SteamProtoType.CSOEconItemTournamentPassport, object_data);
|
|
1046
|
+
// const result = protoDecode(SteamProtoType.CSOEconItemTournamentPassport, object_data);
|
|
1048
1047
|
break;
|
|
1049
1048
|
}
|
|
1050
1049
|
case 43: {
|
|
@@ -1089,13 +1088,13 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1089
1088
|
}
|
|
1090
1089
|
_clientWelcome = obj;
|
|
1091
1090
|
|
|
1092
|
-
for (const itemId in items) {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
}
|
|
1091
|
+
// for (const itemId in items) {
|
|
1092
|
+
// try {
|
|
1093
|
+
// if (!obj.personalStore.items.includes(parseInt(itemId))) {
|
|
1094
|
+
// delete items[itemId];
|
|
1095
|
+
// }
|
|
1096
|
+
// } catch (e) {}
|
|
1097
|
+
// }
|
|
1099
1098
|
obj.items = items;
|
|
1100
1099
|
callEvent(events.csgoOnline, obj);
|
|
1101
1100
|
|
|
@@ -1109,25 +1108,20 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1109
1108
|
"autoPartyRegister",
|
|
1110
1109
|
);
|
|
1111
1110
|
}
|
|
1112
|
-
|
|
1113
|
-
}
|
|
1114
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate: {
|
|
1111
|
+
},
|
|
1112
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate]({ appId, msgType, payload }) {
|
|
1115
1113
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate).protoDecode(payload);
|
|
1116
|
-
|
|
1117
|
-
}
|
|
1118
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientGlobalStats: {
|
|
1114
|
+
},
|
|
1115
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientGlobalStats]({ appId, msgType, payload }) {
|
|
1119
1116
|
const result = new SteamProto(SteamProtoType.CMsgClientUGSGetGlobalStatsResponse).protoDecode(payload);
|
|
1120
|
-
|
|
1121
|
-
}
|
|
1122
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer: {
|
|
1117
|
+
},
|
|
1118
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer]({ appId, msgType, payload }) {
|
|
1123
1119
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_ClientReportPlayer).protoDecode(payload);
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientTextMsg: {
|
|
1120
|
+
},
|
|
1121
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GC2ClientTextMsg]({ appId, msgType, payload }) {
|
|
1127
1122
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_GC2ClientTextMsg).protoDecode(payload);
|
|
1128
|
-
|
|
1129
|
-
}
|
|
1130
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello: {
|
|
1123
|
+
},
|
|
1124
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello]({ appId, msgType, payload }) {
|
|
1131
1125
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello).protoDecode(payload);
|
|
1132
1126
|
const example = {
|
|
1133
1127
|
my_current_event_teams: [],
|
|
@@ -1193,65 +1187,49 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1193
1187
|
}
|
|
1194
1188
|
_clientHello = result;
|
|
1195
1189
|
callEvent(events.csgoClientHello, result);
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1198
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse: {
|
|
1190
|
+
},
|
|
1191
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse]({ appId, msgType, payload }) {
|
|
1199
1192
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_ClientReportResponse).protoDecode(payload);
|
|
1200
|
-
|
|
1201
|
-
}
|
|
1202
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientCommendPlayerQueryResponse: {
|
|
1193
|
+
},
|
|
1194
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientCommendPlayerQueryResponse]({ appId, msgType, payload }) {
|
|
1203
1195
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_ClientCommendPlayer).protoDecode(payload);
|
|
1204
|
-
|
|
1205
|
-
}
|
|
1206
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment: {
|
|
1196
|
+
},
|
|
1197
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment]({ appId, msgType, payload }) {
|
|
1207
1198
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment).protoDecode(payload);
|
|
1208
|
-
|
|
1209
|
-
}
|
|
1210
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchList: {
|
|
1199
|
+
},
|
|
1200
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchList]({ appId, msgType, payload }) {
|
|
1211
1201
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_MatchList).protoDecode(payload);
|
|
1212
|
-
|
|
1213
|
-
}
|
|
1214
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GetEventFavorites_Response: {
|
|
1202
|
+
},
|
|
1203
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_GetEventFavorites_Response]({ appId, msgType, payload }) {
|
|
1215
1204
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_GetEventFavorites_Response).protoDecode(payload);
|
|
1216
|
-
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
break;
|
|
1220
|
-
}
|
|
1221
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_ClientDeepStats: {
|
|
1205
|
+
},
|
|
1206
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_StartAgreementSessionInGame]({ appId, msgType, payload }) {},
|
|
1207
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_ClientDeepStats]({ appId, msgType, payload }) {
|
|
1222
1208
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_ClientDeepStats).protoDecode(payload);
|
|
1223
|
-
|
|
1224
|
-
}
|
|
1225
|
-
case ESteamProto.EGCBaseClientMsg.k_EMsgGCClientConnectionStatus: {
|
|
1209
|
+
},
|
|
1210
|
+
[ESteamProto.EGCBaseClientMsg.k_EMsgGCClientConnectionStatus]({ appId, msgType, payload }) {
|
|
1226
1211
|
const result = new SteamProto(SteamProtoType.CMsgConnectionStatus).protoDecode(payload);
|
|
1227
|
-
|
|
1228
|
-
}
|
|
1229
|
-
case ESteamProto.EGCItemMsg.k_EMsgGCStoreGetUserDataResponse: {
|
|
1212
|
+
},
|
|
1213
|
+
[ESteamProto.EGCItemMsg.k_EMsgGCStoreGetUserDataResponse]({ appId, msgType, payload }) {
|
|
1230
1214
|
const result = new SteamProto(SteamProtoType.CMsgStoreGetUserDataResponse).protoDecode(payload);
|
|
1231
|
-
|
|
1232
|
-
}
|
|
1233
|
-
case ESteamProto.EGCItemMsg.k_EMsgGCStorePurchaseFinalizeResponse: {
|
|
1215
|
+
},
|
|
1216
|
+
[ESteamProto.EGCItemMsg.k_EMsgGCStorePurchaseFinalizeResponse]({ appId, msgType, payload }) {
|
|
1234
1217
|
const result = new SteamProto(SteamProtoType.CMsgGCStorePurchaseFinalizeResponse).protoDecode(payload);
|
|
1235
|
-
|
|
1236
|
-
}
|
|
1237
|
-
case ESteamProto.EGCItemMsg.k_EMsgGCStorePurchaseCancelResponse: {
|
|
1218
|
+
},
|
|
1219
|
+
[ESteamProto.EGCItemMsg.k_EMsgGCStorePurchaseCancelResponse]({ appId, msgType, payload }) {
|
|
1238
1220
|
const result = new SteamProto(SteamProtoType.CMsgGCStorePurchaseCancelResponse).protoDecode(payload);
|
|
1239
|
-
|
|
1240
|
-
}
|
|
1241
|
-
case ESteamProto.EGCItemMsg.k_EMsgGCStorePurchaseInitResponse: {
|
|
1221
|
+
},
|
|
1222
|
+
[ESteamProto.EGCItemMsg.k_EMsgGCStorePurchaseInitResponse]({ appId, msgType, payload }) {
|
|
1242
1223
|
const result = new SteamProto(SteamProtoType.CMsgGCStorePurchaseInitResponse).protoDecode(payload);
|
|
1243
|
-
|
|
1244
|
-
}
|
|
1245
|
-
case ESteamProto.EMsg.k_EMsgClientMMSCreateLobbyResponse: {
|
|
1224
|
+
},
|
|
1225
|
+
[ESteamProto.EMsg.k_EMsgClientMMSCreateLobbyResponse]({ appId, msgType, payload }) {
|
|
1246
1226
|
const result = new SteamProto(SteamProtoType.CMsgClientMMSCreateLobbyResponse).protoDecode(payload);
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
}
|
|
1250
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientGCRankUpdate: {
|
|
1227
|
+
log("k_EMsgClientMMSCreateLobbyResponse", result);
|
|
1228
|
+
},
|
|
1229
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientGCRankUpdate]({ appId, msgType, payload }) {
|
|
1251
1230
|
const result = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_ClientGCRankUpdate).protoDecode(payload);
|
|
1252
|
-
|
|
1253
|
-
}
|
|
1254
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Search: {
|
|
1231
|
+
},
|
|
1232
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_Party_Search]({ appId, msgType, payload }) {
|
|
1255
1233
|
callGCCallback({
|
|
1256
1234
|
name: gcEvents.partySearch,
|
|
1257
1235
|
async data() {
|
|
@@ -1329,10 +1307,9 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1329
1307
|
return players;
|
|
1330
1308
|
},
|
|
1331
1309
|
});
|
|
1332
|
-
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
let data = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_PlayersProfile).protoDecode(payload)?.account_profiles;
|
|
1310
|
+
},
|
|
1311
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_PlayersProfile]({ appId, msgType, payload }) {
|
|
1312
|
+
const data = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_PlayersProfile).protoDecode(payload)?.account_profiles;
|
|
1336
1313
|
const dataExample = [
|
|
1337
1314
|
{
|
|
1338
1315
|
my_current_event_teams: [],
|
|
@@ -1406,9 +1383,8 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1406
1383
|
});
|
|
1407
1384
|
}
|
|
1408
1385
|
callEvent(events.playersProfile, player);
|
|
1409
|
-
|
|
1410
|
-
}
|
|
1411
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientLogonFatalError: {
|
|
1386
|
+
},
|
|
1387
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientLogonFatalError]({ appId, msgType, payload }) {
|
|
1412
1388
|
const data = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_ClientLogonFatalError).protoDecode(payload);
|
|
1413
1389
|
const dataExample = {
|
|
1414
1390
|
errorcode: 4,
|
|
@@ -1416,9 +1392,8 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1416
1392
|
country: "VN",
|
|
1417
1393
|
};
|
|
1418
1394
|
callEvent(events.fatalError, data);
|
|
1419
|
-
|
|
1420
|
-
}
|
|
1421
|
-
case ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientRequestJoinFriendData: {
|
|
1395
|
+
},
|
|
1396
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientRequestJoinFriendData]({ appId, msgType, payload }) {
|
|
1422
1397
|
const data = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_ClientRequestJoinFriendData).protoDecode(payload);
|
|
1423
1398
|
if (!data?.account_id) {
|
|
1424
1399
|
return;
|
|
@@ -1436,20 +1411,75 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1436
1411
|
data,
|
|
1437
1412
|
key: data.account_id,
|
|
1438
1413
|
});
|
|
1439
|
-
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
.
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1414
|
+
},
|
|
1415
|
+
[ESteamProto.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientNetworkConfig]({ appId, msgType, payload }) {
|
|
1416
|
+
const data = new SteamProto(SteamProtoType.CMsgGCCStrike15_v2_ClientNetworkConfig).protoDecode(payload);
|
|
1417
|
+
let json = null;
|
|
1418
|
+
try {
|
|
1419
|
+
json = JSON.parse(data.data.toString());
|
|
1420
|
+
} catch (e) {}
|
|
1421
|
+
const dataExample = {
|
|
1422
|
+
revision: 1728581583,
|
|
1423
|
+
pops: {
|
|
1424
|
+
ams: {
|
|
1425
|
+
desc: "Amsterdam (Netherlands)",
|
|
1426
|
+
geo: [4.9, 52.37],
|
|
1427
|
+
partners: 1,
|
|
1428
|
+
tier: 1,
|
|
1429
|
+
relays: [
|
|
1430
|
+
{
|
|
1431
|
+
ipv4: "155.133.248.36",
|
|
1432
|
+
port_range: [27015, 27060],
|
|
1433
|
+
},
|
|
1434
|
+
],
|
|
1435
|
+
},
|
|
1436
|
+
atl: {
|
|
1437
|
+
desc: "Atlanta (Georgia)",
|
|
1438
|
+
geo: [-84.39, 33.76],
|
|
1439
|
+
partners: 1,
|
|
1440
|
+
tier: 1,
|
|
1441
|
+
relays: [
|
|
1442
|
+
{
|
|
1443
|
+
ipv4: "162.254.199.166",
|
|
1444
|
+
port_range: [27015, 27060],
|
|
1445
|
+
},
|
|
1446
|
+
],
|
|
1447
|
+
},
|
|
1448
|
+
},
|
|
1449
|
+
certs: ["Ii4IARIgSJbwDpn/07/GHiGMKio0Vh18VN3D/hKzQGh6n0Yx9qpFBayqZk0F7rB4KT6tfJIvitz8MkBJbZJixvdiUoHAs+u62Gd9lyGbHPAwHXlt4Ux3OEsXKgAxRK2wTcKoPWzjcHoKWHW8jpCT2k3YEDnx1HRLb3UO"],
|
|
1450
|
+
p2p_share_ip: {
|
|
1451
|
+
cn: 20,
|
|
1452
|
+
default: 40,
|
|
1453
|
+
ru: 20,
|
|
1454
|
+
},
|
|
1455
|
+
relay_public_key: "5AC884C1045BA0FF44142AC8DCA51B8A98C8F1CB4FEE36284AFBE92FCF594932",
|
|
1456
|
+
revoked_keys: ["11146342570456886677"],
|
|
1457
|
+
typical_pings: [
|
|
1458
|
+
["ams", "fra", 6],
|
|
1459
|
+
["vie", "waw", 10],
|
|
1460
|
+
],
|
|
1461
|
+
success: true,
|
|
1462
|
+
};
|
|
1463
|
+
},
|
|
1464
|
+
};
|
|
1465
|
+
|
|
1466
|
+
if (typeof handleGC[msgType] === "function") {
|
|
1467
|
+
try {
|
|
1468
|
+
await handleGC[msgType]({ appId, msgType, payload });
|
|
1469
|
+
} catch (e) {}
|
|
1470
|
+
} else {
|
|
1471
|
+
log(`receivedFromGC ${msgType} ${key}`);
|
|
1472
|
+
const results = Object.values(SteamProtoType)
|
|
1473
|
+
.map(function (p) {
|
|
1474
|
+
try {
|
|
1475
|
+
return new SteamProto(p).protoDecode(payload);
|
|
1476
|
+
} catch (e) {}
|
|
1477
|
+
})
|
|
1478
|
+
.filter(function (result) {
|
|
1479
|
+
return result && Object.keys(result).length;
|
|
1480
|
+
});
|
|
1481
|
+
log(key, results);
|
|
1482
|
+
results;
|
|
1453
1483
|
}
|
|
1454
1484
|
},
|
|
1455
1485
|
async loggedOn(loggedOnResponse) {
|
|
@@ -1666,12 +1696,14 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
1666
1696
|
callEvent(events.emailInfo, { address, validated });
|
|
1667
1697
|
},
|
|
1668
1698
|
async appLaunched() {
|
|
1669
|
-
|
|
1699
|
+
clearTimeout(_appLaunchedTimeout);
|
|
1700
|
+
_appLaunchedTimeout = setTimeout(function () {
|
|
1670
1701
|
state = getPlayingAppIds().length ? "InGame" : isInvisible ? "Invisible" : "Online";
|
|
1671
1702
|
}, 2000);
|
|
1672
1703
|
},
|
|
1673
1704
|
async appQuit() {
|
|
1674
|
-
|
|
1705
|
+
clearTimeout(_appQuitTimeout);
|
|
1706
|
+
_appQuitTimeout = setTimeout(function () {
|
|
1675
1707
|
state = getPlayingAppIds().length ? "InGame" : isInvisible ? "Invisible" : "Online";
|
|
1676
1708
|
}, 2000);
|
|
1677
1709
|
},
|
|
@@ -2127,19 +2159,42 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
2127
2159
|
callEvent(events.logOff);
|
|
2128
2160
|
events.logOff = [];
|
|
2129
2161
|
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
}
|
|
2136
|
-
if (_cleanNodeSteamFriendTimeout) {
|
|
2137
|
-
clearTimeout(_cleanNodeSteamFriendTimeout);
|
|
2138
|
-
}
|
|
2162
|
+
clearTimeout(_cleanNodeSteamUserTimeout);
|
|
2163
|
+
clearTimeout(_cleanNodeSteamLicensesTimeout);
|
|
2164
|
+
clearTimeout(_cleanNodeSteamFriendTimeout);
|
|
2165
|
+
clearTimeout(_appLaunchedTimeout);
|
|
2166
|
+
clearTimeout(_appQuitTimeout);
|
|
2139
2167
|
|
|
2140
2168
|
if (steamClient) {
|
|
2141
2169
|
steamClient.logOff();
|
|
2142
|
-
|
|
2170
|
+
|
|
2171
|
+
steamClient.limitations = null;
|
|
2172
|
+
steamClient.vac = null;
|
|
2173
|
+
steamClient.wallet = null;
|
|
2174
|
+
steamClient.emailInfo = null;
|
|
2175
|
+
steamClient.licenses = null;
|
|
2176
|
+
steamClient.gifts = null;
|
|
2177
|
+
|
|
2178
|
+
// Friends and users info
|
|
2179
|
+
steamClient.users = {};
|
|
2180
|
+
steamClient.groups = {};
|
|
2181
|
+
steamClient.chats = {};
|
|
2182
|
+
steamClient.myFriends = {};
|
|
2183
|
+
steamClient.myGroups = {};
|
|
2184
|
+
steamClient.myFriendGroups = {};
|
|
2185
|
+
steamClient.myNicknames = {};
|
|
2186
|
+
steamClient.steamServers = {};
|
|
2187
|
+
steamClient.playingState = { blocked: false, appid: 0 };
|
|
2188
|
+
steamClient._playingBlocked = false;
|
|
2189
|
+
steamClient._playingAppIds = [];
|
|
2190
|
+
|
|
2191
|
+
steamClient._gcTokens = []; // game connect tokens
|
|
2192
|
+
steamClient._activeAuthTickets = [];
|
|
2193
|
+
steamClient._contentServerCache = {};
|
|
2194
|
+
steamClient._contentServerTokens = {};
|
|
2195
|
+
steamClient._lastNotificationCounts = {};
|
|
2196
|
+
steamClient._richPresenceLocalization = {};
|
|
2197
|
+
steamClient._incomingMessageQueue = [];
|
|
2143
2198
|
|
|
2144
2199
|
function cleanSteamClient(obj, key) {
|
|
2145
2200
|
const value = obj[key];
|
|
@@ -2175,9 +2230,9 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
2175
2230
|
}
|
|
2176
2231
|
}
|
|
2177
2232
|
|
|
2178
|
-
for (const key in steamClient) {
|
|
2179
|
-
|
|
2180
|
-
}
|
|
2233
|
+
// for (const key in steamClient) {
|
|
2234
|
+
// cleanSteamClient(steamClient, key);
|
|
2235
|
+
// }
|
|
2181
2236
|
steamClient = null;
|
|
2182
2237
|
}
|
|
2183
2238
|
}
|
|
@@ -2606,7 +2661,7 @@ function SteamClient({ username, cookie, clientJsToken, isAutoRequestFreeLicense
|
|
|
2606
2661
|
}
|
|
2607
2662
|
|
|
2608
2663
|
function getPlayingAppIds() {
|
|
2609
|
-
return steamClient
|
|
2664
|
+
return steamClient?._playingAppIds || [];
|
|
2610
2665
|
}
|
|
2611
2666
|
|
|
2612
2667
|
async function requestJoinFriendData(token, version) {
|