29 lines
686 B
C
29 lines
686 B
C
//
|
|
// Created by rov on 12/27/25.
|
|
//
|
|
|
|
#ifndef TIBIA_NETWORK_H
|
|
#define TIBIA_NETWORK_H
|
|
|
|
#include <stdbool.h>
|
|
#include <SDL3_net/SDL_net.h>
|
|
#include "config.h"
|
|
|
|
typedef struct Gui Gui_t;
|
|
|
|
typedef struct Network {
|
|
NET_StreamSocket* socket;
|
|
} Network_t;
|
|
|
|
typedef enum PacketHandler {
|
|
HANDLER_LOGIN_OR_CREATE_CHAR = 0
|
|
} PACKET_HANDLER;
|
|
|
|
bool Network_Init(Network_t* network);
|
|
void Network_Shutdown(const Network_t* network);
|
|
|
|
void Network_ConnectAndReportStatus(Network_t* network, const ConfigParams_t* configParams, const Gui_t* gui);
|
|
|
|
void Network_SendPacket(const Network_t* network, PACKET_HANDLER handler, uint16_t opcode, void* data, int dataLength);
|
|
|
|
#endif //TIBIA_NETWORK_H
|