1 /// Transcription of steamclientpublic.h to D.
2 ///
3 /// Translated by hand, based on v1.3.0 6be41e3
4 ///
5 /// Copyright: Valve Corporation, all rights reserved
6 module steam_gns.client_public;
7 
8 import steam_gns.misc;
9 import steam_gns.stypes;
10 import steam_gns.universe;
11 
12 extern (C++):
13 align(4):
14 
15 // General result codes
16 enum EResult {
17 
18     None = 0,                          // no result
19     OK = 1,                            // success
20     Fail = 2,                          // generic failure
21     NoConnection = 3,                  // no/failed network connection
22 //  NoConnectionRetry = 4,             // OBSOLETE - removed
23     InvalidPassword = 5,               // password/ticket is invalid
24     LoggedInElsewhere = 6,             // same user logged in elsewhere
25     InvalidProtocolVer = 7,            // protocol version is incorrect
26     InvalidParam = 8,                  // a parameter is incorrect
27     FileNotFound = 9,                  // file was not found
28     Busy = 10,                         // called method busy - action not taken
29     InvalidState = 11,                 // called object was in an invalid state
30     InvalidName = 12,                  // name is invalid
31     InvalidEmail = 13,                 // email is invalid
32     DuplicateName = 14,                // name is not unique
33     AccessDenied = 15,                 // access is denied
34     Timeout = 16,                      // operation timed out
35     Banned = 17,                       // VAC2 banned
36     AccountNotFound = 18,              // account not found
37     InvalidSteamID = 19,               // steamID is invalid
38     ServiceUnavailable = 20,           // The requested service is currently unavailable
39     NotLoggedOn = 21,                  // The user is not logged on
40     Pending = 22,                      // Request is pending (may be in process, or waiting on third party)
41     EncryptionFailure = 23,            // Encryption or Decryption failed
42     InsufficientPrivilege = 24,        // Insufficient privilege
43     LimitExceeded = 25,                // Too much of a good thing
44     Revoked = 26,                      // Access has been revoked (used for revoked guest passes)
45     Expired = 27,                      // License/Guest pass the user is trying to access is expired
46     AlreadyRedeemed = 28,              // Guest pass has already been redeemed by account, cannot be acked again
47     DuplicateRequest = 29,             // The request is a duplicate and the action has already occurred in the past, ignored this time
48     AlreadyOwned = 30,                 // All the games in this guest pass redemption request are already owned by the user
49     IPNotFound = 31,                   // IP address not found
50     PersistFailed = 32,                // failed to write change to the data store
51     LockingFailed = 33,                // failed to acquire access lock for this operation
52     LogonSessionReplaced = 34,
53     ConnectFailed = 35,
54     HandshakeFailed = 36,
55     IOFailure = 37,
56     RemoteDisconnect = 38,
57     ShoppingCartNotFound = 39,         // failed to find the shopping cart requested
58     Blocked = 40,                      // a user didn't allow it
59     Ignored = 41,                      // target is ignoring sender
60     NoMatch = 42,                      // nothing matching the request found
61     AccountDisabled = 43,
62     ServiceReadOnly = 44,              // this service is not accepting content changes right now
63     AccountNotFeatured = 45,           // account doesn't have value, so this feature isn't available
64     AdministratorOK = 46,              // allowed to take this action, but only because requester is admin
65     ContentVersion = 47,               // A Version mismatch in content transmitted within the Steam protocol.
66     TryAnotherCM = 48,                 // The current CM can't service the user making a request, user should try another.
67     PasswordRequiredToKickSession = 49,// You are already logged in elsewhere, this cached credential login has failed.
68     AlreadyLoggedInElsewhere = 50,     // You are already logged in elsewhere, you must wait
69     Suspended = 51,                    // Long running operation (content download) suspended/paused
70     Cancelled = 52,                    // Operation canceled (typically by user: content download)
71     DataCorruption = 53,               // Operation canceled because data is ill formed or unrecoverable
72     DiskFull = 54,                     // Operation canceled - not enough disk space.
73     RemoteCallFailed = 55,             // an remote call or IPC call failed
74     PasswordUnset = 56,                // Password could not be verified as it's unset server side
75     ExternalAccountUnlinked = 57,      // External account (PSN, Facebook...) is not linked to a Steam account
76     PSNTicketInvalid = 58,             // PSN ticket was invalid
77     ExternalAccountAlreadyLinked = 59, // External account (PSN, Facebook...) is already linked to some other account, must explicitly request to replace/delete the link first
78     RemoteFileConflict = 60,           // The sync cannot resume due to a conflict between the local and remote files
79     IllegalPassword = 61,              // The requested new password is not legal
80     SameAsPreviousValue = 62,          // new value is the same as the old one ( secret question and answer )
81     AccountLogonDenied = 63,           // account login denied due to 2nd factor authentication failure
82     CannotUseOldPassword = 64,         // The requested new password is not legal
83     InvalidLoginAuthCode = 65,         // account login denied due to auth code invalid
84     AccountLogonDeniedNoMail = 66,     // account login denied due to 2nd factor auth failure - and no mail has been sent
85     HardwareNotCapableOfIPT = 67,      //
86     IPTInitError = 68,                 //
87     ParentalControlRestricted = 69,    // operation failed due to parental control restrictions for current user
88     FacebookQueryError = 70,           // Facebook query returned an error
89     ExpiredLoginAuthCode = 71,         // account login denied due to auth code expired
90     IPLoginRestrictionFailed = 72,
91     AccountLockedDown = 73,
92     AccountLogonDeniedVerifiedEmailRequired = 74,
93     NoMatchingURL = 75,
94     BadResponse = 76,                  // parse failure, missing field, etc.
95     RequirePasswordReEntry = 77,       // The user cannot complete the action until they re-enter their password
96     ValueOutOfRange = 78,              // the value entered is outside the acceptable range
97     UnexpectedError = 79,              // something happened that we didn't expect to ever happen
98     Disabled = 80,                     // The requested service has been configured to be unavailable
99     InvalidCEGSubmission = 81,         // The set of files submitted to the CEG server are not valid !
100     RestrictedDevice = 82,             // The device being used is not allowed to perform this action
101     RegionLocked = 83,                 // The action could not be complete because it is region restricted
102     RateLimitExceeded = 84,            // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent
103     AccountLoginDeniedNeedTwoFactor = 85,  // Need two-factor code to login
104     ItemDeleted = 86,                  // The thing we're trying to access has been deleted
105     AccountLoginDeniedThrottle = 87,   // login attempt failed, try to throttle response to possible attacker
106     TwoFactorCodeMismatch = 88,        // two factor code mismatch
107     TwoFactorActivationCodeMismatch = 89,  // activation code for two-factor didn't match
108     AccountAssociatedToMultiplePartners = 90,  // account has been associated with multiple partners
109     NotModified = 91,                  // data not modified
110     NoMobileDevice = 92,               // the account does not have a mobile device associated with it
111     TimeNotSynced = 93,                // the time presented is out of range or tolerance
112     SmsCodeFailed = 94,                // SMS code failure (no match, none pending, etc.)
113     AccountLimitExceeded = 95,         // Too many accounts access this resource
114     AccountActivityLimitExceeded = 96, // Too many changes to this account
115     PhoneActivityLimitExceeded = 97,   // Too many changes to this phone
116     RefundToWallet = 98,               // Cannot refund to payment method, must use wallet
117     EmailSendFailure = 99,             // Cannot send an email
118     NotSettled = 100,                  // Can't perform operation till payment has settled
119     NeedCaptcha = 101,                 // Needs to provide a valid captcha
120     GSLTDenied = 102,                  // a game server login token owned by this token's owner has been banned
121     GSOwnerDenied = 103,               // game server owner is denied for other reason (account lock, community ban, vac ban, missing phone)
122     InvalidItemType = 104,             // the type of thing we were requested to act on is invalid
123     IPBanned = 105,                    // the ip address has been banned from taking this action
124     GSLTExpired = 106,                 // this token has expired from disuse; can be reset for use
125     InsufficientFunds = 107,           // user doesn't have enough wallet funds to complete the action
126     TooManyPending = 108,              // There are too many of this thing pending already
127     NoSiteLicensesFound = 109,         // No site licenses found
128     WGNetworkSendExceeded = 110,       // the WG couldn't send a response because we exceeded max network send size
129     AccountNotFriends = 111,           // the user is not mutually friends
130     LimitedUserAccount = 112,          // the user is limited
131     CantRemoveItem = 113,              // item can't be removed
132     AccountDeleted = 114,              // account has been deleted
133     ExistingUserCancelledLicense = 115,    // A license for this already exists, but cancelled
134     CommunityCooldown = 116,           // access is denied because of a community cooldown (probably from support profile data resets)
135     NoLauncherSpecified = 117,         // No launcher was specified, but a launcher was needed to choose correct realm for operation.
136     MustAgreeToSSA = 118,              // User must agree to china SSA or global SSA before login
137     LauncherMigrated = 119,            // The specified launcher type is no longer supported; the user should be directed elsewhere
138     SteamRealmMismatch = 120,          // The user's realm does not match the realm of the requested resource
139     InvalidSignature = 121,            // signature check did not match
140     ParseFailure = 122,                // Failed to parse input
141     NoVerifiedPhone = 123,             // account does not have a verified phone number
142 
143 }
144 
145 // Error codes for use with the voice functions
146 enum EVoiceResult {
147 
148     OK = 0,
149     NotInitialized = 1,
150     NotRecording = 2,
151     NoData = 3,
152     BufferTooSmall = 4,
153     DataCorrupted = 5,
154     Restricted = 6,
155     UnsupportedCodec = 7,
156     ReceiverOutOfDate = 8,
157     ReceiverDidNotAnswer = 9,
158 
159 }
160 
161 // Result codes to GSHandleClientDeny/Kick
162 enum EDenyReason {
163 
164     Invalid = 0,
165     InvalidVersion = 1,
166     Generic = 2,
167     NotLoggedOn = 3,
168     NoLicense = 4,
169     Cheater = 5,
170     LoggedInElseWhere = 6,
171     UnknownText = 7,
172     IncompatibleAnticheat = 8,
173     MemoryCorruption = 9,
174     IncompatibleSoftware = 10,
175     SteamConnectionLost = 11,
176     SteamConnectionError = 12,
177     SteamResponseTimedOut = 13,
178     SteamValidationStalled = 14,
179     SteamOwnerLeftGuestUser = 15,
180 
181 }
182 
183 // return type of GetAuthSessionTicket
184 alias HAuthTicket = uint;
185 enum HAuthTicket k_HAuthTicketInvalid = 0;
186 
187 // results from BeginAuthSession
188 enum EBeginAuthSessionResult {
189 
190     OK = 0,                        // Ticket is valid for this game and this steamID.
191     InvalidTicket = 1,             // Ticket is not valid.
192     DuplicateRequest = 2,          // A ticket has already been submitted for this steamID
193     InvalidVersion = 3,            // Ticket is from an incompatible interface version
194     GameMismatch = 4,              // Ticket is not for this game
195     ExpiredTicket = 5,             // Ticket has expired
196 
197 }
198 
199 // Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession
200 enum EAuthSessionResponse {
201 
202     OK = 0,                           // Steam has verified the user is online, the ticket is valid and ticket has not been reused.
203     UserNotConnectedToSteam = 1,      // The user in question is not connected to steam
204     NoLicenseOrExpired = 2,           // The license has expired.
205     VACBanned = 3,                    // The user is VAC banned for this game.
206     LoggedInElseWhere = 4,            // The user account has logged in elsewhere and the session containing the game instance has been disconnected.
207     VACCheckTimedOut = 5,             // VAC has been unable to perform anti-cheat checks on this user
208     AuthTicketCanceled = 6,           // The ticket has been canceled by the issuer
209     AuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid.
210     AuthTicketInvalid = 8,            // This ticket is not from a user instance currently connected to steam.
211     PublisherIssuedBan = 9,           // The user is banned for this game. The ban came via the web api and not VAC
212 
213 }
214 
215 // results from UserHasLicenseForApp
216 enum EUserHasLicenseForAppResult {
217 
218     HasLicense = 0,                  // User has a license for specified app
219     DoesNotHaveLicense = 1,          // User does not have a license for the specified app
220     NoAuth = 2,                      // User has not been authenticated
221 
222 }
223 
224 
225 // Steam account types
226 enum EAccountType {
227 
228     Invalid = 0,
229     Individual = 1,       // single user account
230     Multiseat = 2,        // multiseat (e.g. cybercafe) account
231     GameServer = 3,       // game server account
232     AnonGameServer = 4,   // anonymous game server account
233     Pending = 5,          // pending
234     ContentServer = 6,    // content server
235     Clan = 7,
236     Chat = 8,
237     ConsoleUser = 9,      // Fake SteamID for local PSN account on PS3 or Live account on 360, etc.
238     AnonUser = 10,
239 
240     // Max of 16 items in this field
241     TypeMax
242 
243 }
244 
245 
246 
247 //-----------------------------------------------------------------------------
248 // Purpose: Chat Entry Types (previously was only friend-to-friend message types)
249 //-----------------------------------------------------------------------------
250 enum EChatEntryType {
251 
252     Invalid = 0,
253     ChatMsg = 1,        // Normal text message from another user
254     Typing = 2,         // Another user is typing (not used in multi-user chat)
255     InviteGame = 3,     // Invite from other user into that users current game
256     Emote = 4,          // text emote message (deprecated, should be treated as ChatMsg)
257     //k_EChatEntryTypeLobbyGameStart = 5,   // lobby game is starting (dead - listen for LobbyGameCreated_t callback instead)
258     LeftConversation = 6, // user has left the conversation ( closed chat window )
259     // Above are previous FriendMsgType entries, now merged into more generic chat entry types
260     Entered = 7,        // user has entered the conversation (used in multi-user chat and group chat)
261     WasKicked = 8,      // user was kicked (data: 64-bit steamid of actor performing the kick)
262     WasBanned = 9,      // user was banned (data: 64-bit steamid of actor performing the ban)
263     Disconnected = 10,  // user disconnected
264     HistoricalChat = 11,    // a chat message from user's chat history or offilne message
265     //k_EChatEntryTypeReserved1 = 12, // No longer used
266     //k_EChatEntryTypeReserved2 = 13, // No longer used
267     LinkBlocked = 14, // a link was removed by the chat filter.
268 
269 }
270 
271 
272 //-----------------------------------------------------------------------------
273 // Purpose: Chat Room Enter Responses
274 //-----------------------------------------------------------------------------
275 enum EChatRoomEnterResponse {
276 
277     Success = 1,        // Success
278     DoesntExist = 2,    // Chat doesn't exist (probably closed)
279     NotAllowed = 3,     // General Denied - You don't have the permissions needed to join the chat
280     Full = 4,           // Chat room has reached its maximum size
281     Error = 5,          // Unexpected Error
282     Banned = 6,         // You are banned from this chat room and may not join
283     Limited = 7,        // Joining this chat is not allowed because you are a limited user (no value on account)
284     ClanDisabled = 8,   // Attempt to join a clan chat when the clan is locked or disabled
285     CommunityBan = 9,   // Attempt to join a chat when the user has a community lock on their account
286     MemberBlockedYou = 10, // Join failed - some member in the chat has blocked you from joining
287     YouBlockedMember = 11, // Join failed - you have blocked some member already in the chat
288     // k_EChatRoomEnterResponseNoRankingDataLobby = 12,  // No longer used
289     // k_EChatRoomEnterResponseNoRankingDataUser = 13,  //  No longer used
290     // k_EChatRoomEnterResponseRankOutOfRange = 14, //  No longer used
291     RatelimitExceeded = 15, // Join failed - to many join attempts in a very short period of time
292 
293 }
294 
295 
296 enum uint k_unSteamAccountIDMask = 0xFFFFFFFF;
297 enum uint k_unSteamAccountInstanceMask = 0x000FFFFF;
298 enum uint k_unSteamUserDefaultInstance = 1; // fixed instance for all individual users
299 
300 // Special flags for Chat accounts - they go in the top 8 bits
301 // of the steam ID's "instance", leaving 12 for the actual instances
302 enum EChatSteamIDInstanceFlags {
303 
304     EChatAccountInstanceMask = 0x00000FFF, // top 8 bits are flags
305 
306     EChatInstanceFlagClan = ( k_unSteamAccountInstanceMask + 1 ) >> 1,    // top bit
307     EChatInstanceFlagLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 2,   // next one down, etc
308     EChatInstanceFlagMMSLobby = ( k_unSteamAccountInstanceMask + 1 ) >> 3,    // next one down, etc
309 
310     // Max of 8 flags
311 }
312 
313 
314 //-----------------------------------------------------------------------------
315 // Purpose: Possible positions to tell the overlay to show notifications in
316 //-----------------------------------------------------------------------------
317 enum ENotificationPosition {
318 
319     TopLeft = 0,
320     TopRight = 1,
321     BottomLeft = 2,
322     BottomRight = 3,
323 
324 }
325 
326 
327 //-----------------------------------------------------------------------------
328 // Purpose: Broadcast upload result details
329 //-----------------------------------------------------------------------------
330 enum EBroadcastUploadResult {
331 
332     None = 0,   // broadcast state unknown
333     OK = 1,     // broadcast was good, no problems
334     InitFailed = 2, // broadcast init failed
335     FrameFailed = 3,    // broadcast frame upload failed
336     Timeout = 4,    // broadcast upload timed out
337     BandwidthExceeded = 5,  // broadcast send too much data
338     LowFPS = 6, // broadcast FPS too low
339     MissingKeyFrames = 7,   // broadcast sending not enough key frames
340     NoConnection = 8,   // broadcast client failed to connect to relay
341     RelayFailed = 9,    // relay dropped the upload
342     SettingsChanged = 10,   // the client changed broadcast settings
343     MissingAudio = 11,  // client failed to send audio data
344     TooFarBehind = 12,  // clients was too slow uploading
345     TranscodeBehind = 13,   // server failed to keep up with transcode
346     NotAllowedToPlay = 14, // Broadcast does not have permissions to play game
347     Busy = 15, // RTMP host to busy to take new broadcast stream, choose another
348     Banned = 16, // Account banned from community broadcast
349     AlreadyActive = 17, // We already already have an stream running.
350     ForcedOff = 18, // We explicitly shutting down a broadcast
351     AudioBehind = 19, // Audio stream was too far behind video
352     Shutdown = 20,  // Broadcast Server was shut down
353     Disconnect = 21,    // broadcast uploader TCP disconnected
354     VideoInitFailed = 22,   // invalid video settings
355     AudioInitFailed = 23,   // invalid audio settings
356 
357 }
358 
359 
360 //-----------------------------------------------------------------------------
361 // Purpose: Reasons a user may not use the Community Market.
362 //          Used in MarketEligibilityResponse_t.
363 //-----------------------------------------------------------------------------
364 enum EMarketNotAllowedReasonFlags {
365 
366     None = 0,
367 
368     // A back-end call failed or something that might work again on retry
369     TemporaryFailure = (1 << 0),
370 
371     // Disabled account
372     AccountDisabled = (1 << 1),
373 
374     // Locked account
375     AccountLockedDown = (1 << 2),
376 
377     // Limited account (no purchases)
378     AccountLimited = (1 << 3),
379 
380     // The account is banned from trading items
381     TradeBanned = (1 << 4),
382 
383     // Wallet funds aren't tradable because the user has had no purchase
384     // activity in the last year or has had no purchases prior to last month
385     AccountNotTrusted = (1 << 5),
386 
387     // The user doesn't have Steam Guard enabled
388     SteamGuardNotEnabled = (1 << 6),
389 
390     // The user has Steam Guard, but it hasn't been enabled for the required
391     // number of days
392     SteamGuardOnlyRecentlyEnabled = (1 << 7),
393 
394     // The user has recently forgotten their password and reset it
395     RecentPasswordReset = (1 << 8),
396 
397     // The user has recently funded his or her wallet with a new payment method
398     NewPaymentMethod = (1 << 9),
399 
400     // An invalid cookie was sent by the user
401     InvalidCookie = (1 << 10),
402 
403     // The user has Steam Guard, but is using a new computer or web browser
404     UsingNewDevice = (1 << 11),
405 
406     // The user has recently refunded a store purchase by his or herself
407     RecentSelfRefund = (1 << 12),
408 
409     // The user has recently funded his or her wallet with a new payment method that cannot be verified
410     NewPaymentMethodCannotBeVerified = (1 << 13),
411 
412     // Not only is the account not trusted, but they have no recent purchases at all
413     NoRecentPurchases = (1 << 14),
414 
415     // User accepted a wallet gift that was recently purchased
416     AcceptedWalletGift = (1 << 15),
417 
418 }
419 
420 
421 //
422 // describes XP / progress restrictions to apply for games with duration control /
423 // anti-indulgence enabled for minor Steam China users.
424 //
425 // WARNING: DO NOT RENUMBER
426 enum EDurationControlProgress {
427 
428     Full = 0,    // Full progress
429     Half = 1,    // deprecated - XP or persistent rewards should be halved
430     None = 2,    // deprecated - XP or persistent rewards should be stopped
431 
432     ExitSoon_3h = 3,     // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon
433     ExitSoon_5h = 4,     // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon
434     ExitSoon_Night = 5,  // game running after day period, game should exit - steam will terminate the game soon
435 
436 }
437 
438 
439 //
440 // describes which notification timer has expired, for steam china duration control feature
441 //
442 // WARNING: DO NOT RENUMBER
443 enum EDurationControlNotification {
444 
445     None = 0,        // just informing you about progress, no notification to show
446     _1Hour = 1,       // "you've been playing for N hours"
447 
448     _3Hours = 2,      // deprecated - "you've been playing for 3 hours; take a break"
449     HalfProgress = 3,// deprecated - "your XP / progress is half normal"
450     NoProgress = 4,  // deprecated - "your XP / progress is zero"
451 
452     ExitSoon_3h = 5, // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon
453     ExitSoon_5h = 6, // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon
454     ExitSoon_Night = 7,// game running after day period, game should exit - steam will terminate the game soon
455 
456 }
457 
458 
459 //
460 // Specifies a game's online state in relation to duration control
461 //
462 enum EDurationControlOnlineState {
463 
464     Invalid = 0,              // nil value
465     Offline = 1,              // currently in offline play - single-player, offline co-op, etc.
466     Online = 2,               // currently in online play
467     OnlineHighPri = 3,        // currently in online play and requests not to be interrupted
468 
469 }
470 
471 
472 // Steam ID structure (64 bits total)
473 struct CSteamID {
474 
475     ulong m_steamid;
476 
477 }
478 
479 /+
480 inline bool CSteamID::IsValid() const
481 {
482     if ( m_steamid.m_comp.m_EAccountType <= k_EAccountTypeInvalid || m_steamid.m_comp.m_EAccountType >= k_EAccountTypeMax )
483         return false;
484 
485     if ( m_steamid.m_comp.m_EUniverse <= k_EUniverseInvalid || m_steamid.m_comp.m_EUniverse >= k_EUniverseMax )
486         return false;
487 
488     if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual )
489     {
490         if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != k_unSteamUserDefaultInstance )
491             return false;
492     }
493 
494     if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeClan )
495     {
496         if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != 0 )
497             return false;
498     }
499 
500     if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeGameServer )
501     {
502         if ( m_steamid.m_comp.m_unAccountID == 0 )
503             return false;
504         // Any limit on instances?  We use them for local users and bots
505     }
506     return true;
507 }
508 
509 // generic invalid CSteamID
510 #define k_steamIDNil CSteamID()
511 
512 // This steamID comes from a user game connection to an out of date GS that hasnt implemented the protocol
513 // to provide its steamID
514 #define k_steamIDOutofDateGS CSteamID( 0, 0, k_EUniverseInvalid, k_EAccountTypeInvalid )
515 // This steamID comes from a user game connection to an sv_lan GS
516 #define k_steamIDLanModeGS CSteamID( 0, 0, k_EUniversePublic, k_EAccountTypeInvalid )
517 // This steamID can come from a user game connection to a GS that has just booted but hasnt yet even initialized
518 // its steam3 component and started logging on.
519 #define k_steamIDNotInitYetGS CSteamID( 1, 0, k_EUniverseInvalid, k_EAccountTypeInvalid )
520 // This steamID can come from a user game connection to a GS that isn't using the steam authentication system but still
521 // wants to support the "Join Game" option in the friends list
522 #define k_steamIDNonSteamGS CSteamID( 2, 0, k_EUniverseInvalid, k_EAccountTypeInvalid )
523 
524 +/
525 
526 /+
527 
528 
529 #ifdef STEAM
530 // Returns the matching chat steamID, with the default instance of 0
531 // If the steamID passed in is already of type k_EAccountTypeChat it will be returned with the same instance
532 CSteamID ChatIDFromSteamID( const CSteamID &steamID );
533 // Returns the matching clan steamID, with the default instance of 0
534 // If the steamID passed in is already of type k_EAccountTypeClan it will be returned with the same instance
535 CSteamID ClanIDFromSteamID( const CSteamID &steamID );
536 // Asserts steamID type before conversion
537 CSteamID ChatIDFromClanID( const CSteamID &steamIDClan );
538 // Asserts steamID type before conversion
539 CSteamID ClanIDFromChatID( const CSteamID &steamIDChat );
540 
541 #endif // _STEAM
542 
543 +/
544 
545 
546 /+
547 
548 //-----------------------------------------------------------------------------
549 // Purpose: encapsulates an appID/modID pair
550 //-----------------------------------------------------------------------------
551 class CGameID
552 {
553 public:
554 
555     CGameID()
556     {
557         m_gameID.m_nType = k_EGameIDTypeApp;
558         m_gameID.m_nAppID = k_uAppIdInvalid;
559         m_gameID.m_nModID = 0;
560     }
561 
562     explicit CGameID( uint64 ulGameID )
563     {
564         m_ulGameID = ulGameID;
565     }
566 #ifdef INT64_DIFFERENT_FROM_INT64_T
567     CGameID( uint64_t ulGameID )
568     {
569         m_ulGameID = (uint64)ulGameID;
570     }
571 #endif
572 
573     explicit CGameID( int32 nAppID )
574     {
575         m_ulGameID = 0;
576         m_gameID.m_nAppID = nAppID;
577     }
578 
579     explicit CGameID( uint32 nAppID )
580     {
581         m_ulGameID = 0;
582         m_gameID.m_nAppID = nAppID;
583     }
584 
585     CGameID( uint32 nAppID, uint32 nModID )
586     {
587         m_ulGameID = 0;
588         m_gameID.m_nAppID = nAppID;
589         m_gameID.m_nModID = nModID;
590         m_gameID.m_nType = k_EGameIDTypeGameMod;
591     }
592 
593     CGameID( const CGameID &that )
594     {
595         m_ulGameID = that.m_ulGameID;
596     }
597 
598     CGameID& operator=( const CGameID & that )
599     {
600         m_ulGameID = that.m_ulGameID;
601         return *this;
602     }
603 
604     // Hidden functions used only by Steam
605     explicit CGameID( const char *pchGameID );
606     const char *Render() const;                 // render this Game ID to string
607     static const char *Render( uint64 ulGameID );       // static method to render a uint64 representation of a Game ID to a string
608 
609     uint64 ToUint64() const
610     {
611         return m_ulGameID;
612     }
613 
614     uint64 *GetUint64Ptr()
615     {
616         return &m_ulGameID;
617     }
618 
619     void Set( uint64 ulGameID )
620     {
621         m_ulGameID = ulGameID;
622     }
623 
624     bool IsMod() const
625     {
626         return ( m_gameID.m_nType == k_EGameIDTypeGameMod );
627     }
628 
629     bool IsShortcut() const
630     {
631         return ( m_gameID.m_nType == k_EGameIDTypeShortcut );
632     }
633 
634     bool IsP2PFile() const
635     {
636         return ( m_gameID.m_nType == k_EGameIDTypeP2P );
637     }
638 
639     bool IsSteamApp() const
640     {
641         return ( m_gameID.m_nType == k_EGameIDTypeApp );
642     }
643 
644     uint32 ModID() const
645     {
646         return m_gameID.m_nModID;
647     }
648 
649     uint32 AppID() const
650     {
651         return m_gameID.m_nAppID;
652     }
653 
654     bool operator == ( const CGameID &rhs ) const
655     {
656         return m_ulGameID == rhs.m_ulGameID;
657     }
658 
659     bool operator != ( const CGameID &rhs ) const
660     {
661         return !(*this == rhs);
662     }
663 
664     bool operator < ( const CGameID &rhs ) const
665     {
666         return ( m_ulGameID < rhs.m_ulGameID );
667     }
668 
669     bool IsValid() const
670     {
671         // each type has it's own invalid fixed point:
672         switch( m_gameID.m_nType )
673         {
674         case k_EGameIDTypeApp:
675             return m_gameID.m_nAppID != k_uAppIdInvalid;
676 
677         case k_EGameIDTypeGameMod:
678             return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
679 
680         case k_EGameIDTypeShortcut:
681             return (m_gameID.m_nModID & 0x80000000) != 0;
682 
683         case k_EGameIDTypeP2P:
684             return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
685 
686         default:
687             return false;
688         }
689 
690     }
691 
692     void Reset()
693     {
694         m_ulGameID = 0;
695     }
696 
697 //
698 // Internal stuff.  Use the accessors above if possible
699 //
700 
701     enum EGameIDType
702     {
703         k_EGameIDTypeApp        = 0,
704         k_EGameIDTypeGameMod    = 1,
705         k_EGameIDTypeShortcut   = 2,
706         k_EGameIDTypeP2P        = 3,
707     };
708 
709     struct GameID_t
710     {
711 #ifdef VALVE_BIG_ENDIAN
712         unsigned int m_nModID : 32;
713         unsigned int m_nType : 8;
714         unsigned int m_nAppID : 24;
715 #else
716         unsigned int m_nAppID : 24;
717         unsigned int m_nType : 8;
718         unsigned int m_nModID : 32;
719 #endif
720     };
721 
722     union
723     {
724         uint64 m_ulGameID;
725         GameID_t m_gameID;
726     };
727 };
728 
729 #pragma pack( pop )
730 
731 const int k_cchGameExtraInfoMax = 64;
732 
733 
734 //-----------------------------------------------------------------------------
735 // Purpose: Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback
736 //  just before minidump file is captured after a crash has occurred.  (Allows app to append additional comment data to the dump, etc.)
737 //-----------------------------------------------------------------------------
738 typedef void (*PFNPreMinidumpCallback)(void *context);
739 
740 enum EGameSearchErrorCode_t
741 {
742     k_EGameSearchErrorCode_OK = 1,
743     k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2,
744     k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3,
745     k_EGameSearchErrorCode_Failed_Not_Lobby_Leader = 4, // if not the lobby leader can not call SearchForGameWithLobby
746     k_EGameSearchErrorCode_Failed_No_Host_Available = 5, // no host is available that matches those search params
747     k_EGameSearchErrorCode_Failed_Search_Params_Invalid = 6, // search params are invalid
748     k_EGameSearchErrorCode_Failed_Offline = 7, // offline, could not communicate with server
749     k_EGameSearchErrorCode_Failed_NotAuthorized = 8, // either the user or the application does not have priveledges to do this
750     k_EGameSearchErrorCode_Failed_Unknown_Error = 9, // unknown error
751 };
752 
753 enum EPlayerResult_t
754 {
755     k_EPlayerResultFailedToConnect = 1, // failed to connect after confirming
756     k_EPlayerResultAbandoned = 2,       // quit game without completing it
757     k_EPlayerResultKicked = 3,          // kicked by other players/moderator/server rules
758     k_EPlayerResultIncomplete = 4,      // player stayed to end but game did not conclude successfully ( nofault to player )
759     k_EPlayerResultCompleted = 5,       // player completed game
760 };
761 
762 
763 enum ESteamIPv6ConnectivityProtocol
764 {
765     k_ESteamIPv6ConnectivityProtocol_Invalid = 0,
766     k_ESteamIPv6ConnectivityProtocol_HTTP = 1,      // because a proxy may make this different than other protocols
767     k_ESteamIPv6ConnectivityProtocol_UDP = 2,       // test UDP connectivity. Uses a port that is commonly needed for other Steam stuff. If UDP works, TCP probably works.
768 };
769 
770 // For the above transport protocol, what do we think the local machine's connectivity to the internet over ipv6 is like
771 enum ESteamIPv6ConnectivityState
772 {
773     k_ESteamIPv6ConnectivityState_Unknown = 0,  // We haven't run a test yet
774     k_ESteamIPv6ConnectivityState_Good = 1,     // We have recently been able to make a request on ipv6 for the given protocol
775     k_ESteamIPv6ConnectivityState_Bad = 2,      // We failed to make a request, either because this machine has no ipv6 address assigned, or it has no upstream connectivity
776 };
777 
778 
779 // Define compile time assert macros to let us validate the structure sizes.
780 #define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1];
781 
782 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
783 // The 32-bit version of gcc has the alignment requirement for uint64 and double set to
784 // 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
785 // The 64-bit version of gcc has the alignment requirement for these types set to
786 // 8 meaning that unless we use #pragma pack(4) our structures will get bigger.
787 // The 64-bit structure packing has to match the 32-bit structure packing for each platform.
788 #define VALVE_CALLBACK_PACK_SMALL
789 #else
790 #define VALVE_CALLBACK_PACK_LARGE
791 #endif
792 
793 #if defined( VALVE_CALLBACK_PACK_SMALL )
794 #pragma pack( push, 4 )
795 #elif defined( VALVE_CALLBACK_PACK_LARGE )
796 #pragma pack( push, 8 )
797 #else
798 #error ???
799 #endif
800 
801 typedef struct ValvePackingSentinel_t
802 {
803     uint32 m_u32;
804     uint64 m_u64;
805     uint16 m_u16;
806     double m_d;
807 } ValvePackingSentinel_t;
808 
809 #pragma pack( pop )
810 
811 
812 #if defined(VALVE_CALLBACK_PACK_SMALL)
813 VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 )
814 #elif defined(VALVE_CALLBACK_PACK_LARGE)
815 VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 )
816 #else
817 #error ???
818 #endif
819 
820 #endif // STEAMCLIENTPUBLIC_H
821 
822 +/