+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ * All trademarks are property of their respective owners
+ */
+
#ifndef NETWORK_H
#define NETWORK_H
#include "vg/vg_stdint.h"
+#include "steam.h"
+#include "network_msg.h"
+#include "highscores.h"
+#include "addon_types.h"
+
+static int network_scores_updated = 0;
+
+/*
+ * Interface
+ */
+//#define SR_USE_LOCALHOST
+
+/* Call it at start; Connects us to the gameserver */
+static void network_init(void);
+
+/* Run this from main loop */
+static void network_update(void);
+
+/* Call it at shutdown */
+static void network_end(void);
+
+/*
+ * Can buffer up a bunch of these by calling many times, they will be
+ * sent at the next connection
+ */
+static void network_submit_highscore( u32 trackid, u16 points, u16 time );
+
+/*
+ * Game endpoints are provided with the same names to allow running without a
+ * network connection.
+ */
+
+struct {
+ u8 app_symmetric_key[ 1024 ];
+ u32 app_key_length;
+ EServerMode auth_mode;
+
+ HSteamNetConnection remote;
+ ESteamNetworkingConnectionState state;
+
+ f64 last_attempt, last_frame;
+ u32 retries;
+ i32 network_info;
+}
+static network_client = {
+ .state = k_ESteamNetworkingConnectionState_None,
+ .auth_mode = eServerModeAuthentication,
+};
+static int packet_minsize( SteamNetworkingMessage_t *msg, u32 size );
+static void network_send_item( enum netmsg_playeritem_type type );
#endif /* NETWORK_H */