51 lines
827 B
C
51 lines
827 B
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#pragma once
|
|
#include "clientremote.h"
|
|
|
|
typedef enum {
|
|
CLIENT_TYPE_SINGLE_PLAYER,
|
|
CLIENT_TYPE_LOCAL,
|
|
CLIENT_TYPE_REMOTE
|
|
} clienttype_t;
|
|
|
|
typedef enum {
|
|
CLIENT_STATE_DISCONNECTED,
|
|
CLIENT_STATE_DISCONNECTING,
|
|
CLIENT_STATE_CONNECTING,
|
|
CLIENT_STATE_CONNECTED
|
|
} clientstate_t;
|
|
|
|
typedef struct _client_t {
|
|
clienttype_t type;
|
|
clientstate_t state;
|
|
|
|
union {
|
|
clientremote_t remote;
|
|
};
|
|
} client_t;
|
|
|
|
typedef struct {
|
|
clienttype_t type;
|
|
|
|
union {
|
|
clientremoteinit_t remote;
|
|
};
|
|
} clientinit_t;
|
|
|
|
void clientInit(
|
|
client_t *client,
|
|
const clientinit_t init
|
|
);
|
|
|
|
void clientSend(
|
|
client_t *client,
|
|
const packet_t packet
|
|
);
|
|
|
|
void clientDispose(client_t *client); |