2 * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
3 * All trademarks are property of their respective owners
9 #include "vg/vg_stdint.h"
11 #include "network_msg.h"
12 #include "highscores.h"
14 VG_STATIC
int network_scores_updated
= 0;
19 //#define SR_USE_LOCALHOST
21 /* Call it at start; Connects us to the gameserver */
22 VG_STATIC
void network_init(void);
24 /* Run this from main loop */
25 VG_STATIC
void network_update(void);
27 /* Call it at shutdown */
28 VG_STATIC
void network_end(void);
31 * Can buffer up a bunch of these by calling many times, they will be
32 * sent at the next connection
34 VG_STATIC
void network_submit_highscore( u32 trackid
, u16 points
, u16 time
);
37 * Game endpoints are provided with the same names to allow running without a
43 u8 app_symmetric_key
[ 1024 ];
45 EServerMode auth_mode
;
49 HSteamNetConnection remote
;
50 ESteamNetworkingConnectionState state
;
52 f64 last_attempt
, last_frame
;
55 static network_client
= {
56 .state
= k_ESteamNetworkingConnectionState_None
,
57 .auth_mode
= eServerModeAuthentication
,
61 #else /* SR_NETWORKED */
63 VG_STATIC
void network_init(void){}
64 VG_STATIC
void network_update(void){}
65 VG_STATIC
void network_end(void){}
67 #endif /* SR_NETWORKED */
68 #endif /* NETWORK_H */