More Steam functionality, less renaming. functions now closely relate to the original function/class/method structure and many helper types have been added native to BlitzSteam (no need for BlitzUtility).

This commit is contained in:
Michael Fabian Dirks
2016-03-04 03:47:32 +01:00
parent 7209e0936e
commit 2bf8361797
67 changed files with 4507 additions and 3109 deletions
+96 -32
View File
@@ -16,8 +16,76 @@
#include "BlitzCallback.h"
BlitzCallback::BlitzCallback(BP_Function3_t pFunctionPointer) {
std::map<uint32_t, size_t>* BlitzCallback_Sizes;
#define BlitzCallback_Sizes_Add(T) BlitzCallback_Sizes->emplace(T::k_iCallback, sizeof(T))
void BlitzCallback_Init() {
BlitzCallback_Sizes = new std::map<uint32_t, size_t>();
BlitzCallback_Sizes->emplace(0, sizeof(BlitzCallback));
// SteamAPI
// SteamAppList
BlitzCallback_Sizes_Add(SteamAppInstalled_t);
BlitzCallback_Sizes_Add(SteamAppUninstalled_t);
// SteamApps
BlitzCallback_Sizes_Add(DlcInstalled_t);
BlitzCallback_Sizes_Add(RegisterActivationCodeResponse_t);
BlitzCallback_Sizes_Add(AppProofOfPurchaseKeyResponse_t);
BlitzCallback_Sizes_Add(NewLaunchQueryParameters_t);
// SteamController
// SteamFriends
BlitzCallback_Sizes_Add(PersonaStateChange_t);
BlitzCallback_Sizes_Add(GameOverlayActivated_t);
BlitzCallback_Sizes_Add(GameServerChangeRequested_t);
BlitzCallback_Sizes_Add(GameLobbyJoinRequested_t);
BlitzCallback_Sizes_Add(AvatarImageLoaded_t);
BlitzCallback_Sizes_Add(ClanOfficerListResponse_t);
BlitzCallback_Sizes_Add(FriendRichPresenceUpdate_t);
BlitzCallback_Sizes_Add(GameRichPresenceJoinRequested_t);
BlitzCallback_Sizes_Add(GameConnectedClanChatMsg_t);
BlitzCallback_Sizes_Add(GameConnectedChatJoin_t);
BlitzCallback_Sizes_Add(GameConnectedChatLeave_t);
BlitzCallback_Sizes_Add(DownloadClanActivityCountsResult_t);
BlitzCallback_Sizes_Add(JoinClanChatRoomCompletionResult_t);
BlitzCallback_Sizes_Add(GameConnectedFriendChatMsg_t);
BlitzCallback_Sizes_Add(FriendsGetFollowerCount_t);
BlitzCallback_Sizes_Add(FriendsIsFollowing_t);
BlitzCallback_Sizes_Add(FriendsEnumerateFollowingList_t);
BlitzCallback_Sizes_Add(SetPersonaNameResponse_t);
// SteamGameServer
BlitzCallback_Sizes_Add(GSClientApprove_t);
BlitzCallback_Sizes_Add(GSClientDeny_t);
BlitzCallback_Sizes_Add(GSClientKick_t);
BlitzCallback_Sizes_Add(GSClientAchievementStatus_t);
BlitzCallback_Sizes_Add(GSPolicyResponse_t);
BlitzCallback_Sizes_Add(GSGameplayStats_t);
BlitzCallback_Sizes_Add(GSClientGroupStatus_t);
BlitzCallback_Sizes_Add(GSReputation_t);
BlitzCallback_Sizes_Add(AssociateWithClanResult_t);
BlitzCallback_Sizes_Add(ComputeNewPlayerCompatibilityResult_t);
// SteamGameServerStats
BlitzCallback_Sizes_Add(GSStatsReceived_t);
BlitzCallback_Sizes_Add(GSStatsStored_t);
BlitzCallback_Sizes_Add(GSStatsUnloaded_t);
// SteamHTMLSurface
BlitzCallback_Sizes_Add(HTML_BrowserReady_t);
}
BlitzCallback::BlitzCallback(BP_BlitzFunction3_t pFunctionPointer) {
this->m_pFunctionPointer = pFunctionPointer;
this->m_hSteamAPICall = 0;
this->m_iCallback = 0;
// Initialize BlitzCallback_Sizes
if (BlitzCallback_Sizes == 0)
BlitzCallback_Init();
}
BlitzCallback::~BlitzCallback() {
@@ -26,21 +94,21 @@ BlitzCallback::~BlitzCallback() {
}
int BlitzCallback::GetCallbackSizeBytes() {
return sizeof(BlitzCallback);
return (BlitzCallback_Sizes->find(this->m_iCallback)->second);
}
void BlitzCallback::Run(void *pvParam) {
if (this->m_hSteamAPICall != 0)
this->m_hSteamAPICall = 0; // Caller unregisters for us.
if (m_hSteamAPICall != 0)
m_hSteamAPICall = 0; // Caller unregisters for us.
BP_CallFunction3(m_pFunctionPointer, reinterpret_cast<uint32_t>(pvParam), 0, 0);
BP_CallFunction3(m_pFunctionPointer, reinterpret_cast<int32_t>(pvParam), 0, 0);
}
void BlitzCallback::Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall) {
if (this->m_hSteamAPICall != 0)
this->m_hSteamAPICall = 0; // Caller unregisters for us.
if (m_hSteamAPICall != 0)
m_hSteamAPICall = 0; // Caller unregisters for us.
BP_CallFunction3(m_pFunctionPointer, reinterpret_cast<uint32_t>(pvParam), (uint32_t)bIOFailure, (uint32_t)&hSteamAPICall);
BP_CallFunction3(m_pFunctionPointer, reinterpret_cast<int32_t>(pvParam), (bIOFailure ? 0 : 1), reinterpret_cast<int32_t>(&hSteamAPICall));
}
bool BlitzCallback::IsRegistered() {
@@ -48,8 +116,10 @@ bool BlitzCallback::IsRegistered() {
}
void BlitzCallback::Register(uint32_t iCallback) {
if (!this->IsRegistered())
SteamAPI_RegisterCallback(this, iCallback);
if (this->IsRegistered())
this->Unregister();
SteamAPI_RegisterCallback(this, iCallback);
}
void BlitzCallback::Unregister() {
@@ -57,19 +127,22 @@ void BlitzCallback::Unregister() {
SteamAPI_UnregisterCallback(this);
}
void BlitzCallback::RegisterResult(SteamAPICall_t hSteamAPICall) {
if (this->m_hSteamAPICall == 0) {
SteamAPI_RegisterCallResult(this, hSteamAPICall);
this->m_hSteamAPICall = hSteamAPICall;
}
void BlitzCallback::RegisterResult(SteamAPICall_t hSteamAPICall, uint32_t iCallback) {
if (this->m_hSteamAPICall == 0)
this->UnregisterResult();
this->m_hSteamAPICall = hSteamAPICall;
this->m_iCallback = iCallback;
SteamAPI_RegisterCallResult(this, hSteamAPICall);
}
void BlitzCallback::UnregisterResult()
{
if (this->m_hSteamAPICall != 0) {
void BlitzCallback::UnregisterResult() {
if (this->m_hSteamAPICall != 0)
SteamAPI_UnregisterCallResult(this, this->m_hSteamAPICall);
this->m_hSteamAPICall = 0;
}
this->m_hSteamAPICall = 0;
this->m_iCallback = 0;
}
bool BlitzCallback::IsGameServer() {
@@ -83,49 +156,40 @@ void BlitzCallback::SetGameServer(bool bIsGameServer) {
}
// DLL-Callables
DLL_FUNCTION(BlitzCallback*) BS_Callback_Create(BP_Function3_t pFunctionPointer) {
#pragma comment(linker, "/EXPORT:BS_Callback_Create=_BS_Callback_Create@4")
DLL_FUNCTION(BlitzCallback*) BS_Callback_Create(BP_BlitzFunction3_t pFunctionPointer) {
return new BlitzCallback(pFunctionPointer);
}
DLL_FUNCTION(void) BS_Callback_Destroy(BlitzCallback* pCallback) {
#pragma comment(linker, "/EXPORT:BS_Callback_Destroy=_BS_Callback_Destroy@4")
delete pCallback;
}
DLL_FUNCTION(int32_t) BS_Callback_IsRegistered(BlitzCallback* pCallback) {
#pragma comment(linker, "/EXPORT:BS_Callback_IsRegistered=_BS_Callback_IsRegistered@4")
return pCallback->IsRegistered();
}
DLL_FUNCTION(int32_t) BS_Callback_IsGameServer(BlitzCallback* pCallback) {
#pragma comment(linker, "/EXPORT:BS_Callback_IsGameServer=_BS_Callback_IsGameServer@4")
return pCallback->IsGameServer();
}
DLL_FUNCTION(int32_t) BS_Callback_SetGameServerFlag(BlitzCallback* pCallback, int32_t bIsGameServer) {
#pragma comment(linker, "/EXPORT:BS_Callback_SetGameServerFlag=_BS_Callback_SetGameServerFlag@8")
bool isGameServer = pCallback->IsGameServer();
pCallback->SetGameServer(!!bIsGameServer);
return isGameServer;
}
DLL_FUNCTION(void) BS_Callback_Register(BlitzCallback* pCallback, uint32_t iCallback) {
#pragma comment(linker, "/EXPORT:BS_Callback_Register=_BS_Callback_Register@8")
pCallback->Register(iCallback);
}
DLL_FUNCTION(void) BS_Callback_Unregister(BlitzCallback* pCallback) {
#pragma comment(linker, "/EXPORT:BS_Callback_Unregister=_BS_Callback_Unregister@4")
pCallback->Unregister();
}
DLL_FUNCTION(void) BS_Callback_RegisterResult(BlitzCallback* pCallback, SteamAPICall_t* pSteamAPICall) {
#pragma comment(linker, "/EXPORT:BS_Callback_RegisterResult=_BS_Callback_RegisterResult@8")
pCallback->RegisterResult(*pSteamAPICall);
DLL_FUNCTION(void) BS_Callback_RegisterResult(BlitzCallback* pCallback, SteamAPICall_t* pSteamAPICall, uint32_t iCallback) {
pCallback->RegisterResult(*pSteamAPICall, iCallback);
}
DLL_FUNCTION(void) BS_Callback_UnregisterResult(BlitzCallback* pCallback) {
#pragma comment(linker, "/EXPORT:BS_Callback_UnregisterResult=_BS_Callback_UnregisterResult@4")
pCallback->UnregisterResult();
}
+11 -7
View File
@@ -14,13 +14,16 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "BlitzSteam.h"
BS_I#include "BlitzSteam.h"
#include "BlitzPointer.h"
#include <list>
#include <vector>
#include <map>
class BlitzCallback : public CCallbackBase {
public:
BlitzCallback(BP_Function3_t pFunctionPointer);
BlitzCallback(BP_BlitzFunction3_t pFunctionPointer);
~BlitzCallback();
virtual void Run(void *pvParam);
@@ -34,15 +37,16 @@ class BlitzCallback : public CCallbackBase {
void Register(uint32_t iCallback);
void Unregister();
void RegisterResult(SteamAPICall_t hSteamAPICall);
void RegisterResult(SteamAPICall_t hSteamAPICall, uint32_t iCallback);
void UnregisterResult();
private:
BP_Function3_t m_pFunctionPointer;
BP_BlitzFunction3_t m_pFunctionPointer;
uint32_t m_iCallback;
SteamAPICall_t m_hSteamAPICall;
};
DLL_FUNCTION(BlitzCallback*) BS_Callback_Create(BP_Function3_t pFunctionPointer);
DLL_FUNCTION(BlitzCallback*) BS_Callback_Create(BP_BlitzFunction3_t pFunctionPointer);
DLL_FUNCTION(void) BS_Callback_Destroy(BlitzCallback* pCallback);
DLL_FUNCTION(int32_t) BS_Callback_IsRegistered(BlitzCallback* pCallback);
@@ -51,5 +55,5 @@ DLL_FUNCTION(int32_t) BS_Callback_SetGameServerFlag(BlitzCallback* pCallback, in
DLL_FUNCTION(void) BS_Callback_Register(BlitzCallback* pCallback, uint32_t iCallback);
DLL_FUNCTION(void) BS_Callback_Unregister(BlitzCallback* pCallback);
DLL_FUNCTION(void) BS_Callback_RegisterResult(BlitzCallback* pCallback, SteamAPICall_t* pSteamAPICall);
DLL_FUNCTION(void) BS_Callback_RegisterResult(BlitzCallback* pCallback, SteamAPICall_t* pSteamAPICall, uint32_t iCallback);
DLL_FUNCTION(void) BS_Callback_UnregisterResult(BlitzCallback* pCallback);
+14 -12
View File
@@ -14,16 +14,18 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
BS_I
// Types of Blitz Functions.
typedef int32_t(__stdcall *BP_BlitzFunction0_t)();
typedef int32_t(__stdcall *BP_BlitzFunction1_t)(int32_t);
typedef int32_t(__stdcall *BP_BlitzFunction2_t)(int32_t, int32_t);
typedef int32_t(__stdcall *BP_BlitzFunction3_t)(int32_t, int32_t, int32_t);
typedef int32_t(__stdcall *BP_BlitzFunction4_t)(int32_t, int32_t, int32_t, int32_t);
typedef int32_t(__stdcall *BP_BlitzFunction5_t)(int32_t, int32_t, int32_t, int32_t, int32_t);
typedef void*(__stdcall *BP_Function0_t)();
typedef void*(__stdcall *BP_Function1_t)(uint32_t);
typedef void*(__stdcall *BP_Function2_t)(uint32_t, uint32_t);
typedef void*(__stdcall *BP_Function3_t)(uint32_t, uint32_t, uint32_t);
typedef void*(__stdcall *BP_Function4_t)(uint32_t, uint32_t, uint32_t, uint32_t);
#define BP_CallFunction0(ptr) ((BP_Function0_t)ptr)()
#define BP_CallFunction1(ptr, p1) ((BP_Function1_t)ptr)(p1)
#define BP_CallFunction2(ptr, p1, p2) ((BP_Function2_t)ptr)(p1, p2)
#define BP_CallFunction3(ptr, p1, p2, p3) ((BP_Function3_t)ptr)(p1, p2, p3)
#define BP_CallFunction4(ptr, p1, p2, p3, p4) ((BP_Function4_t)ptr)(p1, p2, p3, p4)
#define BP_CallFunction0(ptr) (reinterpret_cast<BP_BlitzFunction0_t>(ptr))()
#define BP_CallFunction1(ptr, p1) (reinterpret_cast<BP_BlitzFunction1_t>(ptr))(p1)
#define BP_CallFunction2(ptr, p1, p2) (reinterpret_cast<BP_BlitzFunction2_t>(ptr))(p1, p2)
#define BP_CallFunction3(ptr, p1, p2, p3) (reinterpret_cast<BP_BlitzFunction3_t>(ptr))(p1, p2, p3)
#define BP_CallFunction4(ptr, p1, p2, p3, p4) (reinterpret_cast<BP_BlitzFunction4_t>(ptr))(p1, p2, p3, p4)
#define BP_CallFunction5(ptr, p1, p2, p3, p4, p5) (reinterpret_cast<BP_BlitzFunction5_t>(ptr))(p1, p2, p3, p4, p5)
-211
View File
@@ -1,211 +0,0 @@
// BlitzSteam - Steam wrapper for Blitz
// Copyright (C) 2015 Xaymar (Michael Fabian Dirks)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "CSteamID.h"
DLL_FUNCTION(CSteamID*) BS_CSteamID_New() {
return new CSteamID();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_New=_BS_CSteamID_New@0")
DLL_FUNCTION(CSteamID*) BS_CSteamID_FromID(uint32_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) {
return new CSteamID(unAccountID, eUniverse, eAccountType);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_FromID=_BS_CSteamID_FromID@12")
DLL_FUNCTION(CSteamID*) BS_CSteamID_FromIDInstance(uint32_t unAccountID, uint32_t unInstance, EUniverse eUniverse, EAccountType eAccountType) {
return new CSteamID(unAccountID, unInstance, eUniverse, eAccountType);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_FromIDInstance=_BS_CSteamID_FromIDInstance@16")
DLL_FUNCTION(CSteamID*) BS_CSteamID_FromSteamID(uint64_t* ulSteamID) {
return new CSteamID(*ulSteamID);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_FromSteamID=_BS_CSteamID_FromSteamID@4")
DLL_FUNCTION(CSteamID*) BS_CSteamID_Copy(CSteamID* pSteamID) {
return new CSteamID(*pSteamID);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_Copy=_BS_CSteamID_Copy@4")
DLL_FUNCTION(void) BS_CSteamID_Destroy(CSteamID* pSteamID) {
delete pSteamID;
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_Destroy=_BS_CSteamID_Destroy@4")
DLL_FUNCTION(void) BS_CSteamID_Set(CSteamID* pSteamID, uint32_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) {
pSteamID->Set(unAccountID, eUniverse, eAccountType);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_Set=_BS_CSteamID_Set@16")
DLL_FUNCTION(void) BS_CSteamID_InstancedSet(CSteamID* pSteamID, uint32_t unAccountID, uint32_t unInstance, EUniverse eUniverse, EAccountType eAccountType) {
pSteamID->InstancedSet(unAccountID, unInstance, eUniverse, eAccountType);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_InstancedSet=_BS_CSteamID_InstancedSet@20")
DLL_FUNCTION(void) BS_CSteamID_FullSet(CSteamID* pSteamID, uint64_t* ulIdentifier, EUniverse eUniverse, EAccountType eAccountType) {
pSteamID->FullSet(*ulIdentifier, eUniverse, eAccountType);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_FullSet=_BS_CSteamID_FullSet@16")
DLL_FUNCTION(void) BS_CSteamID_SetFromUInt64(CSteamID* pSteamID, uint64_t* ulSteamID) {
pSteamID->SetFromUint64(*ulSteamID);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_SetFromUInt64=_BS_CSteamID_SetFromUInt64@8")
DLL_FUNCTION(void) BS_CSteamID_Clear(CSteamID* pSteamID) {
pSteamID->Clear();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_Clear=_BS_CSteamID_Clear@4")
DLL_FUNCTION(uint64_t*) BS_CSteamID_ConvertToUInt64(CSteamID* pSteamID) {
uint64_t* val = new uint64_t;
*val = pSteamID->ConvertToUint64();
return val;
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_ConvertToUInt64=_BS_CSteamID_ConvertToUInt64@4")
DLL_FUNCTION(uint64_t*) BS_CSteamID_GetStaticAccountKey(CSteamID* pSteamID) {
uint64_t* val = new uint64_t;
*val = pSteamID->GetStaticAccountKey();
return val;
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_GetStaticAccountKey=_BS_CSteamID_GetStaticAccountKey@4")
DLL_FUNCTION(void) BS_CSteamID_CreateBlankAnonLogon(CSteamID* pSteamID, EUniverse eUniverse) {
pSteamID->CreateBlankAnonLogon(eUniverse);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_CreateBlankAnonLogon=_BS_CSteamID_CreateBlankAnonLogon@8")
DLL_FUNCTION(void) BS_CSteamID_CreateBlankAnonUserLogon(CSteamID* pSteamID, EUniverse eUniverse) {
pSteamID->CreateBlankAnonUserLogon(eUniverse);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_CreateBlankAnonUserLogon=_BS_CSteamID_CreateBlankAnonUserLogon@8")
DLL_FUNCTION(uint32_t) BS_CSteamID_BlankAnonAccount(CSteamID* pSteamID) {
return pSteamID->BBlankAnonAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_BlankAnonAccount=_BS_CSteamID_BlankAnonAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_GameServerAccount(CSteamID* pSteamID) {
return pSteamID->BGameServerAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_GameServerAccount=_BS_CSteamID_GameServerAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_PersistentGameServerAccount(CSteamID* pSteamID) {
return pSteamID->BPersistentGameServerAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_PersistentGameServerAccount=_BS_CSteamID_PersistentGameServerAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_AnonGameServerAccount(CSteamID* pSteamID) {
return pSteamID->BAnonGameServerAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_AnonGameServerAccount=_BS_CSteamID_AnonGameServerAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_ContentServerAccount(CSteamID* pSteamID) {
return pSteamID->BContentServerAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_ContentServerAccount=_BS_CSteamID_ContentServerAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_ClanAccount(CSteamID* pSteamID) {
return pSteamID->BClanAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_ClanAccount=_BS_CSteamID_ClanAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_ChatAccount(CSteamID* pSteamID) {
return pSteamID->BChatAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_ChatAccount=_BS_CSteamID_ChatAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_IsLobby(CSteamID* pSteamID) {
return pSteamID->IsLobby();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_IsLobby=_BS_CSteamID_IsLobby@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_IndividualAccount(CSteamID* pSteamID) {
return pSteamID->BIndividualAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_IndividualAccount=_BS_CSteamID_IndividualAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_AnonAccount(CSteamID* pSteamID) {
return pSteamID->BAnonAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_AnonAccount=_BS_CSteamID_AnonAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_AnonUserAccount(CSteamID* pSteamID) {
return pSteamID->BAnonUserAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_AnonUserAccount=_BS_CSteamID_AnonUserAccount@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_ConsoleUserAccount(CSteamID* pSteamID) {
return pSteamID->BConsoleUserAccount();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_ConsoleUserAccount=_BS_CSteamID_ConsoleUserAccount@4")
DLL_FUNCTION(void) BS_CSteamID_SetAccountID(CSteamID* pSteamID, AccountID_t unAccountID) {
pSteamID->SetAccountID(unAccountID);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_SetAccountID=_BS_CSteamID_SetAccountID@8")
DLL_FUNCTION(void) BS_CSteamID_SetAccountInstance(CSteamID* pSteamID, uint32_t unInstance) {
pSteamID->SetAccountInstance(unInstance);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_SetAccountInstance=_BS_CSteamID_SetAccountInstance@8")
DLL_FUNCTION(void) BS_CSteamID_ClearIndividualInstance(CSteamID* pSteamID) {
pSteamID->ClearIndividualInstance();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_ClearIndividualInstance=_BS_CSteamID_ClearIndividualInstance@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_HasNoIndividualInstance(CSteamID* pSteamID) {
return pSteamID->HasNoIndividualInstance();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_HasNoIndividualInstance=_BS_CSteamID_HasNoIndividualInstance@4")
DLL_FUNCTION(AccountID_t) BS_CSteamID_GetAccountID(CSteamID* pSteamID) {
return pSteamID->GetAccountID();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_GetAccountID=_BS_CSteamID_GetAccountID@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_GetAccountInstance(CSteamID* pSteamID) {
return pSteamID->GetUnAccountInstance();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_GetAccountInstance=_BS_CSteamID_GetAccountInstance@4")
DLL_FUNCTION(EAccountType) BS_CSteamID_GetEAccountType(CSteamID* pSteamID) {
return pSteamID->GetEAccountType();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_GetEAccountType=_BS_CSteamID_GetEAccountType@4")
DLL_FUNCTION(EUniverse) BS_CSteamID_GetEUniverse(CSteamID* pSteamID) {
return pSteamID->GetEUniverse();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_GetEUniverse=_BS_CSteamID_GetEUniverse@4")
DLL_FUNCTION(void) BS_CSteamID_SetEUniverse(CSteamID* pSteamID, EUniverse eUniverse) {
pSteamID->SetEUniverse(eUniverse);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_SetEUniverse=_BS_CSteamID_SetEUniverse@8")
DLL_FUNCTION(uint32_t) BS_CSteamID_IsValid(CSteamID* pSteamID) {
return pSteamID->IsValid();
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_IsValid=_BS_CSteamID_IsValid@4")
DLL_FUNCTION(uint32_t) BS_CSteamID_Compare(CSteamID* pSteamID, CSteamID* pSteamIDOther) {
return (pSteamID == pSteamIDOther ? 1 : 0) + (pSteamID < pSteamIDOther ? 2 : 0) + (pSteamID > pSteamIDOther ? 4 : 0);
}
#pragma comment(linker, "/EXPORT:BS_CSteamID_Compare=_BS_CSteamID_Compare@8")
-57
View File
@@ -1,57 +0,0 @@
// BlitzSteam - Steam wrapper for Blitz
// Copyright (C) 2015 Xaymar (Michael Fabian Dirks)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "BlitzSteam.h"
DLL_FUNCTION(CSteamID*) BS_CSteamID_New();
DLL_FUNCTION(CSteamID*) BS_CSteamID_FromID(uint32_t unAccountID, EUniverse eUniverse, EAccountType eAccountType);
DLL_FUNCTION(CSteamID*) BS_CSteamID_FromIDInstance(uint32_t unAccountID, uint32_t unInstance, EUniverse eUniverse, EAccountType eAccountType);
DLL_FUNCTION(CSteamID*) BS_CSteamID_FromSteamID(uint64_t* ulSteamID);
DLL_FUNCTION(CSteamID*) BS_CSteamID_Copy(CSteamID* pSteamID);
DLL_FUNCTION(void) BS_CSteamID_Destroy(CSteamID* pSteamID);
DLL_FUNCTION(void) BS_CSteamID_Set(CSteamID* pSteamID, uint32_t unAccountID, EUniverse eUniverse, EAccountType eAccountType);
DLL_FUNCTION(void) BS_CSteamID_InstancedSet(CSteamID* pSteamID, uint32_t unAccountID, uint32_t unInstance, EUniverse eUniverse, EAccountType eAccountType);
DLL_FUNCTION(void) BS_CSteamID_FullSet(CSteamID* pSteamID, uint64_t* ulIdentifier, EUniverse eUniverse, EAccountType eAccountType);
DLL_FUNCTION(void) BS_CSteamID_SetFromUInt64(CSteamID* pSteamID, uint64_t* ulSteamID);
DLL_FUNCTION(void) BS_CSteamID_Clear(CSteamID* pSteamID);
DLL_FUNCTION(uint64_t*) BS_CSteamID_ConvertToUInt64(CSteamID* pSteamID);
DLL_FUNCTION(uint64_t*) BS_CSteamID_GetStaticAccountKey(CSteamID* pSteamID);
DLL_FUNCTION(void) BS_CSteamID_CreateBlankAnonLogon(CSteamID* pSteamID, EUniverse eUniverse);
DLL_FUNCTION(void) BS_CSteamID_CreateBlankAnonUserLogon(CSteamID* pSteamID, EUniverse eUniverse);
DLL_FUNCTION(uint32_t) BS_CSteamID_BlankAnonAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_GameServerAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_PersistentGameServerAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_AnonGameServerAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_ContentServerAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_ClanAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_ChatAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_IsLobby(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_IndividualAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_AnonAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_AnonUserAccount(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_ConsoleUserAccount(CSteamID* pSteamID);
DLL_FUNCTION(void) BS_CSteamID_SetAccountID(CSteamID* pSteamID, AccountID_t unAccountID);
DLL_FUNCTION(void) BS_CSteamID_SetAccountInstance(CSteamID* pSteamID, uint32_t unInstance);
DLL_FUNCTION(void) BS_CSteamID_ClearIndividualInstance(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_HasNoIndividualInstance(CSteamID* pSteamID);
DLL_FUNCTION(AccountID_t) BS_CSteamID_GetAccountID(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_GetAccountInstance(CSteamID* pSteamID);
DLL_FUNCTION(EAccountType) BS_CSteamID_GetEAccountType(CSteamID* pSteamID);
DLL_FUNCTION(EUniverse) BS_CSteamID_GetEUniverse(CSteamID* pSteamID);
DLL_FUNCTION(void) BS_CSteamID_SetEUniverse(CSteamID* pSteamID, EUniverse eUniverse);
DLL_FUNCTION(uint32_t) BS_CSteamID_IsValid(CSteamID* pSteamID);
DLL_FUNCTION(uint32_t) BS_CSteamID_Compare(CSteamID* pSteamID, CSteamID* pSteamIDOther);
-9
View File
@@ -17,7 +17,6 @@
#include "Helper.h"
DLL_FUNCTION(const char*) BS_Helper_FormatUnixTime(uint32_t unTime, const char* pchFormat) {
#pragma comment(linker, "/EXPORT:BS_Helper_FormatUnixTime=_BS_Helper_FormatUnixTime@8")
char* output = new char[strlen(pchFormat) * 4];
time_t t = unTime;
struct tm *tm = localtime(&t);
@@ -25,18 +24,10 @@ DLL_FUNCTION(const char*) BS_Helper_FormatUnixTime(uint32_t unTime, const char*
delete tm;
return output;
}
DLL_FUNCTION(void) BS_Helper_DeleteLong(uint64_t* pLong) {
#pragma comment(linker, "/EXPORT:BS_Helper_DeleteLong=_BS_Helper_DeleteLong@4")
delete pLong;
}
DLL_FUNCTION(double_t*) BS_Helper_CreateDouble(float_t value) {
#pragma comment(linker, "/EXPORT:BS_Helper_CreateDouble=_BS_Helper_CreateDouble@4")
return new double_t(value);
}
DLL_FUNCTION(void) BS_Helper_DeleteDouble(double_t* pDouble) {
#pragma comment(linker, "/EXPORT:BS_Helper_DeleteDouble=_BS_Helper_DeleteDouble@4")
delete pDouble;
}
+1 -2
View File
@@ -14,7 +14,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "BlitzSteam.h"
BS_I#include "BlitzSteam.h"
DLL_FUNCTION(const char*) BS_Helper_FormatUnixTime(uint32_t unTime, const char* pchFormat);
-11
View File
@@ -17,56 +17,45 @@
#include "Memory.h"
DLL_FUNCTION(void*) BS_Memory_Alloc(uint32_t iSize) {
#pragma comment(linker, "/EXPORT:BS_Memory_Alloc=_BS_Memory_Alloc@4")
return malloc(iSize);
}
DLL_FUNCTION(void*) BS_Memory_ReAlloc(void* pMemory, uint32_t iNewSize) {
#pragma comment(linker, "/EXPORT:BS_Memory_ReAlloc=_BS_Memory_ReAlloc@8")
return realloc(pMemory, iNewSize);
}
DLL_FUNCTION(void) BS_Memory_Free(void* pMemory) {
#pragma comment(linker, "/EXPORT:BS_Memory_Free=_BS_Memory_Free@4")
free(pMemory);
}
DLL_FUNCTION(uint8_t) BS_Memory_PeekByte(void* pMemory, uint32_t offset) {
#pragma comment(linker, "/EXPORT:BS_Memory_PeekByte=_BS_Memory_PeekByte@8")
return *(reinterpret_cast<uint8_t*>(pMemory) + offset);
}
DLL_FUNCTION(uint16_t) BS_Memory_PeekShort(void* pMemory, uint32_t offset) {
#pragma comment(linker, "/EXPORT:BS_Memory_PeekShort=_BS_Memory_PeekShort@8")
return *(uint16_t*)(reinterpret_cast<uint8_t*>(pMemory) + offset);
}
DLL_FUNCTION(uint32_t) BS_Memory_PeekInt(void* pMemory, uint32_t offset) {
#pragma comment(linker, "/EXPORT:BS_Memory_PeekInt=_BS_Memory_PeekInt@8")
return *(uint32_t*)(reinterpret_cast<uint8_t*>(pMemory) + offset);
}
DLL_FUNCTION(float_t) BS_Memory_PeekFloat(void* pMemory, uint32_t offset) {
#pragma comment(linker, "/EXPORT:BS_Memory_PeekFloat=_BS_Memory_PeekFloat@8")
return *(float_t*)(reinterpret_cast<uint8_t*>(pMemory) + offset);
}
DLL_FUNCTION(void) BS_Memory_PokeByte(void* pMemory, uint32_t offset, uint8_t value) {
#pragma comment(linker, "/EXPORT:BS_Memory_PokeByte=_BS_Memory_PokeByte@12")
*((reinterpret_cast<uint8_t*>(pMemory) + offset)) = value;
}
DLL_FUNCTION(void) BS_Memory_PokeShort(void* pMemory, uint32_t offset, uint16_t value) {
#pragma comment(linker, "/EXPORT:BS_Memory_PokeShort=_BS_Memory_PokeShort@12")
*(reinterpret_cast<uint16_t*>(reinterpret_cast<uint8_t*>(pMemory) + offset)) = value;
}
DLL_FUNCTION(void) BS_Memory_PokeInt(void* pMemory, uint32_t offset, uint32_t value) {
#pragma comment(linker, "/EXPORT:BS_Memory_PokeInt=_BS_Memory_PokeInt@12")
*(reinterpret_cast<uint32_t*>(reinterpret_cast<uint8_t*>(pMemory) + offset)) = value;
}
DLL_FUNCTION(void) BS_Memory_PokeFloat(void* pMemory, uint32_t offset, float_t value) {
#pragma comment(linker, "/EXPORT:BS_Memory_PokeFloat=_BS_Memory_PokeFloat@12")
*(reinterpret_cast<float_t*>(reinterpret_cast<uint8_t*>(pMemory) + offset)) = value;
}
+1 -2
View File
@@ -14,8 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "BlitzSteam.h"
BS_I#include "BlitzSteam.h"
DLL_FUNCTION(void*) BS_Memory_Alloc(uint32_t iSize);
DLL_FUNCTION(void*) BS_Memory_ReAlloc(void* pMemory, uint32_t iNewSize);