2025-12-19 02:38:21 +09:00
|
|
|
#ifndef __AF_COMMON_H__
|
|
|
|
|
#define __AF_COMMON_H__
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
2025-12-20 12:11:57 +09:00
|
|
|
#include <stdarg.h>
|
2025-12-20 13:06:17 +09:00
|
|
|
#include <time.h>
|
2025-12-19 02:38:21 +09:00
|
|
|
|
|
|
|
|
#include <fishsoup.h>
|
|
|
|
|
|
2025-12-19 08:52:48 +09:00
|
|
|
#include <af_config.h>
|
|
|
|
|
|
2025-12-19 02:38:21 +09:00
|
|
|
#ifdef AF_SERVER
|
|
|
|
|
#include <af_server.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef AF_CLIENT
|
|
|
|
|
#include <af_client.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define AF_DEFAULT_PORT 5312
|
2025-12-20 04:24:44 +09:00
|
|
|
#define AF_VERSION "0.0.0"
|
2026-01-06 22:29:22 +09:00
|
|
|
#define AF_COPYRIGHT "Copyright (C) 2025-2026 Pyrite development team"
|
2025-12-19 02:38:21 +09:00
|
|
|
|
2025-12-20 11:06:31 +09:00
|
|
|
enum AF_USER_PACKETS {
|
2025-12-20 12:11:57 +09:00
|
|
|
AF_PACKET_HELLO = FISHSOUP_PACKET_USER,
|
|
|
|
|
AF_PACKET_OK,
|
|
|
|
|
AF_PACKET_ERROR,
|
|
|
|
|
AF_PACKET_JOIN
|
2025-12-20 11:06:31 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#pragma pack(1)
|
2025-12-20 12:11:57 +09:00
|
|
|
typedef struct af_packet_hello {
|
|
|
|
|
unsigned char major;
|
|
|
|
|
unsigned char minor;
|
|
|
|
|
unsigned char patch;
|
|
|
|
|
} af_packet_hello_t;
|
|
|
|
|
|
|
|
|
|
typedef struct af_packet_ok {
|
|
|
|
|
char reason[256];
|
|
|
|
|
} af_packet_ok_t;
|
|
|
|
|
|
|
|
|
|
typedef struct af_packet_error {
|
|
|
|
|
char reason[256];
|
|
|
|
|
} af_packet_error_t;
|
|
|
|
|
|
2025-12-20 11:06:31 +09:00
|
|
|
typedef struct af_packet_join {
|
2025-12-20 12:11:57 +09:00
|
|
|
char username[256];
|
2025-12-20 11:06:31 +09:00
|
|
|
} af_packet_join_t;
|
|
|
|
|
#pragma pack()
|
2025-12-19 02:38:21 +09:00
|
|
|
|
2025-12-20 12:11:57 +09:00
|
|
|
/* version.c */
|
|
|
|
|
void af_common_version(unsigned char* v_major, unsigned char* v_minor, unsigned char* v_patch);
|
|
|
|
|
|
|
|
|
|
/* log.c */
|
|
|
|
|
void af_common_log_info(const char* fmt, ...);
|
|
|
|
|
|
2025-12-19 02:38:21 +09:00
|
|
|
#endif
|