From 5ed5cbf28653c762629c0a900a4500586d7dab45 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 30 May 2019 11:22:11 -0500 Subject: [PATCH] lsteamclient: Fix SteamNetConnectionStatusChangedCallback_t conversion It was declared inside an extern "C" block in the SDK, which for some reason cindex doesn't include. --- lsteamclient/cb_converters.dat | 1 + lsteamclient/cb_converters.h | 4 ++++ lsteamclient/cb_getapi_sizes.dat | 2 ++ lsteamclient/cb_getapi_table.dat | 6 ++++++ lsteamclient/gen_wrapper.py | 2 ++ .../steamworks_sdk_144/isteamnetworkingsockets.h | 2 +- lsteamclient/struct_converters_144.cpp | 15 +++++++++++++++ 7 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lsteamclient/cb_converters.dat b/lsteamclient/cb_converters.dat index a39a92f1..d27b2192 100644 --- a/lsteamclient/cb_converters.dat +++ b/lsteamclient/cb_converters.dat @@ -45,6 +45,7 @@ case 0x000c0d59: win_msg->m_cubParam = 16; win_msg->m_pubParam = HeapAlloc(GetPr case 0x000c11a4: win_msg->m_cubParam = 12; win_msg->m_pubParam = HeapAlloc(GetProcessHeap(), 0, win_msg->m_cubParam); cb_HTML_FileOpenDialog_t_12((void*)lin_msg.m_pubParam, (void*)win_msg->m_pubParam); break; case 0x00141260: win_msg->m_cubParam = 24; win_msg->m_pubParam = HeapAlloc(GetProcessHeap(), 0, win_msg->m_cubParam); cb_SteamInventoryStartPurchaseResult_t_24((void*)lin_msg.m_pubParam, (void*)win_msg->m_pubParam); break; case 0x002000d1: win_msg->m_cubParam = 40; win_msg->m_pubParam = HeapAlloc(GetProcessHeap(), 0, win_msg->m_cubParam); cb_GSReputation_t_40((void*)lin_msg.m_pubParam, (void*)win_msg->m_pubParam); break; +case 0x02c004c5: win_msg->m_cubParam = 712; win_msg->m_pubParam = HeapAlloc(GetProcessHeap(), 0, win_msg->m_cubParam); cb_SteamNetConnectionStatusChangedCallback_t_712((void*)lin_msg.m_pubParam, (void*)win_msg->m_pubParam); break; case 0x00140835: win_msg->m_cubParam = 24; win_msg->m_pubParam = HeapAlloc(GetProcessHeap(), 0, win_msg->m_cubParam); cb_HTTPRequestCompleted_t_24((void*)lin_msg.m_pubParam, (void*)win_msg->m_pubParam); break; case 0x26240d4a: win_msg->m_cubParam = 9776; win_msg->m_pubParam = HeapAlloc(GetProcessHeap(), 0, win_msg->m_cubParam); cb_SteamUGCRequestUGCDetailsResult_t_9776((void*)lin_msg.m_pubParam, (void*)win_msg->m_pubParam); break; case 0x000c051b: win_msg->m_cubParam = 16; win_msg->m_pubParam = HeapAlloc(GetProcessHeap(), 0, win_msg->m_cubParam); cb_RemoteStorageFileShareResult_t_16((void*)lin_msg.m_pubParam, (void*)win_msg->m_pubParam); break; diff --git a/lsteamclient/cb_converters.h b/lsteamclient/cb_converters.h index 55c1e482..3bd57559 100644 --- a/lsteamclient/cb_converters.h +++ b/lsteamclient/cb_converters.h @@ -186,6 +186,10 @@ struct GSReputation_t; struct winGSReputation_t_40; extern void cb_GSReputation_t_40(const struct GSReputation_t *l, struct winGSReputation_t_40 *w); +struct SteamNetConnectionStatusChangedCallback_t; +struct winSteamNetConnectionStatusChangedCallback_t_712; +extern void cb_SteamNetConnectionStatusChangedCallback_t_712(const struct SteamNetConnectionStatusChangedCallback_t *l, struct winSteamNetConnectionStatusChangedCallback_t_712 *w); + struct HTTPRequestCompleted_t; struct winHTTPRequestCompleted_t_24; extern void cb_HTTPRequestCompleted_t_24(const struct HTTPRequestCompleted_t *l, struct winHTTPRequestCompleted_t_24 *w); diff --git a/lsteamclient/cb_getapi_sizes.dat b/lsteamclient/cb_getapi_sizes.dat index c4be0984..8845f0e6 100644 --- a/lsteamclient/cb_getapi_sizes.dat +++ b/lsteamclient/cb_getapi_sizes.dat @@ -54,6 +54,8 @@ case 2103: /* HTTPRequestDataReceived_t_24 */ return 20; case 2101: /* HTTPRequestCompleted_t_32 */ return 24; +case 1221: /* SteamNetConnectionStatusChangedCallback_t_712 */ + return 704; case 2102: /* HTTPRequestHeadersReceived_t_16 */ return 12; case 3402: /* SteamUGCRequestUGCDetailsResult_t_9784 */ diff --git a/lsteamclient/cb_getapi_table.dat b/lsteamclient/cb_getapi_table.dat index bc637245..8d2b82af 100644 --- a/lsteamclient/cb_getapi_table.dat +++ b/lsteamclient/cb_getapi_table.dat @@ -173,6 +173,12 @@ case 2101: case 24: cb_HTTPRequestCompleted_t_24(lin_callback, callback); break; } break; +case 1221: + switch(callback_len){ + default: + case 712: cb_SteamNetConnectionStatusChangedCallback_t_712(lin_callback, callback); break; + } + break; case 2102: switch(callback_len){ default: diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index c6130f06..0eae340b 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -874,6 +874,8 @@ def handle_struct(sdkver, struct): cppfile.write("#include \"steam_defs.h\"\n") cppfile.write("#include \"steamworks_sdk_%s/steam_api.h\"\n" % sdkver) cppfile.write("#include \"steamworks_sdk_%s/isteamgameserver.h\"\n" % (sdkver)) + if os.path.isfile("steamworks_sdk_%s/isteamnetworkingsockets.h" % sdkver): + cppfile.write("#include \"steamworks_sdk_%s/isteamnetworkingsockets.h\"\n" % (sdkver)) if os.path.isfile("steamworks_sdk_%s/isteamgameserverstats.h" % sdkver): cppfile.write("#include \"steamworks_sdk_%s/isteamgameserverstats.h\"\n" % (sdkver)) if os.path.isfile("steamworks_sdk_%s/isteamgamecoordinator.h" % sdkver): diff --git a/lsteamclient/steamworks_sdk_144/isteamnetworkingsockets.h b/lsteamclient/steamworks_sdk_144/isteamnetworkingsockets.h index a9befc09..774d45a8 100644 --- a/lsteamclient/steamworks_sdk_144/isteamnetworkingsockets.h +++ b/lsteamclient/steamworks_sdk_144/isteamnetworkingsockets.h @@ -424,6 +424,7 @@ extern "C" { inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets(); STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamGameServerNetworkingSockets, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); #endif +} /// Callback struct used to notify when a connection has changed state #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -484,6 +485,5 @@ struct SteamNetConnectionStatusChangedCallback_t }; #pragma pack( pop ) -} #endif // ISTEAMNETWORKINGSOCKETS diff --git a/lsteamclient/struct_converters_144.cpp b/lsteamclient/struct_converters_144.cpp index 71758c16..44a9c05b 100644 --- a/lsteamclient/struct_converters_144.cpp +++ b/lsteamclient/struct_converters_144.cpp @@ -1,6 +1,7 @@ #include "steam_defs.h" #include "steamworks_sdk_144/steam_api.h" #include "steamworks_sdk_144/isteamgameserver.h" +#include "steamworks_sdk_144/isteamnetworkingsockets.h" #include "steamworks_sdk_144/isteamgameserverstats.h" #include "steamworks_sdk_144/isteamgamecoordinator.h" #include "steamworks_sdk_144/steamnetworkingtypes.h" @@ -841,5 +842,19 @@ void cb_GSReputation_t_40(const struct GSReputation_t *lin, struct winGSReputati win->m_unBanExpires = lin->m_unBanExpires; } +#pragma pack( push, 8 ) +struct winSteamNetConnectionStatusChangedCallback_t_712 { + HSteamNetConnection m_hConn; + SteamNetConnectionInfo_t m_info; + ESteamNetworkingConnectionState m_eOldState; +} __attribute__ ((ms_struct)); +#pragma pack( pop ) +void cb_SteamNetConnectionStatusChangedCallback_t_712(const struct SteamNetConnectionStatusChangedCallback_t *lin, struct winSteamNetConnectionStatusChangedCallback_t_712 *win) +{ + win->m_hConn = lin->m_hConn; + win->m_info = lin->m_info; + win->m_eOldState = lin->m_eOldState; +} + }