basic auth
[vg.git] / src / vg / vg_steam_networking.h
1 #ifndef VG_STEAM_NETWORKING_H
2 #define VG_STEAM_NETWORKING_H
3
4 #include "vg_steam.h"
5
6 #ifdef VALVE_CALLBACK_PACK_SMALL
7 #pragma pack(push,4)
8 #else
9 #pragma pack(push,8)
10 #endif
11
12 typedef enum ESteamNetworkingConfigScope ESteamNetworkingConfigScope;
13 enum ESteamNetworkingConfigScope
14 {
15 k_ESteamNetworkingConfig_Global = 1,
16 k_ESteamNetworkingConfig_SocketsInterface = 2,
17 k_ESteamNetworkingConfig_ListenSocket = 3,
18 k_ESteamNetworkingConfig_Connection = 4,
19 k_ESteamNetworkingConfigScope__Force32Bit = 0x7fffffff
20 };
21
22 typedef enum ESteamNetworkingConfigDataType ESteamNetworkingConfigDataType;
23 enum ESteamNetworkingConfigDataType
24 {
25 k_ESteamNetworkingConfig_Int32 = 1,
26 k_ESteamNetworkingConfig_Int64 = 2,
27 k_ESteamNetworkingConfig_Float = 3,
28 k_ESteamNetworkingConfig_String = 4,
29 k_ESteamNetworkingConfig_Ptr = 5,
30
31 k_ESteamNetworkingConfigDataType__Force32Bit = 0x7fffffff
32 };
33
34 typedef enum ESteamNetworkingConfigValue ESteamNetworkingConfigValue;
35 enum ESteamNetworkingConfigValue
36 {
37 k_ESteamNetworkingConfig_Invalid = 0,
38 k_ESteamNetworkingConfig_TimeoutInitial = 24,
39 k_ESteamNetworkingConfig_TimeoutConnected = 25,
40 k_ESteamNetworkingConfig_SendBufferSize = 9,
41 k_ESteamNetworkingConfig_ConnectionUserData = 40,
42 k_ESteamNetworkingConfig_SendRateMin = 10,
43 k_ESteamNetworkingConfig_SendRateMax = 11,
44 k_ESteamNetworkingConfig_NagleTime = 12,
45 k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23,
46 k_ESteamNetworkingConfig_MTU_PacketSize = 32,
47 k_ESteamNetworkingConfig_MTU_DataSize = 33,
48 k_ESteamNetworkingConfig_Unencrypted = 34,
49 k_ESteamNetworkingConfig_SymmetricConnect = 37,
50 k_ESteamNetworkingConfig_LocalVirtualPort = 38,
51 k_ESteamNetworkingConfig_DualWifi_Enable = 39,
52 k_ESteamNetworkingConfig_EnableDiagnosticsUI = 46,
53 k_ESteamNetworkingConfig_FakePacketLoss_Send = 2,
54 k_ESteamNetworkingConfig_FakePacketLoss_Recv = 3,
55 k_ESteamNetworkingConfig_FakePacketLag_Send = 4,
56 k_ESteamNetworkingConfig_FakePacketLag_Recv = 5,
57 k_ESteamNetworkingConfig_FakePacketReorder_Send = 6,
58 k_ESteamNetworkingConfig_FakePacketReorder_Recv = 7,
59 k_ESteamNetworkingConfig_FakePacketReorder_Time = 8,
60 k_ESteamNetworkingConfig_FakePacketDup_Send = 26,
61 k_ESteamNetworkingConfig_FakePacketDup_Recv = 27,
62 k_ESteamNetworkingConfig_FakePacketDup_TimeMax = 28,
63 k_ESteamNetworkingConfig_PacketTraceMaxBytes = 41,
64 k_ESteamNetworkingConfig_FakeRateLimit_Send_Rate = 42,
65 k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst = 43,
66 k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate = 44,
67 k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst = 45,
68 k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged = 201,
69 k_ESteamNetworkingConfig_Callback_AuthStatusChanged = 202,
70 k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged = 203,
71 k_ESteamNetworkingConfig_Callback_MessagesSessionRequest = 204,
72 k_ESteamNetworkingConfig_Callback_MessagesSessionFailed = 205,
73 k_ESteamNetworkingConfig_Callback_CreateConnectionSignaling = 206,
74 k_ESteamNetworkingConfig_Callback_FakeIPResult = 207,
75 k_ESteamNetworkingConfig_P2P_STUN_ServerList = 103,
76 k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable = 104,
77 k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty = 105,
78 k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty = 106,
79 k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19,
80 k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20,
81 k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21,
82 k_ESteamNetworkingConfig_SDRClient_SingleSocket = 22,
83 k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29,
84 k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress = 30,
85 k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr = 31,
86 k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36,
87 k_ESteamNetworkingConfig_LogLevel_AckRTT = 13,
88 k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14,
89 k_ESteamNetworkingConfig_LogLevel_Message = 15,
90 k_ESteamNetworkingConfig_LogLevel_PacketGaps = 16,
91 k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17,
92 k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18,
93 k_ESteamNetworkingConfig_DELETED_EnumerateDevVars = 35,
94 k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff
95 };
96
97
98 typedef enum ESteamNetworkingConnectionState ESteamNetworkingConnectionState;
99 enum ESteamNetworkingConnectionState
100 {
101 k_ESteamNetworkingConnectionState_None = 0,
102 k_ESteamNetworkingConnectionState_Connecting = 1,
103 k_ESteamNetworkingConnectionState_FindingRoute = 2,
104 k_ESteamNetworkingConnectionState_Connected = 3,
105 k_ESteamNetworkingConnectionState_ClosedByPeer = 4,
106 k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5,
107 k_ESteamNetworkingConnectionState_FinWait = -1,
108 k_ESteamNetworkingConnectionState_Linger = -2,
109 k_ESteamNetworkingConnectionState_Dead = -3,
110 k_ESteamNetworkingConnectionState__Force32Bit = 0x7fffffff
111 };
112
113 typedef enum ESteamNetConnectionEnd ESteamNetConnectionEnd;
114 enum ESteamNetConnectionEnd
115 {
116 k_ESteamNetConnectionEnd_Invalid = 0,
117 k_ESteamNetConnectionEnd_App_Min = 1000,
118 k_ESteamNetConnectionEnd_App_Generic = k_ESteamNetConnectionEnd_App_Min,
119 k_ESteamNetConnectionEnd_App_Max = 1999,
120 k_ESteamNetConnectionEnd_AppException_Min = 2000,
121 k_ESteamNetConnectionEnd_AppException_Generic =
122 k_ESteamNetConnectionEnd_AppException_Min,
123 k_ESteamNetConnectionEnd_AppException_Max = 2999,
124 k_ESteamNetConnectionEnd_Local_Min = 3000,
125 k_ESteamNetConnectionEnd_Local_OfflineMode = 3001,
126 k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity = 3002,
127 k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay = 3003,
128 k_ESteamNetConnectionEnd_Local_NetworkConfig = 3004,
129 k_ESteamNetConnectionEnd_Local_Rights = 3005,
130 k_ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses = 3006,
131
132 k_ESteamNetConnectionEnd_Local_Max = 3999,
133 k_ESteamNetConnectionEnd_Remote_Min = 4000,
134 k_ESteamNetConnectionEnd_Remote_Timeout = 4001,
135 k_ESteamNetConnectionEnd_Remote_BadCrypt = 4002,
136 k_ESteamNetConnectionEnd_Remote_BadCert = 4003,
137 k_ESteamNetConnectionEnd_Remote_BadProtocolVersion = 4006,
138 k_ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses = 4007,
139
140 k_ESteamNetConnectionEnd_Remote_Max = 4999,
141
142 k_ESteamNetConnectionEnd_Misc_Min = 5000,
143 k_ESteamNetConnectionEnd_Misc_Generic = 5001,
144 k_ESteamNetConnectionEnd_Misc_InternalError = 5002,
145 k_ESteamNetConnectionEnd_Misc_Timeout = 5003,
146 k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005,
147 k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient = 5006,
148 k_ESteamNetConnectionEnd_Misc_P2P_Rendezvous = 5008,
149 k_ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall = 5009,
150 k_ESteamNetConnectionEnd_Misc_PeerSentNoConnection = 5010,
151
152 k_ESteamNetConnectionEnd_Misc_Max = 5999,
153 k_ESteamNetConnectionEnd__Force32Bit = 0x7fffffff
154 };
155
156 typedef enum ESteamNetworkingIdentityType ESteamNetworkingIdentityType;
157 enum ESteamNetworkingIdentityType
158 {
159 k_ESteamNetworkingIdentityType_Invalid = 0,
160 k_ESteamNetworkingIdentityType_SteamID = 16,
161 k_ESteamNetworkingIdentityType_IPAddress = 1,
162 k_ESteamNetworkingIdentityType_GenericString = 2,
163 k_ESteamNetworkingIdentityType_GenericBytes = 3,
164 k_ESteamNetworkingIdentityType_UnknownType = 4,
165 k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff,
166 };
167
168 typedef enum ESteamNetworkingAvailability ESteamNetworkingAvailability;
169 enum ESteamNetworkingAvailability
170 {
171 k_ESteamNetworkingAvailability_CannotTry = -102,
172 k_ESteamNetworkingAvailability_Failed = -101,
173 k_ESteamNetworkingAvailability_Previously = -100,
174 k_ESteamNetworkingAvailability_Retrying = -10,
175 k_ESteamNetworkingAvailability_NeverTried = 1,
176 k_ESteamNetworkingAvailability_Waiting = 2,
177 k_ESteamNetworkingAvailability_Attempting = 3,
178 k_ESteamNetworkingAvailability_Current = 100,
179 k_ESteamNetworkingAvailability_Unknown = 0,
180 k_ESteamNetworkingAvailability__Force32bit = 0x7fffffff,
181 };
182
183 /* Handle used to identify a connection to a remote host. */
184 typedef u32 HSteamNetConnection;
185 HSteamNetConnection const k_HSteamNetConnection_Invalid = 0;
186
187 /*
188 * Handle used to identify a "listen socket". Unlike traditional
189 * Berkeley sockets, a listen socket and a connection are two
190 * different abstractions.
191 */
192 typedef u32 HSteamListenSocket;
193 HSteamListenSocket const k_HSteamListenSocket_Invalid = 0;
194
195 typedef u32 SteamNetworkingPOPID;
196
197 #define k_cchSteamNetworkingMaxConnectionCloseReason 128
198 #define k_cchSteamNetworkingMaxConnectionDescription 128
199 #define k_cchSteamNetworkingMaxConnectionAppName 32
200
201 #pragma pack(push,1)
202 /* Store an IP and port. IPv6 is always used; IPv4 is represented using
203 * "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd
204 * (RFC 4291 section 2.5.5.2.)
205 */
206 typedef struct SteamNetworkingIPAddr SteamNetworkingIPAddr;
207 struct SteamNetworkingIPAddr
208 {
209 union
210 {
211 u8 m_ipv6[ 16 ];
212
213 /* RFC4038, section 4.2 */
214 struct IPv4MappedAddress
215 {
216 u64 m_8zeros;
217 u16 m_0000;
218 u16 m_ffff;
219 u8 m_ip[ 4 ]; /* NOTE: As bytes, i.e. network byte order */
220 }
221 m_ipv4;
222 };
223
224 u16 m_port; // Host byte order
225 };
226
227 typedef struct SteamNetworkingIdentity SteamNetworkingIdentity;
228 struct SteamNetworkingIdentity
229 {
230 ESteamNetworkingIdentityType m_eType;
231
232 int m_cbSize;
233 union
234 {
235 u64 m_steamID64;
236 char m_szGenericString[ 32 ];
237 u8 m_genericBytes[ 32 ];
238 char m_szUnknownRawString[ 128 ];
239 SteamNetworkingIPAddr m_ip;
240 u32 m_reserved[ 32 ];
241 };
242 };
243
244 #pragma pack(pop)
245
246 /*
247 * "Fake IPs" are assigned to hosts, to make it easier to interface with
248 * older code that assumed all hosts will have an IPv4 address
249 */
250 typedef enum ESteamNetworkingFakeIPType ESteamNetworkingFakeIPType;
251 enum ESteamNetworkingFakeIPType
252 {
253 k_ESteamNetworkingFakeIPType_Invalid,
254 k_ESteamNetworkingFakeIPType_NotFake,
255 k_ESteamNetworkingFakeIPType_GlobalIPv4,
256 k_ESteamNetworkingFakeIPType_LocalIPv4,
257 k_ESteamNetworkingFakeIPType__Force32Bit = 0x7fffffff
258 };
259
260 /* Set everything to zero. E.g. [::]:0 */
261 void SteamAPI_SteamNetworkingIPAddr_Clear( SteamNetworkingIPAddr* self );
262
263 /* Returns true if the IP is ::0. (Doesn't check port.) */
264 int SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros(
265 SteamNetworkingIPAddr* self );
266
267 /*
268 * Set IPv6 address. IP is interpreted as bytes, so there are no endian issues.
269 * (Same as inaddr_in6.) The IP can be a mapped IPv4 address
270 */
271 void SteamAPI_SteamNetworkingIPAddr_SetIPv6( SteamNetworkingIPAddr* self,
272 u8 *ipv6, u16 nPort );
273
274 /* Sets to IPv4 mapped address. IP and port are in host byte order. */
275 void SteamAPI_SteamNetworkingIPAddr_SetIPv4( SteamNetworkingIPAddr* self,
276 u32 nIP, u16 nPort );
277
278 /* Return true if IP is mapped IPv4 */
279 int SteamAPI_SteamNetworkingIPAddr_IsIPv4( SteamNetworkingIPAddr* self );
280
281 /*
282 * Returns IP in host byte order (e.g. aa.bb.cc.dd as 0xaabbccdd).
283 * Returns 0 if IP is not mapped IPv4.
284 */
285 u32 SteamAPI_SteamNetworkingIPAddr_GetIPv4( SteamNetworkingIPAddr* self );
286
287 /* Set to the IPv6 localhost address ::1, and the specified port. */
288 void SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost(
289 SteamNetworkingIPAddr* self, u16 nPort );
290
291 /*
292 * Return true if this identity is localhost.
293 * (Either IPv6 ::1, or IPv4 127.0.0.1)
294 */
295 int SteamAPI_SteamNetworkingIPAddr_IsLocalHost( SteamNetworkingIPAddr* self );
296
297 /*
298 * Print to a string, with or without the port. Mapped IPv4 addresses are
299 * printed as dotted decimal (12.34.56.78), otherwise this will print the
300 * canonical form according to RFC5952. If you include the port, IPv6 will be
301 * surrounded by brackets, e.g. [::1:2]:80. Your buffer should be at least
302 * k_cchMaxString bytes to avoid truncation
303 *
304 * See also SteamNetworkingIdentityRender
305 */
306 void SteamAPI_SteamNetworkingIPAddr_ToString( SteamNetworkingIPAddr* self,
307 char *buf, u32 cbBuf, int bWithPort );
308
309 /*
310 * Parse an IP address and optional port. If a port is not present, it is set
311 * to 0.
312 * (This means that you cannot tell if a zero port was explicitly specified.)
313 */
314 int SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr* self,
315 const char *pszStr );
316
317 /* See if two addresses are identical */
318 int SteamAPI_SteamNetworkingIPAddr_IsEqualTo( SteamNetworkingIPAddr* self,
319 SteamNetworkingIPAddr *x );
320
321 /*
322 * Classify address as FakeIP. This function never returns
323 * k_ESteamNetworkingFakeIPType_Invalid.
324 */
325 ESteamNetworkingFakeIPType SteamAPI_SteamNetworkingIPAddr_GetFakeIPType(
326 SteamNetworkingIPAddr* self );
327
328 /* Return true if we are a FakeIP */
329 int SteamAPI_SteamNetworkingIPAddr_IsFakeIP( SteamNetworkingIPAddr* self );
330
331
332 /* Describe the state of a connection. */
333 typedef struct SteamNetConnectionInfo_t SteamNetConnectionInfo_t;
334 struct SteamNetConnectionInfo_t
335 {
336 SteamNetworkingIdentity m_identityRemote;
337
338 /* Arbitrary user data set by the local application code */
339 i64 m_nUserData;
340
341 /* Handle to listen socket this was connected on, or
342 * k_HSteamListenSocket_Invalid if we initiated the connection */
343 HSteamListenSocket m_hListenSocket;
344
345 /* Remote address. Might be all 0's if we don't know it, or if this is N/A.
346 * (E.g. Basically everything except direct UDP connection.) */
347 SteamNetworkingIPAddr m_addrRemote;
348 u16 m__pad1;
349
350 /* What data center is the remote host in? (0 if we don't know.) */
351 SteamNetworkingPOPID m_idPOPRemote;
352
353 /* What relay are we using to communicate with the remote host?
354 * (0 if not applicable.) */
355 SteamNetworkingPOPID m_idPOPRelay;
356
357 /* High level state of the connection */
358 ESteamNetworkingConnectionState m_eState;
359
360 /* Basic cause of the connection termination or problem.
361 * See ESteamNetConnectionEnd for the values used */
362 int m_eEndReason;
363
364 /*
365 * Human-readable, but non-localized explanation for connection
366 * termination or problem. This is intended for debugging /
367 * diagnostic purposes only, not to display to users. It might
368 * have some details specific to the issue.
369 */
370 char m_szEndDebug[ 128 ];
371
372 /*
373 * Debug description. This includes the internal connection ID,
374 * connection type (and peer information), and any name
375 * given to the connection by the app. This string is used in various
376 * internal logging messages.
377 *
378 * Note that the connection ID *usually* matches the HSteamNetConnection
379 * handle, but in certain cases with symmetric connections it might not.
380 */
381 char m_szConnectionDescription[ 128 ];
382
383 /*
384 * Misc flags. Bitmask of k_nSteamNetworkConnectionInfoFlags_Xxxx
385 */
386 int m_nFlags;
387
388 /*
389 * Internal stuff, room to change API easily
390 */
391 u32 reserved[63];
392 };
393
394 /*
395 * In a few places we need to set configuration options on listen sockets and
396 * connections, and have them take effect *before* the listen socket or
397 * connection really starts doing anything. Creating the object and then setting
398 * the options "immediately" after creation doesn't work completely, because
399 * network packets could be received between the time the object is created and
400 * when the options are applied. To set options at creation time in a reliable
401 * way, they must be passed to the creation function. This structure is used to
402 * pass those options.
403 *
404 * For the meaning of these fields, see ISteamNetworkingUtils::SetConfigValue.
405 * Basically when the object is created, we just iterate over the list of
406 * options and call ISteamNetworkingUtils::SetConfigValueStruct, where the scope
407 * arguments are supplied by the object being created.
408 */
409 typedef struct SteamNetworkingConfigValue_t SteamNetworkingConfigValue_t;
410 struct SteamNetworkingConfigValue_t
411 {
412 /* Which option is being set */
413 ESteamNetworkingConfigValue m_eValue;
414
415 /// Which field below did you fill in?
416 ESteamNetworkingConfigDataType m_eDataType;
417
418 /// Option value
419 union
420 {
421 i32 m_int32;
422 i64 m_int64;
423 float m_float;
424 const char *m_string; // Points to your '\0'-terminated buffer
425 void *m_ptr;
426 } m_val;
427 };
428
429 void SteamAPI_SteamNetworkingConfigValue_t_SetInt32(
430 SteamNetworkingConfigValue_t* self,
431 ESteamNetworkingConfigValue eVal, i32 data );
432
433 void SteamAPI_SteamNetworkingConfigValue_t_SetInt64(
434 SteamNetworkingConfigValue_t* self,
435 ESteamNetworkingConfigValue eVal, i64 data );
436
437 void SteamAPI_SteamNetworkingConfigValue_t_SetFloat(
438 SteamNetworkingConfigValue_t* self,
439 ESteamNetworkingConfigValue eVal, float data );
440
441 void SteamAPI_SteamNetworkingConfigValue_t_SetPtr(
442 SteamNetworkingConfigValue_t* self,
443 ESteamNetworkingConfigValue eVal, void *data );
444
445 void SteamAPI_SteamNetworkingConfigValue_t_SetString(
446 SteamNetworkingConfigValue_t* self, ESteamNetworkingConfigValue eVal,
447 const char * data );
448
449 /*
450 * Handle used to identify a poll group, used to query many
451 * connections at once efficiently.
452 */
453 typedef u32 HSteamNetPollGroup;
454 HSteamNetPollGroup const k_HSteamNetPollGroup_Invalid = 0;
455
456 void *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v012(void);
457 void *SteamAPI_SteamGameServerNetworkingSockets_SteamAPI(void)
458 {
459 return SteamAPI_SteamGameServerNetworkingSockets_SteamAPI_v012();
460 }
461
462
463 void *SteamAPI_SteamNetworkingSockets_SteamAPI_v012();
464 void *SteamAPI_SteamNetworkingSockets_SteamAPI()
465 {
466 return SteamAPI_SteamNetworkingSockets_SteamAPI_v012();
467 }
468
469 HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP(
470 void *self, SteamNetworkingIPAddr *localAddress, int nOptions,
471 SteamNetworkingConfigValue_t *pOptions );
472
473 HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectByIPAddress(
474 void *self,
475 SteamNetworkingIPAddr *address, int nOptions,
476 SteamNetworkingConfigValue_t *pOptions );
477
478
479 EResult SteamAPI_ISteamNetworkingSockets_AcceptConnection(
480 void *self, HSteamNetConnection hConn );
481
482 int SteamAPI_ISteamNetworkingSockets_CloseConnection(
483 void *self, HSteamNetConnection hPeer, int nReason, const char *pszDebug,
484 int bEnableLinger );
485
486 int SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress(
487 void *self, HSteamListenSocket hSocket,
488 SteamNetworkingIPAddr *address );
489
490 int SteamAPI_ISteamNetworkingSockets_CloseConnection(
491 void *self, HSteamNetConnection hPeer, int nReason, const char *pszDebug,
492 int bEnableLinger );
493
494 int SteamAPI_ISteamNetworkingSockets_CloseListenSocket(
495 void *self, HSteamListenSocket hSocket );
496
497 /*
498 * Callbacks
499 */
500
501 enum { k_iSteamNetConnectionStatusChangedCallBack =
502 k_iSteamNetworkingSocketsCallbacks + 1 };
503
504 typedef struct SteamNetConnectionStatusChangedCallback_t
505 SteamNetConnectionStatusChangedCallback_t;
506 struct SteamNetConnectionStatusChangedCallback_t
507 {
508 /// Connection handle
509 HSteamNetConnection m_hConn;
510
511 /// Full connection info
512 SteamNetConnectionInfo_t m_info;
513
514 /// Previous state. (Current state is in m_info.m_eState)
515 ESteamNetworkingConnectionState m_eOldState;
516 };
517
518 enum { k_iSteamNetAuthenticationStatus =
519 k_iSteamNetworkingSocketsCallbacks + 2 };
520
521 typedef struct SteamNetAuthenticationStatus_t SteamNetAuthenticationStatus_t;
522 struct SteamNetAuthenticationStatus_t
523 {
524 /// Status
525 ESteamNetworkingAvailability m_eAvail;
526
527 /// Non-localized English language status. For diagnostic/debugging
528 /// purposes only.
529 char m_debugMsg[ 256 ];
530 };
531
532 #pragma pack(pop)
533 #endif /* VG_STEAM_NETWORKING_H */