-
Notifications
You must be signed in to change notification settings - Fork 1
/
SteamApi.h
4060 lines (3405 loc) · 181 KB
/
SteamApi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include <stdio.h>
#define k_SteamMusicNameMaxLength 255
#define k_SteamMusicPNGMaxLength 65535
typedef char int8;
typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
typedef int int32;
typedef unsigned int uint32;
typedef long long int64;
typedef unsigned long long uint64;
typedef uint64 unknown_ret;
typedef int32 HSteamPipe;
typedef int32 HSteamUser;
typedef int32 HSteamCall;
typedef uint32 HAuthTicket;
typedef uint32 AccountID_t;
typedef uint64 SteamAPICall_t;
typedef uint64 PublishedFileId_t;
typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket()
typedef uint32 SNetListenSocket_t; // CreateListenSocket()
typedef uint32 CellID_t;
typedef uint32 AppId_t;
typedef uint32 DepotId_t;
typedef int32 HNewItemRequest;
typedef uint64 ItemID;
typedef uint32 HTTPRequestHandle;
typedef uint32 ScreenshotHandle;
typedef uint64 ClientUnifiedMessageHandle;
typedef uint32 HHTMLBrowser;
typedef uint64 UGCHandle_t;
typedef uint64 UGCFileWriteStreamHandle_t;
typedef uint64 PublishedFileUpdateHandle_t;
const DepotId_t k_uDepotIdInvalid = 0x0;
const AppId_t k_uAppIdInvalid = 0x0;
const AppId_t k_nGameIDNotepad = 65535;
const AppId_t k_nGameIDCSSTestApp = 65534;
const AppId_t k_nGameIDDRMTestApp_Static = 6710;
const AppId_t k_nGameIDDRMTestApp_Blob = 6711;
const AppId_t k_nGameIDDRMTestApp_Dynamic = 6712;
const AppId_t k_nGameIDDRMTestApp_SDK = 6713;
const AppId_t k_nGameIDWinUI = 7;
const AppId_t k_nGameIDWinUI2 = 8;
const AppId_t k_nGameIDCS = 10;
const AppId_t k_nGameIDTFC = 20;
const AppId_t k_nGameIDDOD = 30;
const AppId_t k_nGameIDDMC = 40;
const AppId_t k_nGameIDOpFor = 50;
const AppId_t k_nGameIDRicochet = 60;
const AppId_t k_nGameIDHL1 = 70;
const AppId_t k_nGameIDCZero = 80;
const AppId_t k_nGameIDCSBeta = 150;
const AppId_t k_nGameIDMacVAC = 160;
const AppId_t k_nGameIDWinVAC = 202;
const AppId_t k_nGameIDScreenshots = 760;
const AppId_t k_nGameDRMTest = 199;
const AppId_t k_nGameIDBaseSourceSDK = 215;
const AppId_t k_nGameIDHL2 = 220;
const AppId_t k_nDepotHL2Buka = 235;
const AppId_t k_nGameIDCSS = 240;
const AppId_t k_nGameIDCSSBeta = 260;
const AppId_t k_nGameHL1SRC = 280;
const AppId_t k_nGameIDDODSRC = 300;
const AppId_t k_nGameIDHL2DM = 320;
const AppId_t k_nGameIDPortal = 400;
const AppId_t k_nGameIDHL2EP2 = 420;
const AppId_t k_nGameIDTF2 = 440;
const AppId_t k_nGameIDL4D = 500;
const AppId_t k_nGameIDL4DDemo = 530;
const AppId_t k_nGameIDL4D2 = 550;
const AppId_t k_nGameIDASW = 630;
const AppId_t k_nGameIDTF2Staging = 810;
const AppId_t k_nGameIDPortal2Main = 852;
const AppId_t k_nGameIDPortal2 = 620;
const AppId_t k_nGameIDASWMain = 877;
const AppId_t k_nGameIDDOTA = 882;
const AppId_t k_nGameIDASWStaging = 886;
const AppId_t k_nGameIDRedOrchestra = 1200;
const AppId_t k_nGameIDRedOrchestraBeta = 1210;
const AppId_t k_nGameIDKillingFloor = 1250;
const AppId_t k_nGameIDSin1 = 1309;
const AppId_t k_nGameIDEarth2160 = 1900;
const AppId_t k_nGameIDTheShip = 2400;
const AppId_t k_nGameIDTheShipBeta = 2410;
const AppId_t k_nGameIDDarkMessiahSP = 2100;
const AppId_t k_nGameIDDarkMessiahMPBeta = 2110;
const AppId_t k_nGameIDDarkMessiahMP = 2115;
const AppId_t k_nGameIDDarkMessiahSPDemo = 2120;
const AppId_t k_nGameIDDarkMessiahFix = 2130;
const AppId_t k_nGameRaceWTCC = 4230;
const AppId_t k_nGameIDLostPlanetOld = 6500;
const AppId_t k_nGameIDLostPlanet = 6510;
const AppId_t k_nGameIDNBA2K9 = 7740;
const AppId_t k_nGameIDCallofDuty4 = 7940;
const AppId_t k_nMLBFrontOfficeManager = 7780;
const AppId_t k_nGameIDMW2SP = 10180;
const AppId_t k_nGameIDMW2MP = 10190;
const AppId_t k_nGameIDIW5SP = 42680;
const AppId_t k_nGameIDIW5MP = 42690;
const AppId_t k_nGameIDCODBLOPSSP = 42700;
const AppId_t k_nGameIDCODBLOPSMP = 42710;
const AppId_t k_nGameIDEmpireTotalWar = 10500;
const AppId_t k_nGameCSSOnline = 11600;
const AppId_t k_nGameIDFirstSource = 200;
const AppId_t k_nGameIDLastSource = 999;
const AppId_t k_nGameIDFirstGoldSource = 10;
const AppId_t k_nGameIDLastGoldSource = 199;
const AppId_t k_nGameIDFirstNonSource = 1000;
const AppId_t k_nGameIDMax = 2147483647;
const AppId_t k_nGameIDStress = 30020;
const AppId_t k_nGameIDGCTest = 30100;
const AppId_t k_nAppATIDriver_Vista7_32 = 61800;
const AppId_t k_nAppATIDriver_Vista7_64 = 61810;
const AppId_t k_nAppATIDriver_XP_32 = 61820;
const AppId_t k_nAppATIDriver_XP_64 = 61830;
// RTime32
// We use this 32 bit time representing real world time.
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
typedef uint32 RTime32;
const RTime32 k_RTime32Nil = 0;
const RTime32 k_RTime32MinValid = 10;
const RTime32 k_RTime32Infinite = 2147483647;
const uint32 INVALID_HTTMLBROWSER = 0;
const CellID_t k_uCellIDInvalid = 0xFFFFFFFF;
const SteamAPICall_t k_uAPICallInvalid = 0;
const HAuthTicket k_HAuthTicketInvalid = 0;
const unsigned int k_unSteamAccountIDMask = 0xFFFFFFFF;
const unsigned int k_unSteamAccountInstanceMask = 0x000FFFFF;
// we allow 3 simultaneous user account instances right now, 1= desktop, 2 = console, 4 = web, 0 = all
const unsigned int k_unSteamUserDesktopInstance = 1;
const unsigned int k_unSteamUserConsoleInstance = 2;
const unsigned int k_unSteamUserWebInstance = 4;
// General result codes
typedef enum EResult
{
k_EResultOK = 1, // success
k_EResultFail = 2, // generic failure
k_EResultNoConnection = 3, // no/failed network connection
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
k_EResultInvalidPassword = 5, // password/ticket is invalid
k_EResultLoggedInElsewhere = 6, // same user logged in elsewhere
k_EResultInvalidProtocolVer = 7, // protocol version is incorrect
k_EResultInvalidParam = 8, // a parameter is incorrect
k_EResultFileNotFound = 9, // file was not found
k_EResultBusy = 10, // called method busy - action not taken
k_EResultInvalidState = 11, // called object was in an invalid state
k_EResultInvalidName = 12, // name is invalid
k_EResultInvalidEmail = 13, // email is invalid
k_EResultDuplicateName = 14, // name is not unique
k_EResultAccessDenied = 15, // access is denied
k_EResultTimeout = 16, // operation timed out
k_EResultBanned = 17, // VAC2 banned
k_EResultAccountNotFound = 18, // account not found
k_EResultInvalidSteamID = 19, // steamID is invalid
k_EResultServiceUnavailable = 20, // The requested service is currently unavailable
k_EResultNotLoggedOn = 21, // The user is not logged on
k_EResultPending = 22, // Request is pending (may be in process, or waiting on third party)
k_EResultEncryptionFailure = 23, // Encryption or Decryption failed
k_EResultInsufficientPrivilege = 24, // Insufficient privilege
k_EResultLimitExceeded = 25, // Too much of a good thing
k_EResultRevoked = 26, // Access has been revoked (used for revoked guest passes)
k_EResultExpired = 27, // License/Guest pass the user is trying to access is expired
k_EResultAlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again
k_EResultDuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time
k_EResultAlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user
k_EResultIPNotFound = 31, // IP address not found
k_EResultPersistFailed = 32, // failed to write change to the data store
k_EResultLockingFailed = 33, // failed to acquire access lock for this operation
k_EResultLogonSessionReplaced = 34,
k_EResultConnectFailed = 35,
k_EResultHandshakeFailed = 36,
k_EResultIOFailure = 37,
k_EResultRemoteDisconnect = 38,
k_EResultShoppingCartNotFound = 39, // failed to find the shopping cart requested
k_EResultBlocked = 40, // a user didn't allow it
k_EResultIgnored = 41, // target is ignoring sender
k_EResultNoMatch = 42, // nothing matching the request found
k_EResultAccountDisabled = 43,
k_EResultServiceReadOnly = 44, // this service is not accepting content changes right now
k_EResultAccountNotFeatured = 45, // account doesn't have value, so this feature isn't available
k_EResultAdministratorOK = 46, // allowed to take this action, but only because requester is admin
k_EResultContentVersion = 47, // A Version mismatch in content transmitted within the Steam protocol.
k_EResultTryAnotherCM = 48, // The current CM can't service the user making a request, user should try another.
k_EResultPasswordRequiredToKickSession = 49, // You are already logged in elsewhere, this cached credential login has failed.
k_EResultAlreadyLoggedInElsewhere = 50, // You are already logged in elsewhere, you must wait
k_EResultSuspended = 51, // Long running operation (content download) suspended/paused
k_EResultCancelled = 52, // Operation canceled (typically by user: content download)
k_EResultDataCorruption = 53, // Operation canceled because data is ill formed or unrecoverable
k_EResultDiskFull = 54, // Operation canceled - not enough disk space.
k_EResultRemoteCallFailed = 55, // an remote call or IPC call failed
k_EResultPasswordUnset = 56, // Password could not be verified as it's unset server side
k_EResultPSNAccountUnlinked = 57, // Attempt to logon from a PS3 failed because the PSN online id is not linked to a Steam account
k_EResultPSNTicketInvalid = 58, // PSN ticket was invalid
k_EResultPSNAccountAlreadyLinked = 59, // PSN account is already linked to some other account, must explicitly request to replace/delete the link first
k_EResultRemoteFileConflict = 60, // The sync cannot resume due to a conflict between the local and remote files
k_EResultIllegalPassword = 61, // The requested new password is not legal
k_EResultSameAsPreviousValue = 62, // new value is the same as the old one ( secret question and answer )
k_EResultAccountLogonDenied = 63, // account login denied due to 2nd factor authentication failure
k_EResultCannotUseOldPassword = 64, // The requested new password is not legal
k_EResultInvalidLoginAuthCode = 65, // account login denied due to auth code invalid
k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent
k_EResultHardwareNotCapableOfIPT = 67, //
k_EResultIPTInitError = 68, //
k_EResultParentalControlRestrictions = 69, // Operation failed due to parental control restrictions for current user
k_EResultFacebookQueryError = 70, // Facebook query returned an error
k_EResultExpiredLoginAuthCode = 71, // Expired Login Auth Code
k_EResultIPLoginRestrictionFailed = 72, // IP Login Restriction Failed
k_EResultAccountLockedDown = 73, // Account Locked Down
k_EResultAccountLogonDeniedVerifiedEmailRequired = 74, // Account Logon Denied Verified Email Required
k_EResultNoMatchingURL = 75, // No matching URL
k_EResultBadResponse = 76, // parse failure, missing field, etc.
k_EResultRequirePasswordReEntry = 77, // The user cannot complete the action until they re-enter their password
k_EResultValueOutOfRange = 78, // the value entered is outside the acceptable range
k_EResultUnexpectedError = 79, //
k_EResultFeatureDisabled = 80, //
k_EResultInvalidCEGSubmission = 81, //
k_EResultRestrictedDevice = 82, //
k_EResultRegionLocked = 83, //
k_EResultRateLimitExceeded = 84, //
} EResult;
// Steam API call failure results
typedef enum ESteamAPICallFailure
{
k_ESteamAPICallFailureNone = -1, // no failure
k_ESteamAPICallFailureSteamGone = 0, // the local Steam process has gone away
k_ESteamAPICallFailureNetworkFailure = 1, // the network connection to Steam has been broken, or was already broken
// SteamServersDisconnected_t callback will be sent around the same time
// SteamServersConnected_t will be sent when the client is able to talk to the Steam servers again
k_ESteamAPICallFailureInvalidHandle = 2, // the SteamAPICall_t handle passed in no longer exists
k_ESteamAPICallFailureMismatchedCallback = 3,// GetAPICallResult() was called with the wrong callback type for this API call
} ESteamAPICallFailure;
typedef enum EAccountType
{
k_EAccountTypeInvalid = 0,
k_EAccountTypeIndividual = 1, // single user account
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
k_EAccountTypeGameServer = 3, // game server account
k_EAccountTypeAnonGameServer = 4, // anonymous game server account
k_EAccountTypePending = 5, // pending
k_EAccountTypeContentServer = 6, // content server
k_EAccountTypeClan = 7,
k_EAccountTypeChat = 8,
k_EAccountTypeConsoleUser = 9, // Fake SteamID for local PSN account on PS3 or Live account on 360, etc.
k_EAccountTypeAnonUser = 10,
// Max of 16 items in this field
k_EAccountTypeMax
} EAccountType;
// Steam universes. Each universe is a self-contained Steam instance.
typedef enum EUniverse
{
k_EUniverseInvalid = 0,
k_EUniversePublic = 1,
k_EUniverseBeta = 2,
k_EUniverseInternal = 3,
k_EUniverseDev = 4,
// k_EUniverseRC = 5, // Removed
k_EUniverseMax
} EUniverse;
// Error codes for use with the voice functions
typedef enum EVoiceResult
{
k_EVoiceResultOK = 0,
k_EVoiceResultNotInitialized = 1,
k_EVoiceResultNotRecording = 2,
k_EVoiceResultNoData = 3,
k_EVoiceResultBufferTooSmall = 4,
k_EVoiceResultDataCorrupted = 5,
k_EVoiceResultRestricted = 6,
k_EVoiceResultUnsupportedCodec = 7,
} EVoiceResult;
//-----------------------------------------------------------------------------
// Purpose: Base values for callback identifiers, each callback must
// have a unique ID.
//-----------------------------------------------------------------------------
enum ECallbackType
{
k_iSteamUserCallbacks = 100,
k_iSteamGameServerCallbacks = 200,
k_iSteamFriendsCallbacks = 300,
k_iSteamBillingCallbacks = 400,
k_iSteamMatchmakingCallbacks = 500,
k_iSteamContentServerCallbacks = 600,
k_iSteamUtilsCallbacks = 700,
k_iClientFriendsCallbacks = 800,
k_iClientUserCallbacks = 900,
k_iSteamAppsCallbacks = 1000,
k_iSteamUserStatsCallbacks = 1100,
k_iSteamNetworkingCallbacks = 1200,
k_iClientRemoteStorageCallbacks = 1300,
k_iSteamUserItemsCallbacks = 1400,
k_iSteamGameServerItemsCallbacks = 1500,
k_iClientUtilsCallbacks = 1600,
k_iSteamGameCoordinatorCallbacks = 1700,
k_iSteamGameServerStatsCallbacks = 1800,
k_iSteam2AsyncCallbacks = 1900,
k_iSteamGameStatsCallbacks = 2000,
k_iClientHTTPCallbacks = 2100,
k_iClientScreenshotsCallbacks = 2200,
k_iSteamScreenshotsCallbacks = 2300,
k_iClientAudioCallbacks = 2400,
k_iSteamUnifiedMessagesCallbacks = 2500,
k_iClientUnifiedMessagesCallbacks = 2600,
k_iClientControllerCallbacks = 2700,
k_iSteamControllerCallbacks = 2800,
k_iClientParentalSettingsCallbacks = 2900,
k_iClientDeviceAuthCallbacks = 3000,
k_iClientNetworkDeviceManagerCallbacks = 3100,
k_iClientMusicCallbacks = 3200,
k_iClientRemoteClientManagerCallbacks = 3300,
k_iClientUGCCallbacks = 3400,
k_iSteamStreamClientCallbacks = 3500,
k_IClientProductBuilderCallbacks = 3600,
k_iClientShortcutsCallbacks = 3700,
k_iClientRemoteControlManagerCallbacks = 3800,
k_iSteamAppListCallbacks = 3900,
k_iSteamMusicCallbacks = 4000,
k_iSteamMusicRemoteCallbacks = 4100,
k_iClientVRCallbacks = 4200,
k_iClientReservedCallbacks = 4300,
k_iSteamReservedCallbacks = 4400,
k_iSteamHTMLSurfaceCallbacks = 4500,
k_iClientVideoCallbacks = 4600,
k_iClientInventoryCallbacks = 4700,
};
enum EAppState
{
k_EAppStateInvalid = 0,
k_EAppStateUninstalled = 1,
k_EAppStateUpdateRequired = 2,
k_EAppStateFullyInstalled = 4,
k_EAppStateDataEncrypted = 8,
k_EAppStateSharedOnly = 64,
k_EAppStateDataLocked = 16,
k_EAppStateFilesMissing = 32,
k_EAppStateFilesCorrupt = 128,
k_EAppStateAppRunning = 8192,
k_EAppStateBackupRunning = 4096,
k_EAppStateUpdateRunning = 256,
k_EAppStateUpdateStopping = 8388608,
k_EAppStateUpdatePaused = 512,
k_EAppStateUpdateStarted = 1024,
k_EAppStateReconfiguring = 65536,
k_EAppStateAddingFiles = 262144,
k_EAppStateDownloading = 1048576,
k_EAppStateStaging = 2097152,
k_EAppStateCommitting = 4194304,
k_EAppStateUninstalling = 2048,
k_EAppStatePreallocating = 524288,
k_EAppStateValidating = 131072,
};
typedef enum EAppUsageEvent
{
k_EAppUsageEventGameLaunch = 1,
k_EAppUsageEventGameLaunchTrial = 2,
k_EAppUsageEventMedia = 3,
k_EAppUsageEventPreloadStart = 4,
k_EAppUsageEventPreloadFinish = 5,
k_EAppUsageEventMarketingMessageView = 6, // deprecated, do not use
k_EAppUsageEventInGameAdViewed = 7,
k_EAppUsageEventGameLaunchFreeWeekend = 8,
} EAppUsageEvent;
enum EAppEvent
{
k_EAppEventDownloadComplete = 2,
};
enum EAppInfoSection
{
k_EAppInfoSectionUnknown = 0,
k_EAppInfoSectionAll,
k_EAppInfoSectionCommon,
k_EAppInfoSectionExtended,
k_EAppInfoSectionConfig,
k_EAppInfoSectionStats,
k_EAppInfoSectionInstall,
k_EAppInfoSectionDepots,
k_EAppInfoSectionVac,
k_EAppInfoSectionDrm,
k_EAppInfoSectionUfs,
k_EAppInfoSectionOgg,
k_EAppInfoSectionItems,
k_EAppInfoSectionPolicies,
k_EAppInfoSectionSysreqs,
k_EAppInfoSectionCommunity,
k_EAppInfoSectionStore // store
};
#pragma pack( push, 1 )
struct AppUpdateInfo_s
{
RTime32 m_timeUpdateStart;
uint64 m_unBytesToDownload;
uint64 m_unBytesDownloaded;
uint64 m_unBytesToProcess;
uint64 m_unBytesProcessed;
uint32 m_uUnk;
};
#pragma pack( pop )
struct DownloadStats_s
{
uint32 m_uIsDownloadEnabled;
uint32 m_unCurrentConnections;
uint32 m_unCurrentBytesPerSec;
uint64 m_unTotalBytesDownload;
CellID_t m_unCurrentCell;
};
enum EAppDownloadPriority
{
k_EAppDownloadPriorityNone = 0,
k_EAppDownloadPriorityFirst = 1,
k_EAppDownloadPriorityUp = 2,
k_EAppDownloadPriorityDown = 3,
k_EAppDownloadPriorityLast = 4,
k_EAppDownloadPriorityPaused = 5,
};
enum EAppUpdateError
{
k_EAppErrorNone = 0,
k_EAppErrorUnspecified = 1,
k_EAppErrorPaused = 2,
k_EAppErrorCanceled = 3,
k_EAppErrorSuspended = 4,
k_EAppErrorNoSubscription = 5,
k_EAppErrorNoConnection = 6,
k_EAppErrorTimeout = 7,
k_EAppErrorMissingKey = 8,
k_EAppErrorMissingConfig = 9,
k_EAppErrorDiskReadFailure = 10,
k_EAppErrorDiskWriteFailure = 11,
k_EAppErrorCorruptContent = 13,
k_EAppErrorWaitingForDisk = 14,
k_EAppErrorInvalidInstallPath = 15,
k_EAppErrorApplicationRunning = 16,
k_EAppErrorDependencyFailure = 17,
k_EAppErrorNotInstalled = 18,
k_EAppErrorUpdateRequired = 19,
k_EAppErrorStillBusy = 20,
k_EAppErrorNoConnectionToContentServers = 21,
k_EAppErrorInvalidApplicationConfiguration = 22,
k_EAppErrorInvalidContentConfiguration = 23,
k_EAppErrorMissingManifest = 24,
k_EAppErrorNotReleased = 25,
k_EAppErrorRegionRestricted = 26,
k_EAppErrorCorruptDepotCache = 27,
k_EAppErrorMissingExecutable = 28,
k_EAppErrorInvalidPlatform = 29,
k_EAppErrorInvalidFileSystem = 30,
k_EAppErrorCorruptUpdateFiles = 31,
k_EAppUpdateErrorDownloadCorrupt = 32,
k_EAppUpdateErrorDownloadDisabled = 33,
k_EAppUpdateErrorSharedLibraryLocked = 34,
k_EAppUpdateErrorPurchasePending = 35,
k_EAppUpdateErrorOtherSessionPlaying = 36,
};
//-----------------------------------------------------------------------------
// Purpose: possible results when registering an activation code
//-----------------------------------------------------------------------------
enum ERegisterActivactionCodeResult
{
k_ERegisterActivactionCodeResultOK = 0,
k_ERegisterActivactionCodeResultFail = 1,
k_ERegisterActivactionCodeResultAlreadyRegistered = 2,
k_ERegisterActivactionCodeResultTimeout = 3,
k_ERegisterActivactionCodeAlreadyOwned = 4
};
enum EAppOwnershipFlags
{
k_EAppOwnershipFlagsNone = 0,
k_EAppOwnershipFlagsOwnsLicense = 1 << 0,
k_EAppOwnershipFlagsFreeLicense = 1 << 1,
k_EAppOwnershipFlagsRegionRestricted = 1 << 2,
k_EAppOwnershipFlagsLowViolence = 1 << 3,
k_EAppOwnershipFlagsInvalidPlatform = 1 << 4,
k_EAppOwnershipFlagsSharedLicense = 1 << 5,
k_EAppOwnershipFlagsFreeWeekend = 1 << 6,
k_EAppOwnershipFlagsLockedLicense = 1 << 7,
k_EAppOwnershipFlagsPending = 1 << 8,
k_EAppOwnershipFlagsExpired = 1 << 9,
k_EAppOwnershipFlagsPermanent = 1 << 10,
k_EAppOwnershipFlagsRecurring = 1 << 11,
k_EAppOwnershipFlagsCanceled = 8192, // Canceled
k_EAppOwnershipFlagsAutoGrant = 16384, // Auto Grant
};
enum EAppReleaseState
{
k_EAppReleaseStateUnknown = 0,
k_EAppReleaseStateUnavailable,
k_EAppReleaseStatePrerelease,
k_EAppReleaseStatePreloadonly,
k_EAppReleaseStateReleased,
};
enum EAppAutoUpdateBehavior
{
// TODO: Reverse this enum
};
enum EAppAllowDownloadsWhileRunningBehavior
{
// TODO: Reverse this enum
};
enum EAppDownloadQueuePlacement
{
k_EAppDownloadQueuePlacementPriorityNone = 0, // Priority None
k_EAppDownloadQueuePlacementPriorityFirst, // Priority First
k_EAppDownloadQueuePlacementPriorityUp, // Priority Up
k_EAppDownloadQueuePlacementPriorityDown, // Priority Down
k_EAppDownloadQueuePlacementPriorityLast, // Priority Last
k_EAppDownloadQueuePlacementPriorityPaused, // Priority Paused
};
struct SHADigestWrapper_t
{
uint32 A;
uint32 B;
uint32 C;
uint32 D;
uint32 E;
};
const int k_cubAppProofOfPurchaseKeyMax = 64; // max bytes of a legacy cd key we support
// Special flags for Chat accounts - they go in the top 8 bits
// of the steam ID's "instance", leaving 12 for the actual instances
enum EChatSteamIDInstanceFlags
{
k_EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
k_EChatInstanceFlagClan = (k_unSteamAccountInstanceMask + 1) >> 1, // top bit
k_EChatInstanceFlagLobby = (k_unSteamAccountInstanceMask + 1) >> 2, // next one down, etc
k_EChatInstanceFlagMMSLobby = (k_unSteamAccountInstanceMask + 1) >> 3, // next one down, etc
// Max of 8 flags
};
enum EBeginAuthSessionResult;
enum EUserHasLicenseForAppResult;
//-----------------------------------------------------------------------------
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
//-----------------------------------------------------------------------------
enum EChatEntryType
{
k_EChatEntryTypeInvalid = 0,
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
k_EChatEntryTypeEmote = 4, // text emote message
k_EChatEntryTypeLobbyGameStart = 5, // lobby game is starting
k_EChatEntryTypeLeftConversation = 6, // user has left the conversation ( closed chat window )
// Above are previous FriendMsgType entries, now merged into more generic chat entry types
};
// Every individual instance of an item has a globally-unique ItemInstanceID.
// This ID is unique to the combination of (player, specific item instance)
// and will not be transferred to another player or re-used for another item.
typedef uint64 SteamItemInstanceID_t;
static const SteamItemInstanceID_t k_SteamItemInstanceIDInvalid = ~(SteamItemInstanceID_t)0;
// Types of items in your game are identified by a 32-bit "item definition number".
// Valid definition numbers are between 1 and 999999999; numbers less than or equal to
// zero are invalid, and numbers greater than or equal to one billion (1x10^9) are
// reserved for internal Steam use.
typedef int32 SteamItemDef_t;
enum ESteamItemFlags
{
// Item status flags - these flags are permenantly attached to specific item instances
k_ESteamItemNoTrade = 1 << 0, // This item is account-locked and cannot be traded or given away.
// Action confirmation flags - these flags are set one time only, as part of a result set
k_ESteamItemRemoved = 1 << 8, // The item has been destroyed, traded away, expired, or otherwise invalidated
k_ESteamItemConsumed = 1 << 9, // The item quantity has been decreased by 1 via ConsumeItem API.
// All other flag bits are currently reserved for internal Steam use at this time.
// Do not assume anything about the state of other flags which are not defined here.
};
struct SteamItemDetails_t
{
SteamItemInstanceID_t m_itemId;
SteamItemDef_t m_iDefinition;
uint16 m_unQuantity;
uint16 m_unFlags; // see ESteamItemFlags
};
typedef int32 SteamInventoryResult_t;
static const SteamInventoryResult_t k_SteamInventoryResultInvalid = -1;
// SteamInventoryResultReady_t callbacks are fired whenever asynchronous
// results transition from "Pending" to "OK" or an error state. There will
// always be exactly one callback per handle.
struct SteamInventoryResultReady_t
{
enum { k_iCallback = k_iClientInventoryCallbacks + 0 };
SteamInventoryResult_t m_handle;
EResult m_result;
};
// SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems
// successfully returns a result which is newer / fresher than the last
// known result. (It will not trigger if the inventory hasn't changed,
// or if results from two overlapping calls are reversed in flight and
// the earlier result is already known to be stale/out-of-date.)
// The normal ResultReady callback will still be triggered immediately
// afterwards; this is an additional notification for your convenience.
struct SteamInventoryFullUpdate_t
{
enum { k_iCallback = k_iClientInventoryCallbacks + 1 };
SteamInventoryResult_t m_handle;
};
// A SteamInventoryDefinitionUpdate_t callback is triggered whenever
// item definitions have been updated, which could be in response to
// LoadItemDefinitions() or any other async request which required
// a definition update in order to process results from the server.
struct SteamInventoryDefinitionUpdate_t
{
enum { k_iCallback = k_iClientInventoryCallbacks + 2 };
};
enum AudioPlayback_Status
{
AudioPlayback_Undefined = 0,
AudioPlayback_Playing = 1,
AudioPlayback_Paused = 2,
AudioPlayback_Idle = 3
};
enum EVRScreenshotType { };
enum ELobbyComparison
{
k_ELobbyComparisonEqualToOrLessThan = -2,
k_ELobbyComparisonLessThan = -1,
k_ELobbyComparisonEqual = 0,
k_ELobbyComparisonGreaterThan = 1,
k_ELobbyComparisonEqualToOrGreaterThan = 2,
k_ELobbyComparisonNotEqual = 3,
};
// lobby search distance
enum ELobbyDistanceFilter
{
k_ELobbyDistanceFilterClose, // only lobbies in the same immediate region will be returned
k_ELobbyDistanceFilterDefault, // only lobbies in the same region or close, but looking further if the current region has infrequent lobby activity (the default)
k_ELobbyDistanceFilterFar, // for games that don't have many latency requirements, will return lobbies about half-way around the globe
k_ELobbyDistanceFilterWorldwide, // no filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients)
};
// lobby type description
enum ELobbyType
{
k_ELobbyTypePrivate = 0, // only way to join the lobby is to invite to someone else
k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list
k_ELobbyTypePublic = 2, // visible for friends and in lobby list
k_ELobbyTypeInvisible = 3, // returned by search, but not visible to other friends
// useful if you want a user in two lobbies, for example matching groups together
// a user can be in only one regular lobby, and up to two invisible lobbies
};
enum EGamepadTextInputMode
{
k_EGamepadTextInputModeNormal,
k_EGamepadTextInputModePassword
};
enum EGamepadTextInputLineMode
{
k_EGamepadTextInputLineModeSingleLine,
k_EGamepadTextInputLineModeMultipleLines
};
enum ENotificationPosition
{
k_EPositionTopLeft,
k_EPositionTopRight,
k_EPositionBottomLeft,
k_EPositionBottomRight
};
enum EHTMLMouseButton
{
eHTMLMouseButton_Left = 0,
eHTMLMouseButton_Right = 1,
eHTMLMouseButton_Middle = 2,
};
enum EHTMLKeyModifiers
{
eHTMLKeyModifier_None = 0,
eHTMLKeyModifier_AltDown = 1 << 0,
eHTMLKeyModifier_CrtlDown = 1 << 1,
eHTMLKeyModifier_ShiftDown = 1 << 2,
};
// This enum is used in client API methods, do not re-number existing values.
enum EHTTPMethod
{
k_EHTTPMethodInvalid = 0,
k_EHTTPMethodGET,
k_EHTTPMethodHEAD,
k_EHTTPMethodPOST,
k_EHTTPMethodPUT,
k_EHTTPMethodDELETE,
k_EHTTPMethodOPTIONS,
// The remaining HTTP methods are not yet supported, per rfc2616 section 5.1.1 only GET and HEAD are required for
// a compliant general purpose server. We'll likely add more as we find uses for them.
// k_EHTTPMethodTRACE,
// k_EHTTPMethodCONNECT
};
enum EP2PSend
{
// Basic UDP send. Packets can't be bigger than 1200 bytes (your typical MTU size). Can be lost, or arrive out of order (rare).
// The sending API does have some knowledge of the underlying connection, so if there is no NAT-traversal accomplished or
// there is a recognized adjustment happening on the connection, the packet will be batched until the connection is open again.
k_EP2PSendUnreliable = 0,
// As above, but if the underlying p2p connection isn't yet established the packet will just be thrown away. Using this on the first
// packet sent to a remote host almost guarantees the packet will be dropped.
// This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets
k_EP2PSendUnreliableNoDelay = 1,
// Reliable message send. Can send up to 1MB of data in a single message.
// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for efficient sends of large chunks of data.
k_EP2PSendReliable = 2,
// As above, but applies the Nagle algorithm to the send - sends will accumulate
// until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm).
// Useful if you want to send a set of smaller messages but have the coalesced into a single packet
// Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then
// do a normal k_EP2PSendReliable to force all the buffered data to be sent.
k_EP2PSendReliableWithBuffering = 3,
};
// describes how the socket is currently connected
enum ESNetSocketConnectionType
{
k_ESNetSocketConnectionTypeNotConnected = 0,
k_ESNetSocketConnectionTypeUDP = 1,
k_ESNetSocketConnectionTypeUDPRelay = 2,
};
struct P2PSessionState_t
{
uint8 m_bConnectionActive; // true if we've got an active open connection
uint8 m_bConnecting; // true if we're currently trying to establish a connection
uint8 m_eP2PSessionError; // last error recorded (see enum above)
uint8 m_bUsingRelay; // true if it's going through a relay server (TURN)
int32 m_nBytesQueuedForSend;
int32 m_nPacketsQueuedForSend;
uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server.
uint16 m_nRemotePort; // Only exists for compatibility with older authentication api's
};
#pragma pack( push, 1 )
//-----------------------------------------------------------------------------
// Purpose: encapsulates an appID/modID pair
//-----------------------------------------------------------------------------
class CGameID
{
public:
CGameID()
{
m_gameID.m_nType = k_EGameIDTypeApp;
m_gameID.m_nAppID = k_uAppIdInvalid;
m_gameID.m_nModID = 0;
}
//explicit CGameID(uint64 ulGameID)
//{
// m_ulGameID = ulGameID;
//}
//explicit CGameID(int32 nAppID)
//{
// m_ulGameID = 0;
// m_gameID.m_nAppID = nAppID;
//}
//explicit CGameID(uint32 nAppID)
//{
// m_ulGameID = 0;
// m_gameID.m_nAppID = nAppID;
//}
//CGameID(uint32 nAppID, uint32 nModID)
//{
// m_ulGameID = 0;
// m_gameID.m_nAppID = nAppID;
// m_gameID.m_nModID = nModID;
// m_gameID.m_nType = k_EGameIDTypeGameMod;
//}
// Hidden functions used only by Steam
explicit CGameID(const char *pchGameID);
const char *Render() const; // render this Game ID to string
static const char *Render(uint64 ulGameID); // static method to render a uint64 representation of a Game ID to a string
// must include checksum_crc.h first to get this functionality
#if defined( CHECKSUM_CRC_H )
CGameID(uint32 nAppID, const char *pchModPath)
{
m_ulGameID = 0;
m_gameID.m_nAppID = nAppID;
m_gameID.m_nType = k_EGameIDTypeGameMod;
char rgchModDir[MAX_PATH];
Q_FileBase(pchModPath, rgchModDir, sizeof(rgchModDir));
CRC32_t crc32;
CRC32_Init(&crc32);
CRC32_ProcessBuffer(&crc32, rgchModDir, Q_strlen(rgchModDir));
CRC32_Final(&crc32);
// set the high-bit on the mod-id
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
// replacement for appID's
m_gameID.m_nModID = crc32 | (0x80000000);
}
CGameID(const char *pchExePath, const char *pchAppName)
{
m_ulGameID = 0;
m_gameID.m_nAppID = k_uAppIdInvalid;
m_gameID.m_nType = k_EGameIDTypeShortcut;
CRC32_t crc32;
CRC32_Init(&crc32);
CRC32_ProcessBuffer(&crc32, pchExePath, Q_strlen(pchExePath));
CRC32_ProcessBuffer(&crc32, pchAppName, Q_strlen(pchAppName));
CRC32_Final(&crc32);
// set the high-bit on the mod-id
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
// replacement for appID's
m_gameID.m_nModID = crc32 | (0x80000000);
}
#if defined( VSTFILEID_H )
CGameID(VstFileID vstFileID)
{
m_ulGameID = 0;
m_gameID.m_nAppID = k_uAppIdInvalid;
m_gameID.m_nType = k_EGameIDTypeP2P;
CRC32_t crc32;
CRC32_Init(&crc32);
const char *pchFileId = vstFileID.Render();
CRC32_ProcessBuffer(&crc32, pchFileId, Q_strlen(pchFileId));
CRC32_Final(&crc32);
// set the high-bit on the mod-id
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
// replacement for appID's
m_gameID.m_nModID = crc32 | (0x80000000);
}
#endif /* VSTFILEID_H */
#endif /* CHECKSUM_CRC_H */
uint64 ToUint64() const
{
return m_ulGameID;
}
uint64 *GetUint64Ptr()
{
return &m_ulGameID;
}
bool IsMod() const
{
return (m_gameID.m_nType == k_EGameIDTypeGameMod);
}
bool IsShortcut() const
{
return (m_gameID.m_nType == k_EGameIDTypeShortcut);
}
bool IsP2PFile() const
{
return (m_gameID.m_nType == k_EGameIDTypeP2P);
}
bool IsSteamApp() const
{
return (m_gameID.m_nType == k_EGameIDTypeApp);
}
uint32 ModID() const
{
return m_gameID.m_nModID;
}
uint32 AppID() const
{
return m_gameID.m_nAppID;
}
bool operator == (const CGameID &rhs) const
{
return m_ulGameID == rhs.m_ulGameID;
}
bool operator != (const CGameID &rhs) const
{
return !(*this == rhs);
}
bool operator < (const CGameID &rhs) const
{
return (m_ulGameID < rhs.m_ulGameID);
}
bool IsValid() const
{
// each type has it's own invalid fixed point:
switch (m_gameID.m_nType)
{
case k_EGameIDTypeApp:
return m_gameID.m_nAppID != k_uAppIdInvalid;
break;
case k_EGameIDTypeGameMod:
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
break;
case k_EGameIDTypeShortcut:
return (m_gameID.m_nModID & 0x80000000) != 0;
break;
case k_EGameIDTypeP2P:
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
break;
default:
#if defined(Assert)
Assert(false);
#endif
return false;
}
}
void Reset()
{
m_ulGameID = 0;
}
private:
enum EGameIDType
{
k_EGameIDTypeApp = 0,
k_EGameIDTypeGameMod = 1,
k_EGameIDTypeShortcut = 2,