forked from FoxCouncil/Steamworks.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SteamMatchmaking.cs
528 lines (372 loc) · 26.5 KB
/
SteamMatchmaking.cs
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
// !! // Steamworks.Core - SteamMatchmaking.cs
// *.-". // Created: 2016-10-19 [7:51 PM]
// | | // Copyright 2016 // MIT License // The Fox Council
// Modified by: Fox Diller on 2016-10-22 @ 3:03 PM
#region Usings
using System;
using System.Runtime.InteropServices;
#endregion
namespace Steamworks.Core
{
public class SteamMatchmaking : ISteamMatchmaking
{
private readonly IntPtr m_instancePtr;
public SteamMatchmaking(IntPtr c_instancePtr)
{
m_instancePtr = c_instancePtr;
}
private void CheckIfUsable()
{
if (m_instancePtr == IntPtr.Zero)
{
throw new InvalidOperationException("Steam Matchmaking Not Initialized!");
}
}
#region Native Methods
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")]
private static extern int SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(IntPtr c_instancePtr);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGame")]
private static extern bool SteamAPI_ISteamMatchmaking_GetFavoriteGame(IntPtr c_instancePtr, int c_iGame, ref uint c_pnAppId, ref uint c_pnIp, ref char c_pnConnPort, ref char c_pnQueryPort, ref uint c_punFlags, ref uint c_pRTime32LastPlayedOnServer);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddFavoriteGame")]
private static extern int SteamAPI_ISteamMatchmaking_AddFavoriteGame(IntPtr c_instancePtr, uint c_nAppId, uint c_nIp, char c_nConnPort, char c_nQueryPort, uint c_unFlags, uint c_rTime32LastPlayedOnServer);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_RemoveFavoriteGame")]
private static extern bool SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(IntPtr c_instancePtr, uint c_nAppId, uint c_nIp, char c_nConnPort, char c_nQueryPort, uint c_unFlags);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyList")]
private static extern ulong SteamAPI_ISteamMatchmaking_RequestLobbyList(IntPtr c_instancePtr);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter")]
private static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(IntPtr c_instancePtr, SafeUtf8String c_pchKeyToMatch, SafeUtf8String c_pchValueToMatch, uint c_eComparisonType);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter")]
private static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(IntPtr c_instancePtr, SafeUtf8String c_pchKeyToMatch, int c_nValueToMatch, uint c_eComparisonType);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter")]
private static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(IntPtr c_instancePtr, SafeUtf8String c_pchKeyToMatch, int c_nValueToBeCloseTo);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable")]
private static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(IntPtr c_instancePtr, int c_nSlotsAvailable);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter")]
private static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(IntPtr c_instancePtr, uint c_eLobbyDistanceFilter);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter")]
private static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(IntPtr c_instancePtr, int c_cMaxResults);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter")]
private static extern void SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyByIndex")]
private static extern ulong SteamAPI_ISteamMatchmaking_GetLobbyByIndex(IntPtr c_instancePtr, int c_iLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_CreateLobby")]
private static extern ulong SteamAPI_ISteamMatchmaking_CreateLobby(IntPtr c_instancePtr, uint c_eLobbyType, int c_cMaxMembers);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_JoinLobby")]
private static extern ulong SteamAPI_ISteamMatchmaking_JoinLobby(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_LeaveLobby")]
private static extern void SteamAPI_ISteamMatchmaking_LeaveLobby(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_InviteUserToLobby")]
private static extern bool SteamAPI_ISteamMatchmaking_InviteUserToLobby(IntPtr c_instancePtr, ulong c_steamIdLobby, ulong c_steamIdInvitee);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetNumLobbyMembers")]
private static extern int SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex")]
private static extern ulong SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(IntPtr c_instancePtr, ulong c_steamIdLobby, int c_iMember);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyData")]
private static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData(IntPtr c_instancePtr, ulong c_steamIdLobby, SafeUtf8String c_pchKey);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyData")]
private static extern bool SteamAPI_ISteamMatchmaking_SetLobbyData(IntPtr c_instancePtr, ulong c_steamIdLobby, SafeUtf8String c_pchKey, SafeUtf8String c_pchValue);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataCount")]
private static extern int SteamAPI_ISteamMatchmaking_GetLobbyDataCount(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex")]
private static extern bool SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(IntPtr c_instancePtr, ulong c_steamIdLobby, int c_iLobbyData, SafeUtf8String c_pchKey, int c_cchKeyBufferSize, SafeUtf8String c_pchValue, int c_cchValueBufferSize);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_DeleteLobbyData")]
private static extern bool SteamAPI_ISteamMatchmaking_DeleteLobbyData(IntPtr c_instancePtr, ulong c_steamIdLobby, SafeUtf8String c_pchKey);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberData")]
private static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData(IntPtr c_instancePtr, ulong c_steamIdLobby, ulong c_steamIdUser, SafeUtf8String c_pchKey);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberData")]
private static extern void SteamAPI_ISteamMatchmaking_SetLobbyMemberData(IntPtr c_instancePtr, ulong c_steamIdLobby, SafeUtf8String c_pchKey, SafeUtf8String c_pchValue);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SendLobbyChatMsg")]
private static extern bool SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(IntPtr c_instancePtr, ulong c_steamIdLobby, IntPtr c_pvMsgBody, int c_cubMsgBody);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyChatEntry")]
private static extern int SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(IntPtr c_instancePtr, ulong c_steamIdLobby, int c_iChatId, ref CSteamId c_pSteamIdUser, IntPtr c_pvData, int c_cubData, ref uint c_peChatEntryType);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyData")]
private static extern bool SteamAPI_ISteamMatchmaking_RequestLobbyData(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyGameServer")]
private static extern void SteamAPI_ISteamMatchmaking_SetLobbyGameServer(IntPtr c_instancePtr, ulong c_steamIdLobby, uint c_unGameServerIp, char c_unGameServerPort, ulong c_steamIdGameServer);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyGameServer")]
private static extern bool SteamAPI_ISteamMatchmaking_GetLobbyGameServer(IntPtr c_instancePtr, ulong c_steamIdLobby, ref uint c_punGameServerIp, ref char c_punGameServerPort, ref CSteamId c_psteamIdGameServer);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit")]
private static extern bool SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(IntPtr c_instancePtr, ulong c_steamIdLobby, int c_cMaxMembers);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit")]
private static extern int SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyType")]
private static extern bool SteamAPI_ISteamMatchmaking_SetLobbyType(IntPtr c_instancePtr, ulong c_steamIdLobby, uint c_eLobbyType);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyJoinable")]
private static extern bool SteamAPI_ISteamMatchmaking_SetLobbyJoinable(IntPtr c_instancePtr, ulong c_steamIdLobby, bool c_bLobbyJoinable);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyOwner")]
private static extern ulong SteamAPI_ISteamMatchmaking_GetLobbyOwner(IntPtr c_instancePtr, ulong c_steamIdLobby);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyOwner")]
private static extern bool SteamAPI_ISteamMatchmaking_SetLobbyOwner(IntPtr c_instancePtr, ulong c_steamIdLobby, ulong c_steamIdNewOwner);
[DllImport(SteamApi.STEAMWORKS_MODULE_NAME, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLinkedLobby")]
private static extern bool SteamAPI_ISteamMatchmaking_SetLinkedLobby(IntPtr c_instancePtr, ulong c_steamIdLobby, ulong c_steamIdLobbyDependent);
#endregion
#region Overrides of ISteamMatchmaking
public override IntPtr GetIntPtr()
{
return m_instancePtr;
}
public override int GetFavoriteGameCount()
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(m_instancePtr);
return a_result;
}
public override bool GetFavoriteGame(int c_iGame, ref uint c_pnAppId, ref uint c_pnIp, ref char c_pnConnPort, ref char c_pnQueryPort, ref uint c_punFlags, ref uint c_pRTime32LastPlayedOnServer)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetFavoriteGame(m_instancePtr, c_iGame, ref c_pnAppId, ref c_pnIp, ref c_pnConnPort, ref c_pnQueryPort, ref c_punFlags, ref c_pRTime32LastPlayedOnServer);
return a_result;
}
public override int AddFavoriteGame(uint c_nAppId, uint c_nIp, char c_nConnPort, char c_nQueryPort, uint c_unFlags, uint c_rTime32LastPlayedOnServer)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_AddFavoriteGame(m_instancePtr, c_nAppId, c_nIp, c_nConnPort, c_nQueryPort, c_unFlags, c_rTime32LastPlayedOnServer);
return a_result;
}
public override bool RemoveFavoriteGame(uint c_nAppId, uint c_nIp, char c_nConnPort, char c_nQueryPort, uint c_unFlags)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(m_instancePtr, c_nAppId, c_nIp, c_nConnPort, c_nQueryPort, c_unFlags);
return a_result;
}
public override ulong RequestLobbyList()
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_RequestLobbyList(m_instancePtr);
return a_result;
}
public override void AddRequestLobbyListStringFilter(string c_pchKeyToMatch, string c_pchValueToMatch, uint c_eComparisonType)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(m_instancePtr, new SafeUtf8String(c_pchKeyToMatch), new SafeUtf8String(c_pchKeyToMatch), c_eComparisonType);
}
public override void AddRequestLobbyListNumericalFilter(string c_pchKeyToMatch, int c_nValueToMatch, uint c_eComparisonType)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(m_instancePtr, new SafeUtf8String(c_pchKeyToMatch), c_nValueToMatch, c_eComparisonType);
}
public override void AddRequestLobbyListNearValueFilter(string c_pchKeyToMatch, int c_nValueToBeCloseTo)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(m_instancePtr, new SafeUtf8String(c_pchKeyToMatch), c_nValueToBeCloseTo);
}
public override void AddRequestLobbyListFilterSlotsAvailable(int c_nSlotsAvailable)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(m_instancePtr, c_nSlotsAvailable);
}
public override void AddRequestLobbyListDistanceFilter(uint c_eLobbyDistanceFilter)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(m_instancePtr, c_eLobbyDistanceFilter);
}
public override void AddRequestLobbyListResultCountFilter(int c_cMaxResults)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(m_instancePtr, c_cMaxResults);
}
public override void AddRequestLobbyListCompatibleMembersFilter(ulong c_steamIdLobby)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(m_instancePtr, c_steamIdLobby);
}
public override ulong GetLobbyByIndex(int c_iLobby)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyByIndex(m_instancePtr, c_iLobby);
return a_result;
}
public override ulong CreateLobby(uint c_eLobbyType, int c_cMaxMembers)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_CreateLobby(m_instancePtr, c_eLobbyType, c_cMaxMembers);
return a_result;
}
public override ulong JoinLobby(ulong c_steamIdLobby)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_JoinLobby(m_instancePtr, c_steamIdLobby);
return a_result;
}
public override void LeaveLobby(ulong c_steamIdLobby)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_LeaveLobby(m_instancePtr, c_steamIdLobby);
}
public override bool InviteUserToLobby(ulong c_steamIdLobby, ulong c_steamIdInvitee)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_InviteUserToLobby(m_instancePtr, c_steamIdLobby, c_steamIdInvitee);
return a_result;
}
public override int GetNumLobbyMembers(ulong c_steamIdLobby)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(m_instancePtr, c_steamIdLobby);
return a_result;
}
public override ulong GetLobbyMemberByIndex(ulong c_steamIdLobby, int c_iMember)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(m_instancePtr, c_steamIdLobby, c_iMember);
return a_result;
}
public override string GetLobbyData(ulong c_steamIdLobby, string c_pchKey)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyData(m_instancePtr, c_steamIdLobby, new SafeUtf8String(c_pchKey));
return SafeUtf8String.ToString(a_result);
}
public override bool SetLobbyData(ulong c_steamIdLobby, string c_pchKey, string c_pchValue)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_SetLobbyData(m_instancePtr, c_steamIdLobby, new SafeUtf8String(c_pchKey), new SafeUtf8String(c_pchValue));
return a_result;
}
public override int GetLobbyDataCount(ulong c_steamIdLobby)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyDataCount(m_instancePtr, c_steamIdLobby);
return a_result;
}
public override bool GetLobbyDataByIndex(ulong c_steamIdLobby, int c_iLobbyData, string c_pchKey, int c_cchKeyBufferSize, string c_pchValue, int c_cchValueBufferSize)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(m_instancePtr, c_steamIdLobby, c_iLobbyData, new SafeUtf8String(c_pchKey), c_cchKeyBufferSize, new SafeUtf8String(c_pchValue), c_cchValueBufferSize);
return a_result;
}
public override bool DeleteLobbyData(ulong c_steamIdLobby, string c_pchKey)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_DeleteLobbyData(m_instancePtr, c_steamIdLobby, new SafeUtf8String(c_pchKey));
return a_result;
}
public override string GetLobbyMemberData(ulong c_steamIdLobby, ulong c_steamIdUser, string c_pchKey)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyMemberData(m_instancePtr, c_steamIdLobby, c_steamIdUser, new SafeUtf8String(c_pchKey));
return SafeUtf8String.ToString(a_result);
}
public override void SetLobbyMemberData(ulong c_steamIdLobby, string c_pchKey, string c_pchValue)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_SetLobbyMemberData(m_instancePtr, c_steamIdLobby, new SafeUtf8String(c_pchKey), new SafeUtf8String(c_pchValue));
}
public override bool SendLobbyChatMsg(ulong c_steamIdLobby, IntPtr c_pvMsgBody, int c_cubMsgBody)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(m_instancePtr, c_steamIdLobby, c_pvMsgBody, c_cubMsgBody);
return a_result;
}
public override int GetLobbyChatEntry(ulong c_steamIdLobby, int c_iChatId, out CSteamId c_pSteamIdUser, IntPtr c_pvData, int c_cubData, ref uint c_peChatEntryType)
{
CheckIfUsable();
c_pSteamIdUser = new CSteamId();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(m_instancePtr, c_steamIdLobby, c_iChatId, ref c_pSteamIdUser, c_pvData, c_cubData, ref c_peChatEntryType);
return a_result;
}
public override bool RequestLobbyData(ulong c_steamIdLobby)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_RequestLobbyData(m_instancePtr, c_steamIdLobby);
return a_result;
}
public override void SetLobbyGameServer(ulong c_steamIdLobby, uint c_unGameServerIp, char c_unGameServerPort, ulong c_steamIdGameServer)
{
CheckIfUsable();
SteamAPI_ISteamMatchmaking_SetLobbyGameServer(m_instancePtr, c_steamIdLobby, c_unGameServerIp, c_unGameServerPort, c_steamIdGameServer);
}
public override bool GetLobbyGameServer(ulong c_steamIdLobby, ref uint c_punGameServerIp, ref char c_punGameServerPort, out CSteamId c_psteamIdGameServer)
{
CheckIfUsable();
c_psteamIdGameServer = new CSteamId();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyGameServer(m_instancePtr, c_steamIdLobby, ref c_punGameServerIp, ref c_punGameServerPort, ref c_psteamIdGameServer);
return a_result;
}
public override bool SetLobbyMemberLimit(ulong c_steamIdLobby, int c_cMaxMembers)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(m_instancePtr, c_steamIdLobby, c_cMaxMembers);
return a_result;
}
public override int GetLobbyMemberLimit(ulong c_steamIdLobby)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(m_instancePtr, c_steamIdLobby);
return a_result;
}
public override bool SetLobbyType(ulong c_steamIdLobby, uint c_eLobbyType)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_SetLobbyType(m_instancePtr, c_steamIdLobby, c_eLobbyType);
return a_result;
}
public override bool SetLobbyJoinable(ulong c_steamIdLobby, bool c_bLobbyJoinable)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_SetLobbyJoinable(m_instancePtr, c_steamIdLobby, c_bLobbyJoinable);
return a_result;
}
public override ulong GetLobbyOwner(ulong c_steamIdLobby)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_GetLobbyOwner(m_instancePtr, c_steamIdLobby);
return a_result;
}
public override bool SetLobbyOwner(ulong c_steamIdLobby, ulong c_steamIdNewOwner)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_SetLobbyOwner(m_instancePtr, c_steamIdLobby, c_steamIdNewOwner);
return a_result;
}
public override bool SetLinkedLobby(ulong c_steamIdLobby, ulong c_steamIdLobbyDependent)
{
CheckIfUsable();
var a_result = SteamAPI_ISteamMatchmaking_SetLinkedLobby(m_instancePtr, c_steamIdLobby, c_steamIdLobbyDependent);
return a_result;
}
#endregion
}
public abstract class ISteamMatchmaking
{
public abstract IntPtr GetIntPtr();
public abstract int GetFavoriteGameCount();
public abstract bool GetFavoriteGame(int c_iGame, ref uint c_pnAppId, ref uint c_pnIp, ref char c_pnConnPort, ref char c_pnQueryPort, ref uint c_punFlags, ref uint c_pRTime32LastPlayedOnServer);
public abstract int AddFavoriteGame(uint c_nAppId, uint c_nIp, char c_nConnPort, char c_nQueryPort, uint c_unFlags, uint c_rTime32LastPlayedOnServer);
public abstract bool RemoveFavoriteGame(uint c_nAppId, uint c_nIp, char c_nConnPort, char c_nQueryPort, uint c_unFlags);
public abstract ulong RequestLobbyList();
public abstract void AddRequestLobbyListStringFilter(string c_pchKeyToMatch, string c_pchValueToMatch, uint c_eComparisonType);
public abstract void AddRequestLobbyListNumericalFilter(string c_pchKeyToMatch, int c_nValueToMatch, uint c_eComparisonType);
public abstract void AddRequestLobbyListNearValueFilter(string c_pchKeyToMatch, int c_nValueToBeCloseTo);
public abstract void AddRequestLobbyListFilterSlotsAvailable(int c_nSlotsAvailable);
public abstract void AddRequestLobbyListDistanceFilter(uint c_eLobbyDistanceFilter);
public abstract void AddRequestLobbyListResultCountFilter(int c_cMaxResults);
public abstract void AddRequestLobbyListCompatibleMembersFilter(ulong c_steamIdLobby);
public abstract ulong GetLobbyByIndex(int c_iLobby);
public abstract ulong CreateLobby(uint c_eLobbyType, int c_cMaxMembers);
public abstract ulong JoinLobby(ulong c_steamIdLobby);
public abstract void LeaveLobby(ulong c_steamIdLobby);
public abstract bool InviteUserToLobby(ulong c_steamIdLobby, ulong c_steamIdInvitee);
public abstract int GetNumLobbyMembers(ulong c_steamIdLobby);
public abstract ulong GetLobbyMemberByIndex(ulong c_steamIdLobby, int c_iMember);
public abstract string GetLobbyData(ulong c_steamIdLobby, string c_pchKey);
public abstract bool SetLobbyData(ulong c_steamIdLobby, string c_pchKey, string c_pchValue);
public abstract int GetLobbyDataCount(ulong c_steamIdLobby);
public abstract bool GetLobbyDataByIndex(ulong c_steamIdLobby, int c_iLobbyData, string c_pchKey, int c_cchKeyBufferSize, string c_pchValue, int c_cchValueBufferSize);
public abstract bool DeleteLobbyData(ulong c_steamIdLobby, string c_pchKey);
public abstract string GetLobbyMemberData(ulong c_steamIdLobby, ulong c_steamIdUser, string c_pchKey);
public abstract void SetLobbyMemberData(ulong c_steamIdLobby, string c_pchKey, string c_pchValue);
public abstract bool SendLobbyChatMsg(ulong c_steamIdLobby, IntPtr c_pvMsgBody, int c_cubMsgBody);
public abstract int GetLobbyChatEntry(ulong c_steamIdLobby, int c_iChatId, out CSteamId c_pSteamIdUser, IntPtr c_pvData, int c_cubData, ref uint c_peChatEntryType);
public abstract bool RequestLobbyData(ulong c_steamIdLobby);
public abstract void SetLobbyGameServer(ulong c_steamIdLobby, uint c_unGameServerIp, char c_unGameServerPort, ulong c_steamIdGameServer);
public abstract bool GetLobbyGameServer(ulong c_steamIdLobby, ref uint c_punGameServerIp, ref char c_punGameServerPort, out CSteamId c_psteamIdGameServer);
public abstract bool SetLobbyMemberLimit(ulong c_steamIdLobby, int c_cMaxMembers);
public abstract int GetLobbyMemberLimit(ulong c_steamIdLobby);
public abstract bool SetLobbyType(ulong c_steamIdLobby, uint c_eLobbyType);
public abstract bool SetLobbyJoinable(ulong c_steamIdLobby, bool c_bLobbyJoinable);
public abstract ulong GetLobbyOwner(ulong c_steamIdLobby);
public abstract bool SetLobbyOwner(ulong c_steamIdLobby, ulong c_steamIdNewOwner);
public abstract bool SetLinkedLobby(ulong c_steamIdLobby, ulong c_steamIdLobbyDependent);
}
}