1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
using System;
using System.Runtime.InteropServices;
namespace Steamworks;
public static class SteamMatchmaking
{
public static int GetFavoriteGameCount()
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_GetFavoriteGameCount(CSteamAPIContext.GetSteamMatchmaking());
}
public static bool GetFavoriteGame(int iGame, out AppId_t pnAppID, out uint pnIP, out ushort pnConnPort, out ushort pnQueryPort, out uint punFlags, out uint pRTime32LastPlayedOnServer)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_GetFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), iGame, out pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer);
}
public static int AddFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_AddFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer);
}
public static bool RemoveFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_RemoveFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), nAppID, nIP, nConnPort, nQueryPort, unFlags);
}
public static SteamAPICall_t RequestLobbyList()
{
InteropHelp.TestIfAvailableClient();
return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_RequestLobbyList(CSteamAPIContext.GetSteamMatchmaking());
}
public static void AddRequestLobbyListStringFilter(string pchKeyToMatch, string pchValueToMatch, ELobbyComparison eComparisonType)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch);
using InteropHelp.UTF8StringHandle pchValueToMatch2 = new InteropHelp.UTF8StringHandle(pchValueToMatch);
NativeMethods.ISteamMatchmaking_AddRequestLobbyListStringFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, pchValueToMatch2, eComparisonType);
}
public static void AddRequestLobbyListNumericalFilter(string pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch);
NativeMethods.ISteamMatchmaking_AddRequestLobbyListNumericalFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, nValueToMatch, eComparisonType);
}
public static void AddRequestLobbyListNearValueFilter(string pchKeyToMatch, int nValueToBeCloseTo)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch);
NativeMethods.ISteamMatchmaking_AddRequestLobbyListNearValueFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, nValueToBeCloseTo);
}
public static void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable)
{
InteropHelp.TestIfAvailableClient();
NativeMethods.ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(CSteamAPIContext.GetSteamMatchmaking(), nSlotsAvailable);
}
public static void AddRequestLobbyListDistanceFilter(ELobbyDistanceFilter eLobbyDistanceFilter)
{
InteropHelp.TestIfAvailableClient();
NativeMethods.ISteamMatchmaking_AddRequestLobbyListDistanceFilter(CSteamAPIContext.GetSteamMatchmaking(), eLobbyDistanceFilter);
}
public static void AddRequestLobbyListResultCountFilter(int cMaxResults)
{
InteropHelp.TestIfAvailableClient();
NativeMethods.ISteamMatchmaking_AddRequestLobbyListResultCountFilter(CSteamAPIContext.GetSteamMatchmaking(), cMaxResults);
}
public static void AddRequestLobbyListCompatibleMembersFilter(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
NativeMethods.ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static CSteamID GetLobbyByIndex(int iLobby)
{
InteropHelp.TestIfAvailableClient();
return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyByIndex(CSteamAPIContext.GetSteamMatchmaking(), iLobby);
}
public static SteamAPICall_t CreateLobby(ELobbyType eLobbyType, int cMaxMembers)
{
InteropHelp.TestIfAvailableClient();
return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_CreateLobby(CSteamAPIContext.GetSteamMatchmaking(), eLobbyType, cMaxMembers);
}
public static SteamAPICall_t JoinLobby(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_JoinLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static void LeaveLobby(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
NativeMethods.ISteamMatchmaking_LeaveLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static bool InviteUserToLobby(CSteamID steamIDLobby, CSteamID steamIDInvitee)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_InviteUserToLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDInvitee);
}
public static int GetNumLobbyMembers(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_GetNumLobbyMembers(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static CSteamID GetLobbyMemberByIndex(CSteamID steamIDLobby, int iMember)
{
InteropHelp.TestIfAvailableClient();
return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyMemberByIndex(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iMember);
}
public static string GetLobbyData(CSteamID steamIDLobby, string pchKey)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamMatchmaking_GetLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2));
}
public static bool SetLobbyData(CSteamID steamIDLobby, string pchKey, string pchValue)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue);
return NativeMethods.ISteamMatchmaking_SetLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2, pchValue2);
}
public static int GetLobbyDataCount(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_GetLobbyDataCount(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static bool GetLobbyDataByIndex(CSteamID steamIDLobby, int iLobbyData, out string pchKey, int cchKeyBufferSize, out string pchValue, int cchValueBufferSize)
{
InteropHelp.TestIfAvailableClient();
IntPtr intPtr = Marshal.AllocHGlobal(cchKeyBufferSize);
IntPtr intPtr2 = Marshal.AllocHGlobal(cchValueBufferSize);
bool flag = NativeMethods.ISteamMatchmaking_GetLobbyDataByIndex(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iLobbyData, intPtr, cchKeyBufferSize, intPtr2, cchValueBufferSize);
pchKey = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
Marshal.FreeHGlobal(intPtr);
pchValue = (flag ? InteropHelp.PtrToStringUTF8(intPtr2) : null);
Marshal.FreeHGlobal(intPtr2);
return flag;
}
public static bool DeleteLobbyData(CSteamID steamIDLobby, string pchKey)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
return NativeMethods.ISteamMatchmaking_DeleteLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2);
}
public static string GetLobbyMemberData(CSteamID steamIDLobby, CSteamID steamIDUser, string pchKey)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamMatchmaking_GetLobbyMemberData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDUser, pchKey2));
}
public static void SetLobbyMemberData(CSteamID steamIDLobby, string pchKey, string pchValue)
{
InteropHelp.TestIfAvailableClient();
using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
using InteropHelp.UTF8StringHandle pchValue2 = new InteropHelp.UTF8StringHandle(pchValue);
NativeMethods.ISteamMatchmaking_SetLobbyMemberData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2, pchValue2);
}
public static bool SendLobbyChatMsg(CSteamID steamIDLobby, byte[] pvMsgBody, int cubMsgBody)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_SendLobbyChatMsg(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pvMsgBody, cubMsgBody);
}
public static int GetLobbyChatEntry(CSteamID steamIDLobby, int iChatID, out CSteamID pSteamIDUser, byte[] pvData, int cubData, out EChatEntryType peChatEntryType)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_GetLobbyChatEntry(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType);
}
public static bool RequestLobbyData(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_RequestLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static void SetLobbyGameServer(CSteamID steamIDLobby, uint unGameServerIP, ushort unGameServerPort, CSteamID steamIDGameServer)
{
InteropHelp.TestIfAvailableClient();
NativeMethods.ISteamMatchmaking_SetLobbyGameServer(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer);
}
public static bool GetLobbyGameServer(CSteamID steamIDLobby, out uint punGameServerIP, out ushort punGameServerPort, out CSteamID psteamIDGameServer)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_GetLobbyGameServer(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer);
}
public static bool SetLobbyMemberLimit(CSteamID steamIDLobby, int cMaxMembers)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_SetLobbyMemberLimit(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, cMaxMembers);
}
public static int GetLobbyMemberLimit(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_GetLobbyMemberLimit(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static bool SetLobbyType(CSteamID steamIDLobby, ELobbyType eLobbyType)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_SetLobbyType(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, eLobbyType);
}
public static bool SetLobbyJoinable(CSteamID steamIDLobby, bool bLobbyJoinable)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_SetLobbyJoinable(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, bLobbyJoinable);
}
public static CSteamID GetLobbyOwner(CSteamID steamIDLobby)
{
InteropHelp.TestIfAvailableClient();
return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyOwner(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
}
public static bool SetLobbyOwner(CSteamID steamIDLobby, CSteamID steamIDNewOwner)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_SetLobbyOwner(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDNewOwner);
}
public static bool SetLinkedLobby(CSteamID steamIDLobby, CSteamID steamIDLobbyDependent)
{
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamMatchmaking_SetLinkedLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDLobbyDependent);
}
}
|