steamutils 1.4.95 → 1.4.97

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1301,10 +1301,12 @@ export default class SteamUser {
1301
1301
  }
1302
1302
  } else if (redirectURL?.startsWith("https://steamcommunity.com/login/")) {
1303
1303
  console.error("Login first", originalURL, self._steamIdUser);
1304
- eventEmitter.emit("login_first", {
1305
- steamId: self._steamIdUser,
1306
- redirectURL,
1307
- });
1304
+ if (self._steamIdUser) {
1305
+ eventEmitter.emit("login_first", {
1306
+ steamId: self._steamIdUser,
1307
+ redirectURL,
1308
+ });
1309
+ }
1308
1310
 
1309
1311
  response = new ResponseError({
1310
1312
  loginFirst: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.4.95",
3
+ "version": "1.4.97",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",
package/steamproto.js CHANGED
@@ -1,35 +1,41 @@
1
- import path from "path";
2
- import { fileURLToPath } from "url";
3
- import Protobuf from "protobufjs";
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- export class SteamProto {
9
- constructor(proto) {
10
- this._proto = proto;
11
- }
12
-
13
- toProto() {
14
- const root = new Protobuf.Root().loadSync(path.join(`${__dirname}/protos/`, this._proto.filename), {
15
- keepCase: true,
16
- });
17
- return root[this._proto.name];
18
- }
19
-
20
- protoEncode(obj) {
21
- const protobuf = this.toProto();
22
- return protobuf.encode(protobuf.create(obj)).finish();
23
- }
24
-
25
- protoEncodeBase64(obj) {
26
- return this.protoEncode(obj).toString("base64");
27
- }
28
-
29
- protoDecode(obj) {
30
- const protobuf = this.toProto();
31
- return protobuf.toObject(protobuf.decode(obj), { defaults: true });
32
- }
33
- }
1
+ import path from "path";
2
+ import { fileURLToPath } from "url";
3
+ import Protobuf from "protobufjs";
34
4
 
35
- export const SteamProtoType = {};export const ESteamProto = {};ESteamProto.ECsgoGCMsg = {"k_EMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate":9104,"k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello":9109,"k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello":9110,"k_EMsgGCCStrike15_v2_ClientReportPlayer":9119,"k_EMsgGCCStrike15_v2_ClientCommendPlayer":9121,"k_EMsgGCCStrike15_v2_ClientReportResponse":9122,"k_EMsgGCCStrike15_v2_ClientCommendPlayerQuery":9123,"k_EMsgGCCStrike15_v2_ClientCommendPlayerQueryResponse":9124,"k_EMsgGCCStrike15_v2_ClientRequestPlayersProfile":9127,"k_EMsgGCCStrike15_v2_PlayersProfile":9128,"k_EMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment":9132,"k_EMsgGCCStrike15_v2_GC2ClientTextMsg":9134,"k_EMsgGCCStrike15_v2_MatchList":9139,"k_EMsgGCCStrike15_v2_ClientRequestJoinFriendData":9163,"k_EMsgGCCStrike15_v2_AcknowledgePenalty":9171,"k_EMsgGCCStrike15_v2_GC2ClientGlobalStats":9173,"k_EMsgGCCStrike15_v2_ClientLogonFatalError":9187,"k_EMsgGCCStrike15_v2_Party_Register":9189,"k_EMsgGCCStrike15_v2_Party_Search":9191,"k_EMsgGCCStrike15_v2_Party_Invite":9192,"k_EMsgGCCStrike15_v2_Account_RequestCoPlays":9193,"k_EMsgGCCStrike15_v2_ClientGCRankUpdate":9194,"k_EMsgGCCStrike15_v2_GetEventFavorites_Response":9203,"k_EMsgGCCStrike15_ClientDeepStats":9210,"k_EMsgGCCStrike15_StartAgreementSessionInGame":9211,"k_EMsgGCCStrike15_v2_ClientRedeemFreeReward":9219,"k_EMsgGCCStrike15_v2_ClientNetworkConfig":9220};ESteamProto.EGCItemMsg = {"k_EMsgGCStoreGetUserData":2500,"k_EMsgGCStoreGetUserDataResponse":2501,"k_EMsgGCStorePurchaseFinalize":2504,"k_EMsgGCStorePurchaseFinalizeResponse":2505,"k_EMsgGCStorePurchaseCancel":2506,"k_EMsgGCStorePurchaseCancelResponse":2507,"k_EMsgGCStorePurchaseInit":2510,"k_EMsgGCStorePurchaseInitResponse":2511};ESteamProto.EMsg = {"k_EMsgClientChatInvite":800,"k_EMsgGCHInviteUserToLobby":2238,"k_EMsgClientRequestedClientStats":5480,"k_EMsgClientMMSCreateLobby":6601,"k_EMsgClientMMSCreateLobbyResponse":6602,"k_EMsgClientMMSJoinLobby":6603,"k_EMsgClientMMSSetLobbyData":6609,"k_EMsgClientMMSSetLobbyDataResponse":6610,"k_EMsgClientMMSGetLobbyData":6611,"k_EMsgClientMMSLobbyData":6612,"k_EMsgClientMMSInviteToLobby":6621};ESteamProto.EGCBaseClientMsg = {"k_EMsgGCClientWelcome":4004,"k_EMsgGCClientHello":4006,"k_EMsgGCClientConnectionStatus":4009};SteamProtoType.CMsgGCStorePurchaseInit = {"name":"CMsgGCStorePurchaseInit","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseInitResponse = {"name":"CMsgGCStorePurchaseInitResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconGameAccountClient = {"name":"CSOEconGameAccountClient","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOItemRecipe = {"name":"CSOItemRecipe","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItem = {"name":"CSOEconItem","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgStoreGetUserData = {"name":"CMsgStoreGetUserData","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgStoreGetUserDataResponse = {"name":"CMsgStoreGetUserDataResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItemDropRateBonus = {"name":"CSOEconItemDropRateBonus","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItemLeagueViewPass = {"name":"CSOEconItemLeagueViewPass","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItemEventTicket = {"name":"CSOEconItemEventTicket","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseCancel = {"name":"CMsgGCStorePurchaseCancel","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseCancelResponse = {"name":"CMsgGCStorePurchaseCancelResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseFinalize = {"name":"CMsgGCStorePurchaseFinalize","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseFinalizeResponse = {"name":"CMsgGCStorePurchaseFinalizeResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconDefaultEquippedDefinitionInstanceClient = {"name":"CSOEconDefaultEquippedDefinitionInstanceClient","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate = {"name":"CMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello = {"name":"CMsgGCCStrike15_v2_MatchmakingGC2ClientHello","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientGCRankUpdate = {"name":"CMsgGCCStrike15_v2_ClientGCRankUpdate","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientReportPlayer = {"name":"CMsgGCCStrike15_v2_ClientReportPlayer","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientCommendPlayer = {"name":"CMsgGCCStrike15_v2_ClientCommendPlayer","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientReportResponse = {"name":"CMsgGCCStrike15_v2_ClientReportResponse","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientRequestJoinFriendData = {"name":"CMsgGCCStrike15_v2_ClientRequestJoinFriendData","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCstrike15_v2_ClientRedeemFreeReward = {"name":"CMsgGCCstrike15_v2_ClientRedeemFreeReward","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientNetworkConfig = {"name":"CMsgGCCStrike15_v2_ClientNetworkConfig","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_ClientDeepStats = {"name":"CMsgGCCStrike15_ClientDeepStats","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientRequestPlayersProfile = {"name":"CMsgGCCStrike15_v2_ClientRequestPlayersProfile","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_PlayersProfile = {"name":"CMsgGCCStrike15_v2_PlayersProfile","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment = {"name":"CMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_GC2ClientTextMsg = {"name":"CMsgGCCStrike15_v2_GC2ClientTextMsg","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_MatchList = {"name":"CMsgGCCStrike15_v2_MatchList","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOEconCoupon = {"name":"CSOEconCoupon","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOAccountItemPersonalStore = {"name":"CSOAccountItemPersonalStore","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOQuestProgress = {"name":"CSOQuestProgress","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOAccountSeasonalOperation = {"name":"CSOAccountSeasonalOperation","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOPersonaDataPublic = {"name":"CSOPersonaDataPublic","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_AcknowledgePenalty = {"name":"CMsgGCCStrike15_v2_AcknowledgePenalty","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientLogonFatalError = {"name":"CMsgGCCStrike15_v2_ClientLogonFatalError","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_Register = {"name":"CMsgGCCStrike15_v2_Party_Register","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_Search = {"name":"CMsgGCCStrike15_v2_Party_Search","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_SearchResults = {"name":"CMsgGCCStrike15_v2_Party_SearchResults","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_Invite = {"name":"CMsgGCCStrike15_v2_Party_Invite","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Account_RequestCoPlays = {"name":"CMsgGCCStrike15_v2_Account_RequestCoPlays","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_GetEventFavorites_Response = {"name":"CMsgGCCStrike15_v2_GetEventFavorites_Response","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgClientHello = {"name":"CMsgClientHello","filename":"csgo\\gcsdk_gcmessages.proto"};SteamProtoType.CMsgClientWelcome = {"name":"CMsgClientWelcome","filename":"csgo\\gcsdk_gcmessages.proto"};SteamProtoType.CMsgConnectionStatus = {"name":"CMsgConnectionStatus","filename":"csgo\\gcsdk_gcmessages.proto"};SteamProtoType.CPlayer_GetFriendsGameplayInfo_Request = {"name":"CPlayer_GetFriendsGameplayInfo_Request","filename":"csgo\\steammessages_player.steamworkssdk.proto"};SteamProtoType.CPlayer_GetFriendsGameplayInfo_Response = {"name":"CPlayer_GetFriendsGameplayInfo_Response","filename":"csgo\\steammessages_player.steamworkssdk.proto"};SteamProtoType.CAuthentication_RefreshToken_Revoke_Request = {"name":"CAuthentication_RefreshToken_Revoke_Request","filename":"steam\\steammessages_auth.steamclient.proto"};SteamProtoType.CAuthenticationSupport_QueryRefreshTokenByID_Request = {"name":"CAuthenticationSupport_QueryRefreshTokenByID_Request","filename":"steam\\steammessages_auth.steamclient.proto"};SteamProtoType.CMsgClientRequestedClientStats = {"name":"CMsgClientRequestedClientStats","filename":"steam\\steammessages_clientserver.proto"};SteamProtoType.CMsgClientUGSGetGlobalStats = {"name":"CMsgClientUGSGetGlobalStats","filename":"steam\\steammessages_clientserver_2.proto"};SteamProtoType.CMsgClientUGSGetGlobalStatsResponse = {"name":"CMsgClientUGSGetGlobalStatsResponse","filename":"steam\\steammessages_clientserver_2.proto"};SteamProtoType.CMsgClientMMSCreateLobby = {"name":"CMsgClientMMSCreateLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSCreateLobbyResponse = {"name":"CMsgClientMMSCreateLobbyResponse","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSJoinLobby = {"name":"CMsgClientMMSJoinLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSJoinLobbyResponse = {"name":"CMsgClientMMSJoinLobbyResponse","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSSetLobbyData = {"name":"CMsgClientMMSSetLobbyData","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSSetLobbyDataResponse = {"name":"CMsgClientMMSSetLobbyDataResponse","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSGetLobbyData = {"name":"CMsgClientMMSGetLobbyData","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSLobbyData = {"name":"CMsgClientMMSLobbyData","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSUserJoinedLobby = {"name":"CMsgClientMMSUserJoinedLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSInviteToLobby = {"name":"CMsgClientMMSInviteToLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CFriendMessages_SendMessage_Request = {"name":"CFriendMessages_SendMessage_Request","filename":"steam\\steammessages_friendmessages.steamclient.proto"};SteamProtoType.CFriendMessages_SendMessage_Response = {"name":"CFriendMessages_SendMessage_Response","filename":"steam\\steammessages_friendmessages.steamclient.proto"};SteamProtoType.CPlayer_GetPlayerLinkDetails_Request = {"name":"CPlayer_GetPlayerLinkDetails_Request","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.CPlayer_GetPlayerLinkDetails_Response = {"name":"CPlayer_GetPlayerLinkDetails_Response","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.ProfileTheme = {"name":"ProfileTheme","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.ProfilePreferences = {"name":"ProfilePreferences","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.CCheckout_GetFriendOwnershipForGifting_Response = {"name":"CCheckout_GetFriendOwnershipForGifting_Response","filename":"webui\\service_checkout.proto"};SteamProtoType.CFriendsList_GetFriendsList_Response = {"name":"CFriendsList_GetFriendsList_Response","filename":"webui\\service_friendslist.proto"};
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+
8
+ export class SteamProto {
9
+ constructor(proto) {
10
+ this._proto = proto;
11
+ }
12
+
13
+ toProto() {
14
+ const root = new Protobuf.Root().loadSync(path.join(`${__dirname}/protos/`, this._proto.filename), {
15
+ keepCase: true,
16
+ });
17
+ return root[this._proto.name];
18
+ }
19
+
20
+ protoEncode(obj) {
21
+ const protobuf = this.toProto();
22
+ return protobuf.encode(protobuf.create(obj)).finish();
23
+ }
24
+
25
+ protoEncodeBase64(obj) {
26
+ return this.protoEncode(obj).toString("base64");
27
+ }
28
+
29
+ protoDecode(obj) {
30
+ const protobuf = this.toProto();
31
+ try {
32
+ return protobuf.toObject(protobuf.decode(obj), { defaults: true });
33
+ } catch (e) {
34
+ console.error(`[${this._proto.name}] protoDecode 1`, typeof obj, obj);
35
+ console.error(`[${this._proto.name}] protoDecode 2`, e);
36
+ return null;
37
+ }
38
+ }
39
+ }
40
+
41
+ export const SteamProtoType = {};export const ESteamProto = {};ESteamProto.ECsgoGCMsg = {"k_EMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate":9104,"k_EMsgGCCStrike15_v2_MatchmakingClient2GCHello":9109,"k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello":9110,"k_EMsgGCCStrike15_v2_ClientReportPlayer":9119,"k_EMsgGCCStrike15_v2_ClientCommendPlayer":9121,"k_EMsgGCCStrike15_v2_ClientReportResponse":9122,"k_EMsgGCCStrike15_v2_ClientCommendPlayerQuery":9123,"k_EMsgGCCStrike15_v2_ClientCommendPlayerQueryResponse":9124,"k_EMsgGCCStrike15_v2_ClientRequestPlayersProfile":9127,"k_EMsgGCCStrike15_v2_PlayersProfile":9128,"k_EMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment":9132,"k_EMsgGCCStrike15_v2_GC2ClientTextMsg":9134,"k_EMsgGCCStrike15_v2_MatchList":9139,"k_EMsgGCCStrike15_v2_ClientRequestJoinFriendData":9163,"k_EMsgGCCStrike15_v2_AcknowledgePenalty":9171,"k_EMsgGCCStrike15_v2_GC2ClientGlobalStats":9173,"k_EMsgGCCStrike15_v2_ClientLogonFatalError":9187,"k_EMsgGCCStrike15_v2_Party_Register":9189,"k_EMsgGCCStrike15_v2_Party_Search":9191,"k_EMsgGCCStrike15_v2_Party_Invite":9192,"k_EMsgGCCStrike15_v2_Account_RequestCoPlays":9193,"k_EMsgGCCStrike15_v2_ClientGCRankUpdate":9194,"k_EMsgGCCStrike15_v2_GetEventFavorites_Response":9203,"k_EMsgGCCStrike15_ClientDeepStats":9210,"k_EMsgGCCStrike15_StartAgreementSessionInGame":9211,"k_EMsgGCCStrike15_v2_ClientNetworkConfig":9220};ESteamProto.EGCItemMsg = {"k_EMsgGCStoreGetUserData":2500,"k_EMsgGCStoreGetUserDataResponse":2501,"k_EMsgGCStorePurchaseFinalize":2504,"k_EMsgGCStorePurchaseFinalizeResponse":2505,"k_EMsgGCStorePurchaseCancel":2506,"k_EMsgGCStorePurchaseCancelResponse":2507,"k_EMsgGCStorePurchaseInit":2510,"k_EMsgGCStorePurchaseInitResponse":2511};ESteamProto.EMsg = {"k_EMsgClientChatInvite":800,"k_EMsgGCHInviteUserToLobby":2238,"k_EMsgClientRequestedClientStats":5480,"k_EMsgClientMMSCreateLobby":6601,"k_EMsgClientMMSCreateLobbyResponse":6602,"k_EMsgClientMMSJoinLobby":6603,"k_EMsgClientMMSSetLobbyData":6609,"k_EMsgClientMMSSetLobbyDataResponse":6610,"k_EMsgClientMMSGetLobbyData":6611,"k_EMsgClientMMSLobbyData":6612,"k_EMsgClientMMSInviteToLobby":6621};ESteamProto.EGCBaseClientMsg = {"k_EMsgGCClientWelcome":4004,"k_EMsgGCClientHello":4006,"k_EMsgGCClientConnectionStatus":4009};SteamProtoType.CMsgGCStorePurchaseInit = {"name":"CMsgGCStorePurchaseInit","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseInitResponse = {"name":"CMsgGCStorePurchaseInitResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconGameAccountClient = {"name":"CSOEconGameAccountClient","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOItemRecipe = {"name":"CSOItemRecipe","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItem = {"name":"CSOEconItem","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgStoreGetUserData = {"name":"CMsgStoreGetUserData","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgStoreGetUserDataResponse = {"name":"CMsgStoreGetUserDataResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItemDropRateBonus = {"name":"CSOEconItemDropRateBonus","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItemLeagueViewPass = {"name":"CSOEconItemLeagueViewPass","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconItemEventTicket = {"name":"CSOEconItemEventTicket","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseCancel = {"name":"CMsgGCStorePurchaseCancel","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseCancelResponse = {"name":"CMsgGCStorePurchaseCancelResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseFinalize = {"name":"CMsgGCStorePurchaseFinalize","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCStorePurchaseFinalizeResponse = {"name":"CMsgGCStorePurchaseFinalizeResponse","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CSOEconDefaultEquippedDefinitionInstanceClient = {"name":"CSOEconDefaultEquippedDefinitionInstanceClient","filename":"csgo\\base_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate = {"name":"CMsgGCCStrike15_v2_MatchmakingGC2ClientUpdate","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_MatchmakingGC2ClientHello = {"name":"CMsgGCCStrike15_v2_MatchmakingGC2ClientHello","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientGCRankUpdate = {"name":"CMsgGCCStrike15_v2_ClientGCRankUpdate","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientReportPlayer = {"name":"CMsgGCCStrike15_v2_ClientReportPlayer","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientCommendPlayer = {"name":"CMsgGCCStrike15_v2_ClientCommendPlayer","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientReportResponse = {"name":"CMsgGCCStrike15_v2_ClientReportResponse","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientRequestJoinFriendData = {"name":"CMsgGCCStrike15_v2_ClientRequestJoinFriendData","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCstrike15_v2_ClientRedeemFreeReward = {"name":"CMsgGCCstrike15_v2_ClientRedeemFreeReward","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientNetworkConfig = {"name":"CMsgGCCStrike15_v2_ClientNetworkConfig","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_ClientDeepStats = {"name":"CMsgGCCStrike15_ClientDeepStats","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientRequestPlayersProfile = {"name":"CMsgGCCStrike15_v2_ClientRequestPlayersProfile","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_PlayersProfile = {"name":"CMsgGCCStrike15_v2_PlayersProfile","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment = {"name":"CMsgGCCStrike15_v2_PlayerOverwatchCaseAssignment","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_GC2ClientTextMsg = {"name":"CMsgGCCStrike15_v2_GC2ClientTextMsg","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_MatchList = {"name":"CMsgGCCStrike15_v2_MatchList","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOEconCoupon = {"name":"CSOEconCoupon","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOAccountItemPersonalStore = {"name":"CSOAccountItemPersonalStore","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOQuestProgress = {"name":"CSOQuestProgress","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOAccountSeasonalOperation = {"name":"CSOAccountSeasonalOperation","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CSOPersonaDataPublic = {"name":"CSOPersonaDataPublic","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_AcknowledgePenalty = {"name":"CMsgGCCStrike15_v2_AcknowledgePenalty","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_ClientLogonFatalError = {"name":"CMsgGCCStrike15_v2_ClientLogonFatalError","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_Register = {"name":"CMsgGCCStrike15_v2_Party_Register","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_Search = {"name":"CMsgGCCStrike15_v2_Party_Search","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_SearchResults = {"name":"CMsgGCCStrike15_v2_Party_SearchResults","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Party_Invite = {"name":"CMsgGCCStrike15_v2_Party_Invite","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_Account_RequestCoPlays = {"name":"CMsgGCCStrike15_v2_Account_RequestCoPlays","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgGCCStrike15_v2_GetEventFavorites_Response = {"name":"CMsgGCCStrike15_v2_GetEventFavorites_Response","filename":"csgo\\cstrike15_gcmessages.proto"};SteamProtoType.CMsgClientHello = {"name":"CMsgClientHello","filename":"csgo\\gcsdk_gcmessages.proto"};SteamProtoType.CMsgClientWelcome = {"name":"CMsgClientWelcome","filename":"csgo\\gcsdk_gcmessages.proto"};SteamProtoType.CMsgConnectionStatus = {"name":"CMsgConnectionStatus","filename":"csgo\\gcsdk_gcmessages.proto"};SteamProtoType.CPlayer_GetFriendsGameplayInfo_Request = {"name":"CPlayer_GetFriendsGameplayInfo_Request","filename":"csgo\\steammessages_player.steamworkssdk.proto"};SteamProtoType.CPlayer_GetFriendsGameplayInfo_Response = {"name":"CPlayer_GetFriendsGameplayInfo_Response","filename":"csgo\\steammessages_player.steamworkssdk.proto"};SteamProtoType.CAuthentication_RefreshToken_Revoke_Request = {"name":"CAuthentication_RefreshToken_Revoke_Request","filename":"steam\\steammessages_auth.steamclient.proto"};SteamProtoType.CAuthenticationSupport_QueryRefreshTokenByID_Request = {"name":"CAuthenticationSupport_QueryRefreshTokenByID_Request","filename":"steam\\steammessages_auth.steamclient.proto"};SteamProtoType.CMsgClientRequestedClientStats = {"name":"CMsgClientRequestedClientStats","filename":"steam\\steammessages_clientserver.proto"};SteamProtoType.CMsgClientUGSGetGlobalStats = {"name":"CMsgClientUGSGetGlobalStats","filename":"steam\\steammessages_clientserver_2.proto"};SteamProtoType.CMsgClientUGSGetGlobalStatsResponse = {"name":"CMsgClientUGSGetGlobalStatsResponse","filename":"steam\\steammessages_clientserver_2.proto"};SteamProtoType.CMsgClientMMSCreateLobby = {"name":"CMsgClientMMSCreateLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSCreateLobbyResponse = {"name":"CMsgClientMMSCreateLobbyResponse","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSJoinLobby = {"name":"CMsgClientMMSJoinLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSJoinLobbyResponse = {"name":"CMsgClientMMSJoinLobbyResponse","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSSetLobbyData = {"name":"CMsgClientMMSSetLobbyData","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSSetLobbyDataResponse = {"name":"CMsgClientMMSSetLobbyDataResponse","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSGetLobbyData = {"name":"CMsgClientMMSGetLobbyData","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSLobbyData = {"name":"CMsgClientMMSLobbyData","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSUserJoinedLobby = {"name":"CMsgClientMMSUserJoinedLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CMsgClientMMSInviteToLobby = {"name":"CMsgClientMMSInviteToLobby","filename":"steam\\steammessages_clientserver_mms.proto"};SteamProtoType.CFriendMessages_SendMessage_Request = {"name":"CFriendMessages_SendMessage_Request","filename":"steam\\steammessages_friendmessages.steamclient.proto"};SteamProtoType.CFriendMessages_SendMessage_Response = {"name":"CFriendMessages_SendMessage_Response","filename":"steam\\steammessages_friendmessages.steamclient.proto"};SteamProtoType.CPlayer_GetPlayerLinkDetails_Request = {"name":"CPlayer_GetPlayerLinkDetails_Request","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.CPlayer_GetPlayerLinkDetails_Response = {"name":"CPlayer_GetPlayerLinkDetails_Response","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.ProfileTheme = {"name":"ProfileTheme","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.ProfilePreferences = {"name":"ProfilePreferences","filename":"steam\\steammessages_player.steamclient.proto"};SteamProtoType.CCheckout_GetFriendOwnershipForGifting_Response = {"name":"CCheckout_GetFriendOwnershipForGifting_Response","filename":"webui\\service_checkout.proto"};SteamProtoType.CFriendsList_GetFriendsList_Response = {"name":"CFriendsList_GetFriendsList_Response","filename":"webui\\service_friendslist.proto"};
package/utils.js CHANGED
@@ -985,3 +985,40 @@ export async function loginWithCredentials({ username, password, timeoutMs = 120
985
985
  }
986
986
  });
987
987
  }
988
+
989
+ function calculateAccountXP(currentXp, xpEarnedThisWeek, xpEarned, nextXp) {
990
+ return (
991
+ (() => {
992
+ if (!Number.isFinite(nextXp)) {
993
+ return;
994
+ }
995
+
996
+ currentXp = currentXp || 0;
997
+ if (currentXp === nextXp) {
998
+ return;
999
+ }
1000
+
1001
+ const update = { currentXp: nextXp };
1002
+ if (nextXp < currentXp) {
1003
+ update.xpExceed = Date.now();
1004
+ }
1005
+ const resetDay = getBonusXpTimeRefresh().format("YYYY-MM-DD");
1006
+ const isWeekReset = xpEarnedThisWeek !== resetDay;
1007
+ let xpEarnedThisRank = nextXp - currentXp;
1008
+ if (xpEarnedThisRank < 0) {
1009
+ xpEarnedThisRank += 5000;
1010
+ }
1011
+ if (isWeekReset) {
1012
+ update.xpEarnedThisWeek = resetDay;
1013
+ update.xpEarned = xpEarnedThisRank;
1014
+ } else {
1015
+ update.xpEarned = (xpEarned || 0) + xpEarnedThisRank;
1016
+ if (xpEarnedThisRank === 0) {
1017
+ return;
1018
+ }
1019
+ }
1020
+
1021
+ return update;
1022
+ })() || {}
1023
+ );
1024
+ }