mirror of
https://github.com/suyu-emu/Yucom.git
synced 2026-09-21 13:22:43 -07:00
lsteamclient: Synthesize SDK version 1.16x
For SteamFriends010.
This commit is contained in:
@@ -0,0 +1,306 @@
|
||||
#include "steam_defs.h"
|
||||
#include "steamworks_sdk_116x/steam_api.h"
|
||||
#include "steamclient_private.h"
|
||||
#include "cppISteamFriends_SteamFriends010.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "struct_converters_116x.h"
|
||||
const char * cppISteamFriends_SteamFriends010_GetPersonaName(void *linux_side)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetPersonaName();
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_SetPersonaName(void *linux_side, const char * pchPersonaName)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->SetPersonaName((const char *)pchPersonaName);
|
||||
}
|
||||
|
||||
EPersonaState cppISteamFriends_SteamFriends010_GetPersonaState(void *linux_side)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetPersonaState();
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetFriendCount(void *linux_side, int iFriendFlags)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendCount((int)iFriendFlags);
|
||||
}
|
||||
|
||||
CSteamID cppISteamFriends_SteamFriends010_GetFriendByIndex(void *linux_side, int iFriend, int iFriendFlags)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendByIndex((int)iFriend, (int)iFriendFlags);
|
||||
}
|
||||
|
||||
EFriendRelationship cppISteamFriends_SteamFriends010_GetFriendRelationship(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendRelationship((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
EPersonaState cppISteamFriends_SteamFriends010_GetFriendPersonaState(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendPersonaState((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
const char * cppISteamFriends_SteamFriends010_GetFriendPersonaName(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendPersonaName((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_GetFriendGamePlayed(void *linux_side, CSteamID steamIDFriend, FriendGameInfo_t * pFriendGameInfo)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendGamePlayed((CSteamID)steamIDFriend, (FriendGameInfo_t *)pFriendGameInfo);
|
||||
}
|
||||
|
||||
const char * cppISteamFriends_SteamFriends010_GetFriendPersonaNameHistory(void *linux_side, CSteamID steamIDFriend, int iPersonaName)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendPersonaNameHistory((CSteamID)steamIDFriend, (int)iPersonaName);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_HasFriend(void *linux_side, CSteamID steamIDFriend, int iFriendFlags)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->HasFriend((CSteamID)steamIDFriend, (int)iFriendFlags);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetClanCount(void *linux_side)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanCount();
|
||||
}
|
||||
|
||||
CSteamID cppISteamFriends_SteamFriends010_GetClanByIndex(void *linux_side, int iClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanByIndex((int)iClan);
|
||||
}
|
||||
|
||||
const char * cppISteamFriends_SteamFriends010_GetClanName(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanName((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
const char * cppISteamFriends_SteamFriends010_GetClanTag(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanTag((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_GetClanActivityCounts(void *linux_side, CSteamID steamIDClan, int * pnOnline, int * pnInGame, int * pnChatting)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanActivityCounts((CSteamID)steamIDClan, (int *)pnOnline, (int *)pnInGame, (int *)pnChatting);
|
||||
}
|
||||
|
||||
SteamAPICall_t cppISteamFriends_SteamFriends010_DownloadClanActivityCounts(void *linux_side, CSteamID * psteamIDClans, int cClansToRequest)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->DownloadClanActivityCounts((CSteamID *)psteamIDClans, (int)cClansToRequest);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetFriendCountFromSource(void *linux_side, CSteamID steamIDSource)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendCountFromSource((CSteamID)steamIDSource);
|
||||
}
|
||||
|
||||
CSteamID cppISteamFriends_SteamFriends010_GetFriendFromSourceByIndex(void *linux_side, CSteamID steamIDSource, int iFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendFromSourceByIndex((CSteamID)steamIDSource, (int)iFriend);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_IsUserInSource(void *linux_side, CSteamID steamIDUser, CSteamID steamIDSource)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->IsUserInSource((CSteamID)steamIDUser, (CSteamID)steamIDSource);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_SetInGameVoiceSpeaking(void *linux_side, CSteamID steamIDUser, bool bSpeaking)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->SetInGameVoiceSpeaking((CSteamID)steamIDUser, (bool)bSpeaking);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_ActivateGameOverlay(void *linux_side, const char * pchDialog)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->ActivateGameOverlay((const char *)pchDialog);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_ActivateGameOverlayToUser(void *linux_side, const char * pchDialog, CSteamID steamID)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->ActivateGameOverlayToUser((const char *)pchDialog, (CSteamID)steamID);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_ActivateGameOverlayToWebPage(void *linux_side, const char * pchURL)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->ActivateGameOverlayToWebPage((const char *)pchURL);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_ActivateGameOverlayToStore(void *linux_side, AppId_t nAppID)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->ActivateGameOverlayToStore((AppId_t)nAppID);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_SetPlayedWith(void *linux_side, CSteamID steamIDUserPlayedWith)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->SetPlayedWith((CSteamID)steamIDUserPlayedWith);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_ActivateGameOverlayInviteDialog(void *linux_side, CSteamID steamIDLobby)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->ActivateGameOverlayInviteDialog((CSteamID)steamIDLobby);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetSmallFriendAvatar(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetSmallFriendAvatar((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetMediumFriendAvatar(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetMediumFriendAvatar((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetLargeFriendAvatar(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetLargeFriendAvatar((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_RequestUserInformation(void *linux_side, CSteamID steamIDUser, bool bRequireNameOnly)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->RequestUserInformation((CSteamID)steamIDUser, (bool)bRequireNameOnly);
|
||||
}
|
||||
|
||||
SteamAPICall_t cppISteamFriends_SteamFriends010_RequestClanOfficerList(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->RequestClanOfficerList((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
CSteamID cppISteamFriends_SteamFriends010_GetClanOwner(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanOwner((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetClanOfficerCount(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanOfficerCount((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
CSteamID cppISteamFriends_SteamFriends010_GetClanOfficerByIndex(void *linux_side, CSteamID steamIDClan, int iOfficer)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanOfficerByIndex((CSteamID)steamIDClan, (int)iOfficer);
|
||||
}
|
||||
|
||||
uint32 cppISteamFriends_SteamFriends010_GetUserRestrictions(void *linux_side)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetUserRestrictions();
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_SetRichPresence(void *linux_side, const char * pchKey, const char * pchValue)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->SetRichPresence((const char *)pchKey, (const char *)pchValue);
|
||||
}
|
||||
|
||||
void cppISteamFriends_SteamFriends010_ClearRichPresence(void *linux_side)
|
||||
{
|
||||
((ISteamFriends*)linux_side)->ClearRichPresence();
|
||||
}
|
||||
|
||||
const char * cppISteamFriends_SteamFriends010_GetFriendRichPresence(void *linux_side, CSteamID steamIDFriend, const char * pchKey)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendRichPresence((CSteamID)steamIDFriend, (const char *)pchKey);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetFriendRichPresenceKeyCount(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendRichPresenceKeyCount((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
const char * cppISteamFriends_SteamFriends010_GetFriendRichPresenceKeyByIndex(void *linux_side, CSteamID steamIDFriend, int iKey)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendRichPresenceKeyByIndex((CSteamID)steamIDFriend, (int)iKey);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_InviteUserToGame(void *linux_side, CSteamID steamIDFriend, const char * pchConnectString)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->InviteUserToGame((CSteamID)steamIDFriend, (const char *)pchConnectString);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetCoplayFriendCount(void *linux_side)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetCoplayFriendCount();
|
||||
}
|
||||
|
||||
CSteamID cppISteamFriends_SteamFriends010_GetCoplayFriend(void *linux_side, int iCoplayFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetCoplayFriend((int)iCoplayFriend);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetFriendCoplayTime(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendCoplayTime((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
AppId_t cppISteamFriends_SteamFriends010_GetFriendCoplayGame(void *linux_side, CSteamID steamIDFriend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendCoplayGame((CSteamID)steamIDFriend);
|
||||
}
|
||||
|
||||
SteamAPICall_t cppISteamFriends_SteamFriends010_JoinClanChatRoom(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->JoinClanChatRoom((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_LeaveClanChatRoom(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->LeaveClanChatRoom((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetClanChatMemberCount(void *linux_side, CSteamID steamIDClan)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanChatMemberCount((CSteamID)steamIDClan);
|
||||
}
|
||||
|
||||
CSteamID cppISteamFriends_SteamFriends010_GetChatMemberByIndex(void *linux_side, CSteamID steamIDClan, int iUser)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetChatMemberByIndex((CSteamID)steamIDClan, (int)iUser);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_SendClanChatMessage(void *linux_side, CSteamID steamIDClanChat, const char * pchText)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->SendClanChatMessage((CSteamID)steamIDClanChat, (const char *)pchText);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetClanChatMessage(void *linux_side, CSteamID steamIDClanChat, int iMessage, void * prgchText, int cchTextMax, EChatEntryType * _a, CSteamID * _b)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetClanChatMessage((CSteamID)steamIDClanChat, (int)iMessage, (void *)prgchText, (int)cchTextMax, (EChatEntryType *)_a, (CSteamID *)_b);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_IsClanChatAdmin(void *linux_side, CSteamID steamIDClanChat, CSteamID steamIDUser)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->IsClanChatAdmin((CSteamID)steamIDClanChat, (CSteamID)steamIDUser);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_IsClanChatWindowOpenInSteam(void *linux_side, CSteamID steamIDClanChat)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->IsClanChatWindowOpenInSteam((CSteamID)steamIDClanChat);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_OpenClanChatWindowInSteam(void *linux_side, CSteamID steamIDClanChat)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->OpenClanChatWindowInSteam((CSteamID)steamIDClanChat);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_CloseClanChatWindowInSteam(void *linux_side, CSteamID steamIDClanChat)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->CloseClanChatWindowInSteam((CSteamID)steamIDClanChat);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_SetListenForFriendsMessages(void *linux_side, bool bInterceptEnabled)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->SetListenForFriendsMessages((bool)bInterceptEnabled);
|
||||
}
|
||||
|
||||
bool cppISteamFriends_SteamFriends010_ReplyToFriendMessage(void *linux_side, CSteamID steamIDFriend, const char * pchMsgToSend)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->ReplyToFriendMessage((CSteamID)steamIDFriend, (const char *)pchMsgToSend);
|
||||
}
|
||||
|
||||
int cppISteamFriends_SteamFriends010_GetFriendMessage(void *linux_side, CSteamID steamIDFriend, int iMessageID, void * pvData, int cubData, EChatEntryType * peChatEntryType)
|
||||
{
|
||||
return ((ISteamFriends*)linux_side)->GetFriendMessage((CSteamID)steamIDFriend, (int)iMessageID, (void *)pvData, (int)cubData, (EChatEntryType *)peChatEntryType);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern const char * cppISteamFriends_SteamFriends010_GetPersonaName(void *);
|
||||
extern void cppISteamFriends_SteamFriends010_SetPersonaName(void *, const char *);
|
||||
extern EPersonaState cppISteamFriends_SteamFriends010_GetPersonaState(void *);
|
||||
extern int cppISteamFriends_SteamFriends010_GetFriendCount(void *, int);
|
||||
extern CSteamID cppISteamFriends_SteamFriends010_GetFriendByIndex(void *, int, int);
|
||||
extern EFriendRelationship cppISteamFriends_SteamFriends010_GetFriendRelationship(void *, CSteamID);
|
||||
extern EPersonaState cppISteamFriends_SteamFriends010_GetFriendPersonaState(void *, CSteamID);
|
||||
extern const char * cppISteamFriends_SteamFriends010_GetFriendPersonaName(void *, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_GetFriendGamePlayed(void *, CSteamID, FriendGameInfo_t *);
|
||||
extern const char * cppISteamFriends_SteamFriends010_GetFriendPersonaNameHistory(void *, CSteamID, int);
|
||||
extern bool cppISteamFriends_SteamFriends010_HasFriend(void *, CSteamID, int);
|
||||
extern int cppISteamFriends_SteamFriends010_GetClanCount(void *);
|
||||
extern CSteamID cppISteamFriends_SteamFriends010_GetClanByIndex(void *, int);
|
||||
extern const char * cppISteamFriends_SteamFriends010_GetClanName(void *, CSteamID);
|
||||
extern const char * cppISteamFriends_SteamFriends010_GetClanTag(void *, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_GetClanActivityCounts(void *, CSteamID, int *, int *, int *);
|
||||
extern SteamAPICall_t cppISteamFriends_SteamFriends010_DownloadClanActivityCounts(void *, CSteamID *, int);
|
||||
extern int cppISteamFriends_SteamFriends010_GetFriendCountFromSource(void *, CSteamID);
|
||||
extern CSteamID cppISteamFriends_SteamFriends010_GetFriendFromSourceByIndex(void *, CSteamID, int);
|
||||
extern bool cppISteamFriends_SteamFriends010_IsUserInSource(void *, CSteamID, CSteamID);
|
||||
extern void cppISteamFriends_SteamFriends010_SetInGameVoiceSpeaking(void *, CSteamID, bool);
|
||||
extern void cppISteamFriends_SteamFriends010_ActivateGameOverlay(void *, const char *);
|
||||
extern void cppISteamFriends_SteamFriends010_ActivateGameOverlayToUser(void *, const char *, CSteamID);
|
||||
extern void cppISteamFriends_SteamFriends010_ActivateGameOverlayToWebPage(void *, const char *);
|
||||
extern void cppISteamFriends_SteamFriends010_ActivateGameOverlayToStore(void *, AppId_t);
|
||||
extern void cppISteamFriends_SteamFriends010_SetPlayedWith(void *, CSteamID);
|
||||
extern void cppISteamFriends_SteamFriends010_ActivateGameOverlayInviteDialog(void *, CSteamID);
|
||||
extern int cppISteamFriends_SteamFriends010_GetSmallFriendAvatar(void *, CSteamID);
|
||||
extern int cppISteamFriends_SteamFriends010_GetMediumFriendAvatar(void *, CSteamID);
|
||||
extern int cppISteamFriends_SteamFriends010_GetLargeFriendAvatar(void *, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_RequestUserInformation(void *, CSteamID, bool);
|
||||
extern SteamAPICall_t cppISteamFriends_SteamFriends010_RequestClanOfficerList(void *, CSteamID);
|
||||
extern CSteamID cppISteamFriends_SteamFriends010_GetClanOwner(void *, CSteamID);
|
||||
extern int cppISteamFriends_SteamFriends010_GetClanOfficerCount(void *, CSteamID);
|
||||
extern CSteamID cppISteamFriends_SteamFriends010_GetClanOfficerByIndex(void *, CSteamID, int);
|
||||
extern uint32 cppISteamFriends_SteamFriends010_GetUserRestrictions(void *);
|
||||
extern bool cppISteamFriends_SteamFriends010_SetRichPresence(void *, const char *, const char *);
|
||||
extern void cppISteamFriends_SteamFriends010_ClearRichPresence(void *);
|
||||
extern const char * cppISteamFriends_SteamFriends010_GetFriendRichPresence(void *, CSteamID, const char *);
|
||||
extern int cppISteamFriends_SteamFriends010_GetFriendRichPresenceKeyCount(void *, CSteamID);
|
||||
extern const char * cppISteamFriends_SteamFriends010_GetFriendRichPresenceKeyByIndex(void *, CSteamID, int);
|
||||
extern bool cppISteamFriends_SteamFriends010_InviteUserToGame(void *, CSteamID, const char *);
|
||||
extern int cppISteamFriends_SteamFriends010_GetCoplayFriendCount(void *);
|
||||
extern CSteamID cppISteamFriends_SteamFriends010_GetCoplayFriend(void *, int);
|
||||
extern int cppISteamFriends_SteamFriends010_GetFriendCoplayTime(void *, CSteamID);
|
||||
extern AppId_t cppISteamFriends_SteamFriends010_GetFriendCoplayGame(void *, CSteamID);
|
||||
extern SteamAPICall_t cppISteamFriends_SteamFriends010_JoinClanChatRoom(void *, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_LeaveClanChatRoom(void *, CSteamID);
|
||||
extern int cppISteamFriends_SteamFriends010_GetClanChatMemberCount(void *, CSteamID);
|
||||
extern CSteamID cppISteamFriends_SteamFriends010_GetChatMemberByIndex(void *, CSteamID, int);
|
||||
extern bool cppISteamFriends_SteamFriends010_SendClanChatMessage(void *, CSteamID, const char *);
|
||||
extern int cppISteamFriends_SteamFriends010_GetClanChatMessage(void *, CSteamID, int, void *, int, EChatEntryType *, CSteamID *);
|
||||
extern bool cppISteamFriends_SteamFriends010_IsClanChatAdmin(void *, CSteamID, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_IsClanChatWindowOpenInSteam(void *, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_OpenClanChatWindowInSteam(void *, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_CloseClanChatWindowInSteam(void *, CSteamID);
|
||||
extern bool cppISteamFriends_SteamFriends010_SetListenForFriendsMessages(void *, bool);
|
||||
extern bool cppISteamFriends_SteamFriends010_ReplyToFriendMessage(void *, CSteamID, const char *);
|
||||
extern int cppISteamFriends_SteamFriends010_GetFriendMessage(void *, CSteamID, int, void *, int, EChatEntryType *);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -51,6 +51,7 @@ sdk_versions = [
|
||||
"119",
|
||||
"118",
|
||||
"117",
|
||||
"116x",
|
||||
"116",
|
||||
"115",
|
||||
"114",
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPS_H
|
||||
#define ISTEAMAPPS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to app data
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamApps
|
||||
{
|
||||
public:
|
||||
virtual bool BIsSubscribed() = 0;
|
||||
virtual bool BIsLowViolence() = 0;
|
||||
virtual bool BIsCybercafe() = 0;
|
||||
virtual bool BIsVACBanned() = 0;
|
||||
virtual const char *GetCurrentGameLanguage() = 0;
|
||||
virtual const char *GetAvailableGameLanguages() = 0;
|
||||
|
||||
// only use this member if you need to check ownership of another game related to yours, a demo for example
|
||||
virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
|
||||
|
||||
// Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed
|
||||
virtual bool BIsDlcInstalled( AppId_t appID ) = 0;
|
||||
|
||||
// returns the Unix time of the purchase of the app
|
||||
virtual uint32 GetEarliestPurchaseUnixTime( AppId_t nAppID ) = 0;
|
||||
|
||||
// Checks if the user is subscribed to the current app through a free weekend
|
||||
// This function will return false for users who have a retail or other type of license
|
||||
// Before using, please ask your Valve technical contact how to package and secure your free weekened
|
||||
virtual bool BIsSubscribedFromFreeWeekend() = 0;
|
||||
|
||||
// Returns the number of DLC pieces for the running app
|
||||
virtual int GetDLCCount() = 0;
|
||||
|
||||
// Returns metadata for DLC by index, of range [0, GetDLCCount()]
|
||||
virtual bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize ) = 0;
|
||||
|
||||
// Install/Uninstall control for optional DLC
|
||||
virtual void InstallDLC( AppId_t nAppID ) = 0;
|
||||
virtual void UninstallDLC( AppId_t nAppID ) = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
// Result returned in a RegisterActivationCodeResponse_t callresult
|
||||
virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION004"
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: posted after the user gains ownership of DLC & that DLC is installed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DlcInstalled_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 5 };
|
||||
AppId_t m_nAppID; // AppID of the DLC
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: response to RegisterActivationCode()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RegisterActivationCodeResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 8 };
|
||||
ERegisterActivactionCodeResult m_eResult;
|
||||
uint32 m_unPackageRegistered; // package that was registered. Only set on success
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMAPPS_H
|
||||
@@ -0,0 +1,32 @@
|
||||
//====== Copyright 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: a private, but well versioned, interface to get at critical bits
|
||||
// of a steam3 appticket - consumed by the simple drm wrapper to let it
|
||||
// ask about ownership with greater confidence.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMAPPTICKET_H
|
||||
#define ISTEAMAPPTICKET_H
|
||||
#ifdef WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: hand out a reasonable "future proof" view of an app ownership ticket
|
||||
// the raw (signed) buffer, and indices into that buffer where the appid and
|
||||
// steamid are located. the sizes of the appid and steamid are implicit in
|
||||
// (each version of) the interface - currently uin32 appid and uint64 steamid
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamAppTicket
|
||||
{
|
||||
public:
|
||||
virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPTICKET_INTERFACE_VERSION "STEAMAPPTICKET_INTERFACE_VERSION001"
|
||||
|
||||
|
||||
#endif // ISTEAMAPPTICKET_H
|
||||
@@ -0,0 +1,180 @@
|
||||
//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Main interface for loading and accessing Steamworks API's from the
|
||||
// Steam client.
|
||||
// For most uses, this code is wrapped inside of SteamAPI_Init()
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMCLIENT_H
|
||||
#define ISTEAMCLIENT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
// handle to a communication pipe to the Steam client
|
||||
typedef int32 HSteamPipe;
|
||||
// handle to single instance of a steam user
|
||||
typedef int32 HSteamUser;
|
||||
// function prototype
|
||||
#if defined( POSIX )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
#if defined( __SNC__ )
|
||||
#pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor
|
||||
#endif
|
||||
|
||||
// interface predec
|
||||
class ISteamUser;
|
||||
class ISteamGameServer;
|
||||
class ISteamFriends;
|
||||
class ISteamUtils;
|
||||
class ISteamMatchmaking;
|
||||
class ISteamContentServer;
|
||||
class ISteamMatchmakingServers;
|
||||
class ISteamUserStats;
|
||||
class ISteamApps;
|
||||
class ISteamNetworking;
|
||||
class ISteamRemoteStorage;
|
||||
class ISteamScreenshots;
|
||||
class ISteamGameServerStats;
|
||||
class ISteamPS3OverlayRender;
|
||||
class ISteamHTTP;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
// connect to an existing steam instance, whether it's in a
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
virtual ISteamUser *GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// retrieves the ISteamGameServer interface associated with the handle
|
||||
virtual ISteamGameServer *GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUtils interface
|
||||
virtual ISteamUtils *GetISteamUtils( HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmaking interface
|
||||
virtual ISteamMatchmaking *GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamMatchmakingServers interface
|
||||
virtual ISteamMatchmakingServers *GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the a generic interface
|
||||
virtual void *GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamUserStats interface
|
||||
virtual ISteamUserStats *GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns the ISteamGameServerStats interface
|
||||
virtual ISteamGameServerStats *GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// returns apps interface
|
||||
virtual ISteamApps *GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// networking
|
||||
virtual ISteamNetworking *GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// remote storage
|
||||
virtual ISteamRemoteStorage *GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// user screenshots
|
||||
virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
// Every IPC call is at minimum a thread context switch if not a process one so you want to rate
|
||||
// control how often you do them.
|
||||
virtual uint32 GetIPCCallCount() = 0;
|
||||
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
|
||||
// Trigger global shutdown for the DLL
|
||||
virtual bool BShutdownIfAllPipesClosed() = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
virtual ISteamPS3OverlayRender *GetISteamPS3OverlayRender() = 0;
|
||||
#endif
|
||||
|
||||
// Expose HTTP interface
|
||||
virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient012"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
enum { k_iSteamUserCallbacks = 100 };
|
||||
enum { k_iSteamGameServerCallbacks = 200 };
|
||||
enum { k_iSteamFriendsCallbacks = 300 };
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iClientRemoteStorageCallbacks = 1300 };
|
||||
enum { k_iSteamUserItemsCallbacks = 1400 };
|
||||
enum { k_iSteamGameServerItemsCallbacks = 1500 };
|
||||
enum { k_iClientUtilsCallbacks = 1600 };
|
||||
enum { k_iSteamGameCoordinatorCallbacks = 1700 };
|
||||
enum { k_iSteamGameServerStatsCallbacks = 1800 };
|
||||
enum { k_iSteam2AsyncCallbacks = 1900 };
|
||||
enum { k_iSteamGameStatsCallbacks = 2000 };
|
||||
enum { k_iClientHTTPCallbacks = 2100 };
|
||||
enum { k_iClientScreenshotsCallbacks = 2200 };
|
||||
enum { k_iSteamScreenshotsCallbacks = 2300 };
|
||||
enum { k_iClientAudioCallbacks = 2400 };
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
//====== Copyright ©, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to the game coordinator for this application
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMECOORDINATOR
|
||||
#define ISTEAMGAMECOORDINATOR
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
|
||||
// list of possible return values from the ISteamGameCoordinator API
|
||||
enum EGCResults
|
||||
{
|
||||
k_EGCResultOK = 0,
|
||||
k_EGCResultNoMessage = 1, // There is no message in the queue
|
||||
k_EGCResultBufferTooSmall = 2, // The buffer is too small for the requested message
|
||||
k_EGCResultNotLoggedOn = 3, // The client is not logged onto Steam
|
||||
k_EGCResultInvalidMessage = 4, // Something was wrong with the message being sent with SendMessage
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for sending and receiving messages from the Game Coordinator
|
||||
// for this application
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameCoordinator
|
||||
{
|
||||
public:
|
||||
|
||||
// sends a message to the Game Coordinator
|
||||
virtual EGCResults SendMessage( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0;
|
||||
|
||||
// returns true if there is a message waiting from the game coordinator
|
||||
virtual bool IsMessageAvailable( uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills the provided buffer with the first message in the queue and returns k_EGCResultOK or
|
||||
// returns k_EGCResultNoMessage if there is no message waiting. pcubMsgSize is filled with the message size.
|
||||
// If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned
|
||||
// and the message remains at the head of the queue.
|
||||
virtual EGCResults RetrieveMessage( uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
};
|
||||
#define STEAMGAMECOORDINATOR_INTERFACE_VERSION "SteamGameCoordinator001"
|
||||
|
||||
// callback notification - A new message is available for reading from the message queue
|
||||
struct GCMessageAvailable_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 1 };
|
||||
uint32 m_nMessageSize;
|
||||
};
|
||||
|
||||
// callback notification - A message failed to make it to the GC. It may be down temporarily
|
||||
struct GCMessageFailed_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 2 };
|
||||
};
|
||||
|
||||
#endif // ISTEAMGAMECOORDINATOR
|
||||
@@ -0,0 +1,384 @@
|
||||
//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVER_H
|
||||
#define ISTEAMGAMESERVER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServer
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// Basic server data. These properties, if set, must be set before before calling LogOn. They
|
||||
// may not be changed after logged in.
|
||||
//
|
||||
|
||||
/// This is called by SteamGameServer_Init, and you will usually not need to call it directly
|
||||
virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0;
|
||||
|
||||
/// Game product identifier. This is currently used by the master server for version checking purposes.
|
||||
/// It's a required field, but will eventually will go away, and the AppID will be used for this purpose.
|
||||
virtual void SetProduct( const char *pszProduct ) = 0;
|
||||
|
||||
/// Description of the game. This is a required field and is displayed in the steam server browser....for now.
|
||||
/// This is a required field, but it will go away eventually, as the data should be determined from the AppID.
|
||||
virtual void SetGameDescription( const char *pszGameDescription ) = 0;
|
||||
|
||||
/// If your game is a "mod," pass the string that identifies it. The default is an empty string, meaning
|
||||
/// this application is the original game, not a mod.
|
||||
///
|
||||
/// @see k_cbMaxGameServerGameDir
|
||||
virtual void SetModDir( const char *pszModDir ) = 0;
|
||||
|
||||
/// Is this is a dedicated server? The default value is false.
|
||||
virtual void SetDedicatedServer( bool bDedicated ) = 0;
|
||||
|
||||
//
|
||||
// Login
|
||||
//
|
||||
|
||||
/// Begin process to login to a persistent game server account
|
||||
///
|
||||
/// You need to register for callbacks to determine the result of this operation.
|
||||
/// @see SteamServersConnected_t
|
||||
/// @see SteamServerConnectFailure_t
|
||||
/// @see SteamServersDisconnected_t
|
||||
virtual void LogOn(
|
||||
const char *pszAccountName,
|
||||
const char *pszPassword
|
||||
) = 0;
|
||||
|
||||
/// Login to a generic, anonymous account.
|
||||
///
|
||||
/// Note: in previous versions of the SDK, this was automatically called within SteamGameServer_Init,
|
||||
/// but this is no longer the case.
|
||||
virtual void LogOnAnonymous() = 0;
|
||||
|
||||
/// Begin process of logging game server out of steam
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
/// Returns true if the master server has requested a restart.
|
||||
/// Only returns true once per request.
|
||||
virtual bool WasRestartRequested() = 0;
|
||||
|
||||
//
|
||||
// Server state. These properties may be changed at any time.
|
||||
//
|
||||
|
||||
/// Max player count that will be reported to server browser and client queries
|
||||
virtual void SetMaxPlayerCount( int cPlayersMax ) = 0;
|
||||
|
||||
/// Number of bots. Default value is zero
|
||||
virtual void SetBotPlayerCount( int cBotplayers ) = 0;
|
||||
|
||||
/// Set the name of server as it will appear in the server browser
|
||||
///
|
||||
/// @see k_cbMaxGameServerName
|
||||
virtual void SetServerName( const char *pszServerName ) = 0;
|
||||
|
||||
/// Set name of map to report in the server browser
|
||||
///
|
||||
/// @see k_cbMaxGameServerName
|
||||
virtual void SetMapName( const char *pszMapName ) = 0;
|
||||
|
||||
/// Let people know if your server will require a password
|
||||
virtual void SetPasswordProtected( bool bPasswordProtected ) = 0;
|
||||
|
||||
/// Spectator server. The default value is zero, meaning the service
|
||||
/// is not used.
|
||||
virtual void SetSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
/// Name of the spectator server. (Only used if spectator port is nonzero.)
|
||||
///
|
||||
/// @see k_cbMaxGameServerMapName
|
||||
virtual void SetSpectatorServerName( const char *pszSpectatorServerName ) = 0;
|
||||
|
||||
/// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
/// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
/// Sets a string defining the "gametags" for this server, this is optional, but if it is set
|
||||
/// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
///
|
||||
/// @see k_cbMaxGameServerTags
|
||||
virtual void SetGameTags( const char *pchGameTags ) = 0;
|
||||
|
||||
/// Sets a string defining the "gamedata" for this server, this is optional, but if it is set
|
||||
/// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
/// don't set this unless it actually changes, its only uploaded to the master once (when
|
||||
/// acknowledged)
|
||||
///
|
||||
/// @see k_cbMaxGameServerGameData
|
||||
virtual void SetGameData( const char *pchGameData) = 0;
|
||||
|
||||
/// Region identifier. This is an optional field, the default value is empty, meaning the "world" region
|
||||
virtual void SetRegion( const char *pszRegion ) = 0;
|
||||
|
||||
//
|
||||
// Player list management / authentication
|
||||
//
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// New auth system APIs - do not mix with the old auth system APIs.
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
|
||||
// pcbTicket retrieves the length of the actual ticket.
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
|
||||
// Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused
|
||||
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
|
||||
virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0;
|
||||
|
||||
// Stop tracking started by BeginAuthSession - called when no longer playing game with this entity
|
||||
virtual void EndAuthSession( CSteamID steamID ) = 0;
|
||||
|
||||
// Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to
|
||||
virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0;
|
||||
|
||||
// After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function
|
||||
// to determine if the user owns downloadable content specified by the provided AppID.
|
||||
virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
|
||||
|
||||
// Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t
|
||||
// returns false if we're not connected to the steam servers and thus cannot ask
|
||||
virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0;
|
||||
|
||||
//
|
||||
// Query steam for server data
|
||||
//
|
||||
|
||||
// Ask for the gameplay stats for the server. Results returned in a callback
|
||||
virtual void GetGameplayStats( ) = 0;
|
||||
|
||||
// Gets the reputation score for the game server. This API also checks if the server or some
|
||||
// other server on the same IP is banned from the Steam master servers.
|
||||
virtual SteamAPICall_t GetServerReputation( ) = 0;
|
||||
|
||||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||
// connect to
|
||||
virtual uint32 GetPublicIP() = 0;
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
|
||||
// AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.
|
||||
// This gets a packet that the master server updater needs to send out on UDP.
|
||||
// It returns the length of the packet it wants to send, or 0 if there are no more packets to send.
|
||||
// Call this each frame until it returns 0.
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
//
|
||||
// Control heartbeats / advertisement with master server
|
||||
//
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void EnableHeartbeats( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
// Force a heartbeat to steam at the next opportunity
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// associate this game server with this clan for the purposes of computing player compat
|
||||
virtual SteamAPICall_t AssociateWithClan( CSteamID steamIDClan ) = 0;
|
||||
|
||||
// ask if any of the current players dont want to play with this new player - or vice versa
|
||||
virtual SteamAPICall_t ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer ) = 0;
|
||||
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer011"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
};
|
||||
|
||||
|
||||
// client has been denied to connection to this game server
|
||||
struct GSClientDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 2 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
char m_rgchOptionalText[128];
|
||||
};
|
||||
|
||||
|
||||
// request the game server should kick the user
|
||||
struct GSClientKick_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 3 };
|
||||
CSteamID m_SteamID;
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
|
||||
// client achievement info
|
||||
struct GSClientAchievementStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 6 };
|
||||
uint64 m_SteamID;
|
||||
char m_pchAchievement[128];
|
||||
bool m_bUnlocked;
|
||||
};
|
||||
|
||||
// received when the game server requests to be displayed as secure (VAC protected)
|
||||
// m_bSecure is true if the game server should display itself as secure to users, false otherwise
|
||||
struct GSPolicyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 15 };
|
||||
uint8 m_bSecure;
|
||||
};
|
||||
|
||||
// GS gameplay stats info
|
||||
struct GSGameplayStats_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 7 };
|
||||
EResult m_eResult; // Result of the call
|
||||
int32 m_nRank; // Overall rank of the server (0-based)
|
||||
uint32 m_unTotalConnects; // Total number of clients who have ever connected to the server
|
||||
uint32 m_unTotalMinutesPlayed; // Total number of minutes ever played on the server
|
||||
};
|
||||
|
||||
// send as a reply to RequestUserGroupStatus()
|
||||
struct GSClientGroupStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 8 };
|
||||
CSteamID m_SteamIDUser;
|
||||
CSteamID m_SteamIDGroup;
|
||||
bool m_bMember;
|
||||
bool m_bOfficer;
|
||||
};
|
||||
|
||||
// Sent as a reply to GetServerReputation()
|
||||
struct GSReputation_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 9 };
|
||||
EResult m_eResult; // Result of the call;
|
||||
uint32 m_unReputationScore; // The reputation score for the game server
|
||||
bool m_bBanned; // True if the server is banned from the Steam
|
||||
// master servers
|
||||
|
||||
// The following members are only filled out if m_bBanned is true. They will all
|
||||
// be set to zero otherwise. Master server bans are by IP so it is possible to be
|
||||
// banned even when the score is good high if there is a bad server on another port.
|
||||
// This information can be used to determine which server is bad.
|
||||
|
||||
uint32 m_unBannedIP; // The IP of the banned server
|
||||
uint16 m_usBannedPort; // The port of the banned server
|
||||
uint64 m_ulBannedGameID; // The game ID the banned server is serving
|
||||
uint32 m_unBanExpires; // Time the ban expires, expressed in the Unix epoch (seconds since 1/1/1970)
|
||||
};
|
||||
|
||||
// Sent as a reply to AssociateWithClan()
|
||||
struct AssociateWithClanResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 10 };
|
||||
EResult m_eResult; // Result of the call;
|
||||
};
|
||||
|
||||
// Sent as a reply to ComputeNewPlayerCompatibility()
|
||||
struct ComputeNewPlayerCompatibilityResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 11 };
|
||||
EResult m_eResult; // Result of the call;
|
||||
int m_cPlayersThatDontLikeCandidate;
|
||||
int m_cPlayersThatCandidateDoesntLike;
|
||||
int m_cClanPlayersThatDontLikeCandidate;
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMGAMESERVER_H
|
||||
@@ -0,0 +1,93 @@
|
||||
//====== Copyright © Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface for game servers to steam stats and achievements
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESERVERSTATS_H
|
||||
#define ISTEAMGAMESERVERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameServerStats
|
||||
{
|
||||
public:
|
||||
// downloads stats for the user
|
||||
// returns a GSStatsReceived_t callback when completed
|
||||
// if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail
|
||||
// these stats will only be auto-updated for clients playing on the server. For other
|
||||
// users you'll need to call RequestUserStats() again to refresh any data
|
||||
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// requests stat information for a user, usable after a successful call to RequestUserStats()
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||
|
||||
// Set / update stats and achievements.
|
||||
// Note: These updates will work only on stats game servers are allowed to edit and only for
|
||||
// game servers that have been declared as officially controlled by the game creators.
|
||||
// Set the IP range of your official servers on the Steamworks page
|
||||
virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0;
|
||||
virtual bool ClearUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a GSStatsStored_t callback when set.
|
||||
//
|
||||
// If the callback has a result of k_EResultInvalidParam, one or more stats
|
||||
// uploaded has been rejected, either because they broke constraints
|
||||
// or were out of date. In this case the server sends back updated values.
|
||||
// The stats should be re-iterated to keep in sync.
|
||||
virtual SteamAPICall_t StoreUserStats( CSteamID steamIDUser ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVERSTATS_INTERFACE_VERSION "SteamGameServerStats001"
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GSStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerStatsCallbacks };
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
CSteamID m_steamIDUser; // The user for whom the stats are retrieved for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GSStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerStatsCallbacks + 1 };
|
||||
EResult m_eResult; // success / error
|
||||
CSteamID m_steamIDUser; // The user for whom the stats were stored
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback indicating that a user's stats have been unloaded.
|
||||
// Call RequestUserStats again to access stats for this user
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GSStatsUnloaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 };
|
||||
CSteamID m_steamIDUser; // User whose stats have been unloaded
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMGAMESERVERSTATS_H
|
||||
@@ -0,0 +1,75 @@
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game play statistics
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMESTATS_H
|
||||
#define ISTEAMGAMESTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for recording game play sessions and details thereof
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameStats
|
||||
{
|
||||
public:
|
||||
virtual SteamAPICall_t GetNewSession( int8 nAccountType, uint64 ulAccountID, int32 nAppID, RTime32 rtTimeStarted ) = 0;
|
||||
virtual SteamAPICall_t EndSession( uint64 ulSessionID, RTime32 rtTimeEnded, int nReasonCode ) = 0;
|
||||
virtual EResult AddSessionAttributeInt( uint64 ulSessionID, const char* pstrName, int32 nData ) = 0;
|
||||
virtual EResult AddSessionAttributeString( uint64 ulSessionID, const char* pstrName, const char *pstrData ) = 0;
|
||||
virtual EResult AddSessionAttributeFloat( uint64 ulSessionID, const char* pstrName, float fData ) = 0;
|
||||
|
||||
virtual EResult AddNewRow( uint64 *pulRowID, uint64 ulSessionID, const char *pstrTableName ) = 0;
|
||||
virtual EResult CommitRow( uint64 ulRowID ) = 0;
|
||||
virtual EResult CommitOutstandingRows( uint64 ulSessionID ) = 0;
|
||||
virtual EResult AddRowAttributeInt( uint64 ulRowID, const char *pstrName, int32 nData ) = 0;
|
||||
virtual EResult AddRowAtributeString( uint64 ulRowID, const char *pstrName, const char *pstrData ) = 0;
|
||||
virtual EResult AddRowAttributeFloat( uint64 ulRowID, const char *pstrName, float fData ) = 0;
|
||||
|
||||
virtual EResult AddSessionAttributeInt64( uint64 ulSessionID, const char *pstrName, int64 llData ) = 0;
|
||||
virtual EResult AddRowAttributeInt64( uint64 ulRowID, const char *pstrName, int64 llData ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMGAMESTATS_INTERFACE_VERSION "SteamGameStats001"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: nAccountType for GetNewSession
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EGameStatsAccountType
|
||||
{
|
||||
k_EGameStatsAccountType_Steam = 1, // ullAccountID is a 64-bit SteamID for a player
|
||||
k_EGameStatsAccountType_Xbox = 2, // ullAccountID is a 64-bit XUID
|
||||
k_EGameStatsAccountType_SteamGameServer = 3, // ullAccountID is a 64-bit SteamID for a game server
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: callback for GetNewSession() method
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameStatsSessionIssued_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameStatsCallbacks + 1 };
|
||||
|
||||
uint64 m_ulSessionID;
|
||||
EResult m_eResult;
|
||||
bool m_bCollectingAny;
|
||||
bool m_bCollectingDetails;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: callback for EndSession() method
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GameStatsSessionClosed_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameStatsCallbacks + 2 };
|
||||
|
||||
uint64 m_ulSessionID;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
#endif // ISTEAMGAMESTATS_H
|
||||
@@ -0,0 +1,127 @@
|
||||
//====== Copyright © 1996-2009, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to http client
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMHTTP_H
|
||||
#define ISTEAMHTTP_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steamhttpenums.h"
|
||||
|
||||
// Handle to a depot build
|
||||
typedef uint32 HTTPRequestHandle;
|
||||
#define INVALID_HTTPREQUEST_HANDLE 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to building depots
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamHTTP
|
||||
{
|
||||
public:
|
||||
|
||||
// Initializes a new HTTP request, returning a handle to use in further operations on it. Requires
|
||||
// the method (GET or POST) and the absolute URL for the request. Only http requests (ie, not https) are
|
||||
// currently supported, so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/
|
||||
// or such.
|
||||
virtual HTTPRequestHandle CreateHTTPRequest( EHTTPMethod eHTTPRequestMethod, const char *pchAbsoluteURL ) = 0;
|
||||
|
||||
// Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after
|
||||
// sending the request. This is just so the caller can easily keep track of which callbacks go with which request data.
|
||||
virtual bool SetHTTPRequestContextValue( HTTPRequestHandle hRequest, uint64 ulContextValue ) = 0;
|
||||
|
||||
// Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default
|
||||
// timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request
|
||||
// has already been sent.
|
||||
virtual bool SetHTTPRequestNetworkActivityTimeout( HTTPRequestHandle hRequest, uint32 unTimeoutSeconds ) = 0;
|
||||
|
||||
// Set a request header value for the request, must be called prior to sending the request. Will
|
||||
// return false if the handle is invalid or the request is already sent.
|
||||
virtual bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, const char *pchHeaderValue ) = 0;
|
||||
|
||||
// Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified
|
||||
// when creating the request. Must be called prior to sending the request. Will return false if the
|
||||
// handle is invalid or the request is already sent.
|
||||
virtual bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, const char *pchParamName, const char *pchParamValue ) = 0;
|
||||
|
||||
// Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on
|
||||
// asyncronous response via callback.
|
||||
//
|
||||
// Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control
|
||||
// header and only do a local cache lookup rather than sending any actual remote request.
|
||||
virtual bool SendHTTPRequest( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0;
|
||||
|
||||
// Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move
|
||||
// the specified request to the tail of the queue. Returns false on invalid handle, or if the request is not yet sent.
|
||||
virtual bool DeferHTTPRequest( HTTPRequestHandle hRequest ) = 0;
|
||||
|
||||
// Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move
|
||||
// the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent.
|
||||
virtual bool PrioritizeHTTPRequest( HTTPRequestHandle hRequest ) = 0;
|
||||
|
||||
// Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also
|
||||
// returns the size of the header value if present so the caller and allocate a correctly sized buffer for
|
||||
// GetHTTPResponseHeaderValue.
|
||||
virtual bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, const char *pchHeaderName, uint32 *unResponseHeaderSize ) = 0;
|
||||
|
||||
// Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// header is not present or if your buffer is too small to contain it's value. You should first call
|
||||
// BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed.
|
||||
virtual bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, uint8 *pHeaderValueBuffer, uint32 unBufferSize ) = 0;
|
||||
|
||||
// Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// handle is invalid.
|
||||
virtual bool GetHTTPResponseBodySize( HTTPRequestHandle hRequest, uint32 *unBodySize ) = 0;
|
||||
|
||||
// Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// handle is invalid or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out
|
||||
// the correct buffer size to use.
|
||||
virtual bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0;
|
||||
|
||||
// Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t
|
||||
// callback and finishing using the response.
|
||||
virtual bool ReleaseHTTPRequest( HTTPRequestHandle hRequest ) = 0;
|
||||
|
||||
// Gets progress on downloading the body for the request. This will be zero unless a response header has already been
|
||||
// received which included a content-length field. For responses that contain no content-length it will report
|
||||
// zero for the duration of the request as the size is unknown until the connection closes.
|
||||
virtual bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest, float *pflPercentOut ) = 0;
|
||||
|
||||
// Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params
|
||||
// have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType
|
||||
// parameter will set the content-type header for the request so the server may know how to interpret the body.
|
||||
virtual bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, const char *pchContentType, uint8 *pubBody, uint32 unBodyLen ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION001"
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
struct HTTPRequestCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientHTTPCallbacks + 1 };
|
||||
|
||||
// Handle value for the request that has completed.
|
||||
HTTPRequestHandle m_hRequest;
|
||||
|
||||
// Context value that the user defined on the request that this callback is associated with, 0 if
|
||||
// no context value was set.
|
||||
uint64 m_ulContextValue;
|
||||
|
||||
// This will be true if we actually got any sort of response from the server (even an error).
|
||||
// It will be false if we failed due to an internal error or client side network failure.
|
||||
bool m_bRequestSuccessful;
|
||||
|
||||
// Will be the HTTP status code value returned by the server, k_EHTTPStatusCode200OK is the normal
|
||||
// OK response, if you get something else you probably need to treat it as a failure.
|
||||
EHTTPStatusCode m_eStatusCode;
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMHTTP_H
|
||||
@@ -0,0 +1 @@
|
||||
#error "This file isn't used any more"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,294 @@
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKING
|
||||
#define ISTEAMNETWORKING
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
|
||||
|
||||
// list of possible errors returned by SendP2PPacket() API
|
||||
// these will be posted in the P2PSessionConnectFail_t callback
|
||||
enum EP2PSessionError
|
||||
{
|
||||
k_EP2PSessionErrorNone = 0,
|
||||
k_EP2PSessionErrorNotRunningApp = 1, // target is not running the same game
|
||||
k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running
|
||||
k_EP2PSessionErrorDestinationNotLoggedIn = 3, // target user isn't connected to Steam
|
||||
k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser()
|
||||
// corporate firewalls can also block this (NAT traversal is not firewall traversal)
|
||||
// make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction
|
||||
k_EP2PSessionErrorMax = 5
|
||||
};
|
||||
|
||||
// SendP2PPacket() send types
|
||||
// Typically k_EP2PSendUnreliable is what you want for UDP-like packets, k_EP2PSendReliable for TCP-like packets
|
||||
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,
|
||||
|
||||
};
|
||||
|
||||
|
||||
// connection state to a specified user, returned by GetP2PSessionState()
|
||||
// this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin
|
||||
#pragma pack( push, 8 )
|
||||
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( pop )
|
||||
|
||||
|
||||
// handle to a socket
|
||||
typedef uint32 SNetSocket_t; // CreateP2PConnectionSocket()
|
||||
typedef uint32 SNetListenSocket_t; // CreateListenSocket()
|
||||
|
||||
// connection progress indicators, used by CreateP2PConnectionSocket()
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
// p2p connections
|
||||
k_ESNetSocketStateLocalCandidatesFound = 11, // we've found our local IP info
|
||||
k_ESNetSocketStateReceivedRemoteCandidates = 12,// we've received information from the remote machine, via the Steam back-end, about their IP info
|
||||
|
||||
// direct connections
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
k_ESNetSocketStateConnectionBroken = 25, // connection has been broken; either the other end has disappeared or our local network connection has broke
|
||||
|
||||
};
|
||||
|
||||
// describes how the socket is currently connected
|
||||
enum ESNetSocketConnectionType
|
||||
{
|
||||
k_ESNetSocketConnectionTypeNotConnected = 0,
|
||||
k_ESNetSocketConnectionTypeUDP = 1,
|
||||
k_ESNetSocketConnectionTypeUDPRelay = 2,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamNetworking
|
||||
{
|
||||
public:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Session-less connection functions
|
||||
// automatically establishes NAT-traversing or Relay server connections
|
||||
|
||||
// Sends a P2P packet to the specified user
|
||||
// UDP-like, unreliable and a max packet size of 1200 bytes
|
||||
// the first packet send may be delayed as the NAT-traversal code runs
|
||||
// if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t
|
||||
// see EP2PSend enum above for the descriptions of the different ways of sending packets
|
||||
//
|
||||
// nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket()
|
||||
// with the same channel number in order to retrieve the data on the other end
|
||||
// using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources
|
||||
virtual bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel = 0 ) = 0;
|
||||
|
||||
// returns true if any data is available for read, and the amount of data that will need to be read
|
||||
virtual bool IsP2PPacketAvailable( uint32 *pcubMsgSize, int nChannel = 0 ) = 0;
|
||||
|
||||
// reads in a packet that has been sent from another user via SendP2PPacket()
|
||||
// returns the size of the message and the steamID of the user who sent it in the last two parameters
|
||||
// if the buffer passed in is too small, the message will be truncated
|
||||
// this call is not blocking, and will return false if no data is available
|
||||
virtual bool ReadP2PPacket( void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, CSteamID *psteamIDRemote, int nChannel = 0 ) = 0;
|
||||
|
||||
// AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback
|
||||
// P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet
|
||||
// if you don't want to talk to the user, just ignore the request
|
||||
// if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically
|
||||
// this may be called multiple times for a single user
|
||||
// (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request)
|
||||
virtual bool AcceptP2PSessionWithUser( CSteamID steamIDRemote ) = 0;
|
||||
|
||||
// call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood
|
||||
// if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted
|
||||
virtual bool CloseP2PSessionWithUser( CSteamID steamIDRemote ) = 0;
|
||||
|
||||
// call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels
|
||||
// open channels to a user have been closed, the open session to the user will be closed and new data from this
|
||||
// user will trigger a P2PSessionRequest_t callback
|
||||
virtual bool CloseP2PChannelWithUser( CSteamID steamIDRemote, int nChannel ) = 0;
|
||||
|
||||
// fills out P2PSessionState_t structure with details about the underlying connection to the user
|
||||
// should only needed for debugging purposes
|
||||
// returns false if no connection exists to the specified user
|
||||
virtual bool GetP2PSessionState( CSteamID steamIDRemote, P2PSessionState_t *pConnectionState ) = 0;
|
||||
|
||||
// Allow P2P connections to fall back to being relayed through the Steam servers if a direct connection
|
||||
// or NAT-traversal cannot be established. Only applies to connections created after setting this value,
|
||||
// or to existing connections that need to automatically reconnect after this value is set.
|
||||
//
|
||||
// P2P packet relay is allowed by default
|
||||
virtual bool AllowP2PPacketRelay( bool bAllow ) = 0;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// LISTEN / CONNECT style interface functions
|
||||
//
|
||||
// This is an older set of functions designed around the Berkeley TCP sockets model
|
||||
// it's preferential that you use the above P2P functions, they're more robust
|
||||
// and these older functions will be removed eventually
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// creates a socket and listens others to connect
|
||||
// will trigger a SocketStatusCallback_t callback on another client connecting
|
||||
// nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports
|
||||
// this can usually just be 0 unless you want multiple sets of connections
|
||||
// unIP is the local IP address to bind to
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketStatusCallback_t callback
|
||||
// on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
// if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect
|
||||
virtual bool DestroySocket( SNetSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
// destroying a listen socket will automatically kill all the regular sockets generated from it
|
||||
virtual bool DestroyListenSocket( SNetListenSocket_t hSocket, bool bNotifyRemoteEnd ) = 0;
|
||||
|
||||
// sending data
|
||||
// must be a handle to a connected socket
|
||||
// data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets
|
||||
// use the reliable flag with caution; although the resend rate is pretty aggressive,
|
||||
// it can still cause stalls in receiving data (like TCP)
|
||||
virtual bool SendDataOnSocket( SNetSocket_t hSocket, void *pubData, uint32 cubData, bool bReliable ) = 0;
|
||||
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool IsDataAvailable( SNetListenSocket_t hListenSocket, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// retrieves data from any socket that has been connected off this listen socket
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
// fills out *phSocket with the socket that data is available on
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
// returns true to describe how the socket ended up connecting
|
||||
virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0;
|
||||
|
||||
// max packet size, in bytes
|
||||
virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0;
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking005"
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
// callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API
|
||||
// in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them
|
||||
struct P2PSessionRequest_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 };
|
||||
CSteamID m_steamIDRemote; // user who wants to talk to us
|
||||
};
|
||||
|
||||
|
||||
// callback notification - packets can't get through to the specified user via the SendP2PPacket() API
|
||||
// all packets queued packets unsent at this point will be dropped
|
||||
// further attempts to send will retry making the connection (but will be dropped if we fail again)
|
||||
struct P2PSessionConnectFail_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 };
|
||||
CSteamID m_steamIDRemote; // user we were sending packets to
|
||||
uint8 m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble
|
||||
};
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
// used as part of the CreateListenSocket() / CreateP2PConnectionSocket()
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
CSteamID m_steamIDRemote; // remote steamID we have connected to, if it has one
|
||||
int m_eSNetSocketState; // socket state, ESNetSocketState
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMNETWORKING
|
||||
@@ -0,0 +1,91 @@
|
||||
//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface the game must provide Steam with on PS3 in order for the
|
||||
// Steam overlay to render.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMPS3OVERLAYRENDERER_H
|
||||
#define ISTEAMPS3OVERLAYRENDERER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "cell/pad.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Enum for supported gradient directions
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EOverlayGradientDirection
|
||||
{
|
||||
k_EOverlayGradientHorizontal = 1,
|
||||
k_EOverlayGradientVertical = 2,
|
||||
k_EOverlayGradientNone = 3,
|
||||
};
|
||||
|
||||
// Helpers for fetching individual color components from ARGB packed DWORD colors Steam PS3 overlay renderer uses.
|
||||
#define STEAM_COLOR_RED( color ) \
|
||||
(int)(((color)>>16)&0xff)
|
||||
|
||||
#define STEAM_COLOR_GREEN( color ) \
|
||||
(int)(((color)>>8)&0xff)
|
||||
|
||||
#define STEAM_COLOR_BLUE( color ) \
|
||||
(int)((color)&0xff)
|
||||
|
||||
#define STEAM_COLOR_ALPHA( color ) \
|
||||
(int)(((color)>>24)&0xff)
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface the game must expose to Steam for rendering
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamPS3OverlayRenderHost
|
||||
{
|
||||
public:
|
||||
|
||||
// Interface for game engine to implement which Steam requires to render.
|
||||
|
||||
// Draw a textured rect. This may use only part of the texture and will pass texture coords, it will also possibly request a gradient and will specify colors for vertexes.
|
||||
virtual void DrawTexturedRect( int x0, int y0, int x1, int y1, float u0, float v0, float u1, float v1, int32 iTextureID, DWORD colorStart, DWORD colorEnd, EOverlayGradientDirection eDirection ) = 0;
|
||||
|
||||
// Load a RGBA texture for Steam, or update a previously loaded one. Updates may be partial. You must not evict or remove this texture once Steam has uploaded it.
|
||||
virtual void LoadOrUpdateTexture( int32 iTextureID, bool bIsFullTexture, int x0, int y0, uint32 uWidth, uint32 uHeight, int32 iBytes, char *pData ) = 0;
|
||||
|
||||
// Delete a texture Steam previously uploaded
|
||||
virtual void DeleteTexture( int32 iTextureID ) = 0;
|
||||
|
||||
// Delete all previously uploaded textures
|
||||
virtual void DeleteAllTextures() = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface Steam exposes for the game to tell it when to render, etc.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamPS3OverlayRender
|
||||
{
|
||||
public:
|
||||
|
||||
// Call once at startup to initialize the Steam overlay and pass it your host interface ptr
|
||||
virtual bool BHostInitialize( uint32 unScreenWidth, uint32 unScreenHeight, uint32 unRefreshRate, ISteamPS3OverlayRenderHost *pRenderHost, void *CellFontLib ) = 0;
|
||||
|
||||
// Call this once a frame when you are ready for the Steam overlay to render (ie, right before flipping buffers, after all your rendering)
|
||||
virtual void Render() = 0;
|
||||
|
||||
// Call this everytime you read input on PS3.
|
||||
//
|
||||
// If this returns true, then the overlay is active and has consumed the input, your game
|
||||
// should then ignore all the input until BHandleCellPadData once again returns false, which
|
||||
// will mean the overlay is deactivated.
|
||||
virtual bool BHandleCellPadData( const CellPadData &padData ) = 0;
|
||||
|
||||
// Call this if you detect no controllers connected or that the XMB is intercepting input
|
||||
//
|
||||
// This is important to clear input state for the overlay, so keys left down during XMB activation
|
||||
// are not continued to be processed.
|
||||
virtual bool BResetInputState() = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMPS3OVERLAYRENDERER_H
|
||||
@@ -0,0 +1,458 @@
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: public interface to user remote file storage in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMREMOTESTORAGE_H
|
||||
#define ISTEAMREMOTESTORAGE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Structure that contains an array of const char * strings and the number of those strings
|
||||
//-----------------------------------------------------------------------------
|
||||
#pragma pack( push, 8 )
|
||||
struct SteamParamStringArray_t
|
||||
{
|
||||
const char ** m_ppStrings;
|
||||
int32 m_nNumStrings;
|
||||
};
|
||||
#pragma pack( pop )
|
||||
|
||||
// A handle to a piece of user generated content
|
||||
typedef uint64 UGCHandle_t;
|
||||
typedef uint64 PublishedFileId_t;
|
||||
const UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffffull;
|
||||
|
||||
const uint32 k_cchPublishedDocumentTitleMax = 128 + 1;
|
||||
const uint32 k_cchPublishedDocumentDescriptionMax = 256 + 1;
|
||||
const uint32 k_unEnumeratePublishedFilesMaxResults = 50;
|
||||
const uint32 k_cchTagListMax = 1024 + 1;
|
||||
const uint32 k_cchFilenameMax = 260;
|
||||
|
||||
// Ways to handle a synchronization conflict
|
||||
enum EResolveConflict
|
||||
{
|
||||
k_EResolveConflictKeepClient = 1, // The local version of each file will be used to overwrite the server version
|
||||
k_EResolveConflictKeepServer = 2, // The server version of each file will be used to overwrite the local version
|
||||
};
|
||||
|
||||
enum ERemoteStoragePlatform
|
||||
{
|
||||
k_ERemoteStoragePlatformNone = 0,
|
||||
k_ERemoteStoragePlatformWindows = (1 << 0),
|
||||
k_ERemoteStoragePlatformOSX = (1 << 1 ),
|
||||
k_ERemoteStoragePlatformPS3 = (1 << 2),
|
||||
k_ERemoteStoragePlatformReserved1 = (1 << 3),
|
||||
k_ERemoteStoragePlatformReserved2 = (1 << 4),
|
||||
|
||||
k_ERemoteStoragePlatformAll = 0xffffffff
|
||||
};
|
||||
|
||||
enum ERemoteStoragePublishedFileVisibility
|
||||
{
|
||||
k_ERemoteStoragePublishedFileVisibilityPublic = 0,
|
||||
k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
|
||||
k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: helper structure for making updates to published files.
|
||||
// make sure to update serialization/deserialization in interfacemap.cpp if new properties are added
|
||||
//-----------------------------------------------------------------------------
|
||||
#pragma pack( push, 8 )
|
||||
struct RemoteStorageUpdatePublishedFileRequest_t
|
||||
{
|
||||
public:
|
||||
RemoteStorageUpdatePublishedFileRequest_t()
|
||||
{
|
||||
Initialize( k_GIDNil );
|
||||
}
|
||||
|
||||
RemoteStorageUpdatePublishedFileRequest_t( PublishedFileId_t unPublishedFileId )
|
||||
{
|
||||
Initialize( unPublishedFileId );
|
||||
}
|
||||
|
||||
PublishedFileId_t GetPublishedFileId() { return m_unPublishedFileId; }
|
||||
|
||||
void SetFile( const char *pchFile )
|
||||
{
|
||||
m_pchFile = pchFile;
|
||||
m_bUpdateFile = true;
|
||||
}
|
||||
|
||||
const char *GetFile() { return m_pchFile; }
|
||||
bool BUpdateFile() { return m_bUpdateFile; }
|
||||
|
||||
void SetPreviewFile( const char *pchPreviewFile )
|
||||
{
|
||||
m_pchPreviewFile = pchPreviewFile;
|
||||
m_bUpdatePreviewFile = true;
|
||||
}
|
||||
|
||||
const char *GetPreviewFile() { return m_pchPreviewFile; }
|
||||
bool BUpdatePreviewFile() { return m_bUpdatePreviewFile; }
|
||||
|
||||
void SetTitle( const char *pchTitle )
|
||||
{
|
||||
m_pchTitle = pchTitle;
|
||||
m_bUpdateTitle = true;
|
||||
}
|
||||
|
||||
const char *GetTitle() { return m_pchTitle; }
|
||||
bool BUpdateTitle() { return m_bUpdateTitle; }
|
||||
|
||||
void SetDescription( const char *pchDescription )
|
||||
{
|
||||
m_pchDescription = pchDescription;
|
||||
m_bUpdateDescription = true;
|
||||
}
|
||||
|
||||
const char *GetDescription() { return m_pchDescription; }
|
||||
bool BUpdateDescription() { return m_bUpdateDescription; }
|
||||
|
||||
void SetVisibility( ERemoteStoragePublishedFileVisibility eVisibility )
|
||||
{
|
||||
m_eVisibility = eVisibility;
|
||||
m_bUpdateVisibility = true;
|
||||
}
|
||||
|
||||
const ERemoteStoragePublishedFileVisibility GetVisibility() { return m_eVisibility; }
|
||||
bool BUpdateVisibility() { return m_bUpdateVisibility; }
|
||||
|
||||
void SetTags( SteamParamStringArray_t *pTags )
|
||||
{
|
||||
m_pTags = pTags;
|
||||
m_bUpdateTags = true;
|
||||
}
|
||||
|
||||
SteamParamStringArray_t *GetTags() { return m_pTags; }
|
||||
bool BUpdateTags() { return m_bUpdateTags; }
|
||||
SteamParamStringArray_t **GetTagsPointer() { return &m_pTags; }
|
||||
|
||||
void Initialize( PublishedFileId_t unPublishedFileId )
|
||||
{
|
||||
m_unPublishedFileId = unPublishedFileId;
|
||||
m_pchFile = 0;
|
||||
m_pchPreviewFile = 0;
|
||||
m_pchTitle = 0;
|
||||
m_pchDescription = 0;
|
||||
m_pTags = 0;
|
||||
|
||||
m_bUpdateFile = false;
|
||||
m_bUpdatePreviewFile = false;
|
||||
m_bUpdateTitle = false;
|
||||
m_bUpdateDescription = false;
|
||||
m_bUpdateTags = false;
|
||||
m_bUpdateVisibility = false;
|
||||
}
|
||||
|
||||
private:
|
||||
PublishedFileId_t m_unPublishedFileId;
|
||||
const char *m_pchFile;
|
||||
const char *m_pchPreviewFile;
|
||||
const char *m_pchTitle;
|
||||
const char *m_pchDescription;
|
||||
ERemoteStoragePublishedFileVisibility m_eVisibility;
|
||||
SteamParamStringArray_t *m_pTags;
|
||||
|
||||
bool m_bUpdateFile;
|
||||
bool m_bUpdatePreviewFile;
|
||||
bool m_bUpdateTitle;
|
||||
bool m_bUpdateDescription;
|
||||
bool m_bUpdateVisibility;
|
||||
bool m_bUpdateTags;
|
||||
};
|
||||
#pragma pack( pop )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing, reading and writing files stored remotely
|
||||
// and cached locally
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamRemoteStorage
|
||||
{
|
||||
public:
|
||||
// NOTE
|
||||
//
|
||||
// Filenames are case-insensitive, and will be converted to lowercase automatically.
|
||||
// So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then
|
||||
// iterate the files, the filename returned will be "foo.bar".
|
||||
//
|
||||
|
||||
// file operations
|
||||
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||
virtual bool FileForget( const char *pchFile ) = 0;
|
||||
virtual bool FileDelete( const char *pchFile ) = 0;
|
||||
virtual SteamAPICall_t FileShare( const char *pchFile ) = 0;
|
||||
virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0;
|
||||
|
||||
// file information
|
||||
virtual bool FileExists( const char *pchFile ) = 0;
|
||||
virtual bool FilePersisted( const char *pchFile ) = 0;
|
||||
virtual int32 GetFileSize( const char *pchFile ) = 0;
|
||||
virtual int64 GetFileTimestamp( const char *pchFile ) = 0;
|
||||
virtual ERemoteStoragePlatform GetSyncPlatforms( const char *pchFile ) = 0;
|
||||
|
||||
// iteration
|
||||
virtual int32 GetFileCount() = 0;
|
||||
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||
|
||||
// configuration management
|
||||
virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
|
||||
virtual bool IsCloudEnabledForAccount() = 0;
|
||||
virtual bool IsCloudEnabledForApp() = 0;
|
||||
virtual void SetCloudEnabledForApp( bool bEnabled ) = 0;
|
||||
|
||||
// user generated content
|
||||
virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent ) = 0;
|
||||
virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, char **ppchName, int32 *pnFileSizeInBytes, CSteamID *pSteamIDOwner ) = 0;
|
||||
virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead ) = 0;
|
||||
|
||||
// user generated content iteration
|
||||
virtual int32 GetCachedUGCCount() = 0;
|
||||
virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0;
|
||||
|
||||
// The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you
|
||||
// On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.
|
||||
|
||||
#if defined(_PS3) || defined(_SERVER)
|
||||
// Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback
|
||||
virtual void GetFileListFromServer() = 0;
|
||||
// Indicate this file should be downloaded in the next sync
|
||||
virtual bool FileFetch( const char *pchFile ) = 0;
|
||||
// Indicate this file should be persisted in the next sync
|
||||
virtual bool FilePersist( const char *pchFile ) = 0;
|
||||
// Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback
|
||||
virtual bool SynchronizeToClient() = 0;
|
||||
// Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback
|
||||
virtual bool SynchronizeToServer() = 0;
|
||||
// Reset any fetch/persist/etc requests
|
||||
virtual bool ResetFileRequestState() = 0;
|
||||
#endif
|
||||
|
||||
// publishing UGC
|
||||
virtual SteamAPICall_t PublishFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0;
|
||||
virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, SteamParamStringArray_t *pTags ) = 0;
|
||||
virtual SteamAPICall_t UpdatePublishedFile( RemoteStorageUpdatePublishedFileRequest_t updatePublishedFileRequest ) = 0;
|
||||
virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0;
|
||||
virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0;
|
||||
virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION005"
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sent when the local file cache is fully synced with the server for an app
|
||||
// That means that an application can be started and has all latest files
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncedClient_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 1 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
int m_unNumDownloads;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sent when the server is fully synced with the local file cache for an app
|
||||
// That means that we can shutdown Steam and our data is stored on the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncedServer_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 2 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
int m_unNumUploads;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Status of up and downloads during a sync session
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncProgress_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 3 };
|
||||
char m_rgchCurrentFile[k_cchFilenameMax]; // Current file being transferred
|
||||
AppId_t m_nAppID; // App this info relates to
|
||||
uint32 m_uBytesTransferredThisChunk; // Bytes transferred this chunk
|
||||
double m_dAppPercentComplete; // Percent complete that this app's transfers are
|
||||
bool m_bUploading; // if false, downloading
|
||||
};
|
||||
|
||||
//
|
||||
// IMPORTANT! k_iClientRemoteStorageCallbacks + 4 is used, see iclientremotestorage.h
|
||||
//
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent after we've determined the list of files that are out of sync
|
||||
// with the server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncStatusCheck_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 5 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent after a conflict resolution attempt.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageConflictResolution_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 6 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to FileShare()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageFileShareResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 };
|
||||
EResult m_eResult; // The result of the operation
|
||||
UGCHandle_t m_hFile; // The handle that can be shared with users and features
|
||||
};
|
||||
|
||||
|
||||
// k_iClientRemoteStorageCallbacks + 8 is deprecated! Do not reuse
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to PublishFile()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 9 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to GetPublishedFileDetails()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageGetPublishedFileDetailsResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 10 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_nCreatorAppID; // ID of the app that created this file.
|
||||
AppId_t m_nConsumerAppID; // ID of the app that created this file.
|
||||
char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document
|
||||
char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document
|
||||
UGCHandle_t m_hFile; // The handle of the primary file
|
||||
UGCHandle_t m_hPreviewFile; // The handle of the preview file
|
||||
uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
|
||||
uint32 m_rtimeCreated; // time when the published file was created
|
||||
uint32 m_rtimeUpdated; // time when the published file was last updated
|
||||
ERemoteStoragePublishedFileVisibility m_eVisibility;
|
||||
bool m_bBanned;
|
||||
char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file
|
||||
bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer
|
||||
char m_pchFileName[k_cchFilenameMax]; // The name of the primary file
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to DeletePublishedFile()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageDeletePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 11 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to EnumerateUserPublishedFiles()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageEnumerateUserPublishedFilesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 12 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
int32 m_nResultsReturned;
|
||||
int32 m_nTotalResultCount;
|
||||
PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to SubscribePublishedFile()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageSubscribePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 13 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to EnumerateSubscribePublishedFiles()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageEnumerateUserSubscribedFilesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 14 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
int32 m_nResultsReturned;
|
||||
int32 m_nTotalResultCount;
|
||||
PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
|
||||
uint32 m_rgRTimeSubscribed[ k_unEnumeratePublishedFilesMaxResults ];
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to UnsubscribePublishedFile()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageUnsubscribePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 15 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to UpdatePublishedFile()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageUpdatePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 16 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to UGCDownload()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageDownloadUGCResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 17 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded.
|
||||
AppId_t m_nAppID; // ID of the app that created this file.
|
||||
int32 m_nSizeInBytes; // The size of the file that was downloaded, in bytes.
|
||||
char m_pchFileName[k_cchFilenameMax]; // The name of the file that was downloaded.
|
||||
uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMREMOTESTORAGE_H
|
||||
@@ -0,0 +1,86 @@
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: public interface to user remote file storage in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMSCREENSHOTS_H
|
||||
#define ISTEAMSCREENSHOTS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
const uint32 k_nScreenshotMaxTaggedUsers = 32;
|
||||
const int k_cubUFSTagTypeMax = 255;
|
||||
const int k_cubUFSTagValueMax = 255;
|
||||
|
||||
// Required with of a thumbnail provided to AddScreenshotToLibrary. If you do not provide a thumbnail
|
||||
// one will be generated.
|
||||
const int k_ScreenshotThumbWidth = 200;
|
||||
|
||||
// Handle is valid for the lifetime of your process and no longer
|
||||
typedef uint32 ScreenshotHandle;
|
||||
#define INVALID_SCREENSHOT_HANDLE 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for adding screenshots to the user's screenshot library
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamScreenshots
|
||||
{
|
||||
public:
|
||||
// Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format.
|
||||
// The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
|
||||
virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0;
|
||||
|
||||
// Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio
|
||||
// as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format.
|
||||
// The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
|
||||
// JPEG, TGA, and PNG formats are supported.
|
||||
virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight ) = 0;
|
||||
|
||||
// Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead.
|
||||
virtual void TriggerScreenshot() = 0;
|
||||
|
||||
// Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots,
|
||||
// then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary
|
||||
// in response.
|
||||
virtual void HookScreenshots( bool bHook ) = 0;
|
||||
|
||||
// Sets metadata about a screenshot's location (for example, the name of the map)
|
||||
virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0;
|
||||
|
||||
// Tags a user as being visible in the screenshot
|
||||
virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION001"
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Screenshot successfully written or otherwise added to the library
|
||||
// and can now be tagged
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ScreenshotReady_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamScreenshotsCallbacks + 1 };
|
||||
ScreenshotHandle m_hLocal;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Screenshot has been requested by the user. Only sent if
|
||||
// HookScreenshots() has been called, in which case Steam will not take
|
||||
// the screenshot itself.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ScreenshotRequested_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamScreenshotsCallbacks + 2 };
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMSCREENSHOTS_H
|
||||
@@ -0,0 +1,316 @@
|
||||
//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSER_H
|
||||
#define ISTEAMUSER_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
#pragma pack( push, 8 )
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
#pragma pack( pop )
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUser
|
||||
{
|
||||
public:
|
||||
// returns the HSteamUser this interface represents
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
|
||||
// returns the CSteamID of the account currently logged into the Steam client
|
||||
// a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
// Parameters:
|
||||
// void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.
|
||||
// int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
// bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
// used by only a few games to track usage events
|
||||
virtual void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) = 0;
|
||||
|
||||
// get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.
|
||||
// this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"
|
||||
virtual bool GetUserDataFolder( char *pchBuffer, int cubBuffer ) = 0;
|
||||
|
||||
// Starts voice recording. Once started, use GetVoice() to get the data
|
||||
virtual void StartVoiceRecording( ) = 0;
|
||||
|
||||
// Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for
|
||||
// a little bit after this function is called. GetVoice() should continue to be called until it returns
|
||||
// k_eVoiceResultNotRecording
|
||||
virtual void StopVoiceRecording( ) = 0;
|
||||
|
||||
// Determine the amount of captured audio data that is available in bytes.
|
||||
// This provides both the compressed and uncompressed data. Please note that the uncompressed
|
||||
// data is not the raw feed from the microphone: data may only be available if audible
|
||||
// levels of speech are detected.
|
||||
// nUncompressedVoiceDesiredSampleRate is necessary to know the number of bytes to return in pcbUncompressed - can be set to 0 if you don't need uncompressed (the usual case)
|
||||
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
|
||||
virtual EVoiceResult GetAvailableVoice(uint32 *pcbCompressed, uint32 *pcbUncompressed, uint32 nUncompressedVoiceDesiredSampleRate) = 0;
|
||||
|
||||
// Gets the latest voice data from the microphone. Compressed data is an arbitrary format, and is meant to be handed back to
|
||||
// DecompressVoice() for playback later as a binary blob. Uncompressed data is 16-bit, signed integer, 11025Hz PCM format.
|
||||
// Please note that the uncompressed data is not the raw feed from the microphone: data may only be available if audible
|
||||
// levels of speech are detected, and may have passed through denoising filters, etc.
|
||||
// This function should be called as often as possible once recording has started; once per frame at least.
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer.
|
||||
// nUncompressedBytesWritten is set to the number of bytes written to pUncompressedDestBuffer.
|
||||
// You must grab both compressed and uncompressed here at the same time, if you want both.
|
||||
// Matching data that is not read during this call will be thrown away.
|
||||
// GetAvailableVoice() can be used to determine how much data is actually available.
|
||||
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
|
||||
virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, uint32 cbUncompressedDestBufferSize, uint32 *nUncompressBytesWritten, uint32 nUncompressedVoiceDesiredSampleRate ) = 0;
|
||||
|
||||
// Decompresses a chunk of compressed data produced by GetVoice().
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer unless the return value is k_EVoiceResultBufferTooSmall.
|
||||
// In that case, nBytesWritten is set to the size of the buffer required to decompress the given
|
||||
// data. The suggested buffer size for the destination buffer is 22 kilobytes.
|
||||
// The output format of the data is 16-bit signed at the requested samples per second.
|
||||
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nDesiredSampleRate
|
||||
virtual EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate ) = 0;
|
||||
|
||||
// This returns the frequency of the voice data as it's stored internally; calling DecompressVoice() with this size will yield the best results
|
||||
virtual uint32 GetVoiceOptimalSampleRate() = 0;
|
||||
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
|
||||
// pcbTicket retrieves the length of the actual ticket.
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
|
||||
// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
|
||||
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
|
||||
virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0;
|
||||
|
||||
// Stop tracking started by BeginAuthSession - called when no longer playing game with this entity
|
||||
virtual void EndAuthSession( CSteamID steamID ) = 0;
|
||||
|
||||
// Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to
|
||||
virtual void CancelAuthTicket( HAuthTicket hAuthTicket ) = 0;
|
||||
|
||||
// After receiving a user's authentication data, and passing it to BeginAuthSession, use this function
|
||||
// to determine if the user owns downloadable content specified by the provided AppID.
|
||||
virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
|
||||
|
||||
// returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam
|
||||
// (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT.
|
||||
virtual bool BIsBehindNAT() = 0;
|
||||
|
||||
// set data to be replicated to friends so that they can join your game
|
||||
// CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client
|
||||
// uint32 unIPServer, uint16 usPortServer - the IP address of the game server
|
||||
virtual void AdvertiseGame( CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Requests a ticket encrypted with an app specific shared key
|
||||
// pDataToInclude, cbDataToInclude will be encrypted into the ticket
|
||||
// ( This is asynchronous, you must wait for the ticket to be completed by the server )
|
||||
virtual SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude ) = 0;
|
||||
|
||||
// retrieve a finished ticket
|
||||
virtual bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
// Initiates PS3 Logon request using just PSN ticket.
|
||||
//
|
||||
// PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to
|
||||
// prompt the user for network setup/PSN logon before initiating the Steam side of the logon.
|
||||
//
|
||||
// Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t
|
||||
// may return with EResult k_EResultExternalAccountUnlinked if the PSN account is unknown to Steam. You should
|
||||
// then call LogOnAndLinkSteamAccountToPSN() after prompting the user for credentials to establish a link.
|
||||
// Future calls to LogOn() after the one time link call should succeed as long as the user is connected to PSN.
|
||||
virtual void LogOn( bool bInteractive ) = 0;
|
||||
|
||||
// Initiates a request to logon with a specific steam username/password and create a PSN account link at
|
||||
// the same time. Should call this only if LogOn() has failed and indicated the PSN account is unlinked.
|
||||
//
|
||||
// PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to
|
||||
// prompt the user for network setup/PSN logon before initiating the Steam side of the logon. pchUserName
|
||||
// should be the users Steam username, and pchPassword should be the users Steam password.
|
||||
//
|
||||
// Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t
|
||||
// may return with EResult k_EResultOtherAccountAlreadyLinked if already linked to another account.
|
||||
virtual void LogOnAndLinkSteamAccountToPSN( bool bInteractive, const char *pchUserName, const char *pchPassword ) = 0;
|
||||
|
||||
// Final logon option for PS3, this logs into an existing account if already linked, but if not already linked
|
||||
// creates a new account using the info in the PSN ticket to generate a unique account name. The new account is
|
||||
// then linked to the PSN ticket. This is the faster option for new users who don't have an existing Steam account
|
||||
// to get into multiplayer.
|
||||
//
|
||||
// PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to
|
||||
// prompt the user for network setup/PSN logon before initiating the Steam side of the logon.
|
||||
virtual void LogOnAndCreateNewSteamAccountIfNeeded( bool bInteractive ) = 0;
|
||||
|
||||
// Returns a special SteamID that represents the user's PSN information. Can be used to query the user's PSN avatar,
|
||||
// online name, etc. through the standard Steamworks interfaces.
|
||||
virtual CSteamID GetConsoleSteamID() = 0;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser016"
|
||||
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 1 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called if the client has lost connection to the Steam servers
|
||||
// real-time services will be disabled until a matching SteamServersConnected_t has been posted
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent by the Steam server to the client telling it to disconnect from the specified game server,
|
||||
// which it may be in the process of or already connected to.
|
||||
// The game client should immediately disconnect upon receiving this message.
|
||||
// This can usually occur if the user doesn't have rights to play on the game server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ClientGameServerDeny_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 13 };
|
||||
|
||||
uint32 m_uAppID;
|
||||
uint32 m_unGameServerIP;
|
||||
uint16 m_usGameServerPort;
|
||||
uint16 m_bSecure;
|
||||
uint32 m_uReason;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the callback system for this client is in an error state (and has flushed pending callbacks)
|
||||
// When getting this message the client should disconnect from Steam, reset any stored Steam state and reconnect.
|
||||
// This usually occurs in the rare event the Steam client has some kind of fatal error.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct IPCFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
enum EFailureType
|
||||
{
|
||||
k_EFailureFlushedCallbackQueue,
|
||||
k_EFailurePipeFail,
|
||||
};
|
||||
uint8 m_eFailureType;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for BeginAuthSession
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ValidateAuthTicketResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 43 };
|
||||
CSteamID m_SteamID;
|
||||
EAuthSessionResponse m_eAuthSessionResponse;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a user has responded to a microtransaction authorization request
|
||||
//-----------------------------------------------------------------------------
|
||||
struct MicroTxnAuthorizationResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 52 };
|
||||
|
||||
uint32 m_unAppID; // AppID for this microtransaction
|
||||
uint64 m_ulOrderID; // OrderID provided for the microtransaction
|
||||
uint8 m_bAuthorized; // if user authorized transaction
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result from RequestEncryptedAppTicket
|
||||
//-----------------------------------------------------------------------------
|
||||
struct EncryptedAppTicketResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 54 };
|
||||
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for GetAuthSessionTicket
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GetAuthSessionTicketResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 63 };
|
||||
HAuthTicket m_hAuthTicket;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
@@ -0,0 +1,445 @@
|
||||
//====== Copyright © 1996-2009, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to stats, achievements, and leaderboards
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUSERSTATS_H
|
||||
#define ISTEAMUSERSTATS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "isteamremotestorage.h"
|
||||
|
||||
// size limit on stat or achievement name (UTF-8 encoded)
|
||||
enum { k_cchStatNameMax = 128 };
|
||||
|
||||
// maximum number of bytes for a leaderboard name (UTF-8 encoded)
|
||||
enum { k_cchLeaderboardNameMax = 128 };
|
||||
|
||||
// maximum number of details int32's storable for a single leaderboard entry
|
||||
enum { k_cLeaderboardDetailsMax = 64 };
|
||||
|
||||
// handle to a single leaderboard
|
||||
typedef uint64 SteamLeaderboard_t;
|
||||
|
||||
// handle to a set of downloaded entries in a leaderboard
|
||||
typedef uint64 SteamLeaderboardEntries_t;
|
||||
|
||||
// type of data request, when downloading leaderboard entries
|
||||
enum ELeaderboardDataRequest
|
||||
{
|
||||
k_ELeaderboardDataRequestGlobal = 0,
|
||||
k_ELeaderboardDataRequestGlobalAroundUser = 1,
|
||||
k_ELeaderboardDataRequestFriends = 2,
|
||||
k_ELeaderboardDataRequestUsers = 3
|
||||
};
|
||||
|
||||
// the sort order of a leaderboard
|
||||
enum ELeaderboardSortMethod
|
||||
{
|
||||
k_ELeaderboardSortMethodNone = 0,
|
||||
k_ELeaderboardSortMethodAscending = 1, // top-score is lowest number
|
||||
k_ELeaderboardSortMethodDescending = 2, // top-score is highest number
|
||||
};
|
||||
|
||||
// the display type (used by the Steam Community web site) for a leaderboard
|
||||
enum ELeaderboardDisplayType
|
||||
{
|
||||
k_ELeaderboardDisplayTypeNone = 0,
|
||||
k_ELeaderboardDisplayTypeNumeric = 1, // simple numerical score
|
||||
k_ELeaderboardDisplayTypeTimeSeconds = 2, // the score represents a time, in seconds
|
||||
k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, // the score represents a time, in milliseconds
|
||||
};
|
||||
|
||||
enum ELeaderboardUploadScoreMethod
|
||||
{
|
||||
k_ELeaderboardUploadScoreMethodNone = 0,
|
||||
k_ELeaderboardUploadScoreMethodKeepBest = 1, // Leaderboard will keep user's best score
|
||||
k_ELeaderboardUploadScoreMethodForceUpdate = 2, // Leaderboard will always replace score with specified
|
||||
};
|
||||
|
||||
// a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry()
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
struct LeaderboardEntry_t
|
||||
{
|
||||
CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info
|
||||
int32 m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard
|
||||
int32 m_nScore; // score as set in the leaderboard
|
||||
int32 m_cDetails; // number of int32 details available for this entry
|
||||
UGCHandle_t m_hUGC; // handle for UGC attached to the entry
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing stats, achievements, and leaderboard information
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
// Ask the server to send down this user's data and achievements for this game
|
||||
virtual bool RequestCurrentStats() = 0;
|
||||
|
||||
// Data accessors
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
virtual bool GetAchievement( const char *pchName, bool *pbAchieved ) = 0;
|
||||
virtual bool SetAchievement( const char *pchName ) = 0;
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Get the achievement status, and the time it was unlocked if unlocked.
|
||||
// If the return value is true, but the unlock time is zero, that means it was unlocked before Steam
|
||||
// began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970.
|
||||
virtual bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
//
|
||||
// If the callback has a result of k_EResultInvalidParam, one or more stats
|
||||
// uploaded has been rejected, either because they broke constraints
|
||||
// or were out of date. In this case the server sends back updated values.
|
||||
// The stats should be re-iterated to keep in sync.
|
||||
virtual bool StoreStats() = 0;
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set.
|
||||
// A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback
|
||||
// which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the
|
||||
// specified achievement.
|
||||
virtual int GetAchievementIcon( const char *pchName ) = 0;
|
||||
|
||||
// Get general attributes for an achievement. Accepts the following keys:
|
||||
// - "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8)
|
||||
// - "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden)
|
||||
virtual const char *GetAchievementDisplayAttribute( const char *pchName, const char *pchKey ) = 0;
|
||||
|
||||
// Achievement progress - triggers an AchievementProgress callback, that is all.
|
||||
// Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.
|
||||
virtual bool IndicateAchievementProgress( const char *pchName, uint32 nCurProgress, uint32 nMaxProgress ) = 0;
|
||||
|
||||
// Friends stats & achievements
|
||||
|
||||
// downloads stats for the user
|
||||
// returns a UserStatsReceived_t received when completed
|
||||
// if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail
|
||||
// these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data
|
||||
virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// requests stat information for a user, usable after a successful call to RequestUserStats()
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||
// See notes for GetAchievementAndUnlockTime above
|
||||
virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
|
||||
|
||||
// Reset stats
|
||||
virtual bool ResetAllStats( bool bAchievementsToo ) = 0;
|
||||
|
||||
// Leaderboard functions
|
||||
|
||||
// asks the Steam back-end for a leaderboard by name, and will create it if it's not yet
|
||||
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
|
||||
virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0;
|
||||
|
||||
// as above, but won't create the leaderboard if it's not found
|
||||
// This call is asynchronous, with the result returned in LeaderboardFindResult_t
|
||||
virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0;
|
||||
|
||||
// returns the name of a leaderboard
|
||||
virtual const char *GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the total number of entries in a leaderboard, as of the last request
|
||||
virtual int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the sort method of the leaderboard
|
||||
virtual ELeaderboardSortMethod GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// returns the display type of the leaderboard
|
||||
virtual ELeaderboardDisplayType GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) = 0;
|
||||
|
||||
// Asks the Steam back-end for a set of rows in the leaderboard.
|
||||
// This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t
|
||||
// LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below)
|
||||
// You can ask for more entries than exist, and it will return as many as do exist.
|
||||
// k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries]
|
||||
// k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate
|
||||
// e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after
|
||||
// k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user
|
||||
virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0;
|
||||
// as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers
|
||||
// if a user doesn't have a leaderboard entry, they won't be included in the result
|
||||
// a max of 100 users can be downloaded at a time, with only one outstanding call at a time
|
||||
virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, CSteamID *prgUsers, int cUsers ) = 0;
|
||||
|
||||
// Returns data about a single leaderboard entry
|
||||
// use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries
|
||||
// e.g.
|
||||
// void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded )
|
||||
// {
|
||||
// for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ )
|
||||
// {
|
||||
// LeaderboardEntry_t leaderboardEntry;
|
||||
// int32 details[3]; // we know this is how many we've stored previously
|
||||
// GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 );
|
||||
// assert( leaderboardEntry.m_cDetails == 3 );
|
||||
// ...
|
||||
// }
|
||||
// once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid
|
||||
virtual bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, LeaderboardEntry_t *pLeaderboardEntry, int32 *pDetails, int cDetailsMax ) = 0;
|
||||
|
||||
// Uploads a user score to the Steam back-end.
|
||||
// This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t
|
||||
// Details are extra game-defined information regarding how the user got that score
|
||||
// pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list
|
||||
virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0;
|
||||
|
||||
// Attaches a piece of user generated content the user's entry on a leaderboard.
|
||||
// hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare().
|
||||
// This call is asynchronous, with the result returned in LeaderboardUGCSet_t.
|
||||
virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) = 0;
|
||||
|
||||
// Retrieves the number of players currently playing your game (online + offline)
|
||||
// This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t
|
||||
virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0;
|
||||
|
||||
// Requests that Steam fetch data on the percentage of players who have received each achievement
|
||||
// for the game globally.
|
||||
// This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t.
|
||||
virtual SteamAPICall_t RequestGlobalAchievementPercentages() = 0;
|
||||
|
||||
// Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch
|
||||
// the next most achieved afterwards. Will return -1 if there is no data on achievement
|
||||
// percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback).
|
||||
virtual int GetMostAchievedAchievementInfo( char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0;
|
||||
|
||||
// Get the info on the next most achieved achievement for the game. Call this after GetMostAchievedAchievementInfo or another
|
||||
// GetNextMostAchievedAchievementInfo call passing the iterator from the previous call. Returns -1 after the last
|
||||
// achievement has been iterated.
|
||||
virtual int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0;
|
||||
|
||||
// Returns the percentage of users who have achieved the specified achievement.
|
||||
virtual bool GetAchievementAchievedPercent( const char *pchName, float *pflPercent ) = 0;
|
||||
|
||||
// Requests global stats data, which is available for stats marked as "aggregated".
|
||||
// This call is asynchronous, with the results returned in GlobalStatsReceived_t.
|
||||
// nHistoryDays specifies how many days of day-by-day history to retrieve in addition
|
||||
// to the overall totals. The limit is 60.
|
||||
virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0;
|
||||
|
||||
// Gets the lifetime totals for an aggregated stat
|
||||
virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0;
|
||||
virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0;
|
||||
|
||||
// Gets history for an aggregated stat. pData will be filled with daily values, starting with today.
|
||||
// So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago,
|
||||
// etc. cubData is the size in bytes of the pubData buffer. Returns the number of
|
||||
// elements actually set.
|
||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, int64 *pData, uint32 cubData ) = 0;
|
||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, double *pData, uint32 cubData ) = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
// Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t
|
||||
// callback.
|
||||
virtual bool InstallPS3Trophies() = 0;
|
||||
|
||||
// Returns the amount of space required at boot to install trophies. This value can be used when comparing the amount of space needed
|
||||
// by the game to the available space value passed to the game at boot. The value is set during InstallPS3Trophies().
|
||||
virtual uint64 GetTrophySpaceRequiredBeforeInstall() = 0;
|
||||
|
||||
// On PS3, user stats & achievement progress through Steam must be stored with the user's saved game data.
|
||||
// At startup, before calling RequestCurrentStats(), you must pass the user's stats data to Steam via this method.
|
||||
// If you do not have any user data, call this function with pvData = NULL and cubData = 0
|
||||
virtual bool SetUserStatsData( const void *pvData, uint32 cubData ) = 0;
|
||||
|
||||
// Call to get the user's current stats data. You should retrieve this data after receiving successful UserStatsReceived_t & UserStatsStored_t
|
||||
// callbacks, and store the data with the user's save game data. You can call this method with pvData = NULL and cubData = 0 to get the required
|
||||
// buffer size.
|
||||
virtual bool GetUserStatsData( void *pvData, uint32 cubData, uint32 *pcubWritten ) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION010"
|
||||
|
||||
// callbacks
|
||||
#pragma pack( push, 8 )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
// from the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 1 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // Success / error fetching the stats
|
||||
CSteamID m_steamIDUser; // The user for whom the stats are retrieved for
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the user stats for a game
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 2 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // success / error
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementStored_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 3 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
bool m_bGroupAchievement; // if this is a "group" achievement
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
uint32 m_nCurProgress; // current progress towards the achievement
|
||||
uint32 m_nMaxProgress; // "out of" this many
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result for finding a leaderboard, returned as a result of FindOrCreateLeaderboard() or FindLeaderboard()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardFindResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 4 };
|
||||
SteamLeaderboard_t m_hSteamLeaderboard; // handle to the leaderboard serarched for, 0 if no leaderboard found
|
||||
uint8 m_bLeaderboardFound; // 0 if no leaderboard found
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result indicating scores for a leaderboard have been downloaded and are ready to be retrieved, returned as a result of DownloadLeaderboardEntries()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardScoresDownloaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 5 };
|
||||
SteamLeaderboard_t m_hSteamLeaderboard;
|
||||
SteamLeaderboardEntries_t m_hSteamLeaderboardEntries; // the handle to pass into GetDownloadedLeaderboardEntries()
|
||||
int m_cEntryCount; // the number of entries downloaded
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result indicating scores has been uploaded, returned as a result of UploadLeaderboardScore()
|
||||
// use CCallResult<> to map this async result to a member function
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardScoreUploaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 6 };
|
||||
uint8 m_bSuccess; // 1 if the call was successful
|
||||
SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was
|
||||
int32 m_nScore; // the score that was attempted to set
|
||||
uint8 m_bScoreChanged; // true if the score in the leaderboard change, false if the existing score was better
|
||||
int m_nGlobalRankNew; // the new global rank of the user in this leaderboard
|
||||
int m_nGlobalRankPrevious; // the previous global rank of the user in this leaderboard; 0 if the user had no existing entry in the leaderboard
|
||||
};
|
||||
|
||||
struct NumberOfCurrentPlayers_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 7 };
|
||||
uint8 m_bSuccess; // 1 if the call was successful
|
||||
int32 m_cPlayers; // Number of players currently playing
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback indicating that a user's stats have been unloaded.
|
||||
// Call RequestUserStats again to access stats for this user
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserStatsUnloaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 8 };
|
||||
CSteamID m_steamIDUser; // User whose stats have been unloaded
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback indicating that an achievement icon has been fetched
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserAchievementIconFetched_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 9 };
|
||||
|
||||
CGameID m_nGameID; // Game this is for
|
||||
char m_rgchAchievementName[k_cchStatNameMax]; // name of the achievement
|
||||
bool m_bAchieved; // Is the icon for the achieved or not achieved version?
|
||||
int m_nIconHandle; // Handle to the image, which can be used in SteamUtils()->GetImageRGBA(), 0 means no image is set for the achievement
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback indicating that global achievement percentages are fetched
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GlobalAchievementPercentagesReady_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 10 };
|
||||
|
||||
uint64 m_nGameID; // Game this is for
|
||||
EResult m_eResult; // Result of the operation
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: call result indicating UGC has been uploaded, returned as a result of SetLeaderboardUGC()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LeaderboardUGCSet_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 11 };
|
||||
EResult m_eResult; // The result of the operation
|
||||
SteamLeaderboard_t m_hSteamLeaderboard; // the leaderboard handle that was
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: callback indicating that PS3 trophies have been installed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PS3TrophiesInstalled_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 };
|
||||
uint64 m_nGameID; // Game these stats are for
|
||||
EResult m_eResult; // The result of the operation
|
||||
uint64 m_ulRequiredDiskSpace; // If m_eResult is k_EResultDiskFull, will contain the amount of space needed to install trophies
|
||||
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: callback indicating global stats have been received.
|
||||
// Returned as a result of RequestGlobalStats()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GlobalStatsReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserStatsCallbacks + 12 };
|
||||
uint64 m_nGameID; // Game global stats were requested for
|
||||
EResult m_eResult; // The result of the request
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMUSER_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user