Skip to content

Commit 1eb24c4

Browse files
committed
SteamAccountServiceImpl
1 parent 3f12e97 commit 1eb24c4

12 files changed

+1886
-2
lines changed

src/BD.SteamClient.Models/BD.SteamClient.Models.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18+
<PackageReference Include="BD.Common" />
19+
<PackageReference Include="BD.Common.Primitives" />
20+
<PackageReference Include="Newtonsoft.Json" />
1821
<PackageReference Include="Google.Protobuf" />
1922
<PackageReference Include="Google.Protobuf.Tools" />
2023
</ItemGroup>
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
namespace BD.SteamClient.Enums
2+
{
3+
public enum SteamResult
4+
{
5+
Invalid = 0,
6+
OK = 1,
7+
Fail = 2,
8+
NoConnection = 3,
9+
InvalidPassword = 5,
10+
LoggedInElsewhere = 6,
11+
InvalidProtocolVer = 7,
12+
InvalidParam = 8,
13+
FileNotFound = 9,
14+
Busy = 10,
15+
InvalidState = 11,
16+
InvalidName = 12,
17+
InvalidEmail = 13,
18+
DuplicateName = 14,
19+
AccessDenied = 15,
20+
Timeout = 16,
21+
Banned = 17,
22+
AccountNotFound = 18,
23+
InvalidSteamID = 19,
24+
ServiceUnavailable = 20,
25+
NotLoggedOn = 21,
26+
Pending = 22,
27+
EncryptionFailure = 23,
28+
InsufficientPrivilege = 24,
29+
LimitExceeded = 25,
30+
Revoked = 26,
31+
Expired = 27,
32+
AlreadyRedeemed = 28,
33+
DuplicateRequest = 29,
34+
AlreadyOwned = 30,
35+
IPNotFound = 31,
36+
PersistFailed = 32,
37+
LockingFailed = 33,
38+
LogonSessionReplaced = 34,
39+
ConnectFailed = 35,
40+
HandshakeFailed = 36,
41+
IOFailure = 37,
42+
RemoteDisconnect = 38,
43+
ShoppingCartNotFound = 39,
44+
Blocked = 40,
45+
Ignored = 41,
46+
NoMatch = 42,
47+
AccountDisabled = 43,
48+
ServiceReadOnly = 44,
49+
AccountNotFeatured = 45,
50+
AdministratorOK = 46,
51+
ContentVersion = 47,
52+
TryAnotherCM = 48,
53+
PasswordRequiredToKickSession = 49,
54+
AlreadyLoggedInElsewhere = 50,
55+
Suspended = 51,
56+
Cancelled = 52,
57+
DataCorruption = 53,
58+
DiskFull = 54,
59+
RemoteCallFailed = 55,
60+
PasswordUnset = 56,
61+
ExternalAccountUnlinked = 57,
62+
PSNTicketInvalid = 58,
63+
ExternalAccountAlreadyLinked = 59,
64+
RemoteFileConflict = 60,
65+
IllegalPassword = 61,
66+
SameAsPreviousValue = 62,
67+
AccountLogonDenied = 63,
68+
CannotUseOldPassword = 64,
69+
InvalidLoginAuthCode = 65,
70+
AccountLogonDeniedNoMail = 66,
71+
HardwareNotCapableOfIPT = 67,
72+
IPTInitError = 68,
73+
ParentalControlRestricted = 69,
74+
FacebookQueryError = 70,
75+
ExpiredLoginAuthCode = 71,
76+
IPLoginRestrictionFailed = 72,
77+
AccountLockedDown = 73,
78+
AccountLogonDeniedVerifiedEmailRequired = 74,
79+
NoMatchingURL = 75,
80+
BadResponse = 76,
81+
RequirePasswordReEntry = 77,
82+
ValueOutOfRange = 78,
83+
UnexpectedError = 79,
84+
Disabled = 80,
85+
InvalidCEGSubmission = 81,
86+
RestrictedDevice = 82,
87+
RegionLocked = 83,
88+
RateLimitExceeded = 84,
89+
AccountLoginDeniedNeedTwoFactor = 85,
90+
ItemDeleted = 86,
91+
AccountLoginDeniedThrottle = 87,
92+
TwoFactorCodeMismatch = 88,
93+
TwoFactorActivationCodeMismatch = 89,
94+
AccountAssociatedToMultiplePartners = 90,
95+
NotModified = 91,
96+
NoMobileDevice = 92,
97+
TimeNotSynced = 93,
98+
SMSCodeFailed = 94,
99+
AccountLimitExceeded = 95,
100+
AccountActivityLimitExceeded = 96,
101+
PhoneActivityLimitExceeded = 97,
102+
RefundToWallet = 98,
103+
EmailSendFailure = 99,
104+
NotSettled = 100,
105+
NeedCaptcha = 101,
106+
GSLTDenied = 102,
107+
GSOwnerDenied = 103,
108+
InvalidItemType = 104,
109+
IPBanned = 105,
110+
GSLTExpired = 106,
111+
InsufficientFunds = 107,
112+
TooManyPending = 108,
113+
NoSiteLicensesFound = 109,
114+
WGNetworkSendExceeded = 110,
115+
AccountNotFriends = 111,
116+
LimitedUserAccount = 112,
117+
CantRemoveItem = 113,
118+
AccountDeleted = 114,
119+
ExistingUserCancelledLicense = 115,
120+
CommunityCooldown = 116,
121+
NoLauncherSpecified = 117,
122+
MustAgreeToSSA = 118,
123+
LauncherMigrated = 119,
124+
SteamRealmMismatch = 120,
125+
InvalidSignature = 121,
126+
ParseFailure = 122,
127+
NoVerifiedPhone = 123,
128+
}
129+
130+
public enum PurchaseResultDetail
131+
{
132+
NoDetail = 0,
133+
AVSFailure = 1,
134+
InsufficientFunds = 2,
135+
ContactSupport = 3,
136+
Timeout = 4,
137+
InvalidPackage = 5,
138+
InvalidPaymentMethod = 6,
139+
InvalidData = 7,
140+
OthersInProgress = 8,
141+
AlreadyPurchased = 9,
142+
WrongPrice = 10,
143+
FraudCheckFailed = 11,
144+
CancelledByUser = 12,
145+
RestrictedCountry = 13,
146+
BadActivationCode = 14,
147+
DuplicateActivationCode = 15,
148+
UseOtherPaymentMethod = 16,
149+
UseOtherFunctionSource = 17,
150+
InvalidShippingAddress = 18,
151+
RegionNotSupported = 19,
152+
AcctIsBlocked = 20,
153+
AcctNotVerified = 21,
154+
InvalidAccount = 22,
155+
StoreBillingCountryMismatch = 23,
156+
DoesNotOwnRequiredApp = 24,
157+
CanceledByNewTransaction = 25,
158+
ForceCanceledPending = 26,
159+
FailCurrencyTransProvider = 27,
160+
FailedCyberCafe = 28,
161+
NeedsPreApproval = 29,
162+
PreApprovalDenied = 30,
163+
WalletCurrencyMismatch = 31,
164+
EmailNotValidated = 32,
165+
ExpiredCard = 33,
166+
TransactionExpired = 34,
167+
WouldExceedMaxWallet = 35,
168+
MustLoginPS3AppForPurchase = 36,
169+
CannotShipToPOBox = 37,
170+
InsufficientInventory = 38,
171+
CannotGiftShippedGoods = 39,
172+
CannotShipInternationally = 40,
173+
BillingAgreementCancelled = 41,
174+
InvalidCoupon = 42,
175+
ExpiredCoupon = 43,
176+
AccountLocked = 44,
177+
OtherAbortableInProgress = 45,
178+
ExceededSteamLimit = 46,
179+
OverlappingPackagesInCart = 47,
180+
NoWallet = 48,
181+
NoCachedPaymentMethod = 49,
182+
CannotRedeemCodeFromClient = 50,
183+
PurchaseAmountNoSupportedByProvider = 51,
184+
OverlappingPackagesInPendingTransaction = 52,
185+
RateLimited = 53,
186+
OwnsExcludedApp = 54,
187+
CreditCardBinMismatchesType = 55,
188+
CartValueTooHigh = 56,
189+
BillingAgreementAlreadyExists = 57,
190+
POSACodeNotActivated = 58,
191+
CannotShipToCountry = 59,
192+
HungTransactionCancelled = 60,
193+
PaypalInternalError = 61,
194+
UnknownGlobalCollectError = 62,
195+
InvalidTaxAddress = 63,
196+
PhysicalProductLimitExceeded = 64,
197+
PurchaseCannotBeReplayed = 65,
198+
DelayedCompletion = 66,
199+
BundleTypeCannotBeGifted = 67,
200+
BlockedByUSGov = 68,
201+
ItemsReservedForCommercialUse = 69,
202+
GiftAlreadyOwned = 70,
203+
GiftInvalidForRecipientRegion = 71,
204+
GiftPricingImbalance = 72,
205+
GiftRecipientNotSpecified = 73,
206+
ItemsNotAllowedForCommercialUse = 74,
207+
BusinessStoreCountryCodeMismatch = 75,
208+
UserAssociatedWithManyCafes = 76,
209+
UserNotAssociatedWithCafe = 77,
210+
AddressInvalid = 78,
211+
CreditCardNumberInvalid = 79,
212+
CannotShipToMilitaryPostOffice = 80,
213+
BillingNameInvalidResemblesCreditCard = 81,
214+
PaymentMethodTemporarilyUnavailable = 82,
215+
PaymentMethodNotSupportedForProduct = 83,
216+
}
217+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace BD.SteamClient.Models;
8+
9+
public sealed class CurrencyData
10+
{
11+
public string? Display { get; set; }
12+
13+
public string? CurrencyCode { get; set; }
14+
}
15+
16+
public sealed class CursorData
17+
{
18+
[JsonPropertyName("wallet_txnid")]
19+
public string? WalletTxnid { get; set; }
20+
21+
[JsonPropertyName("timestamp_newest")]
22+
public long TimestampNewest { get; set; }
23+
24+
[JsonPropertyName("balance")]
25+
public string? Balance { get; set; }
26+
27+
[JsonPropertyName("currency")]
28+
public int Currency { get; set; }
29+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
namespace BD.SteamClient.Models;
2+
3+
/// <summary>
4+
/// 账户历史数据返回值
5+
/// </summary>
6+
public class HistoryParseResponse
7+
{
8+
/// <summary>未知</summary>
9+
public int Unknown;
10+
11+
/// <summary>商店购买</summary>
12+
public int StorePurchase;
13+
14+
/// <summary>商店购买[余额]</summary>
15+
public int StorePurchaseWallet;
16+
17+
/// <summary>礼物购买</summary>
18+
public int GiftPurchase;
19+
20+
/// <summary>礼物购买[余额]</summary>
21+
public int GiftPurchaseWallet;
22+
23+
/// <summary>市场购买</summary>
24+
public int MarketPurchase;
25+
26+
/// <summary>市场出售</summary>
27+
public int MarketSelling;
28+
29+
/// <summary>游戏内购</summary>
30+
public int InGamePurchase;
31+
32+
/// <summary>退款</summary>
33+
public int RefundPurchase;
34+
35+
/// <summary>退款[余额]</summary>
36+
public int RefundPurchaseWallet;
37+
38+
/// <summary>购买余额</summary>
39+
public int WalletPurchase;
40+
41+
/// <summary>其他</summary>
42+
public int Other;
43+
44+
public static HistoryParseResponse operator +(HistoryParseResponse a, HistoryParseResponse b)
45+
{
46+
HistoryParseResponse result = new()
47+
{
48+
Unknown = a.Unknown + b.Unknown,
49+
StorePurchase = a.StorePurchase + b.StorePurchase,
50+
StorePurchaseWallet = a.StorePurchaseWallet + b.StorePurchaseWallet,
51+
GiftPurchase = a.GiftPurchase + b.GiftPurchase,
52+
GiftPurchaseWallet = a.GiftPurchaseWallet + b.GiftPurchaseWallet,
53+
MarketPurchase = a.MarketPurchase + b.MarketPurchase,
54+
MarketSelling = a.MarketSelling + b.MarketSelling,
55+
InGamePurchase = a.InGamePurchase + b.InGamePurchase,
56+
RefundPurchase = a.RefundPurchase + b.RefundPurchase,
57+
RefundPurchaseWallet = a.RefundPurchaseWallet + b.RefundPurchaseWallet,
58+
WalletPurchase = a.WalletPurchase + b.WalletPurchase,
59+
Other = a.Other + b.Other,
60+
};
61+
return result;
62+
}
63+
}

0 commit comments

Comments
 (0)