This commit is contained in:
Michael Fabain Dirks
2016-05-08 22:46:41 +02:00
parent d4de6a5e7b
commit 6a44064f25
82 changed files with 8391 additions and 7473 deletions
+8 -2
View File
@@ -59,7 +59,7 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<BufferSecurityCheck>false</BufferSecurityCheck>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
@@ -156,12 +156,15 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="BlitzSteam.cpp" />
<ClCompile Include="Helpers\BlitzPointer.cpp" />
<ClCompile Include="Helpers\Helper.cpp" />
<ClCompile Include="Types\BlitzCallback.cpp" />
<ClCompile Include="Types\CSteamID.cpp" />
<ClCompile Include="Types\Double.cpp" />
<ClCompile Include="Types\SteamMatchmakingTypes.cpp" />
<ClCompile Include="Types\Long.cpp" />
<ClCompile Include="Types\Memory.cpp" />
<ClCompile Include="Types\SteamTypes.cpp" />
<ClCompile Include="Wrapper\Steam.cpp" />
<ClCompile Include="Wrapper\SteamAppList.cpp" />
<ClCompile Include="Wrapper\SteamApps.cpp" />
@@ -195,15 +198,17 @@
<ClInclude Include="Types\BlitzCallback.h" />
<ClInclude Include="Types\CSteamID.h" />
<ClInclude Include="Types\Double.h" />
<ClInclude Include="Types\SteamMatchmakingTypes.h" />
<ClInclude Include="Types\Long.h" />
<ClInclude Include="Types\Memory.h" />
<ClInclude Include="Types\SteamTypes.h" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\BlitzSteam.bb" />
<None Include="Resources\BlitzSteam.ipf" />
<None Include="Resources\BlitzSteamUtility.bb" />
<None Include="Resources\Decls\BlitzSteam.decls" />
<None Include="Resources\Decls\BlitzSteam_BlitzCallback.decls" />
<None Include="Resources\Decls\BlitzSteam_Callback.decls" />
<None Include="Resources\Decls\BlitzSteam_CSteamID.decls" />
<None Include="Resources\Decls\BlitzSteam_Double.decls" />
<None Include="Resources\Decls\BlitzSteam_Long.decls" />
@@ -221,6 +226,7 @@
<None Include="Resources\Decls\BlitzSteam_SteamInventory.decls" />
<None Include="Resources\Decls\BlitzSteam_SteamMatchmaking.decls" />
<None Include="Resources\Decls\BlitzSteam_SteamMatchmakingServers.decls" />
<None Include="Resources\Decls\BlitzSteam_SteamMatchmakingTypes.decls" />
<None Include="Resources\Decls\BlitzSteam_SteamMusic.decls" />
<None Include="Resources\Decls\BlitzSteam_SteamMusicRemote.decls" />
<None Include="Resources\Decls\BlitzSteam_SteamNetworking.decls" />
+21 -3
View File
@@ -128,6 +128,15 @@
<ClCompile Include="Types\Memory.cpp">
<Filter>Source Files\Types</Filter>
</ClCompile>
<ClCompile Include="Types\SteamMatchmakingTypes.cpp">
<Filter>Source Files\Types</Filter>
</ClCompile>
<ClCompile Include="Types\SteamTypes.cpp">
<Filter>Source Files\Types</Filter>
</ClCompile>
<ClCompile Include="Helpers\BlitzPointer.cpp">
<Filter>Source Files\Helpers</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="BlitzSteam.h">
@@ -157,6 +166,12 @@
<ClInclude Include="BlitzSteamInternal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Types\SteamMatchmakingTypes.h">
<Filter>Header Files\Types</Filter>
</ClInclude>
<ClInclude Include="Types\SteamTypes.h">
<Filter>Header Files\Types</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="$(ProjectDir)\Blitz\*.*" />
@@ -200,9 +215,6 @@
<None Include="Resources\Decls\BlitzSteam.decls">
<Filter>Resource Files\Decls</Filter>
</None>
<None Include="Resources\Decls\BlitzSteam_BlitzCallback.decls">
<Filter>Resource Files\Decls</Filter>
</None>
<None Include="Resources\Decls\BlitzSteam_CSteamID.decls">
<Filter>Resource Files\Decls</Filter>
</None>
@@ -293,6 +305,12 @@
<None Include="Resources\BlitzSteam.LICENSE.lesser">
<Filter>Resource Files</Filter>
</None>
<None Include="Resources\Decls\BlitzSteam_SteamMatchmakingTypes.decls">
<Filter>Resource Files\Decls</Filter>
</None>
<None Include="Resources\Decls\BlitzSteam_Callback.decls">
<Filter>Resource Files\Decls</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="Resources\Examples\steam_appid.txt">
+52
View File
@@ -0,0 +1,52 @@
// 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 "BlitzPointer.h"
DLL(intptr_t) BS_BlitzPointer_GetReturnAddress() {
intptr_t BasePointer, ReturnAddress;
__asm { //ASM. Do touch if suicidal.
mov BasePointer, ebp; // Store current BasePointer
}
// Blitz uses X86 Call-Near (E8) instructions to call its own functions.
// We can simply deduce the Return Address like this because of that.
//-- Parent_EBP = *EBP
//-- Parent_RP = Parent_EBP + 16
ReturnAddress = *(intptr_t*)((*(intptr_t*)BasePointer) + 16);
return ReturnAddress;
}
DLL(intptr_t) BS_BlitzPointer_GetFunctionPointer() {
intptr_t BasePointer, ReturnAddress, FunctionPointer;
__asm { //ASM. Do touch if suicidal.
mov BasePointer, ebp; // Store current BasePointer
}
// Blitz uses X86 Call-Near (E8) instructions to call its own functions.
// We can simply deduce the Return Address like this because of that.
//-- Parent_EBP = *EBP
//-- Parent_RP = Parent_EBP + 16
ReturnAddress = *(intptr_t*)((*(intptr_t*)BasePointer) + 16);
// And since it's a Call-Near, the call is offset to the return address.
FunctionPointer = ReturnAddress + *(intptr_t*)(ReturnAddress - 4);
return FunctionPointer;
}
+10 -6
View File
@@ -15,6 +15,10 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "BlitzSteamInternal.h"
DLL(intptr_t) BS_BlitzPointer_GetReturnAddress();
DLL(intptr_t) BS_BlitzPointer_GetFunctionPointer();
// Types of Blitz Functions.
typedef int32_t(__stdcall *BP_BlitzFunction0_t)();
@@ -24,9 +28,9 @@ 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);
#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)
#define BP_CallFunction0(ptr) (ptr)()
#define BP_CallFunction1(ptr, p1) (ptr)(p1)
#define BP_CallFunction2(ptr, p1, p2) (ptr)(p1, p2)
#define BP_CallFunction3(ptr, p1, p2, p3) (ptr)(p1, p2, p3)
#define BP_CallFunction4(ptr, p1, p2, p3, p4) (ptr)(p1, p2, p3, p4)
#define BP_CallFunction5(ptr, p1, p2, p3, p4, p5) (ptr)(p1, p2, p3, p4, p5)
-30
View File
@@ -33,7 +33,6 @@ DLL(void) BS_Helper_CopyMemoryIntMangle(void* pSource, void* pDest, int32_t iMan
int8_t iMangleByte2 = static_cast<int8_t>((iMangling & 0xFF0000) >> 16);
int8_t iMangleByte3 = static_cast<int8_t>((iMangling & 0xFF000000) >> 24);
if (pSource > pDest) {
// Start at beginning
for (uint32_t iY = iAreaY; iY < (iAreaY + iAreaH); iY++) {
// Only do this once per loop
@@ -58,33 +57,4 @@ DLL(void) BS_Helper_CopyMemoryIntMangle(void* pSource, void* pDest, int32_t iMan
(*pSourceOff & 0xFF000000) << -iMangleByte3);
}
}
} else {
//ToDo, mirror the above. Instead of adding we subtract.
//// Start at end
//for (uint32_t iY = y + h; iY >= y; iY--) {
// pSourceOff = reinterpret_cast<uint32_t*>(pSource) + ((tw * iY) + x);
// pDestOff = reinterpret_cast<uint32_t*>(pDest) + ((tw * iY) + x);
// for (uint32_t iX = x + w; iX >= x; iX--) {
// *pDestOff =
// (iMangleByte0 > 0 ?
// (*pSourceOff & 0xFF) >> iMangleByte0 :
// (*pSourceOff & 0xFF) << -iMangleByte0)
// + (iMangleByte1 > 0 ?
// (*pSourceOff & 0xFF00) >> iMangleByte1 :
// (*pSourceOff & 0xFF00) << -iMangleByte1)
// + (iMangleByte2 > 0 ?
// (*pSourceOff & 0xFF0000) >> iMangleByte2 :
// (*pSourceOff & 0xFF0000) << -iMangleByte2)
// + (iMangleByte3 > 0 ?
// (*pSourceOff & 0xFF000000) >> iMangleByte3 :
// (*pSourceOff & 0xFF000000) << -iMangleByte3);
// // Above is some mangling magic i learned in some source code. Allows you to define a byte bit shift using a single integer.
// pSourceOff -= 1;
// pDestOff -= 1;
// }
//}
}
}
+11 -2
View File
@@ -574,6 +574,15 @@ Const BS_EMarketingMessageFlags_PlatformLinux = 1 Shl 3
Const BS_EMarketingMessageFlags_PlatformRestrictions = BS_EMarketingMessageFlags_PlatformWindows Or BS_EMarketingMessageFlags_PlatformMac Or BS_EMarketingMessageFlags_PlatformLinux
;[End Block]
;[Block] Enumeration: EMatchMakingServerResponse
;------------------------------------------------------------------------------
;! Enumeration - EMatchMakingServerResponse
;------------------------------------------------------------------------------
Const BS_EMatchMakingServerResponse_ServerResponded = 0
Const BS_EMatchMakingServerResponse_ServerFailedToRespond = 1
Const BS_EMatchMakingServerResponse_NoServersListedOnMasterServer = 2
;[End Block]
;[Block] Enumeration: ENotificationPosition
;------------------------------------------------------------------------------
;! Enumeration - ENotificationPosition
@@ -1890,6 +1899,6 @@ End Type
;[End Block]
;~IDEal Editor Parameters:
;~F#13#26#31#49#60#71#7E#93#C8#E0#F5#101#110#121#14F#166#178#190#1A1#1E2
;~F#1EB#1F5#20C#216#220#229#232#240#24B#255#26B#27C#295#2A5#314#322#32C#33C#344#351
;~F#13#26#31#49#60#71#7E#93#C8#E0#F5#101#110#121#14F#166#178#190#1A1#1E2
;~F#1EB#1F5#20C#216#220#229#249#254#25E#274#285#29E#2AE#31D#32B#335#345#34D#35A#369
;~F#377#381#392#3A6#3A9#3BF#3F3#413#432#52E#54C#55C#569#65C#6D5#708
+3 -2
View File
@@ -1,9 +1,9 @@
[IDEal Project file]
<Settings>
Version="1"
Expanded="False"
Expanded="True"
Icon=""
MainFile="SteamHTMLSurface_Example.bb"
MainFile="SteamMatchmakingServers_Example.bb"
Compiler="Blitz3D"
CommandLine=""
</Settings>
@@ -18,4 +18,5 @@
AbsPath="\Examples\SteamApps_Example.bb" PrjFolder="\Examples" Line="0" Column="0" Tip="0" Visible="False"
AbsPath="\Examples\SteamController_Example.bb" PrjFolder="\Examples" Line="0" Column="0" Tip="0" Visible="False"
AbsPath="\Examples\SteamHTMLSurface_Example.bb" PrjFolder="\Examples" Line="0" Column="0" Tip="0" Visible="False"
AbsPath="\Examples\SteamMatchmakingServers_Example.bb" PrjFolder="\Examples" Line="0" Column="0" Tip="0" Visible="False"
</Files>
+3
View File
@@ -18,3 +18,6 @@
; Generic ---------------------------------------------------------------------
BS_Helper_FormatUnixTime$(unixTime%, pchFormat$) :"_BS_Helper_FormatUnixTime@8"
BS_Helper_CopyMemoryIntMangle(pSource%, pDest%, iMangling%, iSourceW%, iSourceH%, iDestW%, iDestH%, iAreaX%, iAreaY%, iAreaW%, iAreaH%):"_BS_Helper_CopyMemoryIntMangle@44"
BS_BlitzPointer_GetReturnAddress%() :"_BS_BlitzPointer_GetReturnAddress@0"
BS_BlitzPointer_GetFunctionPointer%() :"_BS_BlitzPointer_GetFunctionPointer@0"
+33
View File
@@ -0,0 +1,33 @@
; 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/>.
.lib "BlitzSteam.dll"
; BlitzCallback ---------------------------------------------------------------
BS_Callback_New%(pFunction%) :"_BS_Callback_New@4"
BS_Callback_Destroy(pThis%) :"_BS_Callback_Destroy@4"
BS_Callback_GetCallbackSizeBytes%(pThis%) :"_BS_Callback_GetCallbackSizeBytes@4"
BS_Callback_SetCallback(pThis%, iCallback%) :"_BS_Callback_SetCallback@8"
BS_Callback_GetCallback%(pThis%) :"_BS_Callback_GetCallback@4"
BS_Callback_SetFunction(pThis%, pFunction%) :"_BS_Callback_SetFunction@8"
BS_Callback_GetFunction%(pThis%) :"_BS_Callback_GetFunction@4"
BS_Callback_SetRegistered(pThis%, bIsRegistered%) :"_BS_Callback_SetRegistered@8"
BS_Callback_IsRegistered%(pThis%) :"_BS_Callback_IsRegistered@4"
BS_Callback_SetGameServer(pThis%, bIsGameServer%) :"_BS_Callback_SetGameServer@8"
BS_Callback_IsGameServer%(pThis%) :"_BS_Callback_IsGameServer@4"
BS_Callback_Register(pThis%, iCallback%) :"_BS_Callback_Register@8"
BS_Callback_Unregister(pThis%) :"_BS_Callback_Unregister@4"
BS_Callback_RegisterResult(pThis%, lSteamAPICall%, iCallback%) :"_BS_Callback_RegisterResult@12"
BS_Callback_UnregisterResult(pThis%) :"_BS_Callback_UnregisterResult@4"
@@ -18,4 +18,25 @@
; MatchmakingServers ----------------------------------------------------------
BS_SteamMatchmakingServers%() :"_BS_SteamMatchmakingServers@0"
; Todo
BS_ISteamMatchmakingServers_RequestInternetServerList%(pThis%, iApp%, ppchFilters*, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestInternetServerList@20"
BS_ISteamMatchmakingServers_RequestInternetServerListEx%(pThis%, iApp%, ppchFilters%, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestInternetServerList@20"
BS_ISteamMatchmakingServers_RequestLANServerList%(pThis%, iApp%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestLANServerList@12"
BS_ISteamMatchmakingServers_RequestFriendsServerList%(pThis%, iApp%, ppchFilters*, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestFriendsServerList@20"
BS_ISteamMatchmakingServers_RequestFriendsServerListEx%(pThis%, iApp%, ppchFilters%, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestFriendsServerList@20"
BS_ISteamMatchmakingServers_RequestFavoritesServerList%(pThis%, iApp%, ppchFilters*, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestFavoritesServerList@20"
BS_ISteamMatchmakingServers_RequestFavoritesServerListEx%(pThis%, iApp%, ppchFilters%, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestFavoritesServerList@20"
BS_ISteamMatchmakingServers_RequestHistoryServerList%(pThis%, iApp%, ppchFilters*, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestHistoryServerList@20"
BS_ISteamMatchmakingServers_RequestHistoryServerListEx%(pThis%, iApp%, ppchFilters%, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestHistoryServerList@20"
BS_ISteamMatchmakingServers_RequestSpectatorServerList%(pThis%, iApp%, ppchFilters*, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestSpectatorServerList@20"
BS_ISteamMatchmakingServers_RequestSpectatorServerListEx%(pThis%, iApp%, ppchFilters%, nFilters%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_RequestSpectatorServerList@20"
BS_ISteamMatchmakingServers_ReleaseRequest%(pThis%, hServerListRequest%) :"_BS_ISteamMatchmakingServers_ReleaseRequest@8"
BS_ISteamMatchmakingServers_GetServerDetails%(pThis%, hRequest%, iServer%) :"_BS_ISteamMatchmakingServers_GetServerDetails@12"
BS_ISteamMatchmakingServers_CancelQuery%(pThis%, hRequest%) :"_BS_ISteamMatchmakingServers_CancelQuery@8"
BS_ISteamMatchmakingServers_RefreshQuery%(pThis%, hRequest%) :"_BS_ISteamMatchmakingServers_RefreshQuery@8"
BS_ISteamMatchmakingServers_IsRefreshing%(pThis%, hRequest%) :"_BS_ISteamMatchmakingServers_IsRefreshing@8"
BS_ISteamMatchmakingServers_GetServerCount%(pThis%, hRequest%) :"_BS_ISteamMatchmakingServers_GetServerCount@8"
BS_ISteamMatchmakingServers_RefreshServer%(pThis%, hRequest%) :"_BS_ISteamMatchmakingServers_RefreshServer@8"
BS_ISteamMatchmakingServers_PingServer%(pThis%, unIP%, usPort%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_PingServer@16"
BS_ISteamMatchmakingServers_PlayerDetails%(pThis%, unIP%, usPort%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_PlayerDetails@16"
BS_ISteamMatchmakingServers_ServerRules%(pThis%, unIP%, usPort%, pRequestServersResponse%):"_BS_ISteamMatchmakingServers_ServerRules@16"
BS_ISteamMatchmakingServers_CancelServerQuery%(pThis%, hServerQuery) :"_BS_ISteamMatchmakingServers_CancelServerQuery@8"
@@ -0,0 +1,78 @@
; 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/>.
.lib "BlitzSteam.dll"
; ISteamMatchmakingServerListResponse -----------------------------------------
BS_ISteamMatchmakingServerListResponse_New%(Data%, pServerResponded%, pServerFailedToRespond%, pRefreshComplete%):"_BS_ISteamMatchmakingServerListResponse_New@16"
BS_ISteamMatchmakingServerListResponse_Destroy%(pThis%):"_BS_ISteamMatchmakingServerListResponse_Destroy@4"
;- Callback pServerResponded: Function(Data%, hRequest%, iServer%)
;- Callback pServerFailedToRespond: Function(Data%, hRequest%, iServer%)
;- Callback pRefreshComplete: Function(Data%)
; ISteamMatchmakingPingResponse -----------------------------------------------
BS_ISteamMatchmakingPingResponse_New%(Data%, pServerResponded%, pServerFailedToRespond%):"_BS_ISteamMatchmakingPingResponse_New@12"
BS_ISteamMatchmakingPingResponse_Destroy%(pThis%):"_BS_ISteamMatchmakingPingResponse_Destroy@4"
;- Callback pServerResponded: Function(Data%, TGameServerItem%)
;- Callback pServerFailedToRespond: Function(Data%)
; ISteamMatchmakingPlayersResponse --------------------------------------------
BS_ISteamMatchmakingPlayersResponse_New%(Data%, pAddPlayerToList%, pPlayersFailedToRespond%, pPlayersRefreshComplete%):"_BS_ISteamMatchmakingPlayersResponse_New@16"
BS_ISteamMatchmakingPlayersResponse_Destroy%(pThis%):"_BS_ISteamMatchmakingPlayersResponse_Destroy@4"
;- Callback pAddPlayerToList: Function(Data%, pchName%, nScore%, flTimePlayer#)
;- Callback pPlayersFailedToRespond: Function(Data%)
;- Callback pPlayersRefreshComplete: Function(Data%)
; ISteamMatchmakingRulesResponse ----------------------------------------------
BS_ISteamMatchmakingRulesResponse_New%(Data%, pRulesResponded%, pRulesFailedToRespond%, pRulesRefreshComplete%):"_BS_ISteamMatchmakingRulesResponse_New@16"
BS_ISteamMatchmakingRulesResponse_Destroy%(pThis%):"_BS_ISteamMatchmakingPlayersResponse_Destroy@4"
;- Callback pRulesResponded: Function(Data%, pchRule%, pchValue%)
;- Callback pRulesFailedToRespond: Function(Data%)
;- Callback pRulesRefreshComplete: Function(Data%)
; TGameServerItem -------------------------------------------------------------
BS_TGameServerItem_GetName$(pThis%) :"_BS_TGameServerItem_GetName@4"
BS_TGameServerItem_SetName(pThis%, cName$) :"_BS_TGameServerItem_SetName@8"
BS_TGameServerItem_NetAdr%(pThis%) :"_BS_TGameServerItem_NetAdr@4"
BS_TGameServerItem_Ping%(pThis%) :"_BS_TGameServerItem_Ping@4"
BS_TGameServerItem_HadSuccessfulResponse%(pThis%) :"_BS_TGameServerItem_HadSuccessfulResponse@4"
BS_TGameServerItem_DoNotRefresh%(pThis%) :"_BS_TGameServerItem_DoNotRefresh@4"
BS_TGameServerItem_GameDir$(pThis%) :"_BS_TGameServerItem_GameDir@4"
BS_TGameServerItem_Map$(pThis%) :"_BS_TGameServerItem_Map@4"
BS_TGameServerItem_GameDescription$(pThis%) :"_BS_TGameServerItem_GameDescription@4"
BS_TGameServerItem_AppId%(pThis%) :"_BS_TGameServerItem_AppId@4"
BS_TGameServerItem_Players%(pThis%) :"_BS_TGameServerItem_Players@4"
BS_TGameServerItem_MaxPlayers%(pThis%) :"_BS_TGameServerItem_MaxPlayers@4"
BS_TGameServerItem_BotPlayers%(pThis%) :"_BS_TGameServerItem_BotPlayers@4"
BS_TGameServerItem_Password%(pThis%) :"_BS_TGameServerItem_Password@4"
BS_TGameServerItem_Secure%(pThis%) :"_BS_TGameServerItem_Secure@4"
BS_TGameServerItem_TimeLastPlayed%(pThis%) :"_BS_TGameServerItem_TimeLastPlayed@4"
BS_TGameServerItem_ServerVersion%(pThis%) :"_BS_TGameServerItem_ServerVersion@4"
BS_TGameServerItem_GameTags$(pThis%) :"_BS_TGameServerItem_GameTags@4"
BS_TGameServerItem_SteamID%(pThis%) :"_BS_TGameServerItem_SteamID@4"
; TServerNetAdr ---------------------------------------------------------------
BS_TServerNetAdr_Set(pThis%, pThat%) :"_BS_TServerNetAdr_Set@8"
BS_TServerNetAdr_Init(pThis%, iIP%, iQueryPort%, iConnectionPort%) :"_BS_TServerNetAdr_Init@16"
BS_TServerNetAdr_GetQueryPort%(pThis%) :"_BS_TServerNetAdr_GetQueryPort@4"
BS_TServerNetAdr_SetQueryPort(pThis%, iPort%) :"_BS_TServerNetAdr_SetQueryPort@8"
BS_TServerNetAdr_GetConnectionPort%(pThis%) :"_BS_TServerNetAdr_GetConnectionPort@4"
BS_TServerNetAdr_SetConnectionPort(pThis%, iPort%) :"_BS_TServerNetAdr_SetConnectionPort@8"
BS_TServerNetAdr_GetIP%(pThis%) :"_BS_TServerNetAdr_GetIP@4"
BS_TServerNetAdr_SetIP(pThis%, iIP%) :"_BS_TServerNetAdr_SetIP@8"
BS_TServerNetAdr_GetConnectionAddressString$(pThis%) :"_BS_TServerNetAdr_GetConnectionAddressString@4"
BS_TServerNetAdr_GetQueryAddressString$(pThis%) :"_BS_TServerNetAdr_GetQueryAddressString@4"
BS_TServerNetAdr_Compare%(pThis%, pThat%) :"_BS_TServerNetAdr_Compare@8"
@@ -22,9 +22,9 @@ BS_SteamGameServerNetworking%() :"_BS_SteamGameServerNetworking@0"
BS_ISteamNetworking_SendP2PPacket%(pThis%, lRemoteSteamId%, pData*, iDataSize%, EP2PSendType%, iChannel%):"_BS_ISteamNetworking_SendP2PPacket@24"
BS_ISteamNetworking_SendP2PPacketEx%(pThis%, lRemoteSteamId%, pData%, iDataSize%, EP2PSendType%, iChannel%):"_BS_ISteamNetworking_SendP2PPacket@24"
BS_ISteamNetworking_IsP2PPacketAvailable%(pThis%, piSize*, iChannel%) :"_BS_ISteamNetworking_IsP2PPacketAvailable@12"
BS_ISteamNetworking_IsP2PPacketAvailableEx%(pThis%, piSize%, iChannel%) :"_BS_ISteamNetworking_IsP2PPacketAvailableEx@12"
BS_ISteamNetworking_ReadP2PPacket%(pThis%, pBuffer*, iBufferSize%, piMessageSize*, lRemoteSteamId%, iChannel%):"_BS_ISteamNetworking_ReadP2PPacket@24"
BS_ISteamNetworking_ReadP2PPacketEx%(pThis%, pBuffer%, iBufferSize%, piMessageSize%, lRemoteSteamId%, iChannel%):"_BS_ISteamNetworking_ReadP2PPacket@24"
BS_ISteamNetworking_IsP2PPacketAvailableEx%(pThis%, piSize%, iChannel%) :"_BS_ISteamNetworking_IsP2PPacketAvailable@12"
BS_ISteamNetworking_ReadP2PPacket%(pThis%, pBuffer*, iBufferSize%, piMessageSize*, plRemoteSteamId*, iChannel%):"_BS_ISteamNetworking_ReadP2PPacket@24"
BS_ISteamNetworking_ReadP2PPacketEx%(pThis%, pBuffer%, iBufferSize%, piMessageSize%, plRemoteSteamId%, iChannel%):"_BS_ISteamNetworking_ReadP2PPacket@24"
BS_ISteamNetworking_AcceptP2PSessionWithUser%(pThis%, lRemoteSteamId%) :"_BS_ISteamNetworking_AcceptP2PSessionWithUser@8"
BS_ISteamNetworking_CloseP2PSessionWithUser%(pThis%, lRemoteSteamId%) :"_BS_ISteamNetworking_CloseP2PSessionWithUser@8"
BS_ISteamNetworking_CloseP2PChannelWithUser%(pThis%, lRemoteSteamId%, iChannel%):"_BS_ISteamNetworking_CloseP2PChannelWithUser@12"
+1 -1
View File
@@ -35,7 +35,7 @@ BS_ISteamUser_GetVoiceEx%(pThisEx%, bCompressed%, pCompressed%, iCompressedSize%
BS_ISteamUser_DecompressVoice(pThis%, pCompressed*, iCompressedSize%, pUncompressed*, iUncompressedSize%, iUncompressedBytesWritten*, iSampleRate%):"_BS_ISteamUser_DecompressVoice@28"
BS_ISteamUser_DecompressVoiceEx(pThis%, pCompressed*, iCompressedSize%, pUncompressed%, iUncompressedSize%, iUncompressedBytesWritten%, iSampleRate%):"_BS_ISteamUser_DecompressVoice@28"
BS_ISteamUser_GetVoiceOptimalSampleRate%(pThis%) :"_BS_ISteamUser_GetVoiceOptimalSampleRate@4"
BS_ISteamUser_GetAuthSessionTicket%(pThis%, pTicket*, iTicketSize%, piTicketSize*):"_BS_ISteamUser_GetAuthSessionTicket@12"
BS_ISteamUser_GetAuthSessionTicket%(pThis%, pTicket*, iTicketSize%, piTicketSize*):"_BS_ISteamUser_GetAuthSessionTicket@16"
BS_ISteamUser_BeginAuthSession%(pThis%, pAuthTicket*, iAuthTicketSize%, lSteamId%):"_BS_ISteamUser_BeginAuthSession@16"
BS_ISteamUser_EndAuthSession(pThis%, lSteamId%) :"_BS_ISteamUser_EndAuthSession@8"
BS_ISteamUser_CancelAuthTicket(pThis%, hAuthTicket%) :"_BS_ISteamUser_CancelAuthTicket@8"
+17 -2
View File
@@ -1,5 +1,20 @@
Include "../BlitzSteam.bb"
; 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 "../BlitzSteam.bb"
;----------------------------------------------------------------
;! Steam Stuff
;----------------------------------------------------------------
@@ -377,5 +392,5 @@ EndGraphics
End
;~IDEal Editor Parameters:
;~F#8#19
;~F#17#28
;~C#Blitz3D
@@ -0,0 +1,88 @@
; 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 "../BlitzSteam.bb"
;----------------------------------------------------------------
;! Configuration
;----------------------------------------------------------------
Const APPID = 480 ; Test App / SpaceWar
Const FRAMERATE = 60
Const RESOLUTION_X = 1024
Const RESOLUTION_Y = 768
Const RESOLUTION_Z = 32
Const RESOLUTION_MODE = 2
;----------------------------------------------------------------
;! Init Code
;----------------------------------------------------------------
Global Timer = CreateTimer(FRAMERATE)
Global ServerListResponse_ServerResponded_p%:ServerListResponse_ServerResponded(0, 0)
Global ServerListResponse_RefreshComplete_p%:ServerListResponse_RefreshComplete(0, 0)
Graphics RESOLUTION_X, RESOLUTION_Y, RESOLUTION_Z, RESOLUTION_MODE
SetBuffer BackBuffer()
If Not BS_SteamAPI_Init() Then RuntimeError "Failed to initialize Steam!"
;----------------------------------------------------------------
;! Main Code
;----------------------------------------------------------------
Local Bank =CreateBank(1)
Local pRequestServersResponse = BS_ISteamMatchmakingServerListResponse_New(ServerListResponse_ServerResponded_p, 0, ServerListResponse_RefreshComplete_p)
Local hRequest = BS_ISteamMatchmakingServers_RequestInternetServerList(BS_SteamMatchmakingServers(), 480, Bank, 0, pRequestServersResponse)
While Not KeyHit(1)
WaitTimer Timer
BS_SteamAPI_RunCallbacks()
Wend
BS_ISteamMatchmakingServers_ReleaseRequest(BS_SteamMatchmakingServers(), hRequest)
BS_SteamAPI_Shutdown()
;----------------------------------------------------------------
;! Functions
;----------------------------------------------------------------
Function ServerListResponse_ServerResponded(hRequest%, iServer%)
If (Not ServerListResponse_ServerResponded_p)
ServerListResponse_ServerResponded_p = BP_GetFunctionPointer()
Return
EndIf
Print iServer
End Function
Function ServerListResponse_RefreshComplete(hRequest%, eMatchMakingServerResponse%)
If (Not ServerListResponse_RefreshComplete_p)
ServerListResponse_RefreshComplete_p = BP_GetFunctionPointer()
Return
EndIf
Select eMatchMakingServerResponse
Case BS_EMatchMakingServerResponse_ServerResponded
Print "Got Servers"
Case BS_EMatchMakingServerResponse_ServerFailedToRespond
Print "Server did not respond"
Case BS_EMatchMakingServerResponse_NoServersListedOnMasterServer
Print "No Servers listed for this game."
Default
Print "Unknown"
End Select
End Function
;~IDEal Editor Parameters:
;~C#Blitz3D
+3
View File
@@ -161,6 +161,9 @@ DLL(EUniverse) BS_CSteamID_GetEUniverse(CSteamID* pThis) {
}
DLL(int32_t) BS_CSteamID_Compare(CSteamID* pThis, CSteamID* pOther) {
if ((pThis == nullptr) || (pOther == nullptr))
return -1;
return /* It can either be Equal (0) or Smaller or Greater. Easy to check. */
/* Greater */
(*pThis > *pOther ? 1 : 0) +
+3
View File
@@ -64,6 +64,9 @@ DLL(int64_t*) BS_Double_ToL(double_t* pThis) {
}
DLL(int32_t) BS_Double_Compare(double_t* pThis, double_t* pOther) {
if ((pThis == nullptr) || (pOther == nullptr))
return -1;
return /* It can either be Equal (0) or Smaller or Greater. Easy to check. */
/* Greater */
(*pThis > *pOther ? 1 : 0) +
+3
View File
@@ -76,6 +76,9 @@ DLL(double_t*) BS_Long_ToD(int64_t* pThis) {
}
DLL(int32_t) BS_Long_Compare(int64_t* pThis, int64_t* pOther) {
if ((pThis == nullptr) || (pOther == nullptr))
return -1;
return /* It can either be Equal (0) or Smaller or Greater. Easy to check. */
/* Greater */
(*pThis > *pOther ? 1 : 0) +
+271
View File
@@ -0,0 +1,271 @@
// 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 "SteamMatchmakingTypes.h"
//////////////////////////////////////////////////////////////////////////
BlitzISteamMatchmakingServerListResponse::BlitzISteamMatchmakingServerListResponse(void* pData, BP_BlitzFunction3_t pServerResponded,
BP_BlitzFunction3_t pServerFailedToRespond, BP_BlitzFunction3_t pRefreshComplete)
: m_pData(pData), m_pServerResponded(pServerResponded), m_pServerFailedToRespond(pServerFailedToRespond), m_pRefreshComplete(pRefreshComplete) {}
void BlitzISteamMatchmakingServerListResponse::ServerResponded(HServerListRequest hRequest, int iServer) {
if (this->m_pServerResponded != nullptr)
BP_CallFunction3(m_pServerResponded, reinterpret_cast<int32_t>(m_pData), reinterpret_cast<int32_t>(hRequest), iServer);
}
void BlitzISteamMatchmakingServerListResponse::ServerFailedToRespond(HServerListRequest hRequest, int iServer) {
if (this->m_pServerFailedToRespond != nullptr)
BP_CallFunction3(m_pServerFailedToRespond, reinterpret_cast<int32_t>(m_pData), reinterpret_cast<int32_t>(hRequest), iServer);
}
void BlitzISteamMatchmakingServerListResponse::RefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response) {
if (this->m_pRefreshComplete != nullptr)
BP_CallFunction3(m_pRefreshComplete, reinterpret_cast<int32_t>(m_pData), reinterpret_cast<int32_t>(hRequest), static_cast<int32_t>(response));
}
DLL(BlitzISteamMatchmakingServerListResponse*) BS_ISteamMatchmakingServerListResponse_New(void* pData, BP_BlitzFunction3_t pServerResponded, BP_BlitzFunction3_t pServerFailedToRespond, BP_BlitzFunction3_t pRefreshComplete) {
return new BlitzISteamMatchmakingServerListResponse(pData, pServerResponded, pServerFailedToRespond, pRefreshComplete);
}
DLL(void) BS_ISteamMatchmakingServerListResponse_Destroy(BlitzISteamMatchmakingServerListResponse* pThis) {
delete pThis;
}
//////////////////////////////////////////////////////////////////////////
BlitzISteamMatchmakingPingResponse::BlitzISteamMatchmakingPingResponse(void* pData, BP_BlitzFunction2_t pServerResponded, BP_BlitzFunction1_t pServerFailedToRespond)
: m_pData(pData), m_pServerResponded(pServerResponded), m_pServerFailedToRespond(pServerFailedToRespond) {}
void BlitzISteamMatchmakingPingResponse::ServerResponded(gameserveritem_t &server) {
if (this->m_pServerResponded != nullptr)
BP_CallFunction2(m_pServerResponded, reinterpret_cast<int32_t>(m_pData), reinterpret_cast<int32_t>(&server));
}
void BlitzISteamMatchmakingPingResponse::ServerFailedToRespond() {
if (this->m_pServerFailedToRespond != nullptr)
BP_CallFunction1(m_pServerFailedToRespond, reinterpret_cast<int32_t>(m_pData));
}
DLL(BlitzISteamMatchmakingPingResponse*) BS_ISteamMatchmakingPingResponse_New(void* pData, BP_BlitzFunction2_t pServerResponded, BP_BlitzFunction1_t pServerFailedToRespond) {
return new BlitzISteamMatchmakingPingResponse(pData, pServerResponded, pServerFailedToRespond);
}
DLL(void) BS_ISteamMatchmakingPingResponse_Destroy(BlitzISteamMatchmakingPingResponse* pThis) {
delete pThis;
}
//////////////////////////////////////////////////////////////////////////
BlitzISteamMatchmakingPlayersResponse::BlitzISteamMatchmakingPlayersResponse(void* pData, BP_BlitzFunction4_t pAddPlayerToList, BP_BlitzFunction1_t pPlayersFailedToRespond, BP_BlitzFunction1_t pPlayersRefreshComplete)
: m_pData(pData), m_pAddPlayerToList(pAddPlayerToList), m_pPlayersFailedToRespond(pPlayersFailedToRespond), m_pPlayersRefreshComplete(pPlayersRefreshComplete) {}
void BlitzISteamMatchmakingPlayersResponse::AddPlayerToList(const char *pchName, int nScore, float flTimePlayed) {
if (m_pAddPlayerToList != nullptr)
BP_CallFunction4(m_pAddPlayerToList, reinterpret_cast<int32_t>(m_pData), reinterpret_cast<int32_t>(pchName), nScore, *reinterpret_cast<int32_t*>(&flTimePlayed));
}
void BlitzISteamMatchmakingPlayersResponse::PlayersFailedToRespond() {
if (m_pPlayersFailedToRespond != nullptr)
BP_CallFunction1(m_pPlayersFailedToRespond, reinterpret_cast<int32_t>(m_pData));
}
void BlitzISteamMatchmakingPlayersResponse::PlayersRefreshComplete() {
if (m_pPlayersRefreshComplete != nullptr)
BP_CallFunction1(m_pPlayersRefreshComplete, reinterpret_cast<int32_t>(m_pData));
}
DLL(BlitzISteamMatchmakingPlayersResponse*) BS_ISteamMatchmakingPlayersResponse_New(void* pData, BP_BlitzFunction4_t pAddPlayerToList, BP_BlitzFunction1_t pPlayersFailedToRespond, BP_BlitzFunction1_t pPlayersRefreshComplete) {
return new BlitzISteamMatchmakingPlayersResponse(pData, pAddPlayerToList, pPlayersFailedToRespond, pPlayersRefreshComplete);
}
DLL(void) BS_ISteamMatchmakingPlayersResponse_Destroy(BlitzISteamMatchmakingPlayersResponse* pThis) {
delete pThis;
}
//////////////////////////////////////////////////////////////////////////
BlitzISteamMatchmakingRulesResponse::BlitzISteamMatchmakingRulesResponse(void* pData, BP_BlitzFunction3_t pRulesResponded, BP_BlitzFunction1_t pRulesFailedToRespond, BP_BlitzFunction1_t pRulesRefreshComplete)
: m_pData(pData), m_pRulesResponded(pRulesResponded), m_pRulesFailedToRespond(pRulesFailedToRespond), m_pRulesRefreshComplete(pRulesRefreshComplete) {}
void BlitzISteamMatchmakingRulesResponse::RulesResponded(const char *pchRule, const char *pchValue) {
if (this->m_pRulesResponded != nullptr)
BP_CallFunction3(m_pRulesResponded, reinterpret_cast<int32_t>(m_pData), reinterpret_cast<int32_t>(pchRule), reinterpret_cast<int32_t>(pchValue));
}
void BlitzISteamMatchmakingRulesResponse::RulesFailedToRespond() {
if (this->m_pRulesFailedToRespond != nullptr)
BP_CallFunction1(m_pRulesFailedToRespond, reinterpret_cast<int32_t>(m_pData));
}
void BlitzISteamMatchmakingRulesResponse::RulesRefreshComplete() {
if (this->m_pRulesRefreshComplete != nullptr)
BP_CallFunction1(m_pRulesRefreshComplete, reinterpret_cast<int32_t>(m_pData));
}
DLL(BlitzISteamMatchmakingRulesResponse*) BS_ISteamMatchmakingRulesResponse_New(void* pData, BP_BlitzFunction3_t pRulesResponded, BP_BlitzFunction1_t pRulesFailedToRespond, BP_BlitzFunction1_t pRulesRefreshComplete) {
return new BlitzISteamMatchmakingRulesResponse(pData, pRulesResponded, pRulesFailedToRespond, pRulesRefreshComplete);
}
DLL(void) BS_ISteamMatchmakingRulesResponse_Destroy(BlitzISteamMatchmakingRulesResponse* pThis) {
delete pThis;
}
//////////////////////////////////////////////////////////////////////////
char* BS_TGameServerItem_CharBuffer = new char[128];
DLL(const char*) BS_TGameServerItem_GetName(gameserveritem_t* pThis) {
strcpy(BS_TGameServerItem_CharBuffer, pThis->GetName());
return BS_TGameServerItem_CharBuffer;
}
DLL(void) BS_TGameServerItem_SetName(gameserveritem_t* pThis, const char* cName) {
pThis->SetName(cName);
}
///< IP/Query Port/Connection Port for this server
DLL(servernetadr_t*) BS_TGameServerItem_NetAdr(gameserveritem_t* pThis) {
return &(pThis->m_NetAdr);
}
///< current ping time in milliseconds
DLL(int) BS_TGameServerItem_Ping(gameserveritem_t* pThis) {
return pThis->m_nPing;
}
///< server has responded successfully in the past
DLL(bool) BS_TGameServerItem_HadSuccessfulResponse(gameserveritem_t* pThis) {
return pThis->m_bHadSuccessfulResponse;
}
///< server is marked as not responding and should no longer be refreshed
DLL(bool) BS_TGameServerItem_DoNotRefresh(gameserveritem_t* pThis) {
return pThis->m_bDoNotRefresh;
}
///< current game directory
DLL(const char*) BS_TGameServerItem_GameDir(gameserveritem_t* pThis) {
strcpy(BS_TGameServerItem_CharBuffer, pThis->m_szGameDir);
return BS_TGameServerItem_CharBuffer;
}
///< current map
DLL(const char*) BS_TGameServerItem_Map(gameserveritem_t* pThis) {
strcpy(BS_TGameServerItem_CharBuffer, pThis->m_szMap);
return BS_TGameServerItem_CharBuffer;
}
///< game description
DLL(const char*) BS_TGameServerItem_GameDescription(gameserveritem_t* pThis) {
strcpy(BS_TGameServerItem_CharBuffer, pThis->m_szGameDescription);
return BS_TGameServerItem_CharBuffer;
}
///< Steam App ID of this server
DLL(uint32_t) BS_TGameServerItem_AppId(gameserveritem_t* pThis) {
return pThis->m_nAppID;
}
///< total number of players currently on the server. INCLUDES BOTS!!
DLL(uint32_t) BS_TGameServerItem_Players(gameserveritem_t* pThis) {
return pThis->m_nPlayers;
}
///< Maximum players that can join this server
DLL(uint32_t) BS_TGameServerItem_MaxPlayers(gameserveritem_t* pThis) {
return pThis->m_nMaxPlayers;
}
///< Number of bots (i.e simulated players) on this server
DLL(uint32_t) BS_TGameServerItem_BotPlayers(gameserveritem_t* pThis) {
return pThis->m_nBotPlayers;
}
///< true if this server needs a password to join
DLL(bool) BS_TGameServerItem_Password(gameserveritem_t* pThis) {
return pThis->m_bPassword;
}
///< Is this server protected by VAC
DLL(bool) BS_TGameServerItem_Secure(gameserveritem_t* pThis) {
return pThis->m_bSecure;
}
///< time (in unix time) when this server was last played on (for favorite/history servers)
DLL(uint32_t) BS_TGameServerItem_TimeLastPlayed(gameserveritem_t* pThis) {
return pThis->m_ulTimeLastPlayed;
}
///< server version as reported to Steam
DLL(uint32_t) BS_TGameServerItem_ServerVersion(gameserveritem_t* pThis) {
return pThis->m_nServerVersion;
}
/// the tags this server exposes
DLL(const char*) BS_TGameServerItem_GameTags(gameserveritem_t* pThis) {
strcpy(BS_TGameServerItem_CharBuffer, pThis->m_szGameTags);
return BS_TGameServerItem_CharBuffer;
}
/// steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam)
DLL(CSteamID*) BS_TGameServerItem_SteamID(gameserveritem_t* pThis) {
return &(pThis->m_steamID);
}
//////////////////////////////////////////////////////////////////////////
char* BS_TServerNetAdr_CharBuffer = new char[128];
DLL(void) BS_TServerNetAdr_Set(servernetadr_t* pThis, servernetadr_t* pThat) {
*pThis = *pThat;
}
DLL(void) BS_TServerNetAdr_Init(servernetadr_t* pThis, uint32_t iIP, uint16_t iQueryPort, uint16_t iConnectionPort) {
pThis->Init(iIP, iQueryPort, iConnectionPort);
}
DLL(uint16_t) BS_TServerNetAdr_GetQueryPort(servernetadr_t* pThis) {
return pThis->GetQueryPort();
}
DLL(void) BS_TServerNetAdr_SetQueryPort(servernetadr_t* pThis, uint16_t iPort) {
pThis->SetQueryPort(iPort);
}
DLL(uint16_t) BS_TServerNetAdr_GetConnectionPort(servernetadr_t* pThis) {
return pThis->GetConnectionPort();
}
DLL(void) BS_TServerNetAdr_SetConnectionPort(servernetadr_t* pThis, uint16_t iPort) {
pThis->SetConnectionPort(iPort);
}
DLL(uint32_t) BS_TServerNetAdr_GetIP(servernetadr_t* pThis) {
return pThis->GetIP();
}
DLL(void) BS_TServerNetAdr_SetIP(servernetadr_t* pThis, uint32_t iIP) {
pThis->SetIP(iIP);
}
DLL(const char*) BS_TServerNetAdr_GetConnectionAddressString(servernetadr_t* pThis) {
strcpy(BS_TServerNetAdr_CharBuffer, pThis->GetConnectionAddressString());
return BS_TServerNetAdr_CharBuffer;
}
DLL(const char*) BS_TServerNetAdr_GetQueryAddressString(servernetadr_t* pThis) {
strcpy(BS_TServerNetAdr_CharBuffer, pThis->GetQueryAddressString());
return BS_TServerNetAdr_CharBuffer;
}
DLL(uint32_t) BS_TServerNetAdr_Compare(servernetadr_t* pThis, servernetadr_t* pThat) {
return (pThis < pThat ? -1 : (pThis > pThat ? 1 : 0));
}
+137
View File
@@ -0,0 +1,137 @@
// 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 "BlitzSteamInternal.h"
#include "../Helpers/BlitzPointer.h"
//-----------------------------------------------------------------------------
// Purpose: Callback interface for receiving responses after a server list refresh
// or an individual server update.
//
// Since you get these callbacks after requesting full list refreshes you will
// usually implement this interface inside an object like CServerBrowser. If that
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
// to cancel any in-progress queries so you don't get a callback into the destructed
// object and crash.
//-----------------------------------------------------------------------------
class BlitzISteamMatchmakingServerListResponse : public ISteamMatchmakingServerListResponse {
private:
void* m_pData;
BP_BlitzFunction3_t m_pServerResponded;
BP_BlitzFunction3_t m_pServerFailedToRespond;
BP_BlitzFunction3_t m_pRefreshComplete;
public:
BlitzISteamMatchmakingServerListResponse(void* pData, BP_BlitzFunction3_t pServerResponded, BP_BlitzFunction3_t pServerFailedToRespond, BP_BlitzFunction3_t pRefreshComplete);
// Server has responded ok with updated data
virtual void ServerResponded(HServerListRequest hRequest, int iServer) override;
// Server has failed to respond
virtual void ServerFailedToRespond(HServerListRequest hRequest, int iServer) override;
// A list refresh you had initiated is now 100% completed
virtual void RefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response) override;
};
//-----------------------------------------------------------------------------
// Purpose: Callback interface for receiving responses after pinging an individual server
//
// These callbacks all occur in response to querying an individual server
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
// destructing an object that implements this interface then you should call
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
// which is in progress. Failure to cancel in progress queries when destructing
// a callback handler may result in a crash when a callback later occurs.
//-----------------------------------------------------------------------------
class BlitzISteamMatchmakingPingResponse : public ISteamMatchmakingPingResponse {
private:
void* m_pData;
BP_BlitzFunction2_t m_pServerResponded;
BP_BlitzFunction1_t m_pServerFailedToRespond;
public:
BlitzISteamMatchmakingPingResponse(void* pData, BP_BlitzFunction2_t pServerResponded, BP_BlitzFunction1_t pServerFailedToRespond);
// Server has responded successfully and has updated data
virtual void ServerResponded(gameserveritem_t &server) override;
// Server failed to respond to the ping request
virtual void ServerFailedToRespond() override;
};
//-----------------------------------------------------------------------------
// Purpose: Callback interface for receiving responses after requesting details on
// who is playing on a particular server.
//
// These callbacks all occur in response to querying an individual server
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
// destructing an object that implements this interface then you should call
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
// which is in progress. Failure to cancel in progress queries when destructing
// a callback handler may result in a crash when a callback later occurs.
//-----------------------------------------------------------------------------
class BlitzISteamMatchmakingPlayersResponse : public ISteamMatchmakingPlayersResponse {
private:
void* m_pData;
BP_BlitzFunction4_t m_pAddPlayerToList;
BP_BlitzFunction1_t m_pPlayersFailedToRespond;
BP_BlitzFunction1_t m_pPlayersRefreshComplete;
public:
BlitzISteamMatchmakingPlayersResponse(void* pData, BP_BlitzFunction4_t pAddPlayerToList, BP_BlitzFunction1_t pPlayersFailedToRespond, BP_BlitzFunction1_t pPlayersRefreshComplete);
// Got data on a new player on the server -- you'll get this callback once per player
// on the server which you have requested player data on.
virtual void AddPlayerToList(const char *pchName, int nScore, float flTimePlayed) override;
// The server failed to respond to the request for player details
virtual void PlayersFailedToRespond() override;
// The server has finished responding to the player details request
// (ie, you won't get anymore AddPlayerToList callbacks)
virtual void PlayersRefreshComplete() override;
};
//-----------------------------------------------------------------------------
// Purpose: Callback interface for receiving responses after requesting rules
// details on a particular server.
//
// These callbacks all occur in response to querying an individual server
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
// destructing an object that implements this interface then you should call
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
// which is in progress. Failure to cancel in progress queries when destructing
// a callback handler may result in a crash when a callback later occurs.
//-----------------------------------------------------------------------------
class BlitzISteamMatchmakingRulesResponse : public ISteamMatchmakingRulesResponse {
private:
void* m_pData;
BP_BlitzFunction3_t m_pRulesResponded;
BP_BlitzFunction1_t m_pRulesFailedToRespond, m_pRulesRefreshComplete;
public:
BlitzISteamMatchmakingRulesResponse(void* pData, BP_BlitzFunction3_t pRulesResponded, BP_BlitzFunction1_t pRulesFailedToRespond, BP_BlitzFunction1_t pRulesRefreshComplete);
// Got data on a rule on the server -- you'll get one of these per rule defined on
// the server you are querying
virtual void RulesResponded(const char *pchRule, const char *pchValue) override;
// The server failed to respond to the request for rule details
virtual void RulesFailedToRespond() override;
// The server has finished responding to the rule details request
// (ie, you won't get anymore RulesResponded callbacks)
virtual void RulesRefreshComplete() override;
};
+17
View File
@@ -0,0 +1,17 @@
// 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 "SteamTypes.h"
+19
View File
@@ -0,0 +1,19 @@
// 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 "BlitzSteamInternal.h"
+168 -1
View File
@@ -16,8 +16,175 @@
#include "BlitzSteam.h"
//-----------------------------------------------------------------------------
// Purpose: Functions for match making services for clients to get to game lists and details
//-----------------------------------------------------------------------------
DLL(ISteamMatchmakingServers*) BS_SteamMatchmakingServers() {
return SteamMatchmakingServers();
}
#pragma message("SteamMatchmakingServers is not ported yet. TODO!")
// Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.
// Each call allocates a new asynchronous request object.
// Request object must be released by calling ReleaseRequest( hServerListRequest )
DLL(HServerListRequest) BS_ISteamMatchmakingServers_RequestInternetServerList(ISteamMatchmakingServers* pThis, AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) {
return pThis->RequestInternetServerList(iApp, ppchFilters, nFilters, pRequestServersResponse);
}
DLL(HServerListRequest) BS_ISteamMatchmakingServers_RequestLANServerList(ISteamMatchmakingServers* pThis, AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse) {
return pThis->RequestLANServerList(iApp, pRequestServersResponse);
}
DLL(HServerListRequest) BS_ISteamMatchmakingServers_RequestFriendsServerList(ISteamMatchmakingServers* pThis, AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) {
return pThis->RequestFriendsServerList(iApp, ppchFilters, nFilters, pRequestServersResponse);
}
DLL(HServerListRequest) BS_ISteamMatchmakingServers_RequestFavoritesServerList(ISteamMatchmakingServers* pThis, AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) {
return pThis->RequestFavoritesServerList(iApp, ppchFilters, nFilters, pRequestServersResponse);
}
DLL(HServerListRequest) BS_ISteamMatchmakingServers_RequestHistoryServerList(ISteamMatchmakingServers* pThis, AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) {
return pThis->RequestHistoryServerList(iApp, ppchFilters, nFilters, pRequestServersResponse);
}
DLL(HServerListRequest) BS_ISteamMatchmakingServers_RequestSpectatorServerList(ISteamMatchmakingServers* pThis, AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse) {
return pThis->RequestSpectatorServerList(iApp, ppchFilters, nFilters, pRequestServersResponse);
}
// Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress.
// RefreshComplete callback is not posted when request is released.
DLL(void) BS_ISteamMatchmakingServers_ReleaseRequest(ISteamMatchmakingServers* pThis, HServerListRequest hServerListRequest) {
pThis->ReleaseRequest(hServerListRequest);
}
/* the filter operation codes that go in the key part of MatchMakingKeyValuePair_t should be one of these:
"map"
- Server passes the filter if the server is playing the specified map.
"gamedataand"
- Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains all of the
specified strings. The value field is a comma-delimited list of strings to match.
"gamedataor"
- Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains at least one of the
specified strings. The value field is a comma-delimited list of strings to match.
"gamedatanor"
- Server passes the filter if the server's game data (ISteamGameServer::SetGameData) does not contain any
of the specified strings. The value field is a comma-delimited list of strings to check.
"gametagsand"
- Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) contains all
of the specified strings. The value field is a comma-delimited list of strings to check.
"gametagsnor"
- Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) does not contain any
of the specified strings. The value field is a comma-delimited list of strings to check.
"and" (x1 && x2 && ... && xn)
"or" (x1 || x2 || ... || xn)
"nand" !(x1 && x2 && ... && xn)
"nor" !(x1 || x2 || ... || xn)
- Performs Boolean operation on the following filters. The operand to this filter specifies
the "size" of the Boolean inputs to the operation, in Key/value pairs. (The keyvalue
pairs must immediately follow, i.e. this is a prefix logical operator notation.)
In the simplest case where Boolean expressions are not nested, this is simply
the number of operands.
For example, to match servers on a particular map or with a particular tag, would would
use these filters.
( server.map == "cp_dustbowl" || server.gametags.contains("payload") )
"or", "2"
"map", "cp_dustbowl"
"gametagsand", "payload"
If logical inputs are nested, then the operand specifies the size of the entire
"length" of its operands, not the number of immediate children.
( server.map == "cp_dustbowl" || ( server.gametags.contains("payload") && !server.gametags.contains("payloadrace") ) )
"or", "4"
"map", "cp_dustbowl"
"and", "2"
"gametagsand", "payload"
"gametagsnor", "payloadrace"
Unary NOT can be achieved using either "nand" or "nor" with a single operand.
"addr"
- Server passes the filter if the server's query address matches the specified IP or IP:port.
"gameaddr"
- Server passes the filter if the server's game address matches the specified IP or IP:port.
The following filter operations ignore the "value" part of MatchMakingKeyValuePair_t
"dedicated"
- Server passes the filter if it passed true to SetDedicatedServer.
"secure"
- Server passes the filter if the server is VAC-enabled.
"notfull"
- Server passes the filter if the player count is less than the reported max player count.
"hasplayers"
- Server passes the filter if the player count is greater than zero.
"noplayers"
- Server passes the filter if it doesn't have any players.
"linux"
- Server passes the filter if it's a linux server
*/
// Get details on a given server in the list, you can get the valid range of index
// values by calling GetServerCount(). You will also receive index values in
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
DLL(gameserveritem_t*) BS_ISteamMatchmakingServers_GetServerDetails(ISteamMatchmakingServers* pThis, HServerListRequest hRequest, int iServer) {
return pThis->GetServerDetails(hRequest, iServer);
}
// Cancel an request which is operation on the given list type. You should call this to cancel
// any in-progress requests before destructing a callback object that may have been passed
// to one of the above list request calls. Not doing so may result in a crash when a callback
// occurs on the destructed object.
// Canceling a query does not release the allocated request handle.
// The request handle must be released using ReleaseRequest( hRequest )
DLL(void) BS_ISteamMatchmakingServers_CancelQuery(ISteamMatchmakingServers* pThis, HServerListRequest hRequest) {
pThis->CancelQuery(hRequest);
}
// Ping every server in your list again but don't update the list of servers
// Query callback installed when the server list was requested will be used
// again to post notifications and RefreshComplete, so the callback must remain
// valid until another RefreshComplete is called on it or the request
// is released with ReleaseRequest( hRequest )
DLL(void) BS_ISteamMatchmakingServers_RefreshQuery(ISteamMatchmakingServers* pThis, HServerListRequest hRequest) {
pThis->RefreshQuery(hRequest);
}
// Returns true if the list is currently refreshing its server list
DLL(bool) BS_ISteamMatchmakingServers_IsRefreshing(ISteamMatchmakingServers* pThis, HServerListRequest hRequest) {
return pThis->IsRefreshing(hRequest);
}
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
DLL(int) BS_ISteamMatchmakingServers_GetServerCount(ISteamMatchmakingServers* pThis, HServerListRequest hRequest) {
return pThis->GetServerCount(hRequest);
}
// Refresh a single server inside of a query (rather than all the servers )
DLL(void) BS_ISteamMatchmakingServers_RefreshServer(ISteamMatchmakingServers* pThis, HServerListRequest hRequest, int iServer) {
pThis->RefreshServer(hRequest, iServer);
}
//-----------------------------------------------------------------------------
// Queries to individual servers directly via IP/Port
//-----------------------------------------------------------------------------
// Request updated ping time and other details from a single server
DLL(HServerQuery) BS_ISteamMatchmakingServers_PingServer(ISteamMatchmakingServers* pThis, uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse) {
return pThis->PingServer(unIP, usPort, pRequestServersResponse);
}
// Request the list of players currently playing on a server
DLL(HServerQuery) BS_ISteamMatchmakingServers_PlayerDetails(ISteamMatchmakingServers* pThis, uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse) {
return pThis->PlayerDetails(unIP, usPort, pRequestServersResponse);
}
// Request the list of rules that the server is running (See ISteamGameServer::SetKeyValue() to set the rules server side)
DLL(HServerQuery) BS_ISteamMatchmakingServers_ServerRules(ISteamMatchmakingServers* pThis, uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse) {
return pThis->ServerRules(unIP, usPort, pRequestServersResponse);
}
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
// any in-progress requests before destructing a callback object that may have been passed
// to one of the above calls to avoid crashing when callbacks occur.
DLL(void) BS_ISteamMatchmakingServers_CancelServerQuery(ISteamMatchmakingServers* pThis, HServerQuery hServerQuery) {
pThis->CancelServerQuery(hServerQuery);
}
+2 -2
View File
@@ -54,8 +54,8 @@ DLL(uint32_t) BS_ISteamNetworking_IsP2PPacketAvailable(ISteamNetworking* pThis,
// returns the size of the message and the steamID of the user who sent it in the last two parameters
// if the buffer passed in is too small, the message will be truncated
// this call is not blocking, and will return false if no data is available
DLL(uint32_t) BS_ISteamNetworking_ReadP2PPacket(ISteamNetworking* pThis, void* pubDest, uint32_t cubDest, uint32_t* pcubMsgSize, CSteamID* pSteamIDRemote, uint32_t nChannel) {
return pThis->ReadP2PPacket(pubDest, cubDest, pcubMsgSize, pSteamIDRemote, nChannel);
DLL(uint32_t) BS_ISteamNetworking_ReadP2PPacket(ISteamNetworking* pThis, void** pubDest, uint32_t cubDest, uint32_t* pcubMsgSize, CSteamID* pSteamIDRemote, uint32_t nChannel) {
return pThis->ReadP2PPacket(*pubDest, cubDest, pcubMsgSize, static_cast<CSteamID*>(pSteamIDRemote), nChannel);
}
// AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback
+1 -1
View File
@@ -141,7 +141,7 @@ DLL(HAuthTicket) BS_ISteamUser_GetAuthSessionTicket( ISteamUser* lpSteamUser, vo
// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
DLL(EBeginAuthSessionResult) BS_ISteamUser_BeginAuthSession( ISteamUser* lpSteamUser, const void *pAuthTicket, uint32_t cbAuthTicket, CSteamID* steamID ) {
DLL(EBeginAuthSessionResult) BS_ISteamUser_BeginAuthSession( ISteamUser* lpSteamUser, const void* pAuthTicket, uint32_t cbAuthTicket, CSteamID* steamID ) {
return lpSteamUser->BeginAuthSession( pAuthTicket, cbAuthTicket, *steamID );
}