Reformat code

This commit is contained in:
momo5502 2018-12-26 16:59:03 +01:00
parent c3383032af
commit 8308b72e96
33 changed files with 562 additions and 433 deletions

View File

@ -98,7 +98,7 @@ workspace "open-iw5"
pchsource "src/std_include.cpp" pchsource "src/std_include.cpp"
linkoptions "/IGNORE:4254 /DYNAMICBASE:NO /SAFESEH:NO /LARGEADDRESSAWARE" linkoptions "/IGNORE:4254 /DYNAMICBASE:NO /SAFESEH:NO /LARGEADDRESSAWARE"
linkoptions "/LAST:.zdata" linkoptions "/LAST:.main"
files { files {

View File

@ -36,7 +36,7 @@ namespace binary_loader
return {}; return {};
} }
std::string load_base(bool verify = true) std::string load_base(const bool verify = true)
{ {
std::string data; std::string data;
if (!utils::io::read_file("iw5mp_server.exe", &data)) if (!utils::io::read_file("iw5mp_server.exe", &data))
@ -87,7 +87,8 @@ namespace binary_loader
std::string build_binary(const std::string& base, const std::string& diff) std::string build_binary(const std::string& base, const std::string& diff)
{ {
const auto* size = reinterpret_cast<const unsigned long long*>(diff.data() + diff.size() - sizeof(unsigned long long)); const auto* size = reinterpret_cast<const unsigned long long*>(diff.data() + diff.size() - sizeof(unsigned long
long));
std::string binary; std::string binary;
binary.resize(size_t(*size)); binary.resize(size_t(*size));

View File

@ -5,7 +5,6 @@
loader::loader(const launcher::mode mode) : mode_(mode) loader::loader(const launcher::mode mode) : mode_(mode)
{ {
} }
FARPROC loader::load(const utils::nt::module& module) const FARPROC loader::load(const utils::nt::module& module) const
@ -22,19 +21,22 @@ FARPROC loader::load(const utils::nt::module& module) const
if (source.get_optional_header()->DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size) if (source.get_optional_header()->DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size)
{ {
const IMAGE_TLS_DIRECTORY* target_tls = reinterpret_cast<PIMAGE_TLS_DIRECTORY>(module.get_ptr() + module const IMAGE_TLS_DIRECTORY* target_tls = reinterpret_cast<PIMAGE_TLS_DIRECTORY>(module.get_ptr() + module
.get_optional_header() .get_optional_header()
->DataDirectory ->
DataDirectory
[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress); [IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress);
const IMAGE_TLS_DIRECTORY* source_tls = reinterpret_cast<PIMAGE_TLS_DIRECTORY>(module.get_ptr() + source const IMAGE_TLS_DIRECTORY* source_tls = reinterpret_cast<PIMAGE_TLS_DIRECTORY>(module.get_ptr() + source
.get_optional_header() .get_optional_header()
->DataDirectory ->
DataDirectory
[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress); [IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress);
*reinterpret_cast<DWORD*>(source_tls->AddressOfIndex) = 0; *reinterpret_cast<DWORD*>(source_tls->AddressOfIndex) = 0;
DWORD old_protect; DWORD old_protect;
VirtualProtect(PVOID(target_tls->StartAddressOfRawData), VirtualProtect(PVOID(target_tls->StartAddressOfRawData),
source_tls->EndAddressOfRawData - source_tls->StartAddressOfRawData, PAGE_READWRITE, &old_protect); source_tls->EndAddressOfRawData - source_tls->StartAddressOfRawData, PAGE_READWRITE,
&old_protect);
const auto tls_base = *reinterpret_cast<LPVOID*>(__readfsdword(0x2C)); const auto tls_base = *reinterpret_cast<LPVOID*>(__readfsdword(0x2C));
std::memmove(tls_base, PVOID(source_tls->StartAddressOfRawData), std::memmove(tls_base, PVOID(source_tls->StartAddressOfRawData),
@ -142,7 +144,8 @@ void loader::load_imports(const utils::nt::module& target, const utils::nt::modu
if (!function) if (!function)
{ {
throw std::runtime_error(utils::string::va("Unable to load import '%s' from module '%s'", function_name.data(), name.data())); throw std::runtime_error(utils::string::va("Unable to load import '%s' from module '%s'",
function_name.data(), name.data()));
} }
*address_table_entry = reinterpret_cast<uintptr_t>(function); *address_table_entry = reinterpret_cast<uintptr_t>(function);

View File

@ -5,7 +5,7 @@
class loader final class loader final
{ {
public: public:
loader(launcher::mode mode); explicit loader(launcher::mode mode);
FARPROC load(const utils::nt::module& module) const; FARPROC load(const utils::nt::module& module) const;
@ -15,8 +15,8 @@ private:
launcher::mode mode_; launcher::mode mode_;
std::function<FARPROC(const std::string&, const std::string&)> import_resolver_; std::function<FARPROC(const std::string&, const std::string&)> import_resolver_;
static void load_section(const utils::nt::module& target, const utils::nt::module& source, IMAGE_SECTION_HEADER* section); static void load_section(const utils::nt::module& target, const utils::nt::module& source,
IMAGE_SECTION_HEADER* section);
void load_sections(const utils::nt::module& target, const utils::nt::module& source) const; void load_sections(const utils::nt::module& target, const utils::nt::module& source) const;
void load_imports(const utils::nt::module& target, const utils::nt::module& source) const; void load_imports(const utils::nt::module& target, const utils::nt::module& source) const;
}; };

View File

@ -1,10 +1,17 @@
#pragma once #pragma once
#include "launcher/launcher.hpp"
class module class module
{ {
public: public:
virtual ~module() {}; virtual ~module()
virtual void post_load() {} {
virtual void pre_destroy() {} }
virtual void post_load()
{
}
virtual void pre_destroy()
{
}
}; };

View File

@ -5,7 +5,7 @@ class module_loader final
{ {
public: public:
template <typename T> template <typename T>
class installer class installer final
{ {
static_assert(std::is_base_of<module, T>::value, "Module has invalid base class"); static_assert(std::is_base_of<module, T>::value, "Module has invalid base class");

View File

@ -8,59 +8,76 @@ class ceg final : public module
public: public:
void post_load() override void post_load() override
{ {
if(game::is_dedi()) return; if (game::is_dedi()) return;
// Remove improper quit check // Remove improper quit check
utils::hook::nop(SELECT_VALUE(0x53444A, 0x5CCDC0, 0), 9); utils::hook::nop(SELECT_VALUE(0x53444A, 0x5CCDC0, 0), 9);
// Only SP has CEG // Only SP has CEG
// CEG in MP has accidentally been removed due to CVE-2018-10718 // CEG in MP has accidentally been removed due to CVE-2018-10718
if(!game::is_sp()) return; if (!game::is_sp()) return;
utils::hook::signature signature(0x401000, 0x3E1000); utils::hook::signature signature(0x401000, 0x3E1000);
signature.add({ "\x56\xE8\x00\x00\x00\x00\x8B\xF0\xE8\x00\x00\x00\x00\x50\x56\xE8", "xx????xxx????xxx", [](char* address) signature.add({
{ "\x56\xE8\x00\x00\x00\x00\x8B\xF0\xE8\x00\x00\x00\x00\x50\x56\xE8", "xx????xxx????xxx", [](char* address)
utils::hook::set<DWORD>(address, 0xC301B0); {
} }); utils::hook::set<DWORD>(address, 0xC301B0);
}
});
// Generic killer caller. // Generic killer caller.
signature.add({ "\x55\x8B\xEC\x80\x7D\x08\x00\x75\x55", "xxxxxx?xx", []( char* address) signature.add({
{ "\x55\x8B\xEC\x80\x7D\x08\x00\x75\x55", "xxxxxx?xx", [](char* address)
utils::hook::set<DWORD>(address, 0xC301B0); {
} }); utils::hook::set<DWORD>(address, 0xC301B0);
}
});
// CEG initialization. // CEG initialization.
signature.add({ "\x55\x8B\xEC\x83\xEC\x18\x53\x56\x57\xE8\x00\x00\x00\x00", "xxxxxxxxxx????", [](char* address) signature.add({
{ "\x55\x8B\xEC\x83\xEC\x18\x53\x56\x57\xE8\x00\x00\x00\x00", "xxxxxxxxxx????", [](char* address)
utils::hook::set<BYTE>(address, 0xC3); {
} }); utils::hook::set<BYTE>(address, 0xC3);
}
});
// Some odd trap. // Some odd trap.
signature.add({ "\x55\x8B\xEC\x81\xEC\x00\x00\x00\x00\x53\x56\x57\x8B\x3D", "xxxxx??xxxxxxx", [](char* address) signature.add({
{ "\x55\x8B\xEC\x81\xEC\x00\x00\x00\x00\x53\x56\x57\x8B\x3D", "xxxxx??xxxxxxx", [](char* address)
utils::hook::set<DWORD>(address, 0xC301B0); {
} }); utils::hook::set<DWORD>(address, 0xC301B0);
}
});
// Custom shit // Custom shit
signature.add({ "\x55\x8B\xEC\x68\x00\x00\x00\x00\x68\x00\x00\x00\x00\x64\xFF\x35\x00\x00\x00\x00\x64\x89\x25\x00\x00\x00\x00\xE8", "xxxx????x????xxx????xxx????x", [](char* address) signature.add({
{ "\x55\x8B\xEC\x68\x00\x00\x00\x00\x68\x00\x00\x00\x00\x64\xFF\x35\x00\x00\x00\x00\x64\x89\x25\x00\x00\x00\x00\xE8",
utils::hook::set<BYTE>(address, 0xC3); "xxxx????x????xxx????xxx????x", [](char* address)
} }); {
utils::hook::set<BYTE>(address, 0xC3);
}
});
// hkcr guid check // hkcr guid check
signature.add({ "\x55\x8B\xEC\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x84\xC0\x75\x06", "xxxx????x????x????xxxx", [](char* address) signature.add({
{ "\x55\x8B\xEC\xB8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x84\xC0\x75\x06",
utils::hook::nop(address + 0xD, 5); // Call "xxxx????x????x????xxxx", [](char* address)
utils::hook::nop(address + 0x14, 2); // Jump {
} }); utils::hook::nop(address + 0xD, 5); // Call
utils::hook::nop(address + 0x14, 2); // Jump
}
});
// hkcr guid check 2 // hkcr guid check 2
signature.add({ "\x55\x8B\xEC\x81\xEC\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x84\xC0\x75\x06", "xxxxx????x????xxxx", [](char* address) signature.add({
{ "\x55\x8B\xEC\x81\xEC\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x84\xC0\x75\x06", "xxxxx????x????xxxx", [
utils::hook::nop(address + 0x9, 5); // Call ](char* address)
utils::hook::nop(address + 0x10, 2); // Jump {
} }); utils::hook::nop(address + 0x9, 5); // Call
utils::hook::nop(address + 0x10, 2); // Jump
}
});
signature.process(); signature.process();
@ -70,9 +87,9 @@ public:
// Some value obfuscation // Some value obfuscation
utils::hook(0x493B81, 0x493BFC, HOOK_JUMP).install()->quick(); utils::hook(0x493B81, 0x493BFC, HOOK_JUMP).install()->quick();
// Ceg uninit // CEG uninitialization
utils::hook::set<BYTE>(0x527110, 0xC3); utils::hook::set<BYTE>(0x527110, 0xC3);
} }
}; };
REGISTER_MODULE(ceg) REGISTER_MODULE(ceg)

View File

@ -10,4 +10,4 @@ public:
} }
}; };
REGISTER_MODULE(dw) REGISTER_MODULE(dw)

View File

@ -2,17 +2,15 @@
#pragma comment(linker, "/merge:.data=.cld") #pragma comment(linker, "/merge:.data=.cld")
#pragma comment(linker, "/merge:.rdata=.clr") #pragma comment(linker, "/merge:.rdata=.clr")
#pragma comment(linker, "/merge:.cl=.zdata") #pragma comment(linker, "/merge:.cl=.main")
#pragma comment(linker, "/merge:.text=.zdata") #pragma comment(linker, "/merge:.text=.main")
#pragma comment(linker, "/section:.zdata,re") #pragma comment(linker, "/section:.main,re")
#pragma comment(linker, "/base:0x400000") #pragma comment(linker, "/base:0x400000")
__declspec(thread) char tls_data[0x2000]; __declspec(thread) char tls_data[0x2000];
#pragma bss_seg(".cdummy") #pragma bss_seg(".payload")
char dummy_seg[BINARY_PAYLOAD_SIZE]; char payload_data[BINARY_PAYLOAD_SIZE];
char stub_seg[0x100000]; #pragma data_seg(".main")
char main_data[200] = {1};
#pragma data_seg(".zdata")
char zdata[200] = { 1 };

View File

@ -23,12 +23,12 @@ namespace steam
return false; return false;
} }
const char *apps::GetCurrentGameLanguage() const char* apps::GetCurrentGameLanguage()
{ {
return "english"; return "english";
} }
const char *apps::GetAvailableGameLanguages() const char* apps::GetAvailableGameLanguages()
{ {
return "english"; return "english";
} }
@ -58,7 +58,8 @@ namespace steam
return 0; return 0;
} }
bool apps::BGetDLCDataByIndex(int iDLC, unsigned int *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize) bool apps::BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName,
int cchNameBufferSize)
{ {
return false; return false;
} }

View File

@ -9,14 +9,15 @@ namespace steam
virtual bool BIsLowViolence(); virtual bool BIsLowViolence();
virtual bool BIsCybercafe(); virtual bool BIsCybercafe();
virtual bool BIsVACBanned(); virtual bool BIsVACBanned();
virtual const char *GetCurrentGameLanguage(); virtual const char* GetCurrentGameLanguage();
virtual const char *GetAvailableGameLanguages(); virtual const char* GetAvailableGameLanguages();
virtual bool BIsSubscribedApp(unsigned int appID); virtual bool BIsSubscribedApp(unsigned int appID);
virtual bool BIsDlcInstalled(unsigned int appID); virtual bool BIsDlcInstalled(unsigned int appID);
virtual unsigned int GetEarliestPurchaseUnixTime(unsigned int nAppID); virtual unsigned int GetEarliestPurchaseUnixTime(unsigned int nAppID);
virtual bool BIsSubscribedFromFreeWeekend(); virtual bool BIsSubscribedFromFreeWeekend();
virtual int GetDLCCount(); virtual int GetDLCCount();
virtual bool BGetDLCDataByIndex(int iDLC, unsigned int *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize); virtual bool BGetDLCDataByIndex(int iDLC, unsigned int* pAppID, bool* pbAvailable, char* pchName,
int cchNameBufferSize);
virtual void InstallDLC(unsigned int nAppID); virtual void InstallDLC(unsigned int nAppID);
virtual void UninstallDLC(unsigned int nAppID); virtual void UninstallDLC(unsigned int nAppID);
}; };

View File

@ -3,14 +3,13 @@
namespace steam namespace steam
{ {
const char *friends::GetPersonaName() const char* friends::GetPersonaName()
{ {
return "GlaDos"; return "GlaDos";
} }
void friends::SetPersonaName(const char *pchPersonaName) void friends::SetPersonaName(const char* pchPersonaName)
{ {
} }
int friends::GetPersonaState() int friends::GetPersonaState()
@ -38,17 +37,17 @@ namespace steam
return 0; return 0;
} }
const char *friends::GetFriendPersonaName(steam_id steamIDFriend) const char* friends::GetFriendPersonaName(steam_id steamIDFriend)
{ {
return ""; return "";
} }
bool friends::GetFriendGamePlayed(steam_id steamIDFriend, void *pFriendGameInfo) bool friends::GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo)
{ {
return false; return false;
} }
const char *friends::GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName) const char* friends::GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName)
{ {
return ""; return "";
} }
@ -68,12 +67,12 @@ namespace steam
return steam_id(); return steam_id();
} }
const char *friends::GetClanName(steam_id steamIDClan) const char* friends::GetClanName(steam_id steamIDClan)
{ {
return "3arc"; return "3arc";
} }
const char *friends::GetClanTag(steam_id steamIDClan) const char* friends::GetClanTag(steam_id steamIDClan)
{ {
return this->GetClanName(steamIDClan); return this->GetClanName(steamIDClan);
} }
@ -97,15 +96,15 @@ namespace steam
{ {
} }
void friends::ActivateGameOverlay(const char *pchDialog) void friends::ActivateGameOverlay(const char* pchDialog)
{ {
} }
void friends::ActivateGameOverlayToUser(const char *pchDialog, steam_id steamID) void friends::ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID)
{ {
} }
void friends::ActivateGameOverlayToWebPage(const char *pchURL) void friends::ActivateGameOverlayToWebPage(const char* pchURL)
{ {
} }
@ -167,7 +166,7 @@ namespace steam
return 0; return 0;
} }
bool friends::SetRichPresence(const char *pchKey, const char *pchValue) bool friends::SetRichPresence(const char* pchKey, const char* pchValue)
{ {
return true; return true;
} }
@ -176,7 +175,7 @@ namespace steam
{ {
} }
const char *friends::GetFriendRichPresence(steam_id steamIDFriend, const char *pchKey) const char* friends::GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey)
{ {
return ""; return "";
} }
@ -186,12 +185,12 @@ namespace steam
return 0; return 0;
} }
const char *friends::GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey) const char* friends::GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey)
{ {
return "a"; return "a";
} }
bool friends::InviteUserToGame(steam_id steamIDFriend, const char *pchConnectString) bool friends::InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString)
{ {
return false; return false;
} }

View File

@ -5,28 +5,28 @@ namespace steam
class friends final class friends final
{ {
public: public:
virtual const char *GetPersonaName(); virtual const char* GetPersonaName();
virtual void SetPersonaName(const char *pchPersonaName); virtual void SetPersonaName(const char* pchPersonaName);
virtual int GetPersonaState(); virtual int GetPersonaState();
virtual int GetFriendCount(int eFriendFlags); virtual int GetFriendCount(int eFriendFlags);
virtual steam_id GetFriendByIndex(int iFriend, int iFriendFlags); virtual steam_id GetFriendByIndex(int iFriend, int iFriendFlags);
virtual int GetFriendRelationship(steam_id steamIDFriend); virtual int GetFriendRelationship(steam_id steamIDFriend);
virtual int GetFriendPersonaState(steam_id steamIDFriend); virtual int GetFriendPersonaState(steam_id steamIDFriend);
virtual const char *GetFriendPersonaName(steam_id steamIDFriend); virtual const char* GetFriendPersonaName(steam_id steamIDFriend);
virtual bool GetFriendGamePlayed(steam_id steamIDFriend, void *pFriendGameInfo); virtual bool GetFriendGamePlayed(steam_id steamIDFriend, void* pFriendGameInfo);
virtual const char *GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName); virtual const char* GetFriendPersonaNameHistory(steam_id steamIDFriend, int iPersonaName);
virtual bool HasFriend(steam_id steamIDFriend, int eFriendFlags); virtual bool HasFriend(steam_id steamIDFriend, int eFriendFlags);
virtual int GetClanCount(); virtual int GetClanCount();
virtual steam_id GetClanByIndex(int iClan); virtual steam_id GetClanByIndex(int iClan);
virtual const char *GetClanName(steam_id steamIDClan); virtual const char* GetClanName(steam_id steamIDClan);
virtual const char *GetClanTag(steam_id steamIDClan); virtual const char* GetClanTag(steam_id steamIDClan);
virtual int GetFriendCountFromSource(steam_id steamIDSource); virtual int GetFriendCountFromSource(steam_id steamIDSource);
virtual steam_id GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend); virtual steam_id GetFriendFromSourceByIndex(steam_id steamIDSource, int iFriend);
virtual bool IsUserInSource(steam_id steamIDUser, steam_id steamIDSource); virtual bool IsUserInSource(steam_id steamIDUser, steam_id steamIDSource);
virtual void SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking); virtual void SetInGameVoiceSpeaking(steam_id steamIDUser, bool bSpeaking);
virtual void ActivateGameOverlay(const char *pchDialog); virtual void ActivateGameOverlay(const char* pchDialog);
virtual void ActivateGameOverlayToUser(const char *pchDialog, steam_id steamID); virtual void ActivateGameOverlayToUser(const char* pchDialog, steam_id steamID);
virtual void ActivateGameOverlayToWebPage(const char *pchURL); virtual void ActivateGameOverlayToWebPage(const char* pchURL);
virtual void ActivateGameOverlayToStore(unsigned int nAppID); virtual void ActivateGameOverlayToStore(unsigned int nAppID);
virtual void SetPlayedWith(steam_id steamIDUserPlayedWith); virtual void SetPlayedWith(steam_id steamIDUserPlayedWith);
virtual void ActivateGameOverlayInviteDialog(steam_id steamIDLobby); virtual void ActivateGameOverlayInviteDialog(steam_id steamIDLobby);
@ -39,12 +39,12 @@ namespace steam
virtual int GetClanOfficerCount(steam_id steamIDClan); virtual int GetClanOfficerCount(steam_id steamIDClan);
virtual steam_id GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer); virtual steam_id GetClanOfficerByIndex(steam_id steamIDClan, int iOfficer);
virtual int GetUserRestrictions(); virtual int GetUserRestrictions();
virtual bool SetRichPresence(const char *pchKey, const char *pchValue); virtual bool SetRichPresence(const char* pchKey, const char* pchValue);
virtual void ClearRichPresence(); virtual void ClearRichPresence();
virtual const char *GetFriendRichPresence(steam_id steamIDFriend, const char *pchKey); virtual const char* GetFriendRichPresence(steam_id steamIDFriend, const char* pchKey);
virtual int GetFriendRichPresenceKeyCount(steam_id steamIDFriend); virtual int GetFriendRichPresenceKeyCount(steam_id steamIDFriend);
virtual const char *GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey); virtual const char* GetFriendRichPresenceKeyByIndex(steam_id steamIDFriend, int iKey);
virtual bool InviteUserToGame(steam_id steamIDFriend, const char *pchConnectString); virtual bool InviteUserToGame(steam_id steamIDFriend, const char* pchConnectString);
virtual int GetCoplayFriendCount(); virtual int GetCoplayFriendCount();
virtual steam_id GetCoplayFriend(int iCoplayFriend); virtual steam_id GetCoplayFriend(int iCoplayFriend);
virtual int GetFriendCoplayTime(steam_id steamIDFriend); virtual int GetFriendCoplayTime(steam_id steamIDFriend);

View File

@ -26,7 +26,8 @@ namespace steam
return steam_id(); return steam_id();
} }
bool game_server::SendUserConnectAndAuthenticate(unsigned int unIPClient, const void *pvAuthBlob, unsigned int cubAuthBlobSize, steam_id *pSteamIDUser) bool game_server::SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob,
unsigned int cubAuthBlobSize, steam_id* pSteamIDUser)
{ {
return true; return true;
} }
@ -40,17 +41,20 @@ namespace steam
{ {
} }
bool game_server::UpdateUserData(steam_id steamIDUser, const char *pchPlayerName, unsigned int uScore) bool game_server::UpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore)
{ {
return true; return true;
} }
bool game_server::SetServerType(unsigned int unServerFlags, unsigned int unGameIP, unsigned short unGamePort, unsigned short unSpectatorPort, unsigned short usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode) bool game_server::SetServerType(unsigned int unServerFlags, unsigned int unGameIP, unsigned short unGamePort,
unsigned short unSpectatorPort, unsigned short usQueryPort, const char* pchGameDir,
const char* pchVersion, bool bLANMode)
{ {
return true; return true;
} }
void game_server::UpdateServerStatus(int cPlayers, int cPlayersMax, int cBotPlayers, const char *pchServerName, const char *pSpectatorServerName, const char *pchMapName) void game_server::UpdateServerStatus(int cPlayers, int cPlayersMax, int cBotPlayers, const char* pchServerName,
const char* pSpectatorServerName, const char* pchMapName)
{ {
} }
@ -58,11 +62,11 @@ namespace steam
{ {
} }
void game_server::SetGameType(const char *pchGameType) void game_server::SetGameType(const char* pchGameType)
{ {
} }
bool game_server::GetUserAchievementStatus(steam_id steamID, const char *pchAchievementName) bool game_server::GetUserAchievementStatus(steam_id steamID, const char* pchAchievementName)
{ {
return false; return false;
} }
@ -86,7 +90,7 @@ namespace steam
return 0; return 0;
} }
void game_server::SetGameData(const char *pchGameData) void game_server::SetGameData(const char* pchGameData)
{ {
} }

View File

@ -10,20 +10,24 @@ namespace steam
virtual bool LoggedOn(); virtual bool LoggedOn();
virtual bool Secure(); virtual bool Secure();
virtual steam_id GetSteamID(); virtual steam_id GetSteamID();
virtual bool SendUserConnectAndAuthenticate(unsigned int unIPClient, const void *pvAuthBlob, unsigned int cubAuthBlobSize, steam_id *pSteamIDUser); virtual bool SendUserConnectAndAuthenticate(unsigned int unIPClient, const void* pvAuthBlob,
unsigned int cubAuthBlobSize, steam_id* pSteamIDUser);
virtual steam_id CreateUnauthenticatedUserConnection(); virtual steam_id CreateUnauthenticatedUserConnection();
virtual void SendUserDisconnect(steam_id steamIDUser); virtual void SendUserDisconnect(steam_id steamIDUser);
virtual bool UpdateUserData(steam_id steamIDUser, const char *pchPlayerName, unsigned int uScore); virtual bool UpdateUserData(steam_id steamIDUser, const char* pchPlayerName, unsigned int uScore);
virtual bool SetServerType(unsigned int unServerFlags, unsigned int unGameIP, unsigned short unGamePort, unsigned short unSpectatorPort, unsigned short usQueryPort, const char *pchGameDir, const char *pchVersion, bool bLANMode); virtual bool SetServerType(unsigned int unServerFlags, unsigned int unGameIP, unsigned short unGamePort,
virtual void UpdateServerStatus(int cPlayers, int cPlayersMax, int cBotPlayers, const char *pchServerName, const char *pSpectatorServerName, const char *pchMapName); unsigned short unSpectatorPort, unsigned short usQueryPort, const char* pchGameDir,
const char* pchVersion, bool bLANMode);
virtual void UpdateServerStatus(int cPlayers, int cPlayersMax, int cBotPlayers, const char* pchServerName,
const char* pSpectatorServerName, const char* pchMapName);
virtual void UpdateSpectatorPort(unsigned short unSpectatorPort); virtual void UpdateSpectatorPort(unsigned short unSpectatorPort);
virtual void SetGameType(const char *pchGameType); virtual void SetGameType(const char* pchGameType);
virtual bool GetUserAchievementStatus(steam_id steamID, const char *pchAchievementName); virtual bool GetUserAchievementStatus(steam_id steamID, const char* pchAchievementName);
virtual void GetGameplayStats(); virtual void GetGameplayStats();
virtual unsigned __int64 GetServerReputation(); virtual unsigned __int64 GetServerReputation();
virtual bool RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup); virtual bool RequestUserGroupStatus(steam_id steamIDUser, steam_id steamIDGroup);
virtual unsigned int GetPublicIP(); virtual unsigned int GetPublicIP();
virtual void SetGameData(const char *pchGameData); virtual void SetGameData(const char* pchGameData);
virtual int UserHasLicenseForApp(steam_id steamID, unsigned int appID); virtual int UserHasLicenseForApp(steam_id steamID, unsigned int appID);
}; };
} }

View File

@ -11,17 +11,22 @@ namespace steam
{ {
} }
bool master_server_updater::HandleIncomingPacket(const void *pData, int cbData, unsigned int srcIP, unsigned short srcPort) bool master_server_updater::HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP,
unsigned short srcPort)
{ {
return true; return true;
} }
int master_server_updater::GetNextOutgoingPacket(void *pOut, int cbMaxOut, unsigned int *pNetAdr, unsigned short *pPort) int master_server_updater::GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr,
unsigned short* pPort)
{ {
return 0; return 0;
} }
void master_server_updater::SetBasicServerData(unsigned short nProtocolVersion, bool bDedicatedServer, const char *pRegionName, const char *pProductName, unsigned short nMaxReportedClients, bool bPasswordProtected, const char *pGameDescription) void master_server_updater::SetBasicServerData(unsigned short nProtocolVersion, bool bDedicatedServer,
const char* pRegionName, const char* pProductName,
unsigned short nMaxReportedClients, bool bPasswordProtected,
const char* pGameDescription)
{ {
} }
@ -29,7 +34,7 @@ namespace steam
{ {
} }
void master_server_updater::SetKeyValue(const char *pKey, const char *pValue) void master_server_updater::SetKeyValue(const char* pKey, const char* pValue)
{ {
} }
@ -46,12 +51,12 @@ namespace steam
{ {
} }
bool master_server_updater::AddMasterServer(const char *pServerAddress) bool master_server_updater::AddMasterServer(const char* pServerAddress)
{ {
return true; return true;
} }
bool master_server_updater::RemoveMasterServer(const char *pServerAddress) bool master_server_updater::RemoveMasterServer(const char* pServerAddress)
{ {
return true; return true;
} }
@ -61,7 +66,7 @@ namespace steam
return 0; return 0;
} }
int master_server_updater::GetMasterServerAddress(int iServer, char *pOut, int outBufferSize) int master_server_updater::GetMasterServerAddress(int iServer, char* pOut, int outBufferSize)
{ {
return 0; return 0;
} }

View File

@ -7,17 +7,19 @@ namespace steam
public: public:
virtual void SetActive(bool bActive); virtual void SetActive(bool bActive);
virtual void SetHeartbeatInterval(int iHeartbeatInterval); virtual void SetHeartbeatInterval(int iHeartbeatInterval);
virtual bool HandleIncomingPacket(const void *pData, int cbData, unsigned int srcIP, unsigned short srcPort); virtual bool HandleIncomingPacket(const void* pData, int cbData, unsigned int srcIP, unsigned short srcPort);
virtual int GetNextOutgoingPacket(void *pOut, int cbMaxOut, unsigned int *pNetAdr, unsigned short *pPort); virtual int GetNextOutgoingPacket(void* pOut, int cbMaxOut, unsigned int* pNetAdr, unsigned short* pPort);
virtual void SetBasicServerData(unsigned short nProtocolVersion, bool bDedicatedServer, const char *pRegionName, const char *pProductName, unsigned short nMaxReportedClients, bool bPasswordProtected, const char *pGameDescription); virtual void SetBasicServerData(unsigned short nProtocolVersion, bool bDedicatedServer, const char* pRegionName,
const char* pProductName, unsigned short nMaxReportedClients,
bool bPasswordProtected, const char* pGameDescription);
virtual void ClearAllKeyValues(); virtual void ClearAllKeyValues();
virtual void SetKeyValue(const char *pKey, const char *pValue); virtual void SetKeyValue(const char* pKey, const char* pValue);
virtual void NotifyShutdown(); virtual void NotifyShutdown();
virtual bool WasRestartRequested(); virtual bool WasRestartRequested();
virtual void ForceHeartbeat(); virtual void ForceHeartbeat();
virtual bool AddMasterServer(const char *pServerAddress); virtual bool AddMasterServer(const char* pServerAddress);
virtual bool RemoveMasterServer(const char *pServerAddress); virtual bool RemoveMasterServer(const char* pServerAddress);
virtual int GetNumMasterServers(); virtual int GetNumMasterServers();
virtual int GetMasterServerAddress(int iServer, char *pOut, int outBufferSize); virtual int GetMasterServerAddress(int iServer, char* pOut, int outBufferSize);
}; };
} }

View File

@ -8,17 +8,22 @@ namespace steam
return 0; return 0;
} }
bool matchmaking::GetFavoriteGame(int iGame, unsigned int *pnAppID, unsigned int *pnIP, unsigned short *pnConnPort, unsigned short *pnQueryPort, unsigned int *punFlags, unsigned int *pRTime32LastPlayedOnServer) bool matchmaking::GetFavoriteGame(int iGame, unsigned int* pnAppID, unsigned int* pnIP, unsigned short* pnConnPort,
unsigned short* pnQueryPort, unsigned int* punFlags,
unsigned int* pRTime32LastPlayedOnServer)
{ {
return false; return false;
} }
int matchmaking::AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort, unsigned short nQueryPort, unsigned int unFlags, unsigned int rTime32LastPlayedOnServer) int matchmaking::AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags,
unsigned int rTime32LastPlayedOnServer)
{ {
return 0; return 0;
} }
bool matchmaking::RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort, unsigned short nQueryPort, unsigned int unFlags) bool matchmaking::RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags)
{ {
return false; return false;
} }
@ -28,15 +33,17 @@ namespace steam
return 0; return 0;
} }
void matchmaking::AddRequestLobbyListStringFilter(const char *pchKeyToMatch, const char *pchValueToMatch, int eComparisonType) void matchmaking::AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
int eComparisonType)
{ {
} }
void matchmaking::AddRequestLobbyListNumericalFilter(const char *pchKeyToMatch, int nValueToMatch, int eComparisonType) void matchmaking::AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
int eComparisonType)
{ {
} }
void matchmaking::AddRequestLobbyListNearValueFilter(const char *pchKeyToMatch, int nValueToBeCloseTo) void matchmaking::AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo)
{ {
} }
@ -60,9 +67,10 @@ namespace steam
unsigned __int64 matchmaking::CreateLobby(int eLobbyType, int cMaxMembers) unsigned __int64 matchmaking::CreateLobby(int eLobbyType, int cMaxMembers)
{ {
const auto result = callbacks::register_call(); const auto result = callbacks::register_call();
auto retvals = static_cast<lobby_created*>(calloc(1, sizeof(lobby_created)));//::Utils::Memory::AllocateArray<LobbyCreated>(); auto retvals = static_cast<lobby_created*>(calloc(1, sizeof(lobby_created)));
//::Utils::Memory::AllocateArray<LobbyCreated>();
steam_id id; steam_id id;
id.raw.account_id = 1337132; id.raw.account_id = 1337132;
id.raw.universe = 1; id.raw.universe = 1;
id.raw.account_type = 8; id.raw.account_type = 8;
@ -81,7 +89,8 @@ namespace steam
unsigned __int64 matchmaking::JoinLobby(steam_id steamIDLobby) unsigned __int64 matchmaking::JoinLobby(steam_id steamIDLobby)
{ {
const auto result = callbacks::register_call(); const auto result = callbacks::register_call();
auto* retvals = static_cast<lobby_enter*>(calloc(1, sizeof(lobby_enter)));//::Utils::Memory::AllocateArray<LobbyEnter>(); auto* retvals = static_cast<lobby_enter*>(calloc(1, sizeof(lobby_enter)));
//::Utils::Memory::AllocateArray<LobbyEnter>();
retvals->m_b_locked = false; retvals->m_b_locked = false;
retvals->m_e_chat_room_enter_response = 1; retvals->m_e_chat_room_enter_response = 1;
retvals->m_rgf_chat_permissions = 0xFFFFFFFF; retvals->m_rgf_chat_permissions = 0xFFFFFFFF;
@ -112,12 +121,12 @@ namespace steam
return SteamUser()->GetSteamID(); return SteamUser()->GetSteamID();
} }
const char *matchmaking::GetLobbyData(steam_id steamIDLobby, const char *pchKey) const char* matchmaking::GetLobbyData(steam_id steamIDLobby, const char* pchKey)
{ {
return "212";//Components::Party::GetLobbyInfo(steamIDLobby, pchKey); return "212"; //Components::Party::GetLobbyInfo(steamIDLobby, pchKey);
} }
bool matchmaking::SetLobbyData(steam_id steamIDLobby, const char *pchKey, const char *pchValue) bool matchmaking::SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
{ {
return true; return true;
} }
@ -127,31 +136,33 @@ namespace steam
return 0; return 0;
} }
bool matchmaking::GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char *pchKey, int cchKeyBufferSize, char *pchValue, int cchValueBufferSize) bool matchmaking::GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
char* pchValue, int cchValueBufferSize)
{ {
return false; return false;
} }
bool matchmaking::DeleteLobbyData(steam_id steamIDLobby, const char *pchKey) bool matchmaking::DeleteLobbyData(steam_id steamIDLobby, const char* pchKey)
{ {
return false; return false;
} }
const char *matchmaking::GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char *pchKey) const char* matchmaking::GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey)
{ {
return ""; return "";
} }
void matchmaking::SetLobbyMemberData(steam_id steamIDLobby, const char *pchKey, const char *pchValue) void matchmaking::SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue)
{ {
} }
bool matchmaking::SendLobbyChatMsg(steam_id steamIDLobby, const void *pvMsgBody, int cubMsgBody) bool matchmaking::SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody)
{ {
return true; return true;
} }
int matchmaking::GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id *pSteamIDUser, void *pvData, int cubData, int *peChatEntryType) int matchmaking::GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
int cubData, int* peChatEntryType)
{ {
return 0; return 0;
} }
@ -161,11 +172,13 @@ namespace steam
return false; return false;
} }
void matchmaking::SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP, unsigned short unGameServerPort, steam_id steamIDGameServer) void matchmaking::SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
unsigned short unGameServerPort, steam_id steamIDGameServer)
{ {
} }
bool matchmaking::GetLobbyGameServer(steam_id steamIDLobby, unsigned int *punGameServerIP, unsigned short *punGameServerPort, steam_id *psteamIDGameServer) bool matchmaking::GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
unsigned short* punGameServerPort, steam_id* psteamIDGameServer)
{ {
return false; return false;
} }

View File

@ -25,13 +25,20 @@ namespace steam
{ {
public: public:
virtual int GetFavoriteGameCount(); virtual int GetFavoriteGameCount();
virtual bool GetFavoriteGame(int iGame, unsigned int *pnAppID, unsigned int *pnIP, unsigned short *pnConnPort, unsigned short *pnQueryPort, unsigned int *punFlags, unsigned int *pRTime32LastPlayedOnServer); virtual bool GetFavoriteGame(int iGame, unsigned int* pnAppID, unsigned int* pnIP, unsigned short* pnConnPort,
virtual int AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort, unsigned short nQueryPort, unsigned int unFlags, unsigned int rTime32LastPlayedOnServer); unsigned short* pnQueryPort, unsigned int* punFlags,
virtual bool RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort, unsigned short nQueryPort, unsigned int unFlags); unsigned int* pRTime32LastPlayedOnServer);
virtual int AddFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags,
unsigned int rTime32LastPlayedOnServer);
virtual bool RemoveFavoriteGame(unsigned int nAppID, unsigned int nIP, unsigned short nConnPort,
unsigned short nQueryPort, unsigned int unFlags);
virtual unsigned __int64 RequestLobbyList(); virtual unsigned __int64 RequestLobbyList();
virtual void AddRequestLobbyListStringFilter(const char *pchKeyToMatch, const char *pchValueToMatch, int eComparisonType); virtual void AddRequestLobbyListStringFilter(const char* pchKeyToMatch, const char* pchValueToMatch,
virtual void AddRequestLobbyListNumericalFilter(const char *pchKeyToMatch, int nValueToMatch, int eComparisonType); int eComparisonType);
virtual void AddRequestLobbyListNearValueFilter(const char *pchKeyToMatch, int nValueToBeCloseTo); virtual void AddRequestLobbyListNumericalFilter(const char* pchKeyToMatch, int nValueToMatch,
int eComparisonType);
virtual void AddRequestLobbyListNearValueFilter(const char* pchKeyToMatch, int nValueToBeCloseTo);
virtual void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable); virtual void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable);
virtual void AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter); virtual void AddRequestLobbyListDistanceFilter(int eLobbyDistanceFilter);
virtual void AddRequestLobbyListResultCountFilter(int cMaxResults); virtual void AddRequestLobbyListResultCountFilter(int cMaxResults);
@ -42,18 +49,22 @@ namespace steam
virtual bool InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee); virtual bool InviteUserToLobby(steam_id steamIDLobby, steam_id steamIDInvitee);
virtual int GetNumLobbyMembers(steam_id steamIDLobby); virtual int GetNumLobbyMembers(steam_id steamIDLobby);
virtual steam_id GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember); virtual steam_id GetLobbyMemberByIndex(steam_id steamIDLobby, int iMember);
virtual const char *GetLobbyData(steam_id steamIDLobby, const char *pchKey); virtual const char* GetLobbyData(steam_id steamIDLobby, const char* pchKey);
virtual bool SetLobbyData(steam_id steamIDLobby, const char *pchKey, const char *pchValue); virtual bool SetLobbyData(steam_id steamIDLobby, const char* pchKey, const char* pchValue);
virtual int GetLobbyDataCount(steam_id steamIDLobby); virtual int GetLobbyDataCount(steam_id steamIDLobby);
virtual bool GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char *pchKey, int cchKeyBufferSize, char *pchValue, int cchValueBufferSize); virtual bool GetLobbyDataByIndex(steam_id steamIDLobby, int iLobbyData, char* pchKey, int cchKeyBufferSize,
virtual bool DeleteLobbyData(steam_id steamIDLobby, const char *pchKey); char* pchValue, int cchValueBufferSize);
virtual const char *GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char *pchKey); virtual bool DeleteLobbyData(steam_id steamIDLobby, const char* pchKey);
virtual void SetLobbyMemberData(steam_id steamIDLobby, const char *pchKey, const char *pchValue); virtual const char* GetLobbyMemberData(steam_id steamIDLobby, steam_id steamIDUser, const char* pchKey);
virtual bool SendLobbyChatMsg(steam_id steamIDLobby, const void *pvMsgBody, int cubMsgBody); virtual void SetLobbyMemberData(steam_id steamIDLobby, const char* pchKey, const char* pchValue);
virtual int GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id *pSteamIDUser, void *pvData, int cubData, int *peChatEntryType); virtual bool SendLobbyChatMsg(steam_id steamIDLobby, const void* pvMsgBody, int cubMsgBody);
virtual int GetLobbyChatEntry(steam_id steamIDLobby, int iChatID, steam_id* pSteamIDUser, void* pvData,
int cubData, int* peChatEntryType);
virtual bool RequestLobbyData(steam_id steamIDLobby); virtual bool RequestLobbyData(steam_id steamIDLobby);
virtual void SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP, unsigned short unGameServerPort, steam_id steamIDGameServer); virtual void SetLobbyGameServer(steam_id steamIDLobby, unsigned int unGameServerIP,
virtual bool GetLobbyGameServer(steam_id steamIDLobby, unsigned int *punGameServerIP, unsigned short *punGameServerPort, steam_id *psteamIDGameServer); unsigned short unGameServerPort, steam_id steamIDGameServer);
virtual bool GetLobbyGameServer(steam_id steamIDLobby, unsigned int* punGameServerIP,
unsigned short* punGameServerPort, steam_id* psteamIDGameServer);
virtual bool SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers); virtual bool SetLobbyMemberLimit(steam_id steamIDLobby, int cMaxMembers);
virtual int GetLobbyMemberLimit(steam_id steamIDLobby); virtual int GetLobbyMemberLimit(steam_id steamIDLobby);
virtual bool SetLobbyType(steam_id steamIDLobby, int eLobbyType); virtual bool SetLobbyType(steam_id steamIDLobby, int eLobbyType);

View File

@ -3,32 +3,37 @@
namespace steam namespace steam
{ {
void* matchmaking_servers::RequestInternetServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse) void* matchmaking_servers::RequestInternetServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse)
{ {
return nullptr; return nullptr;
} }
void* matchmaking_servers::RequestLANServerList(unsigned int iApp, void *pRequestServersResponse) void* matchmaking_servers::RequestLANServerList(unsigned int iApp, void* pRequestServersResponse)
{ {
return nullptr; return nullptr;
} }
void* matchmaking_servers::RequestFriendsServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse) void* matchmaking_servers::RequestFriendsServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse)
{ {
return nullptr; return nullptr;
} }
void* matchmaking_servers::RequestFavoritesServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse) void* matchmaking_servers::RequestFavoritesServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse)
{ {
return nullptr; return nullptr;
} }
void* matchmaking_servers::RequestHistoryServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse) void* matchmaking_servers::RequestHistoryServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse)
{ {
return nullptr; return nullptr;
} }
void* matchmaking_servers::RequestSpectatorServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse) void* matchmaking_servers::RequestSpectatorServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse)
{ {
return nullptr; return nullptr;
} }
@ -37,7 +42,7 @@ namespace steam
{ {
} }
void *matchmaking_servers::GetServerDetails(void* hRequest, int iServer) void* matchmaking_servers::GetServerDetails(void* hRequest, int iServer)
{ {
return nullptr; return nullptr;
} }
@ -64,17 +69,17 @@ namespace steam
{ {
} }
int matchmaking_servers::PingServer(unsigned int unIP, unsigned short usPort, void *pRequestServersResponse) int matchmaking_servers::PingServer(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse)
{ {
return 0; return 0;
} }
int matchmaking_servers::PlayerDetails(unsigned int unIP, unsigned short usPort, void *pRequestServersResponse) int matchmaking_servers::PlayerDetails(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse)
{ {
return 0; return 0;
} }
int matchmaking_servers::ServerRules(unsigned int unIP, unsigned short usPort, void *pRequestServersResponse) int matchmaking_servers::ServerRules(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse)
{ {
return 0; return 0;
} }

View File

@ -5,22 +5,27 @@ namespace steam
class matchmaking_servers final class matchmaking_servers final
{ {
public: public:
virtual void* RequestInternetServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse); virtual void* RequestInternetServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
virtual void* RequestLANServerList(unsigned int iApp, void *pRequestServersResponse); void* pRequestServersResponse);
virtual void* RequestFriendsServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse); virtual void* RequestLANServerList(unsigned int iApp, void* pRequestServersResponse);
virtual void* RequestFavoritesServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse); virtual void* RequestFriendsServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
virtual void* RequestHistoryServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse); void* pRequestServersResponse);
virtual void* RequestSpectatorServerList(unsigned int iApp, void **ppchFilters, unsigned int nFilters, void *pRequestServersResponse); virtual void* RequestFavoritesServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse);
virtual void* RequestHistoryServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse);
virtual void* RequestSpectatorServerList(unsigned int iApp, void** ppchFilters, unsigned int nFilters,
void* pRequestServersResponse);
virtual void ReleaseRequest(void* hServerListRequest); virtual void ReleaseRequest(void* hServerListRequest);
virtual void *GetServerDetails(void* hRequest, int iServer); virtual void* GetServerDetails(void* hRequest, int iServer);
virtual void CancelQuery(void* hRequest); virtual void CancelQuery(void* hRequest);
virtual void RefreshQuery(void* hRequest); virtual void RefreshQuery(void* hRequest);
virtual bool IsRefreshing(void* hRequest); virtual bool IsRefreshing(void* hRequest);
virtual int GetServerCount(void* hRequest); virtual int GetServerCount(void* hRequest);
virtual void RefreshServer(void* hRequest, int iServer); virtual void RefreshServer(void* hRequest, int iServer);
virtual int PingServer(unsigned int unIP, unsigned short usPort, void *pRequestServersResponse); virtual int PingServer(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse);
virtual int PlayerDetails(unsigned int unIP, unsigned short usPort, void *pRequestServersResponse); virtual int PlayerDetails(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse);
virtual int ServerRules(unsigned int unIP, unsigned short usPort, void *pRequestServersResponse); virtual int ServerRules(unsigned int unIP, unsigned short usPort, void* pRequestServersResponse);
virtual void CancelServerQuery(int hServerQuery); virtual void CancelServerQuery(int hServerQuery);
}; };
} }

View File

@ -3,17 +3,18 @@
namespace steam namespace steam
{ {
bool networking::SendP2PPacket(steam_id steamIDRemote, const void *pubData, unsigned int cubData, int eP2PSendType) bool networking::SendP2PPacket(steam_id steamIDRemote, const void* pubData, unsigned int cubData, int eP2PSendType)
{ {
return false; return false;
} }
bool networking::IsP2PPacketAvailable(unsigned int *pcubMsgSize, int idk) bool networking::IsP2PPacketAvailable(unsigned int* pcubMsgSize, int idk)
{ {
return false; return false;
} }
bool networking::ReadP2PPacket(void *pubDest, unsigned int cubDest, unsigned int *pcubMsgSize, steam_id *psteamIDRemote) bool networking::ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
steam_id* psteamIDRemote)
{ {
return false; return false;
} }
@ -33,7 +34,7 @@ namespace steam
return false; return false;
} }
bool networking::GetP2PSessionState(steam_id steamIDRemote, void *pConnectionState) bool networking::GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState)
{ {
return false; return false;
} }
@ -43,12 +44,14 @@ namespace steam
return false; return false;
} }
unsigned int networking::CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort, bool bAllowUseOfPacketRelay) unsigned int networking::CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
bool bAllowUseOfPacketRelay)
{ {
return NULL; return NULL;
} }
unsigned int networking::CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay) unsigned int networking::CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
bool bAllowUseOfPacketRelay)
{ {
return NULL; return NULL;
} }
@ -68,37 +71,40 @@ namespace steam
return false; return false;
} }
bool networking::SendDataOnSocket(unsigned int hSocket, void *pubData, unsigned int cubData, bool bReliable) bool networking::SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable)
{ {
return false; return false;
} }
bool networking::IsDataAvailableOnSocket(unsigned int hSocket, unsigned int *pcubMsgSize) bool networking::IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize)
{ {
return false; return false;
} }
bool networking::RetrieveDataFromSocket(unsigned int hSocket, void *pubDest, unsigned int cubDest, unsigned int *pcubMsgSize) bool networking::RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize)
{ {
return false; return false;
} }
bool networking::IsDataAvailable(unsigned int hListenSocket, unsigned int *pcubMsgSize, unsigned int *phSocket) bool networking::IsDataAvailable(unsigned int hListenSocket, unsigned int* pcubMsgSize, unsigned int* phSocket)
{ {
return false; return false;
} }
bool networking::RetrieveData(unsigned int hListenSocket, void *pubDest, unsigned int cubDest, unsigned int *pcubMsgSize, unsigned int *phSocket) bool networking::RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
unsigned int* pcubMsgSize, unsigned int* phSocket)
{ {
return false; return false;
} }
bool networking::GetSocketInfo(unsigned int hSocket, steam_id *pSteamIDRemote, int *peSocketStatus, unsigned int *punIPRemote, unsigned short *punPortRemote) bool networking::GetSocketInfo(unsigned int hSocket, steam_id* pSteamIDRemote, int* peSocketStatus,
unsigned int* punIPRemote, unsigned short* punPortRemote)
{ {
return false; return false;
} }
bool networking::GetListenSocketInfo(unsigned int hListenSocket, unsigned int *pnIP, unsigned short *pnPort) bool networking::GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort)
{ {
return false; return false;
} }

View File

@ -5,26 +5,32 @@ namespace steam
class networking final class networking final
{ {
public: public:
virtual bool SendP2PPacket(steam_id steamIDRemote, const void *pubData, unsigned int cubData, int eP2PSendType); virtual bool SendP2PPacket(steam_id steamIDRemote, const void* pubData, unsigned int cubData, int eP2PSendType);
virtual bool IsP2PPacketAvailable(unsigned int *pcubMsgSize, int idk); virtual bool IsP2PPacketAvailable(unsigned int* pcubMsgSize, int idk);
virtual bool ReadP2PPacket(void *pubDest, unsigned int cubDest, unsigned int *pcubMsgSize, steam_id *psteamIDRemote); virtual bool ReadP2PPacket(void* pubDest, unsigned int cubDest, unsigned int* pcubMsgSize,
steam_id* psteamIDRemote);
virtual bool AcceptP2PSessionWithUser(steam_id steamIDRemote); virtual bool AcceptP2PSessionWithUser(steam_id steamIDRemote);
virtual bool CloseP2PSessionWithUser(steam_id steamIDRemote); virtual bool CloseP2PSessionWithUser(steam_id steamIDRemote);
virtual bool CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort); virtual bool CloseP2PChannelWithUser(steam_id steamIDRemote, int iVirtualPort);
virtual bool GetP2PSessionState(steam_id steamIDRemote, void *pConnectionState); virtual bool GetP2PSessionState(steam_id steamIDRemote, void* pConnectionState);
virtual bool AllowP2PPacketRelay(bool bAllow); virtual bool AllowP2PPacketRelay(bool bAllow);
virtual unsigned int CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort, bool bAllowUseOfPacketRelay); virtual unsigned int CreateListenSocket(int nVirtualP2PPort, unsigned int nIP, unsigned short nPort,
virtual unsigned int CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay); bool bAllowUseOfPacketRelay);
virtual unsigned int CreateP2PConnectionSocket(steam_id steamIDTarget, int nVirtualPort, int nTimeoutSec,
bool bAllowUseOfPacketRelay);
virtual unsigned int CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec); virtual unsigned int CreateConnectionSocket(unsigned int nIP, unsigned short nPort, int nTimeoutSec);
virtual bool DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd); virtual bool DestroySocket(unsigned int hSocket, bool bNotifyRemoteEnd);
virtual bool DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd); virtual bool DestroyListenSocket(unsigned int hSocket, bool bNotifyRemoteEnd);
virtual bool SendDataOnSocket(unsigned int hSocket, void *pubData, unsigned int cubData, bool bReliable); virtual bool SendDataOnSocket(unsigned int hSocket, void* pubData, unsigned int cubData, bool bReliable);
virtual bool IsDataAvailableOnSocket(unsigned int hSocket, unsigned int *pcubMsgSize); virtual bool IsDataAvailableOnSocket(unsigned int hSocket, unsigned int* pcubMsgSize);
virtual bool RetrieveDataFromSocket(unsigned int hSocket, void *pubDest, unsigned int cubDest, unsigned int *pcubMsgSize); virtual bool RetrieveDataFromSocket(unsigned int hSocket, void* pubDest, unsigned int cubDest,
virtual bool IsDataAvailable(unsigned int hListenSocket, unsigned int *pcubMsgSize, unsigned int *phSocket); unsigned int* pcubMsgSize);
virtual bool RetrieveData(unsigned int hListenSocket, void *pubDest, unsigned int cubDest, unsigned int *pcubMsgSize, unsigned int *phSocket); virtual bool IsDataAvailable(unsigned int hListenSocket, unsigned int* pcubMsgSize, unsigned int* phSocket);
virtual bool GetSocketInfo(unsigned int hSocket, steam_id *pSteamIDRemote, int *peSocketStatus, unsigned int *punIPRemote, unsigned short *punPortRemote); virtual bool RetrieveData(unsigned int hListenSocket, void* pubDest, unsigned int cubDest,
virtual bool GetListenSocketInfo(unsigned int hListenSocket, unsigned int *pnIP, unsigned short *pnPort); unsigned int* pcubMsgSize, unsigned int* phSocket);
virtual bool GetSocketInfo(unsigned int hSocket, steam_id* pSteamIDRemote, int* peSocketStatus,
unsigned int* punIPRemote, unsigned short* punPortRemote);
virtual bool GetListenSocketInfo(unsigned int hListenSocket, unsigned int* pnIP, unsigned short* pnPort);
virtual int GetSocketConnectionType(unsigned int hSocket); virtual int GetSocketConnectionType(unsigned int hSocket);
virtual int GetMaxPacketSize(unsigned int hSocket); virtual int GetMaxPacketSize(unsigned int hSocket);
}; };

View File

@ -3,23 +3,23 @@
namespace steam namespace steam
{ {
bool remote_storage::FileWrite(const char *pchFile, const void *pvData, int cubData) bool remote_storage::FileWrite(const char* pchFile, const void* pvData, int cubData)
{ {
return true; return true;
} }
int remote_storage::GetFileSize(const char *pchFile) int remote_storage::GetFileSize(const char* pchFile)
{ {
return 0; return 0;
} }
int remote_storage::FileRead(const char *pchFile, void *pvData, int cubDataToRead) int remote_storage::FileRead(const char* pchFile, void* pvData, int cubDataToRead)
{ {
OutputDebugStringA(pchFile); OutputDebugStringA(pchFile);
return 0; return 0;
} }
bool remote_storage::FileExists(const char *pchFile) bool remote_storage::FileExists(const char* pchFile)
{ {
return false; return false;
} }
@ -29,13 +29,13 @@ namespace steam
return 0; return 0;
} }
const char *remote_storage::GetFileNameAndSize(int iFile, int *pnFileSizeInBytes) const char* remote_storage::GetFileNameAndSize(int iFile, int* pnFileSizeInBytes)
{ {
*pnFileSizeInBytes = 0; *pnFileSizeInBytes = 0;
return ""; return "";
} }
bool remote_storage::GetQuota(int *pnTotalBytes, int *puAvailableBytes) bool remote_storage::GetQuota(int* pnTotalBytes, int* puAvailableBytes)
{ {
*pnTotalBytes = 0x10000000; *pnTotalBytes = 0x10000000;
*puAvailableBytes = 0x10000000; *puAvailableBytes = 0x10000000;

View File

@ -5,12 +5,12 @@ namespace steam
class remote_storage final class remote_storage final
{ {
public: public:
virtual bool FileWrite(const char *pchFile, const void *pvData, int cubData); virtual bool FileWrite(const char* pchFile, const void* pvData, int cubData);
virtual int GetFileSize(const char *pchFile); virtual int GetFileSize(const char* pchFile);
virtual int FileRead(const char *pchFile, void *pvData, int cubDataToRead); virtual int FileRead(const char* pchFile, void* pvData, int cubDataToRead);
virtual bool FileExists(const char *pchFile); virtual bool FileExists(const char* pchFile);
virtual int GetFileCount(); virtual int GetFileCount();
virtual const char *GetFileNameAndSize(int iFile, int *pnFileSizeInBytes); virtual const char* GetFileNameAndSize(int iFile, int* pnFileSizeInBytes);
virtual bool GetQuota(int *pnTotalBytes, int *puAvailableBytes); virtual bool GetQuota(int* pnTotalBytes, int* puAvailableBytes);
}; };
} }

View File

@ -20,7 +20,8 @@ namespace steam
return id; return id;
} }
int user::InitiateGameConnection(void *pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer, bool bSecure) int user::InitiateGameConnection(void* pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer,
unsigned int unIPServer, unsigned short usPortServer, bool bSecure)
{ {
return 0; return 0;
} }
@ -29,11 +30,11 @@ namespace steam
{ {
} }
void user::TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char *pchExtraInfo) void user::TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char* pchExtraInfo)
{ {
} }
bool user::GetUserDataFolder(char *pchBuffer, int cubBuffer) bool user::GetUserDataFolder(char* pchBuffer, int cubBuffer)
{ {
return false; return false;
} }
@ -46,17 +47,22 @@ namespace steam
{ {
} }
int user::GetAvailableVoice(unsigned int *pcbCompressed, unsigned int *pcbUncompressed, unsigned int nUncompressedVoiceDesiredSampleRate) int user::GetAvailableVoice(unsigned int* pcbCompressed, unsigned int* pcbUncompressed,
unsigned int nUncompressedVoiceDesiredSampleRate)
{ {
return 0; return 0;
} }
int user::GetVoice(bool bWantCompressed, void *pDestBuffer, unsigned int cbDestBufferSize, unsigned int *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, unsigned int cbUncompressedDestBufferSize, unsigned int *nUncompressBytesWritten, unsigned int nUncompressedVoiceDesiredSampleRate) int user::GetVoice(bool bWantCompressed, void* pDestBuffer, unsigned int cbDestBufferSize,
unsigned int* nBytesWritten, bool bWantUncompressed, void* pUncompressedDestBuffer,
unsigned int cbUncompressedDestBufferSize, unsigned int* nUncompressBytesWritten,
unsigned int nUncompressedVoiceDesiredSampleRate)
{ {
return 0; return 0;
} }
int user::DecompressVoice(void *pCompressed, unsigned int cbCompressed, void *pDestBuffer, unsigned int cbDestBufferSize, unsigned int *nBytesWritten) int user::DecompressVoice(void* pCompressed, unsigned int cbCompressed, void* pDestBuffer,
unsigned int cbDestBufferSize, unsigned int* nBytesWritten)
{ {
return 0; return 0;
} }
@ -66,12 +72,12 @@ namespace steam
return 0; return 0;
} }
unsigned int user::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, unsigned int *pcbTicket) unsigned int user::GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{ {
return 0; return 0;
} }
int user::BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, steam_id steamID) int user::BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID)
{ {
return 0; return 0;
} }
@ -98,25 +104,28 @@ namespace steam
{ {
} }
unsigned __int64 user::RequestEncryptedAppTicket(void *pUserData, int cbUserData) unsigned __int64 user::RequestEncryptedAppTicket(void* pUserData, int cbUserData)
{ {
// Generate the authentication ticket // Generate the authentication ticket
//Components::DemonWare::GenerateAuthTicket(std::string(reinterpret_cast<char*>(pUserData), cbUserData)); //Components::DemonWare::GenerateAuthTicket(std::string(reinterpret_cast<char*>(pUserData), cbUserData));
// Create the call response // Create the call response
const auto result = callbacks::register_call(); const auto result = callbacks::register_call();
auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(1, sizeof(encrypted_app_ticket_response)));//::Utils::Memory::AllocateArray<EncryptedAppTicketResponse>(); auto retvals = static_cast<encrypted_app_ticket_response*>(calloc(1, sizeof(encrypted_app_ticket_response)));
//::Utils::Memory::AllocateArray<EncryptedAppTicketResponse>();
retvals->m_e_result = 1; retvals->m_e_result = 1;
// Return the call response // Return the call response
callbacks::return_call(retvals, sizeof(encrypted_app_ticket_response), encrypted_app_ticket_response::callback_id, result); callbacks::return_call(retvals, sizeof(encrypted_app_ticket_response),
encrypted_app_ticket_response::callback_id, result);
return result; return result;
} }
bool user::GetEncryptedAppTicket(void *pTicket, int cbMaxTicket, unsigned int *pcbTicket) bool user::GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket)
{ {
if (cbMaxTicket < 0) return false; if (cbMaxTicket < 0) return false;
return false;//Components::DemonWare::GetAuthTicket(pTicket, static_cast<unsigned int>(cbMaxTicket), pcbTicket); return false;
//Components::DemonWare::GetAuthTicket(pTicket, static_cast<unsigned int>(cbMaxTicket), pcbTicket);
} }
} }

View File

@ -16,24 +16,30 @@ namespace steam
virtual bool LoggedOn(); virtual bool LoggedOn();
virtual steam_id GetSteamID(); virtual steam_id GetSteamID();
virtual int InitiateGameConnection(void *pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer, bool bSecure); virtual int InitiateGameConnection(void* pAuthBlob, int cbMaxAuthBlob, steam_id steamIDGameServer,
unsigned int unIPServer, unsigned short usPortServer, bool bSecure);
virtual void TerminateGameConnection(unsigned int unIPServer, unsigned short usPortServer); virtual void TerminateGameConnection(unsigned int unIPServer, unsigned short usPortServer);
virtual void TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char *pchExtraInfo = ""); virtual void TrackAppUsageEvent(steam_id gameID, int eAppUsageEvent, const char* pchExtraInfo = "");
virtual bool GetUserDataFolder(char *pchBuffer, int cubBuffer); virtual bool GetUserDataFolder(char* pchBuffer, int cubBuffer);
virtual void StartVoiceRecording(); virtual void StartVoiceRecording();
virtual void StopVoiceRecording(); virtual void StopVoiceRecording();
virtual int GetAvailableVoice(unsigned int *pcbCompressed, unsigned int *pcbUncompressed, unsigned int nUncompressedVoiceDesiredSampleRate); virtual int GetAvailableVoice(unsigned int* pcbCompressed, unsigned int* pcbUncompressed,
virtual int GetVoice(bool bWantCompressed, void *pDestBuffer, unsigned int cbDestBufferSize, unsigned int *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, unsigned int cbUncompressedDestBufferSize, unsigned int *nUncompressBytesWritten, unsigned int nUncompressedVoiceDesiredSampleRate); unsigned int nUncompressedVoiceDesiredSampleRate);
virtual int DecompressVoice(void *pCompressed, unsigned int cbCompressed, void *pDestBuffer, unsigned int cbDestBufferSize, unsigned int *nBytesWritten); virtual int GetVoice(bool bWantCompressed, void* pDestBuffer, unsigned int cbDestBufferSize,
unsigned int* nBytesWritten, bool bWantUncompressed, void* pUncompressedDestBuffer,
unsigned int cbUncompressedDestBufferSize, unsigned int* nUncompressBytesWritten,
unsigned int nUncompressedVoiceDesiredSampleRate);
virtual int DecompressVoice(void* pCompressed, unsigned int cbCompressed, void* pDestBuffer,
unsigned int cbDestBufferSize, unsigned int* nBytesWritten);
virtual unsigned int GetVoiceOptimalSampleRate(); virtual unsigned int GetVoiceOptimalSampleRate();
virtual unsigned int GetAuthSessionTicket(void *pTicket, int cbMaxTicket, unsigned int *pcbTicket); virtual unsigned int GetAuthSessionTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
virtual int BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, steam_id steamID); virtual int BeginAuthSession(const void* pAuthTicket, int cbAuthTicket, steam_id steamID);
virtual void EndAuthSession(steam_id steamID); virtual void EndAuthSession(steam_id steamID);
virtual void CancelAuthTicket(unsigned int hAuthTicket); virtual void CancelAuthTicket(unsigned int hAuthTicket);
virtual unsigned int UserHasLicenseForApp(steam_id steamID, unsigned int appID); virtual unsigned int UserHasLicenseForApp(steam_id steamID, unsigned int appID);
virtual bool BIsBehindNAT(); virtual bool BIsBehindNAT();
virtual void AdvertiseGame(steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer); virtual void AdvertiseGame(steam_id steamIDGameServer, unsigned int unIPServer, unsigned short usPortServer);
virtual unsigned __int64 RequestEncryptedAppTicket(void *pUserData, int cbUserData); virtual unsigned __int64 RequestEncryptedAppTicket(void* pUserData, int cbUserData);
virtual bool GetEncryptedAppTicket(void *pTicket, int cbMaxTicket, unsigned int *pcbTicket); virtual bool GetEncryptedAppTicket(void* pTicket, int cbMaxTicket, unsigned int* pcbTicket);
}; };
} }

View File

@ -8,47 +8,47 @@ namespace steam
return true; return true;
} }
bool user_stats::GetStat(const char *pchName, int *pData) bool user_stats::GetStat(const char* pchName, int* pData)
{ {
return false; return false;
} }
bool user_stats::GetStat(const char *pchName, float *pData) bool user_stats::GetStat(const char* pchName, float* pData)
{ {
return false; return false;
} }
bool user_stats::SetStat(const char *pchName, int nData) bool user_stats::SetStat(const char* pchName, int nData)
{ {
return false; return false;
} }
bool user_stats::SetStat(const char *pchName, float fData) bool user_stats::SetStat(const char* pchName, float fData)
{ {
return false; return false;
} }
bool user_stats::UpdateAvgRateStat(const char *pchName, float flCountThisSession, double dSessionLength) bool user_stats::UpdateAvgRateStat(const char* pchName, float flCountThisSession, double dSessionLength)
{ {
return false; return false;
} }
bool user_stats::GetAchievement(const char *pchName, bool *pbAchieved) bool user_stats::GetAchievement(const char* pchName, bool* pbAchieved)
{ {
return false; return false;
} }
bool user_stats::SetAchievement(const char *pchName) bool user_stats::SetAchievement(const char* pchName)
{ {
return false; return false;
} }
bool user_stats::ClearAchievement(const char *pchName) bool user_stats::ClearAchievement(const char* pchName)
{ {
return false; return false;
} }
bool user_stats::GetAchievementAndUnlockTime(const char *pchName, bool *pbAchieved, unsigned int *punUnlockTime) bool user_stats::GetAchievementAndUnlockTime(const char* pchName, bool* pbAchieved, unsigned int* punUnlockTime)
{ {
return false; return false;
} }
@ -58,17 +58,18 @@ namespace steam
return false; return false;
} }
int user_stats::GetAchievementIcon(const char *pchName) int user_stats::GetAchievementIcon(const char* pchName)
{ {
return 0; return 0;
} }
const char *user_stats::GetAchievementDisplayAttribute(const char *pchName, const char *pchKey) const char* user_stats::GetAchievementDisplayAttribute(const char* pchName, const char* pchKey)
{ {
return ""; return "";
} }
bool user_stats::IndicateAchievementProgress(const char *pchName, unsigned int nCurProgress, unsigned int nMaxProgress) bool user_stats::IndicateAchievementProgress(const char* pchName, unsigned int nCurProgress,
unsigned int nMaxProgress)
{ {
return false; return false;
} }
@ -78,22 +79,23 @@ namespace steam
return 0; return 0;
} }
bool user_stats::GetUserStat(steam_id steamIDUser, const char *pchName, int *pData) bool user_stats::GetUserStat(steam_id steamIDUser, const char* pchName, int* pData)
{ {
return false; return false;
} }
bool user_stats::GetUserStat(steam_id steamIDUser, const char *pchName, float *pData) bool user_stats::GetUserStat(steam_id steamIDUser, const char* pchName, float* pData)
{ {
return false; return false;
} }
bool user_stats::GetUserAchievement(steam_id steamIDUser, const char *pchName, bool *pbAchieved) bool user_stats::GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved)
{ {
return false; return false;
} }
bool user_stats::GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char *pchName, bool *pbAchieved, unsigned int *punUnlockTime) bool user_stats::GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char* pchName, bool* pbAchieved,
unsigned int* punUnlockTime)
{ {
return false; return false;
} }
@ -103,17 +105,18 @@ namespace steam
return false; return false;
} }
unsigned __int64 user_stats::FindOrCreateLeaderboard(const char *pchLeaderboardName, int eLeaderboardSortMethod, int eLeaderboardDisplayType) unsigned __int64 user_stats::FindOrCreateLeaderboard(const char* pchLeaderboardName, int eLeaderboardSortMethod,
int eLeaderboardDisplayType)
{ {
return 0; return 0;
} }
unsigned __int64 user_stats::FindLeaderboard(const char *pchLeaderboardName) unsigned __int64 user_stats::FindLeaderboard(const char* pchLeaderboardName)
{ {
return 0; return 0;
} }
const char *user_stats::GetLeaderboardName(unsigned __int64 hSteamLeaderboard) const char* user_stats::GetLeaderboardName(unsigned __int64 hSteamLeaderboard)
{ {
return ""; return "";
} }
@ -133,22 +136,27 @@ namespace steam
return 0; return 0;
} }
unsigned __int64 user_stats::DownloadLeaderboardEntries(unsigned __int64 hSteamLeaderboard, int eLeaderboardDataRequest, int nRangeStart, int nRangeEnd) unsigned __int64 user_stats::DownloadLeaderboardEntries(unsigned __int64 hSteamLeaderboard,
int eLeaderboardDataRequest, int nRangeStart, int nRangeEnd)
{ {
return 0; return 0;
} }
unsigned __int64 user_stats::DownloadLeaderboardEntriesForUsers(unsigned __int64 hSteamLeaderboard, steam_id *prgUsers, int cUsers) unsigned __int64 user_stats::DownloadLeaderboardEntriesForUsers(unsigned __int64 hSteamLeaderboard,
steam_id* prgUsers, int cUsers)
{ {
return 0; return 0;
} }
bool user_stats::GetDownloadedLeaderboardEntry(unsigned __int64 hSteamLeaderboardEntries, int index, int *pLeaderboardEntry, int *pDetails, int cDetailsMax) bool user_stats::GetDownloadedLeaderboardEntry(unsigned __int64 hSteamLeaderboardEntries, int index,
int* pLeaderboardEntry, int* pDetails, int cDetailsMax)
{ {
return false; return false;
} }
unsigned __int64 user_stats::UploadLeaderboardScore(unsigned __int64 hSteamLeaderboard, int eLeaderboardUploadScoreMethod, int nScore, const int *pScoreDetails, int cScoreDetailsCount) unsigned __int64 user_stats::UploadLeaderboardScore(unsigned __int64 hSteamLeaderboard,
int eLeaderboardUploadScoreMethod, int nScore,
const int* pScoreDetails, int cScoreDetailsCount)
{ {
return 0; return 0;
} }
@ -168,17 +176,19 @@ namespace steam
return 0; return 0;
} }
int user_stats::GetMostAchievedAchievementInfo(char *pchName, unsigned int unNameBufLen, float *pflPercent, bool *pbAchieved) int user_stats::GetMostAchievedAchievementInfo(char* pchName, unsigned int unNameBufLen, float* pflPercent,
bool* pbAchieved)
{ {
return 0; return 0;
} }
int user_stats::GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char *pchName, unsigned int unNameBufLen, float *pflPercent, bool *pbAchieved) int user_stats::GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char* pchName, unsigned int unNameBufLen,
float* pflPercent, bool* pbAchieved)
{ {
return 0; return 0;
} }
bool user_stats::GetAchievementAchievedPercent(const char *pchName, float *pflPercent) bool user_stats::GetAchievementAchievedPercent(const char* pchName, float* pflPercent)
{ {
return false; return false;
} }
@ -188,22 +198,22 @@ namespace steam
return 0; return 0;
} }
bool user_stats::GetGlobalStat(const char *pchStatName, __int64 *pData) bool user_stats::GetGlobalStat(const char* pchStatName, __int64* pData)
{ {
return false; return false;
} }
bool user_stats::GetGlobalStat(const char *pchStatName, double *pData) bool user_stats::GetGlobalStat(const char* pchStatName, double* pData)
{ {
return false; return false;
} }
int user_stats::GetGlobalStatHistory(const char *pchStatName, __int64 *pData, unsigned int cubData) int user_stats::GetGlobalStatHistory(const char* pchStatName, __int64* pData, unsigned int cubData)
{ {
return 0; return 0;
} }
int user_stats::GetGlobalStatHistory(const char *pchStatName, double *pData, unsigned int cubData) int user_stats::GetGlobalStatHistory(const char* pchStatName, double* pData, unsigned int cubData)
{ {
return 0; return 0;
} }

View File

@ -6,45 +6,56 @@ namespace steam
{ {
public: public:
virtual bool RequestCurrentStats(); virtual bool RequestCurrentStats();
virtual bool GetStat(const char *pchName, int *pData); virtual bool GetStat(const char* pchName, int* pData);
virtual bool GetStat(const char *pchName, float *pData); virtual bool GetStat(const char* pchName, float* pData);
virtual bool SetStat(const char *pchName, int nData); virtual bool SetStat(const char* pchName, int nData);
virtual bool SetStat(const char *pchName, float fData); virtual bool SetStat(const char* pchName, float fData);
virtual bool UpdateAvgRateStat(const char *pchName, float flCountThisSession, double dSessionLength); virtual bool UpdateAvgRateStat(const char* pchName, float flCountThisSession, double dSessionLength);
virtual bool GetAchievement(const char *pchName, bool *pbAchieved); virtual bool GetAchievement(const char* pchName, bool* pbAchieved);
virtual bool SetAchievement(const char *pchName); virtual bool SetAchievement(const char* pchName);
virtual bool ClearAchievement(const char *pchName); virtual bool ClearAchievement(const char* pchName);
virtual bool GetAchievementAndUnlockTime(const char *pchName, bool *pbAchieved, unsigned int *punUnlockTime); virtual bool GetAchievementAndUnlockTime(const char* pchName, bool* pbAchieved, unsigned int* punUnlockTime);
virtual bool StoreStats(); virtual bool StoreStats();
virtual int GetAchievementIcon(const char *pchName); virtual int GetAchievementIcon(const char* pchName);
virtual const char *GetAchievementDisplayAttribute(const char *pchName, const char *pchKey); virtual const char* GetAchievementDisplayAttribute(const char* pchName, const char* pchKey);
virtual bool IndicateAchievementProgress(const char *pchName, unsigned int nCurProgress, unsigned int nMaxProgress); virtual bool IndicateAchievementProgress(const char* pchName, unsigned int nCurProgress,
unsigned int nMaxProgress);
virtual unsigned __int64 RequestUserStats(steam_id steamIDUser); virtual unsigned __int64 RequestUserStats(steam_id steamIDUser);
virtual bool GetUserStat(steam_id steamIDUser, const char *pchName, int *pData); virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, int* pData);
virtual bool GetUserStat(steam_id steamIDUser, const char *pchName, float *pData); virtual bool GetUserStat(steam_id steamIDUser, const char* pchName, float* pData);
virtual bool GetUserAchievement(steam_id steamIDUser, const char *pchName, bool *pbAchieved); virtual bool GetUserAchievement(steam_id steamIDUser, const char* pchName, bool* pbAchieved);
virtual bool GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char *pchName, bool *pbAchieved, unsigned int *punUnlockTime); virtual bool GetUserAchievementAndUnlockTime(steam_id steamIDUser, const char* pchName, bool* pbAchieved,
unsigned int* punUnlockTime);
virtual bool ResetAllStats(bool bAchievementsToo); virtual bool ResetAllStats(bool bAchievementsToo);
virtual unsigned __int64 FindOrCreateLeaderboard(const char *pchLeaderboardName, int eLeaderboardSortMethod, int eLeaderboardDisplayType); virtual unsigned __int64 FindOrCreateLeaderboard(const char* pchLeaderboardName, int eLeaderboardSortMethod,
virtual unsigned __int64 FindLeaderboard(const char *pchLeaderboardName); int eLeaderboardDisplayType);
virtual const char *GetLeaderboardName(unsigned __int64 hSteamLeaderboard); virtual unsigned __int64 FindLeaderboard(const char* pchLeaderboardName);
virtual const char* GetLeaderboardName(unsigned __int64 hSteamLeaderboard);
virtual int GetLeaderboardEntryCount(unsigned __int64 hSteamLeaderboard); virtual int GetLeaderboardEntryCount(unsigned __int64 hSteamLeaderboard);
virtual int GetLeaderboardSortMethod(unsigned __int64 hSteamLeaderboard); virtual int GetLeaderboardSortMethod(unsigned __int64 hSteamLeaderboard);
virtual int GetLeaderboardDisplayType(unsigned __int64 hSteamLeaderboard); virtual int GetLeaderboardDisplayType(unsigned __int64 hSteamLeaderboard);
virtual unsigned __int64 DownloadLeaderboardEntries(unsigned __int64 hSteamLeaderboard, int eLeaderboardDataRequest, int nRangeStart, int nRangeEnd); virtual unsigned __int64 DownloadLeaderboardEntries(unsigned __int64 hSteamLeaderboard,
virtual unsigned __int64 DownloadLeaderboardEntriesForUsers(unsigned __int64 hSteamLeaderboard, steam_id *prgUsers, int cUsers); int eLeaderboardDataRequest, int nRangeStart,
virtual bool GetDownloadedLeaderboardEntry(unsigned __int64 hSteamLeaderboardEntries, int index, int *pLeaderboardEntry, int *pDetails, int cDetailsMax); int nRangeEnd);
virtual unsigned __int64 UploadLeaderboardScore(unsigned __int64 hSteamLeaderboard, int eLeaderboardUploadScoreMethod, int nScore, const int *pScoreDetails, int cScoreDetailsCount); virtual unsigned __int64 DownloadLeaderboardEntriesForUsers(unsigned __int64 hSteamLeaderboard,
steam_id* prgUsers, int cUsers);
virtual bool GetDownloadedLeaderboardEntry(unsigned __int64 hSteamLeaderboardEntries, int index,
int* pLeaderboardEntry, int* pDetails, int cDetailsMax);
virtual unsigned __int64 UploadLeaderboardScore(unsigned __int64 hSteamLeaderboard,
int eLeaderboardUploadScoreMethod, int nScore,
const int* pScoreDetails, int cScoreDetailsCount);
virtual unsigned __int64 AttachLeaderboardUGC(unsigned __int64 hSteamLeaderboard, unsigned __int64 hUGC); virtual unsigned __int64 AttachLeaderboardUGC(unsigned __int64 hSteamLeaderboard, unsigned __int64 hUGC);
virtual unsigned __int64 GetNumberOfCurrentPlayers(); virtual unsigned __int64 GetNumberOfCurrentPlayers();
virtual unsigned __int64 RequestGlobalAchievementPercentages(); virtual unsigned __int64 RequestGlobalAchievementPercentages();
virtual int GetMostAchievedAchievementInfo(char *pchName, unsigned int unNameBufLen, float *pflPercent, bool *pbAchieved); virtual int GetMostAchievedAchievementInfo(char* pchName, unsigned int unNameBufLen, float* pflPercent,
virtual int GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char *pchName, unsigned int unNameBufLen, float *pflPercent, bool *pbAchieved); bool* pbAchieved);
virtual bool GetAchievementAchievedPercent(const char *pchName, float *pflPercent); virtual int GetNextMostAchievedAchievementInfo(int iIteratorPrevious, char* pchName, unsigned int unNameBufLen,
float* pflPercent, bool* pbAchieved);
virtual bool GetAchievementAchievedPercent(const char* pchName, float* pflPercent);
virtual unsigned __int64 RequestGlobalStats(int nHistoryDays); virtual unsigned __int64 RequestGlobalStats(int nHistoryDays);
virtual bool GetGlobalStat(const char *pchStatName, __int64 *pData); virtual bool GetGlobalStat(const char* pchStatName, __int64* pData);
virtual bool GetGlobalStat(const char *pchStatName, double *pData); virtual bool GetGlobalStat(const char* pchStatName, double* pData);
virtual int GetGlobalStatHistory(const char *pchStatName, __int64 *pData, unsigned int cubData); virtual int GetGlobalStatHistory(const char* pchStatName, __int64* pData, unsigned int cubData);
virtual int GetGlobalStatHistory(const char *pchStatName, double *pData, unsigned int cubData); virtual int GetGlobalStatHistory(const char* pchStatName, double* pData, unsigned int cubData);
}; };
} }

View File

@ -28,17 +28,17 @@ namespace steam
return "US"; return "US";
} }
bool utils::GetImageSize(int iImage, unsigned int *pnWidth, unsigned int *pnHeight) bool utils::GetImageSize(int iImage, unsigned int* pnWidth, unsigned int* pnHeight)
{ {
return false; return false;
} }
bool utils::GetImageRGBA(int iImage, unsigned char *pubDest, int nDestBufferSize) bool utils::GetImageRGBA(int iImage, unsigned char* pubDest, int nDestBufferSize)
{ {
return false; return false;
} }
bool utils::GetCSERIPPort(unsigned int *unIP, unsigned short *usPort) bool utils::GetCSERIPPort(unsigned int* unIP, unsigned short* usPort)
{ {
return false; return false;
} }
@ -61,7 +61,7 @@ namespace steam
} }
} }
bool utils::IsAPICallCompleted(unsigned __int64 hSteamAPICall, bool *pbFailed) bool utils::IsAPICallCompleted(unsigned __int64 hSteamAPICall, bool* pbFailed)
{ {
return false; return false;
} }
@ -71,7 +71,8 @@ namespace steam
return -1; return -1;
} }
bool utils::GetAPICallResult(unsigned __int64 hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed) bool utils::GetAPICallResult(unsigned __int64 hSteamAPICall, void* pCallback, int cubCallback,
int iCallbackExpected, bool* pbFailed)
{ {
return false; return false;
} }
@ -85,7 +86,7 @@ namespace steam
return 0; return 0;
} }
void utils::SetWarningMessageHook(void(*pFunction)(int hpipe, const char *message)) void utils::SetWarningMessageHook(void (*pFunction)(int hpipe, const char* message))
{ {
} }
@ -99,7 +100,7 @@ namespace steam
return false; return false;
} }
unsigned __int64 utils::CheckFileSignature(const char *szFileName) unsigned __int64 utils::CheckFileSignature(const char* szFileName)
{ {
return 0; return 0;
} }

View File

@ -9,21 +9,22 @@ namespace steam
virtual unsigned int GetSecondsSinceComputerActive(); virtual unsigned int GetSecondsSinceComputerActive();
virtual int GetConnectedUniverse(); virtual int GetConnectedUniverse();
virtual unsigned int GetServerRealTime(); virtual unsigned int GetServerRealTime();
virtual const char *GetIPCountry(); virtual const char* GetIPCountry();
virtual bool GetImageSize(int iImage, unsigned int *pnWidth, unsigned int *pnHeight); virtual bool GetImageSize(int iImage, unsigned int* pnWidth, unsigned int* pnHeight);
virtual bool GetImageRGBA(int iImage, unsigned char *pubDest, int nDestBufferSize); virtual bool GetImageRGBA(int iImage, unsigned char* pubDest, int nDestBufferSize);
virtual bool GetCSERIPPort(unsigned int *unIP, unsigned short *usPort); virtual bool GetCSERIPPort(unsigned int* unIP, unsigned short* usPort);
virtual unsigned char GetCurrentBatteryPower(); virtual unsigned char GetCurrentBatteryPower();
virtual unsigned int GetAppID(); virtual unsigned int GetAppID();
virtual void SetOverlayNotificationPosition(int eNotificationPosition); virtual void SetOverlayNotificationPosition(int eNotificationPosition);
virtual bool IsAPICallCompleted(unsigned __int64 hSteamAPICall, bool *pbFailed); virtual bool IsAPICallCompleted(unsigned __int64 hSteamAPICall, bool* pbFailed);
virtual int GetAPICallFailureReason(unsigned __int64 hSteamAPICall); virtual int GetAPICallFailureReason(unsigned __int64 hSteamAPICall);
virtual bool GetAPICallResult(unsigned __int64 hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed); virtual bool GetAPICallResult(unsigned __int64 hSteamAPICall, void* pCallback, int cubCallback,
int iCallbackExpected, bool* pbFailed);
virtual void RunFrame(); virtual void RunFrame();
virtual unsigned int GetIPCCallCount(); virtual unsigned int GetIPCCallCount();
virtual void SetWarningMessageHook(void(*pFunction)(int hpipe, const char *message)); virtual void SetWarningMessageHook(void (*pFunction)(int hpipe, const char* message));
virtual bool IsOverlayEnabled(); virtual bool IsOverlayEnabled();
virtual bool BOverlayNeedsPresent(); virtual bool BOverlayNeedsPresent();
virtual unsigned __int64 CheckFileSignature(const char *szFileName); virtual unsigned __int64 CheckFileSignature(const char* szFileName);
}; };
} }

View File

@ -76,147 +76,148 @@ namespace steam
results_.clear(); results_.clear();
} }
extern "C" extern "C" {
bool SteamAPI_RestartAppIfNecessary()
{ {
bool SteamAPI_RestartAppIfNecessary() return false;
{ }
return false;
}
bool SteamAPI_Init() bool SteamAPI_Init()
{ {
overlay = ::utils::nt::module("gameoverlayrenderer.dll"); overlay = ::utils::nt::module("gameoverlayrenderer.dll");
if (!overlay) if (!overlay)
{
HKEY reg_key;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Valve\\Steam", 0, KEY_QUERY_VALUE, &reg_key) ==
ERROR_SUCCESS)
{ {
HKEY reg_key; char steam_path[MAX_PATH] = {0};
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Valve\\Steam", 0, KEY_QUERY_VALUE, &reg_key) == ERROR_SUCCESS) DWORD length = sizeof(steam_path);
RegQueryValueExA(reg_key, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(steam_path),
&length);
RegCloseKey(reg_key);
std::string overlay_path = steam_path;
if (overlay_path.back() != '\\' && overlay_path.back() != '/')
{ {
char steam_path[MAX_PATH] = { 0 }; overlay_path.push_back('\\');
DWORD length = sizeof(steam_path);
RegQueryValueExA(reg_key, "InstallPath", nullptr, nullptr, reinterpret_cast<BYTE*>(steam_path), &length);
RegCloseKey(reg_key);
std::string overlay_path = steam_path;
if(overlay_path.back() != '\\' && overlay_path.back() != '/')
{
overlay_path.push_back('\\');
}
overlay_path.append("gameoverlayrenderer.dll");
overlay = ::utils::nt::module::load(overlay_path);
} }
overlay_path.append("gameoverlayrenderer.dll");
overlay = ::utils::nt::module::load(overlay_path);
} }
return true;
} }
void SteamAPI_RegisterCallResult(callbacks::base* result, uint64_t call) return true;
{ }
callbacks::register_call_result(call, result);
}
void SteamAPI_RegisterCallback(callbacks::base* handler, int callback) void SteamAPI_RegisterCallResult(callbacks::base* result, uint64_t call)
{ {
callbacks::register_callback(handler, callback); callbacks::register_call_result(call, result);
} }
void SteamAPI_RunCallbacks() void SteamAPI_RegisterCallback(callbacks::base* handler, int callback)
{ {
callbacks::run_callbacks(); callbacks::register_callback(handler, callback);
} }
void SteamAPI_Shutdown() void SteamAPI_RunCallbacks()
{ {
} callbacks::run_callbacks();
}
void SteamAPI_UnregisterCallResult() void SteamAPI_Shutdown()
{ {
} }
void SteamAPI_UnregisterCallback() void SteamAPI_UnregisterCallResult()
{ {
} }
void SteamAPI_UnregisterCallback()
{
}
bool SteamGameServer_Init() bool SteamGameServer_Init()
{ {
return true; return true;
} }
void SteamGameServer_RunCallbacks() void SteamGameServer_RunCallbacks()
{ {
} }
void SteamGameServer_Shutdown() void SteamGameServer_Shutdown()
{ {
} }
friends* SteamFriends() friends* SteamFriends()
{ {
static friends friends; static friends friends;
return &friends; return &friends;
} }
matchmaking* SteamMatchmaking() matchmaking* SteamMatchmaking()
{ {
static matchmaking matchmaking; static matchmaking matchmaking;
return &matchmaking; return &matchmaking;
} }
matchmaking_servers* SteamMatchmakingServers() matchmaking_servers* SteamMatchmakingServers()
{ {
static matchmaking_servers matchmaking_servers; static matchmaking_servers matchmaking_servers;
return &matchmaking_servers; return &matchmaking_servers;
} }
game_server* SteamGameServer() game_server* SteamGameServer()
{ {
static game_server game_server; static game_server game_server;
return &game_server; return &game_server;
} }
master_server_updater* SteamMasterServerUpdater() master_server_updater* SteamMasterServerUpdater()
{ {
static master_server_updater master_server_updater; static master_server_updater master_server_updater;
return &master_server_updater; return &master_server_updater;
} }
networking* SteamNetworking() networking* SteamNetworking()
{ {
static networking networking; static networking networking;
return &networking; return &networking;
} }
remote_storage* SteamRemoteStorage() remote_storage* SteamRemoteStorage()
{ {
static remote_storage remote_storage; static remote_storage remote_storage;
return &remote_storage; return &remote_storage;
} }
user* SteamUser() user* SteamUser()
{ {
static user user; static user user;
return &user; return &user;
} }
utils* SteamUtils() utils* SteamUtils()
{ {
static utils utils; static utils utils;
return &utils; return &utils;
} }
apps* SteamApps() apps* SteamApps()
{ {
static apps apps; static apps apps;
return &apps; return &apps;
} }
user_stats* SteamUserStats() user_stats* SteamUserStats()
{ {
static user_stats user_stats; static user_stats user_stats;
return &user_stats; return &user_stats;
} }
} }
} }

View File

@ -8,7 +8,7 @@ struct raw_steam_id final
unsigned int account_id : 32; unsigned int account_id : 32;
unsigned int account_instance : 20; unsigned int account_instance : 20;
unsigned int account_type : 4; unsigned int account_type : 4;
int universe : 8; int universe : 8;
}; };
typedef union typedef union
@ -37,10 +37,12 @@ namespace steam
class base class base
{ {
public: public:
base() : flags_(0), callback_(0) {}; base() : flags_(0), callback_(0)
{
}
virtual void run(void *pv_param) = 0; virtual void run(void* pv_param) = 0;
virtual void run(void *pv_param, bool failure, uint64_t handle) = 0; virtual void run(void* pv_param, bool failure, uint64_t handle) = 0;
virtual int get_callback_size_bytes() = 0; virtual int get_callback_size_bytes() = 0;
int get_i_callback() const { return callback_; } int get_i_callback() const { return callback_; }