diff --git a/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers001.cpp b/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers001.cpp index 339e76f1..9eb9278b 100644 --- a/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers001.cpp +++ b/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers001.cpp @@ -8,50 +8,32 @@ extern "C" { #endif void cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestInternetServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); ((ISteamMatchmakingServers*)linux_side)->RequestInternetServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestLANServerList(void *linux_side, AppId_t iApp, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); ((ISteamMatchmakingServers*)linux_side)->RequestLANServerList((AppId_t)iApp, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestFriendsServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); ((ISteamMatchmakingServers*)linux_side)->RequestFriendsServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestFavoritesServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); ((ISteamMatchmakingServers*)linux_side)->RequestFavoritesServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestHistoryServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); ((ISteamMatchmakingServers*)linux_side)->RequestHistoryServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestSpectatorServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); ((ISteamMatchmakingServers*)linux_side)->RequestSpectatorServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); } gameserveritem_t * cppISteamMatchmakingServers_SteamMatchMakingServers001_GetServerDetails(void *linux_side, EMatchMakingType eType, int iServer) @@ -86,29 +68,17 @@ void cppISteamMatchmakingServers_SteamMatchMakingServers001_RefreshServer(void * HServerQuery cppISteamMatchmakingServers_SteamMatchMakingServers001_PingServer(void *linux_side, uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse * pRequestServersResponse) { - ISteamMatchmakingPingResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingPingResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); - HServerQuery retval = ((ISteamMatchmakingServers*)linux_side)->PingServer((uint32)unIP, (uint16)usPort, &lin_pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingPingResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->PingServer((uint32)unIP, (uint16)usPort, (ISteamMatchmakingPingResponse *)pRequestServersResponse); } HServerQuery cppISteamMatchmakingServers_SteamMatchMakingServers001_PlayerDetails(void *linux_side, uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse * pRequestServersResponse) { - ISteamMatchmakingPlayersResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingPlayersResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); - HServerQuery retval = ((ISteamMatchmakingServers*)linux_side)->PlayerDetails((uint32)unIP, (uint16)usPort, &lin_pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingPlayersResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->PlayerDetails((uint32)unIP, (uint16)usPort, (ISteamMatchmakingPlayersResponse *)pRequestServersResponse); } HServerQuery cppISteamMatchmakingServers_SteamMatchMakingServers001_ServerRules(void *linux_side, uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse * pRequestServersResponse) { - ISteamMatchmakingRulesResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingRulesResponse_105(pRequestServersResponse, &lin_pRequestServersResponse); - HServerQuery retval = ((ISteamMatchmakingServers*)linux_side)->ServerRules((uint32)unIP, (uint16)usPort, &lin_pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingRulesResponse_105(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->ServerRules((uint32)unIP, (uint16)usPort, (ISteamMatchmakingRulesResponse *)pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers001_CancelServerQuery(void *linux_side, HServerQuery hServerQuery) diff --git a/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers002.cpp b/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers002.cpp index bb48d40a..909b2f18 100644 --- a/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers002.cpp +++ b/lsteamclient/cppISteamMatchmakingServers_SteamMatchMakingServers002.cpp @@ -8,56 +8,32 @@ extern "C" { #endif HServerListRequest cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestInternetServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerListRequest retval = ((ISteamMatchmakingServers*)linux_side)->RequestInternetServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->RequestInternetServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); } HServerListRequest cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestLANServerList(void *linux_side, AppId_t iApp, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerListRequest retval = ((ISteamMatchmakingServers*)linux_side)->RequestLANServerList((AppId_t)iApp, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->RequestLANServerList((AppId_t)iApp, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); } HServerListRequest cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestFriendsServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerListRequest retval = ((ISteamMatchmakingServers*)linux_side)->RequestFriendsServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->RequestFriendsServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); } HServerListRequest cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestFavoritesServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerListRequest retval = ((ISteamMatchmakingServers*)linux_side)->RequestFavoritesServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->RequestFavoritesServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); } HServerListRequest cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestHistoryServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerListRequest retval = ((ISteamMatchmakingServers*)linux_side)->RequestHistoryServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->RequestHistoryServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); } HServerListRequest cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestSpectatorServerList(void *linux_side, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { - ISteamMatchmakingServerListResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingServerListResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerListRequest retval = ((ISteamMatchmakingServers*)linux_side)->RequestSpectatorServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingServerListResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->RequestSpectatorServerList((AppId_t)iApp, (MatchMakingKeyValuePair_t **)ppchFilters, (uint32)nFilters, (ISteamMatchmakingServerListResponse *)pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers002_ReleaseRequest(void *linux_side, HServerListRequest hServerListRequest) @@ -97,29 +73,17 @@ void cppISteamMatchmakingServers_SteamMatchMakingServers002_RefreshServer(void * HServerQuery cppISteamMatchmakingServers_SteamMatchMakingServers002_PingServer(void *linux_side, uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse * pRequestServersResponse) { - ISteamMatchmakingPingResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingPingResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerQuery retval = ((ISteamMatchmakingServers*)linux_side)->PingServer((uint32)unIP, (uint16)usPort, &lin_pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingPingResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->PingServer((uint32)unIP, (uint16)usPort, (ISteamMatchmakingPingResponse *)pRequestServersResponse); } HServerQuery cppISteamMatchmakingServers_SteamMatchMakingServers002_PlayerDetails(void *linux_side, uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse * pRequestServersResponse) { - ISteamMatchmakingPlayersResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingPlayersResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerQuery retval = ((ISteamMatchmakingServers*)linux_side)->PlayerDetails((uint32)unIP, (uint16)usPort, &lin_pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingPlayersResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->PlayerDetails((uint32)unIP, (uint16)usPort, (ISteamMatchmakingPlayersResponse *)pRequestServersResponse); } HServerQuery cppISteamMatchmakingServers_SteamMatchMakingServers002_ServerRules(void *linux_side, uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse * pRequestServersResponse) { - ISteamMatchmakingRulesResponse lin_pRequestServersResponse; - win_to_lin_struct_ISteamMatchmakingRulesResponse_142(pRequestServersResponse, &lin_pRequestServersResponse); - HServerQuery retval = ((ISteamMatchmakingServers*)linux_side)->ServerRules((uint32)unIP, (uint16)usPort, &lin_pRequestServersResponse); - lin_to_win_struct_ISteamMatchmakingRulesResponse_142(&lin_pRequestServersResponse, pRequestServersResponse); - return retval; + return ((ISteamMatchmakingServers*)linux_side)->ServerRules((uint32)unIP, (uint16)usPort, (ISteamMatchmakingRulesResponse *)pRequestServersResponse); } void cppISteamMatchmakingServers_SteamMatchMakingServers002_CancelServerQuery(void *linux_side, HServerQuery hServerQuery) diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 01599156..78f96e94 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -151,6 +151,14 @@ exempt_structs = [ "MatchMakingKeyValuePair_t" ] +# callback classes for which we have a linux wrapper +wrapped_classes = [ + "ISteamMatchmakingServerListResponse", + "ISteamMatchmakingPingResponse", + "ISteamMatchmakingPlayersResponse", + "ISteamMatchmakingRulesResponse" +] + print_sizes = [] class_versions = {} @@ -217,7 +225,8 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e while real_type.kind == clang.cindex.TypeKind.POINTER: real_type = real_type.get_pointee() if real_type.kind == clang.cindex.TypeKind.RECORD and \ - not real_type.spelling in exempt_structs: + not real_type.spelling in exempt_structs and \ + not real_type.spelling in wrapped_classes: need_convert.append(param) if param.spelling == "": @@ -295,8 +304,9 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e cfile.write(", _%s" % unnamed) cpp.write("(%s)_%s" % (param.type.spelling, unnamed)) unnamed = chr(ord(unnamed) + 1) - elif "ISteamMatchmakingServerListResponse" in param.type.spelling: - cfile.write(", create_LinuxMatchmakingServerListResponse(%s)" % param.spelling) + elif param.type.kind == clang.cindex.TypeKind.POINTER and \ + param.type.get_pointee().spelling in wrapped_classes: + cfile.write(", create_Linux%s(%s)" % (param.type.get_pointee().spelling, param.spelling)) cpp.write("(%s)%s" % (param.type.spelling, param.spelling)) elif param in need_convert: cfile.write(", %s" % param.spelling) diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index deb0632d..452e5fee 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -30,7 +30,10 @@ typedef struct __winX winX; void *create_win_interface(const char *name, void *linux_side); unsigned int steamclient_unix_path_to_dos_path(unsigned int api_result, char *inout, unsigned int inout_bytes); -void *create_LinuxMatchmakingServerListResponse(void *win); +void *create_LinuxISteamMatchmakingServerListResponse(void *win); +void *create_LinuxISteamMatchmakingPingResponse(void *win); +void *create_LinuxISteamMatchmakingPlayersResponse(void *win); +void *create_LinuxISteamMatchmakingRulesResponse(void *win); #define TRACE WINE_TRACE #define ERR WINE_ERR diff --git a/lsteamclient/steamclient_wrappers.c b/lsteamclient/steamclient_wrappers.c index 99c56b89..e738ba91 100644 --- a/lsteamclient/steamclient_wrappers.c +++ b/lsteamclient/steamclient_wrappers.c @@ -39,6 +39,7 @@ DEFINE_VTBL_WRAPPER(48); #endif +/***** ISteamMatchmakingServerListResponse *****/ typedef struct winServerListResponse { const vtable_ptr *vtable; } winServerListResponse; @@ -78,10 +79,11 @@ struct gccServerListResponseVtbl { gccServerListResponse_RefreshComplete }; -void *create_LinuxMatchmakingServerListResponse(void *win) +void *create_LinuxISteamMatchmakingServerListResponse(void *win) { struct gccServerListResponse *ret; + /* FIXME: When is it save to free this? CancelServerQuery? */ ret = (struct gccServerListResponse *)HeapAlloc(GetProcessHeap(), 0, sizeof(*ret)); if(!ret) return NULL; @@ -91,3 +93,156 @@ void *create_LinuxMatchmakingServerListResponse(void *win) return ret; } + +/***** ISteamMatchmakingPingResponse *****/ +typedef struct winPingResponse { + const vtable_ptr *vtable; +} winPingResponse; + +struct gccPingResponse { + void *vtable; + struct winPingResponse *win_side; +}; + +void gccPingResponse_ServerResponded(struct gccPingResponse *_this, gameserveritem_t *server) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 0, void, (winPingResponse *, gameserveritem_t *), (_this->win_side, server)); +} + +void gccPingResponse_ServerFailedToRespond(struct gccPingResponse *_this) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 4, void, (winPingResponse *), (_this->win_side)); +} + +struct gccPingResponseVtbl { + void (*ServerResponded)(struct gccPingResponse *, gameserveritem_t *); + + void (*ServerFailedToRespond)(struct gccPingResponse *); +} gccPingResponse_vtbl = { + gccPingResponse_ServerResponded, + gccPingResponse_ServerFailedToRespond +}; + +void *create_LinuxISteamMatchmakingPingResponse(void *win) +{ + struct gccPingResponse *ret; + + ret = (struct gccPingResponse *)HeapAlloc(GetProcessHeap(), 0, sizeof(*ret)); + if(!ret) + return NULL; + + ret->vtable = &gccPingResponse_vtbl; + ret->win_side = (struct winPingResponse*)win; + + return ret; +} + +/***** ISteamMatchmakingPlayersResponse *****/ +typedef struct winPlayersResponse { + const vtable_ptr *vtable; +} winPlayersResponse; + +struct gccPlayersResponse { + void *vtable; + struct winPlayersResponse *win_side; +}; + +void gccPlayersResponse_AddPlayerToList(struct gccPlayersResponse *_this, const char *pchName, int nScore, float flTimePlayed) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 0, void, (winPlayersResponse *, const char *, int, float), (_this->win_side, pchName, nScore, flTimePlayed)); +} + +void gccPlayersResponse_PlayersFailedToRespond(struct gccPlayersResponse *_this) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 4, void, (winPlayersResponse *), (_this->win_side)); +} + +void gccPlayersResponse_PlayersRefreshComplete(struct gccPlayersResponse *_this) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 8, void, (winPlayersResponse *), (_this->win_side)); +} + +struct gccPlayersResponseVtbl { + void (*AddPlayerToList)(struct gccPlayersResponse *, const char *, int, float); + + void (*PlayersFailedToRespond)(struct gccPlayersResponse *); + + void (*PlayersRefreshComplete)(struct gccPlayersResponse *); +} gccPlayersResponse_vtbl = { + gccPlayersResponse_AddPlayerToList, + gccPlayersResponse_PlayersFailedToRespond, + gccPlayersResponse_PlayersRefreshComplete +}; + +void *create_LinuxISteamMatchmakingPlayersResponse(void *win) +{ + struct gccPlayersResponse *ret; + + ret = (struct gccPlayersResponse *)HeapAlloc(GetProcessHeap(), 0, sizeof(*ret)); + if(!ret) + return NULL; + + ret->vtable = &gccPlayersResponse_vtbl; + ret->win_side = (struct winPlayersResponse*)win; + + return ret; +} + +/***** ISteamMatchmakingRulesResponse *****/ +typedef struct winRulesResponse { + const vtable_ptr *vtable; +} winRulesResponse; + +struct gccRulesResponse { + void *vtable; + struct winRulesResponse *win_side; +}; + +void gccRulesResponse_RulesResponded(struct gccRulesResponse *_this, const char *pchRule, const char *pchValue) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 0, void, (winRulesResponse *, const char *, const char *), (_this->win_side, pchRule, pchValue)); +} + +void gccRulesResponse_RulesFailedToRespond(struct gccRulesResponse *_this) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 4, void, (winRulesResponse *), (_this->win_side)); +} + +void gccRulesResponse_RulesRefreshComplete(struct gccRulesResponse *_this) +{ + TRACE("%p/%p\n", _this, _this->win_side); + CALL_VTBL_FUNC(_this->win_side, 8, void, (winRulesResponse *), (_this->win_side)); +} + +struct gccRulesResponseVtbl { + void (*RulesResponded)(struct gccRulesResponse *, const char *, const char*); + + void (*RulesFailedToRespond)(struct gccRulesResponse *); + + void (*RulesRefreshComplete)(struct gccRulesResponse *); +} gccRulesResponse_vtbl = { + gccRulesResponse_RulesResponded, + gccRulesResponse_RulesFailedToRespond, + gccRulesResponse_RulesRefreshComplete +}; + +void *create_LinuxISteamMatchmakingRulesResponse(void *win) +{ + struct gccRulesResponse *ret; + + ret = (struct gccRulesResponse *)HeapAlloc(GetProcessHeap(), 0, sizeof(*ret)); + if(!ret) + return NULL; + + ret->vtable = &gccRulesResponse_vtbl; + ret->win_side = (struct winRulesResponse*)win; + + return ret; +} diff --git a/lsteamclient/winISteamMatchmakingServers.c b/lsteamclient/winISteamMatchmakingServers.c index a5a63bbb..86c342d8 100644 --- a/lsteamclient/winISteamMatchmakingServers.c +++ b/lsteamclient/winISteamMatchmakingServers.c @@ -24,42 +24,42 @@ DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_R HServerListRequest __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_RequestInternetServerList(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestInternetServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestInternetServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_RequestLANServerList, 12) HServerListRequest __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_RequestLANServerList(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, AppId_t iApp, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestLANServerList(_this->linux_side, iApp, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestLANServerList(_this->linux_side, iApp, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_RequestFriendsServerList, 20) HServerListRequest __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_RequestFriendsServerList(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestFriendsServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestFriendsServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_RequestFavoritesServerList, 20) HServerListRequest __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_RequestFavoritesServerList(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestFavoritesServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestFavoritesServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_RequestHistoryServerList, 20) HServerListRequest __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_RequestHistoryServerList(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestHistoryServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestHistoryServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_RequestSpectatorServerList, 20) HServerListRequest __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_RequestSpectatorServerList(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestSpectatorServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_RequestSpectatorServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_ReleaseRequest, 8) @@ -115,21 +115,21 @@ DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_P HServerQuery __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_PingServer(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_PingServer(_this->linux_side, unIP, usPort, pRequestServersResponse); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_PingServer(_this->linux_side, unIP, usPort, create_LinuxISteamMatchmakingPingResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_PlayerDetails, 14) HServerQuery __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_PlayerDetails(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_PlayerDetails(_this->linux_side, unIP, usPort, pRequestServersResponse); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_PlayerDetails(_this->linux_side, unIP, usPort, create_LinuxISteamMatchmakingPlayersResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_ServerRules, 14) HServerQuery __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_ServerRules(winISteamMatchmakingServers_SteamMatchMakingServers002 *_this, uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers002_ServerRules(_this->linux_side, unIP, usPort, pRequestServersResponse); + return cppISteamMatchmakingServers_SteamMatchMakingServers002_ServerRules(_this->linux_side, unIP, usPort, create_LinuxISteamMatchmakingRulesResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers002_CancelServerQuery, 8) @@ -187,42 +187,42 @@ DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_R void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_RequestInternetServerList(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestInternetServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestInternetServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_RequestLANServerList, 12) void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_RequestLANServerList(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, AppId_t iApp, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestLANServerList(_this->linux_side, iApp, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestLANServerList(_this->linux_side, iApp, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_RequestFriendsServerList, 20) void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_RequestFriendsServerList(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestFriendsServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestFriendsServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_RequestFavoritesServerList, 20) void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_RequestFavoritesServerList(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestFavoritesServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestFavoritesServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_RequestHistoryServerList, 20) void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_RequestHistoryServerList(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestHistoryServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestHistoryServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_RequestSpectatorServerList, 20) void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_RequestSpectatorServerList(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, AppId_t iApp, MatchMakingKeyValuePair_t ** ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse * pRequestServersResponse) { TRACE("%p\n", _this); - cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestSpectatorServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxMatchmakingServerListResponse(pRequestServersResponse)); + cppISteamMatchmakingServers_SteamMatchMakingServers001_RequestSpectatorServerList(_this->linux_side, iApp, ppchFilters, nFilters, create_LinuxISteamMatchmakingServerListResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_GetServerDetails, 12) @@ -271,21 +271,21 @@ DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_P HServerQuery __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_PingServer(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers001_PingServer(_this->linux_side, unIP, usPort, pRequestServersResponse); + return cppISteamMatchmakingServers_SteamMatchMakingServers001_PingServer(_this->linux_side, unIP, usPort, create_LinuxISteamMatchmakingPingResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_PlayerDetails, 14) HServerQuery __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_PlayerDetails(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers001_PlayerDetails(_this->linux_side, unIP, usPort, pRequestServersResponse); + return cppISteamMatchmakingServers_SteamMatchMakingServers001_PlayerDetails(_this->linux_side, unIP, usPort, create_LinuxISteamMatchmakingPlayersResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_ServerRules, 14) HServerQuery __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_ServerRules(winISteamMatchmakingServers_SteamMatchMakingServers001 *_this, uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse * pRequestServersResponse) { TRACE("%p\n", _this); - return cppISteamMatchmakingServers_SteamMatchMakingServers001_ServerRules(_this->linux_side, unIP, usPort, pRequestServersResponse); + return cppISteamMatchmakingServers_SteamMatchMakingServers001_ServerRules(_this->linux_side, unIP, usPort, create_LinuxISteamMatchmakingRulesResponse(pRequestServersResponse)); } DEFINE_THISCALL_WRAPPER(winISteamMatchmakingServers_SteamMatchMakingServers001_CancelServerQuery, 8)