#ifndef NETWORKING_H
#define NETWORKING_H

#include "multiplayer_api.h"
#include "game_session.h"

#include "shared/map.h"

typedef struct {
    MultiplayerApi *api;

    bool is_host;
    
    char *session_id;
    char *local_client_id;

    uint32_t listener_id;

    Game_Session *game_session; // Comes from Game_Instance.
    map_uint_t client_id_to_player_index;
} Game_Networking;

bool networking_try_host(Game_Networking *networking, Game_Session *session, Game_Session_Settings settings, uint16_t *out_host_player_id);
bool networking_try_join(Game_Networking *networking, Game_Session *session, const char *session_id);

bool networking_stop(Game_Networking *networking);

#endif