lsteamclient: support ISteamNetworkingMessages

This commit is contained in:
Andrew Eikum 2020-09-29 09:40:02 -05:00
parent f22095c745
commit 30c21636c5
9 changed files with 165 additions and 4 deletions

View file

@ -0,0 +1,42 @@
#include "steam_defs.h"
#pragma push_macro("__cdecl")
#undef __cdecl
#include "steamworks_sdk_150/steam_api.h"
#include "steamworks_sdk_150/steamnetworkingtypes.h"
#include "steamworks_sdk_150/isteamnetworkingmessages.h"
#pragma pop_macro("__cdecl")
#include "steamclient_private.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDKVER_150
#include "struct_converters.h"
#include "cppISteamNetworkingMessages_SteamNetworkingMessages002.h"
EResult cppISteamNetworkingMessages_SteamNetworkingMessages002_SendMessageToUser(void *linux_side, const SteamNetworkingIdentity * identityRemote, const void * pubData, uint32 cubData, int nSendFlags, int nRemoteChannel)
{
return ((ISteamNetworkingMessages*)linux_side)->SendMessageToUser((const SteamNetworkingIdentity *)identityRemote, (const void *)pubData, (uint32)cubData, (int)nSendFlags, (int)nRemoteChannel);
}
bool cppISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser(void *linux_side, const SteamNetworkingIdentity * identityRemote)
{
return ((ISteamNetworkingMessages*)linux_side)->AcceptSessionWithUser((const SteamNetworkingIdentity *)identityRemote);
}
bool cppISteamNetworkingMessages_SteamNetworkingMessages002_CloseSessionWithUser(void *linux_side, const SteamNetworkingIdentity * identityRemote)
{
return ((ISteamNetworkingMessages*)linux_side)->CloseSessionWithUser((const SteamNetworkingIdentity *)identityRemote);
}
bool cppISteamNetworkingMessages_SteamNetworkingMessages002_CloseChannelWithUser(void *linux_side, const SteamNetworkingIdentity * identityRemote, int nLocalChannel)
{
return ((ISteamNetworkingMessages*)linux_side)->CloseChannelWithUser((const SteamNetworkingIdentity *)identityRemote, (int)nLocalChannel);
}
ESteamNetworkingConnectionState cppISteamNetworkingMessages_SteamNetworkingMessages002_GetSessionConnectionInfo(void *linux_side, const SteamNetworkingIdentity * identityRemote, SteamNetConnectionInfo_t * pConnectionInfo, SteamNetworkingQuickConnectionStatus * pQuickStatus)
{
return ((ISteamNetworkingMessages*)linux_side)->GetSessionConnectionInfo((const SteamNetworkingIdentity *)identityRemote, (SteamNetConnectionInfo_t *)pConnectionInfo, (SteamNetworkingQuickConnectionStatus *)pQuickStatus);
}
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,6 @@
extern EResult cppISteamNetworkingMessages_SteamNetworkingMessages002_SendMessageToUser(void *, const SteamNetworkingIdentity *, const void *, uint32, int, int);
extern int cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel(void *, int, winSteamNetworkingMessage_t_150 **, int);
extern bool cppISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser(void *, const SteamNetworkingIdentity *);
extern bool cppISteamNetworkingMessages_SteamNetworkingMessages002_CloseSessionWithUser(void *, const SteamNetworkingIdentity *);
extern bool cppISteamNetworkingMessages_SteamNetworkingMessages002_CloseChannelWithUser(void *, const SteamNetworkingIdentity *, int);
extern ESteamNetworkingConnectionState cppISteamNetworkingMessages_SteamNetworkingMessages002_GetSessionConnectionInfo(void *, const SteamNetworkingIdentity *, SteamNetConnectionInfo_t *, SteamNetworkingQuickConnectionStatus *);

View file

@ -142,6 +142,9 @@ files = [
("isteamparentalsettings.h", [
"ISteamParentalSettings"
]),
("isteamnetworkingmessages.h", [
"ISteamNetworkingMessages"
]),
("isteamnetworkingsockets.h", [
"ISteamNetworkingSockets"
]),
@ -210,6 +213,9 @@ manually_handled_methods = {
"cppISteamNetworkingUtils_SteamNetworkingUtils003": [
"AllocateMessage",
],
"cppISteamNetworkingMessages_SteamNetworkingMessages002": [
"ReceiveMessagesOnChannel"
],
}
# manual converters for simple types (function pointers)
@ -859,7 +865,10 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e
def get_iface_version(classname):
# ISteamClient -> STEAMCLIENT_INTERFACE_VERSION
defname = "%s_INTERFACE_VERSION" % classname[1:].upper()
if "SteamNetworkingMessages" in classname:
defname = "%s_VERSION" % classname[1:].upper()
else:
defname = "%s_INTERFACE_VERSION" % classname[1:].upper()
if defname in iface_versions.keys():
ver = iface_versions[defname]
else:
@ -1207,7 +1216,7 @@ for sdkver in sdk_versions:
for f in os.listdir("steamworks_sdk_%s" % sdkver):
x = open("steamworks_sdk_%s/%s" % (sdkver, f), "r")
for l in x:
if "INTERFACE_VERSION" in l:
if "define STEAM" in l and "_VERSION" in l:
result = prog.match(l)
if result:
iface, version = result.group(1, 2)

View file

@ -98,7 +98,8 @@ typedef uint32_t EUserUGCList,
ESteamIPv6ConnectivityState,
ESteamIPv6ConnectivityProtocol,
EDurationControlOnlineState,
ETextFilteringContext
ETextFilteringContext,
ESteamNetworkingConnectionState
;
/* XXX NO */

View file

@ -198,4 +198,14 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets009_SendMessages(
}
}
int cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel(
void *linux_side, int nLocalChannel,
winSteamNetworkingMessage_t_150 ** ppOutMessages, int nMaxMessages)
{
SteamNetworkingMessage_t *lin_ppOutMessages[nMaxMessages];
int retval = ((ISteamNetworkingMessages*)linux_side)->ReceiveMessagesOnChannel(nLocalChannel, lin_ppOutMessages, nMaxMessages);
lin_to_win_struct_SteamNetworkingMessage_t_150(retval, lin_ppOutMessages, ppOutMessages, nMaxMessages);
return retval;
}
}

View file

@ -2,7 +2,6 @@
#ifndef ISTEAMNETWORKINGMESSAGES
#define ISTEAMNETWORKINGMESSAGES
#pragma once
#include "steamnetworkingtypes.h"

View file

@ -0,0 +1,92 @@
/* This file is auto-generated, do not edit. */
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "cxx.h"
#include "steam_defs.h"
#include "steamclient_private.h"
#include "struct_converters.h"
WINE_DEFAULT_DEBUG_CHANNEL(steamclient);
#include "cppISteamNetworkingMessages_SteamNetworkingMessages002.h"
typedef struct __winISteamNetworkingMessages_SteamNetworkingMessages002 {
vtable_ptr *vtable;
void *linux_side;
} winISteamNetworkingMessages_SteamNetworkingMessages002;
DEFINE_THISCALL_WRAPPER(winISteamNetworkingMessages_SteamNetworkingMessages002_SendMessageToUser, 24)
EResult __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_SendMessageToUser(winISteamNetworkingMessages_SteamNetworkingMessages002 *_this, const SteamNetworkingIdentity * identityRemote, const void * pubData, uint32 cubData, int nSendFlags, int nRemoteChannel)
{
TRACE("%p\n", _this);
return cppISteamNetworkingMessages_SteamNetworkingMessages002_SendMessageToUser(_this->linux_side, identityRemote, pubData, cubData, nSendFlags, nRemoteChannel);
}
DEFINE_THISCALL_WRAPPER(winISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel, 16)
int __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel(winISteamNetworkingMessages_SteamNetworkingMessages002 *_this, int nLocalChannel, winSteamNetworkingMessage_t_150 ** ppOutMessages, int nMaxMessages)
{
TRACE("%p\n", _this);
return cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel(_this->linux_side, nLocalChannel, ppOutMessages, nMaxMessages);
}
DEFINE_THISCALL_WRAPPER(winISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser, 8)
bool __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser(winISteamNetworkingMessages_SteamNetworkingMessages002 *_this, const SteamNetworkingIdentity * identityRemote)
{
TRACE("%p\n", _this);
return cppISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser(_this->linux_side, identityRemote);
}
DEFINE_THISCALL_WRAPPER(winISteamNetworkingMessages_SteamNetworkingMessages002_CloseSessionWithUser, 8)
bool __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_CloseSessionWithUser(winISteamNetworkingMessages_SteamNetworkingMessages002 *_this, const SteamNetworkingIdentity * identityRemote)
{
TRACE("%p\n", _this);
return cppISteamNetworkingMessages_SteamNetworkingMessages002_CloseSessionWithUser(_this->linux_side, identityRemote);
}
DEFINE_THISCALL_WRAPPER(winISteamNetworkingMessages_SteamNetworkingMessages002_CloseChannelWithUser, 12)
bool __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_CloseChannelWithUser(winISteamNetworkingMessages_SteamNetworkingMessages002 *_this, const SteamNetworkingIdentity * identityRemote, int nLocalChannel)
{
TRACE("%p\n", _this);
return cppISteamNetworkingMessages_SteamNetworkingMessages002_CloseChannelWithUser(_this->linux_side, identityRemote, nLocalChannel);
}
DEFINE_THISCALL_WRAPPER(winISteamNetworkingMessages_SteamNetworkingMessages002_GetSessionConnectionInfo, 16)
ESteamNetworkingConnectionState __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_GetSessionConnectionInfo(winISteamNetworkingMessages_SteamNetworkingMessages002 *_this, const SteamNetworkingIdentity * identityRemote, SteamNetConnectionInfo_t * pConnectionInfo, SteamNetworkingQuickConnectionStatus * pQuickStatus)
{
TRACE("%p\n", _this);
return cppISteamNetworkingMessages_SteamNetworkingMessages002_GetSessionConnectionInfo(_this->linux_side, identityRemote, pConnectionInfo, pQuickStatus);
}
extern vtable_ptr winISteamNetworkingMessages_SteamNetworkingMessages002_vtable;
#ifndef __GNUC__
void __asm_dummy_vtables(void) {
#endif
__ASM_VTABLE(winISteamNetworkingMessages_SteamNetworkingMessages002,
VTABLE_ADD_FUNC(winISteamNetworkingMessages_SteamNetworkingMessages002_SendMessageToUser)
VTABLE_ADD_FUNC(winISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel)
VTABLE_ADD_FUNC(winISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser)
VTABLE_ADD_FUNC(winISteamNetworkingMessages_SteamNetworkingMessages002_CloseSessionWithUser)
VTABLE_ADD_FUNC(winISteamNetworkingMessages_SteamNetworkingMessages002_CloseChannelWithUser)
VTABLE_ADD_FUNC(winISteamNetworkingMessages_SteamNetworkingMessages002_GetSessionConnectionInfo)
);
#ifndef __GNUC__
}
#endif
winISteamNetworkingMessages_SteamNetworkingMessages002 *create_winISteamNetworkingMessages_SteamNetworkingMessages002(void *linux_side)
{
winISteamNetworkingMessages_SteamNetworkingMessages002 *r = HeapAlloc(GetProcessHeap(), 0, sizeof(winISteamNetworkingMessages_SteamNetworkingMessages002));
TRACE("-> %p\n", r);
r->vtable = &winISteamNetworkingMessages_SteamNetworkingMessages002_vtable;
r->linux_side = linux_side;
return r;
}

View file

@ -27,6 +27,7 @@ extern void *create_winISteamGameServer_SteamGameServer013(void *);
extern void *create_winISteamGameServerStats_SteamGameServerStats001(void *);
extern void *create_winISteamGameCoordinator_SteamGameCoordinator001(void *);
extern void *create_winISteamParentalSettings_STEAMPARENTALSETTINGS_INTERFACE_VERSION001(void *);
extern void *create_winISteamNetworkingMessages_SteamNetworkingMessages002(void *);
extern void *create_winISteamNetworkingSockets_SteamNetworkingSockets009(void *);
extern void *create_winISteamNetworkingUtils_SteamNetworkingUtils003(void *);
extern void *create_winISteamUtils_SteamUtils009(void *);

View file

@ -27,6 +27,7 @@
{"SteamGameServerStats001", &create_winISteamGameServerStats_SteamGameServerStats001},
{"SteamGameCoordinator001", &create_winISteamGameCoordinator_SteamGameCoordinator001},
{"STEAMPARENTALSETTINGS_INTERFACE_VERSION001", &create_winISteamParentalSettings_STEAMPARENTALSETTINGS_INTERFACE_VERSION001},
{"SteamNetworkingMessages002", &create_winISteamNetworkingMessages_SteamNetworkingMessages002},
{"SteamNetworkingSockets009", &create_winISteamNetworkingSockets_SteamNetworkingSockets009},
{"SteamNetworkingUtils003", &create_winISteamNetworkingUtils_SteamNetworkingUtils003},
{"SteamUtils009", &create_winISteamUtils_SteamUtils009},